How to Perform a Weighted Fit to a Constant?

  • Thread starter Thread starter f95toli
  • Start date Start date
  • Tags Tags
    Constant Fit
f95toli
Science Advisor
Messages
3,509
Reaction score
1,072
I have the following silly problem I don't know how to get round:cry:

I have a set of datapoints, each point has known variance (this is experimental data).

I now want to fit this dataset using a constant, meaning I have an equation y=a, i.e. there is no independent variable.
I also want to know some goodness of fit parameters for my fit, i.e. the standard error and ideally also the R^2 value.

This would obviously be trivial if all the points had the same variance, but I don't know how to handle the fact that I need a weighted fit (presumably with 1/sqrt(variance) as weight for each point)

I do know how to do this for linear fits (Matlab's curve fitting toolbox etc), but Matlab doesn't seem to like fitting to constants. Hence, I might have to do it manually.
 
Physics news on Phys.org
After writing my question...I realized that all I need to do is to calculate the weighted mean:blushing:

Problem solved
 
Hi all, I've been a roulette player for more than 10 years (although I took time off here and there) and it's only now that I'm trying to understand the physics of the game. Basically my strategy in roulette is to divide the wheel roughly into two halves (let's call them A and B). My theory is that in roulette there will invariably be variance. In other words, if A comes up 5 times in a row, B will be due to come up soon. However I have been proven wrong many times, and I have seen some...
Thread 'Detail of Diagonalization Lemma'
The following is more or less taken from page 6 of C. Smorynski's "Self-Reference and Modal Logic". (Springer, 1985) (I couldn't get raised brackets to indicate codification (Gödel numbering), so I use a box. The overline is assigning a name. The detail I would like clarification on is in the second step in the last line, where we have an m-overlined, and we substitute the expression for m. Are we saying that the name of a coded term is the same as the coded term? Thanks in advance.
Back
Top