Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
私は2つの365x1行列s1とs2、平均と標準偏差ベクトルを持っています。新しい 365x1 マトリックスの正規分布をシミュレートしたいと考えています。私が使用したコードは
sim<-matrix(rep(NA,365),nrow=365,ncol=1) for (i in 1:365){y<-rnorm(1,s1[i,],s2[i,]) sim[i,]<-y[i]}
ただし、最初の値のみを生成します。コードを修正するにはどうすればよいですか? どうもありがとうございました!