Hi,
I am trying to write a for nested loop to fill a matrix with the following 227 sample
sample 1
np1=1000
all_yt_s1<- matrix(nrow = 229,
ncol = np1 )
for( i in 1:np1){
all_yt_s1[,i]<-rowSums(all_wts1[i,] *log.return[[1]]) }
sample 2
all_yt_s2<- matrix(nrow = 229,
ncol = np1 )
for( i in 1:np1){
all_yt_s2[,i]<-rowSums(all_wts1[i,] *log.return[[2]]) }
:
:
until sample 227
all_yt_s227<- matrix(nrow = 229,
ncol = np1 )
for( i in 1:np1){
all_yts_227[,i]<-rowSums(all_wts1[i,] *log.return[[227]]) }
please can you help me to write a nested for loop and store all total sample results in list for instance
Thank you in advance