[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [EquisMetaStock Group] Subject: Linear Regression / Linear Regression Slope Relationship



PureBytes Links

Trading Reference Links

Roy,

> b=the slope (Linear Regression Slope)
> and
> b=[(x1-xbar)(y1-ybar)+.......+(xn-xbar)(yn-ybar)]/
>    [(x1-xbar)sq +......+(xn-xbar)sq]

Which is almost the same as: 

startBar:=Cum(1)-pds;
y:=pds*Sum(startBar*x,pds)
 -Sum(startBar,pds)*Sum(x,pds);
z:=pds*Sum(Pwr(startBar,2),pds)
 -Pwr(Sum(startBar,pds),2);
LRS:=y/z;

There must be an easy way to get rid of the Cum(1).

jose '-)



--- In equismetastock@xxxxxxxxxxxxxxx, "Roy Larsen" <rlarsen@xxxx> 
wrote:
> Hi Harry
> 
> I'm totally lost with this mathematical jargon (which I admit is 
what I asked for), but there a
> couple of lines of your post that make sense to me. They are...
> 
> b=the slope (Linear Regression Slope)
> 
> and
> 
> b=[(x1-xbar)(y1-ybar)+.......+(xn-xbar)(yn-ybar)]/
>    [(x1-xbar)sq +......+(xn-xbar)sq]
> 
> Putting these two statements, can I assume that converting b 
correctly into MetaStock code will give
> me an exact replica of the MFL Linear Regression Slope function?
> 
> If that's the case then I am indebted to you.
> 
> Regards
> 
> Roy
> 
> > On 14 Aug 2004 13:57:04 -0000, "Roy Larsen" <rlarsen@xxxx>
> > wrote:
> >
> > >>
> > >>Can anyone help with the mathematical relationship between 
Linear Regression and Linear
> Regression
> > >>Slope.
> >
> > The formula for linear regression is:
> > y=a+bx+E
> >
> > a=the intercept
> > b=the slope (Linear Regression Slope)
> > E=the error
> >
> > normally you already have x and y. They are your paired data 
points.
> > You calculate b, then you estimate a (i.e., assume E=0).
> >
> > Since I don't have symbols on my E-mail program, my definitions of
> > terms are as follows:
> > n=number of pair values (x and y)
> > x1=first value of x
> > xn=nth value of x
> > xbar=sample mean of the x values
> > sq=term squared
> > sqrt=square root of term
> > *=multiply
> >
> > b=[(x1-xbar)(y1-ybar)+.......+(xn-xbar)(yn-ybar)]/
> >    [(x1-xbar)sq +......+(xn-xbar)sq]
> >
> > a=(ybar)-(b)(xbar)
> >
> > You can calculate the linear regression with the trend () function 
in
> > Excel.
> >
> > My statistics book reminded me that the slope by itself cannot 
tell
> > you how strongly correlated x and y are. For that you use the 
Pearson
> > correlation. In Excel, it is Pearson().
> >
> > The formula for the Pearson correlation is:
> >
> > r=[(x1-xbar)(y1-ybar)+.......+(xn-xbar)(yn-ybar)]/
> >    [{(x1-xbar)sq +......+(xn-xbar)sq}sqrt * {(y1-ybar)sq
> > +......+(yn-ybar)sq}sqrt]
> >
> > That is the easy part, Roy. I'll leave the MS coding to you!
> >
> > Harry
> >
> >
> >
> >
> >
> > Yahoo! Groups Links
> >
> >
> >
> >
> >
> >



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Yahoo! Domains - Claim yours for only $14.70
http://us.click.yahoo.com/Z1wmxD/DREIAA/yQLSAA/BefplB/TM
--------------------------------------------------------------------~-> 

 
Yahoo! Groups Links

<*> To visit your group on the web, go to:
    http://groups.yahoo.com/group/equismetastock/

<*> To unsubscribe from this group, send an email to:
    equismetastock-unsubscribe@xxxxxxxxxxxxxxx

<*> Your use of Yahoo! Groups is subject to:
    http://docs.yahoo.com/info/terms/