2
R2WinBugs 패키지를 사용하고 있습니다. 나는 모델 기능변수를 WinBugs 모델에 전달 R
c0yy <- 0.1
syy <- 0.0001
#Model
model <- function(c0yy,syy){
#Likelihood
for(i in 1:n){
y[i] ~ dnorm(mu[i],cyy)
}
#Regression formula
for(i in 1:n){
mu[i] <- alpha + gamma * x[i]
}
#Priors for the regression parameters
alpha ~ dnorm(0,0.000001)
gamma ~ dnorm(0,0.000001)
#Priors for the precision parameter
cyy ~ dnorm(c0yy,syy)
#Monitored variables
beta <- gamma/(alpha-1)
}
filename <- file.path(tempdir(), "Olm.txt")
write.model(model, filename)
에 R 스크립트에서 이전에 계산 된 두 개의 매개 변수를 전달하고 싶은하지만이 오류를 얻을
made use of undefined node c0yy
동안 나는 내부 c0yy
및 syy
의 값을 대체하는 경우 그것을 작동 모델 기능 .. 어떤 도움이 필요하십니까?
감사합니다.