Dear BUGS users,
I'm trying to code a reserving model and I'm encountering some problems:
1) When I press "load inits" I get the message "this chain contains unitialized variables" although I've initialized all my variables.
2) Ignoring the first problem and pressing "gen inits" when I try to update my model I get the message "shape parameter of gamma full conditional too small" although the parameters of gamma distribution that I use are the same that Ntzoufras and Dellaportas (2002) at "BAYESIAN MODELLING OF OUTSTANDING LIABILITIES INCORPORATING CLAIM COUNT UNCERTAINTY" suggest.
Here is the WinBUGS code:
model {
############################################################################
#Model’s likelihood
for (i in 1:n) {
for (j in 1:n){
x[i,j] ~ dlnorm(m[i,j], t)
m[i,j] <- c + a[i] + b[j]
} }
############################################################################
#CONSTRAINTS
#Sum To Zero constraints
a[1] <- -sum(a[2:n])
b[1] <- -sum(b[2:n])
############################################################################
#Priors
c ~ dnorm(0,0.001)
for (i in 2:n) {
a[i] ~ dnorm(0, 0.01)
b[i] ~ dnorm(0,0.01) }
t ~ dgamma(0.001, 0.001)
sigma2 <- 1/t
#############################################################################
#ACCIDENT YEAR
R[1] <- 0
for (i in 2:n){
R[i] <- sum(x[i,(n+2-i):n])
}
#Total <- sum(R[])
}
###############################################################################
#DATA
list(n=10)
x[,1] x[,2] [,3] x[,4] x[,5] x[,6] x[,7] x[,8] x[,9] x[,10]
357848 766940 610542 482940 527326 574398 146342 139950 227229 67948
352118 884021 933894 1183289 445745 320996 527804 266172 425046 NA
290507 1001799 926219 1016654 750816 146923 495992 280405 NA NA
310608 1108250 776189 1562400 272482 352053 206286 NA NA NA
443160 693190 991983 769488 504851 470639 NA NA NA NA
396132 937085 847498 805037 705960 NA NA NA NA NA
440832 847631 1131398 1063269 NA NA NA NA NA NA
359480 1061648 1443370 NA NA NA NA NA NA NA
376686 986608 NA NA NA NA NA NA NA NA
344014 NA NA NA NA NA NA NA NA NA
END
###############################################################################
#INITS
list(a=c(NA,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1,0.1),b=c(NA,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5,0.5), c=5, t=1)
list(a=c(NA,2,2,2,2,2,2,2,2,2),b=c(NA,0,0,0,0,0,0,0,0,0), c=10, t=10)
-------------------------------------------------------------------
This list is for BUGS users to support each other, ask questions or share ideas.
To mail the BUGS list, mail to [log in to unmask]
Before mailing, please check the archive at www.jiscmail.ac.uk/lists/bugs.html
Please do not mail attachments to the list.
To leave the BUGS list, send LEAVE BUGS to [log in to unmask]
If this fails, mail [log in to unmask], NOT the whole list
|