Skip to content
Prev 167445 / 398502 Next

MH algorithm syntax help

The comma *before*  acc=1 ?

I also wondered whether (further up)  this should work:
s2y[i,]=s2y[i-1]  # would think this to result in a dimension mismatch

This looks sketchy as well:
s2y[i,j] = s2y[b[i-1,j] + rnorm(1,mean=0, sd=s2yscale[j])
               ^ ^     ^  # unmatched sqr-brackets

It would be easier to run through a paren matching editor if you gave  
the original loop code as well as the error output.