[R] Loop and cbind

2007-07-04 Thread livia
Hi, I would like to apply the following function for i between 1 and 12, and then construct a list of the return series. for (i in 1:12){ ewma[i] - emaTA(calm[[i]]^2,0.03) standard[i]- calm[[i]]/sqrt(ewma[i]) standard - cbind(standard[i]) } But it does not work. Could anyone give me some advice

Re: [R] Loop and cbind

2007-07-04 Thread john seers \(IFR\)
Hi In what way does it not work? My guess is that you have not declared your values outside the for loop. As they are local they will be lost on exit. You need to declare them before: ewma-vector(length=12) standard-vector(length=12) for ... { } John Seers --- Hi, I

Re: [R] Loop and cbind

2007-07-04 Thread ONKELINX, Thierry
2007 15:19 Aan: livia; r-help@stat.math.ethz.ch Onderwerp: Re: [R] Loop and cbind Hi In what way does it not work? My guess is that you have not declared your values outside the for loop. As they are local they will be lost on exit. You need to declare them before: ewma