Displaying 1 result from an estimated 1 matches for "quantmat".
2001 Aug 30
1
MCMC coding problem
...ations
#
# phi is the standard deviation of the proposal distribution.
# y is the data matrix, ystar is the proposal state
phi <- (2.38^2)/d * diag(phi2,d)
y <- matrix(0,ncol=d,nrow=ntimes)
ystar <- matrix(0,ncol=d,nrow=1)
len <- ntimes/1000 - 1
meanmat <- matrix(0,nrow=len,ncol=d)
quantmat <- array(0, dim = c(3,d,len))
count <- 0
# print("Comment out the browser before running with ntimes large!!")
browser()
for (i in 1:(ntimes-1))
{
ystar <- rmvnorm(n=1,mu=y[i,],sigma=phi)
numer <- (w*dmvnorm(ystar,mu=rep(0,d),sigma=diag(0,d)) +
(1-w)*dmvnorm(ystar,mu=rep(...