### sequential

#### how to speed up the M-H MCMC with a large number of parameters updated sequentially

```I am confronted with a big problem of speeding up the programming. I have a model which have more than 700 parameters and I need to find their posterior distributions which maximize the log-likelihood function. The following is my code:
M = 11
para = matrix(0, M, 771)
wt = rnorm(767, 0, 0.25)
para[1, ] = c(0.397, 0.013, 1.09, wt, 0.5)
trial = rep(1, 771)
acc = rep(0, 771)
for(t in 1:(M-1)){
T = 10^(14) #the small value of T: T=10^6
para.cur = para[t, ]
para.sim = para.cur
current = dam.m4.opt(para.cur)
for(i in 1:771){
if(i != 771){
para.sim[i] = rnorm(1, para.cur[i], 0.25)
}else{
para.sim[i] = abs(rnorm(1, para.cur[i], 0.25))
}
propose = dam.m4.opt(para.sim)
trial[i] = trial[i] +1
a = (propose - current)/T
if(log(runif(1))<a){
para.cur[i] = para.sim[i]
current = propose
acc[i] = acc[i] + 1
}else{
para.sim[i] = para.cur[i]
current = current
}
}
para[t+1, ] = para.cur
}
M is the number of step of the MCMC chain, dam.opt.m4 is the function to calculate the log-likelihood. There are 771 parameters and I need to update them sequentially. T is the tempering. I am wondering how I can use doParallel to speed up the performance? Because of the large number of parameters, even 11 steps can take 3 three days to run so I desperately to know how I can get faster.
I really a appreciate that if anybody can help!```

### Resources

Mobile Apps Dev
Database Users
javascript
java
csharp
php
android
MS Developer
developer works
python
ios
c
html
jquery
RDBMS discuss
Cloud Virtualization