![]() |
Math problem
One can best-fit a straight line y = ax + b through scattered dots (x,y) using least squares linear regression. One minimises the sum of the squares of the error of the found best-fitting line and the actual dots(/measurements).
Now I want to weigh each of these errors for distance to the most recent x(/measurement), giving most weight to the most recent point. Say, if we observe time on the x axis [I'll use brackets as subscript is no option here], c = the number of 'dots' we want to calculate a line from y[t] = the observation at x[t], where t = -(c+1),... , -3, -2, -1, 0 weight w = 0.9^|x[0] - x[t]| What formulas should I use to calculate a and b in y = ax + b? For someone a little more proficient in math than I am it shouldn't be too hard. $25 by epass to the first to correctly post and derive these formulas. Thanks in advance! |
hahahahahahhahahaa @ asking this on gfy :1orglaugh
|
uhhhhhhhhhhhhh :error:error
|
Well GFY is full of retards but has some hidden gems as well!
|
Is this an actual math problem that will be graded by someone? or just something for yourself?
|
Ask Good Will Hunting.
|
Quote:
|
Quote:
|
Quote:
|
hit me up on icq, I can get you an algorithm that will do what you want, icq: 33375924
|
we will help you out with your porn sites, but we refuse to do your homework for you...c'mon now!:thumbsup
|
Quote:
|
I mean, I can obviously minimise the sum of squares by 'brute force' easily for each a and b and approximate their optimum this way, but I would like help in deriving a and b for the point where [delta]f/[delta]a = [delta]f/[delta]b = 0.
|
well, I can get you the "formulas" but really, implementing the formulas involves writing an algorithm to solve this problem... even with simple non-weighted case, you can't just magically get the answer, you have to build an algorithm to solve it...
|
Quote:
a = ( [sum](i=1 to N) (x[i] - x[mean]) (y[i] - y[mean]) ) / ( [sum](i=1 to N) (x[i] - x[mean])^2 Annoying I have to resort to this kind of notation. Naturally you need an algorithm to calculate the sums, means, etc but an equation like the one above is what I'm looking for. The rest I can do myself. |
fun. wish I had the time to play with this one.
I'm probably one stats class short of being able to crank something out for ya. Hit me up tonight, after the business day is done, if you're still looking for an answer, bro. |
All times are GMT -7. The time now is 11:35 AM. |
Powered by vBulletin® Version 3.8.8
Copyright ©2000 - 2025, vBulletin Solutions, Inc.
©2000-, AI Media Network Inc