Chronology Current Month Current Thread Current Date [Year List] [Month List (current year)] [Date Index] [Thread Index] [Thread Prev] [Thread Next] [Date Prev] [Date Next]

# Re: [Phys-L] weighted linear regression using spreadsheets

On 4/3/2020 11:17 AM, John Denker via Phys-l wrote:
On 4/2/20 1:33 PM, bernard cleyet wrote:

I think the fit (is a Marquardt) treats each datum equally unless one weights the data.
Let's discuss the topic of averaging and/or curve fitting.
Note that I consider averaging to be just a particularly simple
form of curve fitting.

Pedagogical suggestion:
A) When introducing the topic, don't even mention weights.
Let all fits be unweighted, by which we mean equally-weighted.

B) On the next turn of the pedagogical spiral, the motto
should be:
-- All averages are weighted averages.
-- All fits are weighted fits.

In my world, equally-weighted data is the exception not the
rule.

Whether the scale (ordinate) is linear of log, the fit is the same.
Really? I must be misunderstanding that sentence, because I
don't see how it could be true. Scaling the data has a huge
effect on the weights. Indeed this is an arcane but effective
way of controlling the weights, if that's what you want, as
discussed below.

=================================== /snip/
Apropos straight line log fits vs curve fits to data,
I generated an exponential dataset: 1,2,4,8,16,32,64,128,256
I added a +50 error at each end of the series, like this:
51,2,4,8,16,32,64,128,306

Exponential data on a linear scale explains a lot
of the variance between fitted curve and data: R^2 = 95%
https://imgur.com/CypXrtF

Log of exponential data on a log scale explains some of the
variance between the fitted straight line and data: R^2 = 54%
https://imgur.com/08CJgeo

Not sure how convincing this is of the virtue of taking the
a least squares fit of the data, rather than its log,
but that is the hope.....

Brian W