使用ABC_mcmc函数时出错:

时间:2019-02-15 02:11:31

标签: r bayesian mcmc

我正在尝试对ParPrior中给定的4个随机值使用ABC_mcmc函数。我收到错误消息:

  

if(dist_simul     缺少需要TRUE / FALSE的值

   X<-1:45
   Y <- c(35326L, 30339L, 23379L, 21877L, 18629L, 17627L, 15691L, 15435L, 
   14205L, 11732L, 10560L, 10592L, 9939L, 7491L, 4928L, 3427L, 8123L, 
   9027L, 8733L, 9599L, 8737L, 9135L, 8548L, 7279L, 8940L, 8459L, 
   8460L, 7700L, 6817L, 7167L, 7089L, 7091L, 7538L, 9206L, 9680L, 
   5876L, 7799L, 8384L, 10586L, 8623L, 7848L, 5534L, 6610L, 6539L, 
   6650L)

n<-length(X)
observedData<-rnorm(n,0,0.01)
g=10000
ParPrior=list(c("unif",0.01,100000),c("unif",0.001,10),
c("unif",0.0001,1),c("unif",0.001,2))
sim.abc <- function(par){ 
c(Y-(par[1]*exp((-par[3]*X)+((par[2]*X^par[4])/par[4]))))
}

model.abc<-ABC_mcmc(method="Marjoram", model=sim.abc, prior=ParPrior, 
summary_stat_target=observedData,tolerance_quantile=0.001, n_rec=g)**

请帮助

0 个答案:

没有答案