[R] number of items to replace is not a multiple of replacement length

2013-07-25 Thread G Girija
Hi All, I have 5 stock values and i am calculating EWMA followed the logic as given ind following link.[ http://www.orecastingfinancialrisk.com/3.html ] library('tseries') returns[,1]<-returns[,1]-mean(returns[,1]) returns[,2]<-returns[,2]-mean(retu

[R] non-conformable arrays

2013-07-23 Thread G Girija
Hi, I have 5 stock values and i am calculating EWMA followed the logic as given ind following link.[ http://www.orecastingfinancialrisk.com/3.html ] [EWMA = matrix(nrow=T,ncol=3) # create a matrix to hold the covariance matrix for each t lambda = 0

[R] Fwd: extracting variance and covariance

2013-07-19 Thread G Girija
hi, Please help me in calculating variance and covariance as i am getting the following error Error in lambda * S + (1 - lambda) * a : non-conformable arrays -- Forwarded message -- From: G Girija Date: Thu, Jul 18, 2013 at 10:20 PM Subject: extracting variance and covariance

[R] extracting variance and covariance

2013-07-18 Thread G Girija
Hi, I am not able to ‘extract variance and covariance’ As mentioned, there are 5 stocks and changed the code [ http://www.forecastingfinancialrisk.com/3.html] as follows: > S<-cov(returns) > S V1 V2 V3 V4 V5 V1 0.0004951526 0.0001256519 0.0

[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) covarian

[R] EWMA --http://www.forecastingfinancialrisk.com/3.html

2013-07-17 Thread G Girija
Hi, I followed the code given in the link http://www.forecastingfinancialrisk.com/3.html EWMA<-matrix(nrow=T,ncol=5) S<-cov(returns) dim(S) [1] 5 5 "EWMA[1,] = c(S)[c(1,4,2)] # extract the variances and covariance" *here we will get a vector but we are equating with a matrix. hence the foll

[R] error in VaR calculation

2013-06-25 Thread G Girija
The code is as follows: monthreturns<-read.zoo('monthlyReturn date.csv',sep=",",header=T) monthreturns<-as.xts(monthreturns,order.by =index(monthreturns),frequency=NULL)*W0 head(monthreturns) dim(monthreturns) portnames<-c('acc','cipla','cmc','idbi','ifci') portfolio names (5 stocks)

[R] error in VaR calculation

2013-06-25 Thread G Girija
Hi, I am your member. Pl help me with the solution. rgds [[alternative HTML version deleted]] __ R-help@r-project.org mailing list https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-gu

[R] evtree

2013-03-14 Thread G Girija
hi I got the following error in 'evtree'. could u help pl. Error in if (var(mf[, nVariables]) <= 0) stop("variance of the denpendent variable is 0") : argument is of length zero [[alternative HTML version deleted]] __ R-help@r-project.org mai