Simple Linear Regression and Area
- From: "Stratocaster" <stotz1@xxxxxxxxxxx>
- Date: Fri, 22 Dec 2006 17:30:34 GMT
I am wondering whether or not given a finite set of data points, and having
constructed a linear regression over the given range, the area under the
data points (assuming they are all positive) is equal to the area under the
linear regression.
This may sound stupid, and well it is stupid, but I think it can help me
illustrate my question.
Let's say you plotted data points from 0 to .1 with increments of
..001derived from a known function, lets say f(x)=x^2.
i.e. datapoints= {f(0), f(.001), f(.002)...f(.1)}
Then you performed a regression of these data points and obtained a
function:
g(x) = (B1)x +(B0);
I've done this, here are some results:
Mathematica: g(x) = -.00175+.0001*x
(Why is this g(x) in the wrong quadrant?)
Shouldn't the area of f(x) be equal to (or very close to) the area under
g(x), over the given interval {0, .1}?
They don't seem to be...
Integral[f(x), {x, 0, .1}] = .00033333
But:
Integral[g(x), {x, 0, .1}] = -.0001745
Yeah, don't know why the negative (that is to say, why the regression
computes all negative values). But curiously this is only about half the
area I expected to result. However, extended the range by an equal amount
in the negative direction (positive direction works to) and
Integral[g(x),{x,-.1,.1}] = -.00035; at least this is close...
Anyway, long story short, why do I need twice the domain for the regression
than for the actual datapoints. Surely, if the function f(x) was linear
this would not be the case, right? But I don't know why there is a
difference in this case.
Thanks for any help, insights, suggestions...overall enlightenmet.
.
- Follow-Ups:
- Re: Simple Linear Regression and Area
- From: Reef Fish
- Re: Simple Linear Regression and Area
- Prev by Date: Re: Comparing fractions (or proportions)
- Next by Date: Re: Matrix derivative
- Previous by thread: Matrix derivative
- Next by thread: Re: Simple Linear Regression and Area
- Index(es):
Relevant Pages
|