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

RE: [amibroker] Re: Covariance



PureBytes Links

Trading Reference Links

Thanks, but there is one problem:

 

Arr2=Yrs;

 

I was looking for the function Yrs in Help but found nothingL, even not similarL

 


From: amibroker@xxxxxxxxxxxxxxx [mailto:amibroker@xxxxxxxxxxxxxxx] On Behalf Of vlanschot
Sent: Wednesday, February 21, 2007 5:21 PM
To: amibroker@xxxxxxxxxxxxxxx
Subject: [amibroker] Re: Covariance

 

Arr1=C;
Arr2=Yrs;

Lookback=30;

Covar=correlation (Arr1, Arr2,Lookback)*StDev(Arr1)*StDev(Arr2);
Var=StDev(Arr1)^2;

A few points:

1) Lookback is arbitrary. Longer is better.
2) You're dealing with non-stationary series. Be careful about
interpretation of statistics.
3) Since correlation of a series with itself is 1, Var is simply
StDev-squared.
4) AB's StDev is based on assumed full population, whereas you're
only using a sample. I.e. purists need to adjust for this.

Hopefully, once the account-manager is fully functional, TJ will
think about adding matrix-functions, with which we could easily
create var-covar matrices of portfolio-returns, factor-returtns, etc.
(Yes, I know I can already do this in AFL, but what about an inverted
matrix??)

PS

--- In amibroker@xxxxxxxxxps.com, "aleskresta" <ales.kresta@...>
wrote:
>
> Greetings,
>
> I am still a little bit confused about arrays in AB, could
someone
> give me an example of one simple thing:
>
> 1)I have an array of Close prices
> 2)I want to create an array(the same length as first) of a number
> 1,2,3, nad so on
> 3)I want to compute covarience between array 1 and array 2, and
> variance of array 2
>
> Because I am confused about arrays I don't know how to do the
second
> thing
>
> Thanks a lot for advice
>

__._,_.___

Please note that this group is for discussion between users only.

To get support from AmiBroker please send an e-mail directly to
SUPPORT {at} amibroker.com

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

For other support material please check also:
http://www.amibroker.com/support.html





SPONSORED LINKS
Investment management software Investment property software Investment software
Investment tracking software Return on investment software

Your email settings: Individual Email|Traditional
Change settings via the Web (Yahoo! ID required)
Change settings via email: Switch delivery to Daily Digest | Switch to Fully Featured
Visit Your Group | Yahoo! Groups Terms of Use | Unsubscribe

__,_._,___