Re: [R] EWMA error

2013-07-18 Thread Pascal Oettli
Please reply to the list. You will have more chance to get an answer. Pascal 2013/7/18 G Girija girija...@gmail.com Hi, Many thanks for your hint. Yes I made a mistake there. Also could you *please* help me in rectifying the following also? I am not able to ‘extract variance and

[R] EWMA error

2013-07-17 Thread G Girija
hi, Could anyone help me in solving the following error: I have 5 stocks returns data (returns) EWMA = matrix(nrow=T,ncol=5) # create a matrix to hold the covariance matrix for each t lambda = 0.94 S-cov(returns) # initial (t=1)

Re: [R] EWMA error

2013-07-17 Thread Pascal Oettli
Hello, 1) In the provided example, you have 2 stock returns and EWMA = matrix(nrow=T, ncol=3) See the number of columns (2+1) Please modify the number of columns according to the number of stock returns. 2) As you have 5 stock returns, the following cannot work EWMA[1,] = c(S)[c(1,4,2)]