Displaying 1 result from an estimated 1 matches for "rollstart".
Did you mean:
pollstart
2008 Aug 02
1
problem with nested loop for regression
...ul for any suggestions. Below is a brief version of my code:
#Code start
library(zoo)
seed.set(1)
Pmat<-matrix(rnorm(1000), nrow=100, ncol=100)
maxcol<-ncol(Pmat)
maxrow<-nrow(Pmat)
startrow<-10
period<-10
wind<-2 #roll window
subdiv<-period/wind
rollstart<-11 #start roll at period+1
#converting Pmat into ts for rollapply() to work...
PmatTS<-ts(Pmat)
Preg<-matrix(NA,ncol=maxcol,nrow=2*maxrow)
PmatWt<-matrix(NA, nrow=subdiv,ncol=maxcol)
mult_col<-matrix(1:5, nrow=5, ncol=1)
#rolling calculations...
for (i in (rollstart):maxrow...