Hi all, following is my R -code and shows the error given below
> n <- 100
> k<-2
> x1 <-c(1, 3);x2 <- c(2,5)
> X <- matrix(c(0,0), nrow = 2, ncol = n)
> for(i in 1:k)
+ X[i, ] <- mh1.epidemic(n,x1[i],x2[i])
Error in X[i, ] <- mh1.epidemic(n,x1[i],x2[i]): 
  number of items to replace is not a multiple of replacement length
 
> psi <-t(apply(X, c(1,2), cumsum))
> for(i in 1:nrow(psi)){
+ psi[i,] <psi[i,]/(1:ncol(psi))
+ print(Gelman.Rubin(psi))
+ 
+ }
Can some one suggest me what this error means and how could I fix it?
        [[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-guide.html
and provide commented, minimal, self-contained, reproducible code.

Reply via email to