GoFuckYourself.com - Adult Webmaster Forum

GoFuckYourself.com - Adult Webmaster Forum (https://gfy.com/index.php)
-   Fucking Around & Business Discussion (https://gfy.com/forumdisplay.php?f=26)
-   -   Math problem (https://gfy.com/showthread.php?t=748301)

Rhesus 07-03-2007 12:59 PM

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!

cranki 07-03-2007 01:05 PM

hahahahahahhahahaa @ asking this on gfy :1orglaugh

Brother Bilo 07-03-2007 01:06 PM

uhhhhhhhhhhhhh :error:error

Rhesus 07-03-2007 01:15 PM

Well GFY is full of retards but has some hidden gems as well!

woj 07-03-2007 01:17 PM

Is this an actual math problem that will be graded by someone? or just something for yourself?

RedShoe 07-03-2007 01:20 PM

Ask Good Will Hunting.

noone1 07-03-2007 01:22 PM

Quote:

Originally Posted by Rhesus (Post 12698123)
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!

Ugh. Google it. No one does this shit by hand. Grab a TI graphing calculator or a computer program.

Rhesus 07-03-2007 01:22 PM

Quote:

Originally Posted by woj (Post 12698215)
Is this an actual math problem that will be graded by someone? or just something for yourself?

It's for myself, I'm not studying anything math-related.

Rhesus 07-03-2007 01:23 PM

Quote:

Originally Posted by noone1 (Post 12698243)
Ugh. Google it. No one does this shit by hand. Grab a TI graphing calculator or a computer program.

All a google search yields is linear regression weighted for variance which is not what I need.

woj 07-03-2007 01:28 PM

hit me up on icq, I can get you an algorithm that will do what you want, icq: 33375924

ADL Josh 07-03-2007 01:32 PM

we will help you out with your porn sites, but we refuse to do your homework for you...c'mon now!:thumbsup

Rhesus 07-03-2007 01:33 PM

Quote:

Originally Posted by woj (Post 12698285)
hit me up on icq, I can get you an algorithm that will do what you want, icq: 33375924

Hello, thank you for your offer, but I want formulas to integrate in other stuff I'm building. I can't work with a seperate algo.

Rhesus 07-03-2007 01:36 PM

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.

woj 07-03-2007 01:39 PM

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...

Rhesus 07-03-2007 01:49 PM

Quote:

Originally Posted by woj (Post 12698351)
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...

I mean to get an equation like this one (for non-weighted cases):

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.

D 07-03-2007 02:23 PM

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