[amibroker] Re: R Squared, different methods with slightly different results

 

Hi


I'm not sure if one is more correct than the other, but I'm having funky issues with R squared code.


Using the code below and applying it to Russell 1000 Historical constituents data from Premium Data, the final variable normVolAdjMomentum, which I want to display a numerical range value from 0-100, occasionally far exceeds that value. Can anybody point out why, please?



Filter = 1;

regSlope = LinRegSlope( C, 90 );
exRegSlope = exp( regSlope );

AddColumn( regSlope, "regSlope" );
AddColumn( exRegSlope, "exRegSlope" );

rSquared = Correlation( BarIndex(), C, 90 ) ^ 2;
//rSquared = Correlation( Cum( 1 ), C, 90 ) ^ 2;

volAdjMomentum = exRegSlope * rSquared;

AddColumn( rSquared, "rSquared" );
AddColumn( volAdjMomentum, "volAdjMomentum" );

normVolAdjMomentum = volAdjMomentum * 100;

AddColumn( normVolAdjMomentum, "normVolAdjMo" );



__._,_.___

Posted by: sladbrook@hotmail.com
Reply via web post Reply to sender Reply to group Start a New Topic Messages in this topic (2)

Check out the automatic photo album with 1 photo(s) from this topic.
R Squared.PNG
**** IMPORTANT PLEASE READ ****
This group is for the discussion between users only.
This is *NOT* technical support channel.

TO GET TECHNICAL SUPPORT send an e-mail directly to
SUPPORT {at} amibroker.com

TO SUBMIT SUGGESTIONS please use FEEDBACK CENTER at
http://www.amibroker.com/feedback/
(submissions sent via other channels won't be considered)

For NEW RELEASE ANNOUNCEMENTS and other news always check DEVLOG:
http://www.amibroker.com/devlog/


.

__,_._,___

Related Posts


EmoticonEmoticon

:)
:(
=(
^_^
:D
=D
=)D
|o|
@@,
;)
:-bd
:-d
:p
:ng
:lv