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

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



PureBytes Links

Trading Reference Links

ok ,this is it


q1:=Input("set lenght of sample",1,10000,20);
k0:=(q1+1)/2;
k1:=Sum(1,q1);
k2:=Mov(C,q1,S);
k3:=(1/q1)*Sum((k1-k0)*(C-k2),q1)/Power(k1-k0,2);
k4:=k2-(k3*k0);
k5:=k4+(k3*k1);
k5;

--- In equismetastock@xxxxxxxxxxxxxxx, "Lionel Issen" <lissen@xxxx> wrote:
> What is pds?
> 
> -----Original Message-----
> From: Jose [mailto:josesilva22@x...] 
> Sent: Saturday, August 14, 2004 11:15 PM
> To: equismetastock@xxxxxxxxxxxxxxx
> Subject: Re: [EquisMetaStock Group] Subject: Linear Regression / Linear
> Regression Slope Relationship
> 
> 
> 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 Links



------------------------ Yahoo! Groups Sponsor --------------------~--> 
Make a clean sweep of pop-up ads. Yahoo! Companion Toolbar.
Now with Pop-Up Blocker. Get it for free!
http://us.click.yahoo.com/L5YrjA/eSIIAA/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/