Closed whzhuscu closed 8 months ago
ok, the 'coda' package has the 'gelman.diag' and 'gelman.plot'. But I can not use it.
> pmcmc_run <- mcstate::pmcmc(mcmc_pars, filter, control = control)
> pmcmc_run
<mcstate_pmcmc> (200 samples across 4 chains)
pars: 200 x 2 matrix of parameters
beta, gamma
probabilities: 200 x 3 matrix of log-probabilities
log_prior, log_likelihood, log_posterior
state: 5 x 200 matrix of final states
trajectories: 5 x 200 x 31 array of particle trajectories
restart: (not included)
> mcmc1 <- coda::as.mcmc(cbind(pmcmc_run$probabilities, pmcmc_run$pars))
> coda::gelman.diag(mcmc1)
Error in coda::gelman.diag(mcmc1) : You need at least two chains
try with at least two chains, as the error suggests.
Sorry to bother you. I have a question: How can I determine whether MCMC and PMCMC parameter estimation results are converging using the "mcstate" package?