R 中 coda 中 mcmc 函数的细化

Thinning for the mcmc function in coda in R

我对用于在给定数据的情况下声明 mcmc 对象的 coda 文档感到有点困惑。

它说(来自documentation on page 21):
"Likewise, if data represents a chain that has already been thinned, the thinning interval should be given as the thin argument."

目前,我计划输入到该函数的数据集已经有样本因细化而被丢弃。换句话说,如果我原来的MCMC链是:0 1 2 3 4 5 6,我的细化间隔是2,那么我打算在coda中喂给mcmc函数的数据就是0,2,4,6。

这是文档中所说的已经 "thinned" 的链的意思吗?如果是这样,为什么我需要指定 thin = 2?

换句话说,我正在考虑是否应该这样调用函数,假设 data = c(0,2,4,6): mcmc(数据,薄 = 1)或 mcmc(数据,薄 = 2)?

谢谢!

它是 mcmc(data, thin = 2) 其中数据 = c(0,2,4,6).

如果您 plot(mcmc(data, thin = 2))plot(mcmc(data, thin = 1) 就会看到这个。在 thin = 1 的情况下,绘图将显示较少的迭代次数。