Print

Print


Hi there,

I'm have a state-space model where the measurement error is modelled as a
mixture of 2 Normal distributions. The specification of this model with
vague priors on both distributions is relatively straight-forward.
However, I have detailed information - error estimates for each
observation in the time series - that I wish to incorporate into the model
via a fixed effect. The reason for using a mixture of 2 Normals is that
some (ca. 5%) of the error estimates are clearly wrong (some are obvious,
some are not) and I would like to estimate an error distribution for those
'screwy' error values, while fixing the measurement error for the rest of
the observations at the known values. On the surface, this problem seems
like it could be solved with some modification of the mixture model
approach used in the 'Eyes' example (this is essentially the approach I
used for the initial model with vague priors) but I cannot figure out how
to specify it in WinBugs! Code for the model with vague priors on
everything is below. Any suggestions would be greatly appreciated!

Ian

Code:

model rw;
# Note: A mixture model for estimation error
{
# Vague prior for observation error (isigma)
isigma~dlnorm(0,.01)
sigma<-1/sqrt(isigma)

# Vague priors for estimation error (itau)
itau[1,1]~dlnorm(0,.01)I(0,1000)
itau[1,2]~dlnorm(0,.01)I(0,1000)
itau[2,1]<-itau[1,1]+theta[1]
itau[2,2]<-itau[1,2]+theta[2]
tau[1,1]<-1/sqrt(itau[1,1])
tau[1,2]<-1/sqrt(itau[1,2])
tau[2,1]<-1/sqrt(itau[2,1])
tau[2,2]<-1/sqrt(itau[2,2])

# Prior for mixing proportion
P[1:2]~ddirch(alpha[])
theta[1]~dnorm(0,1.0E-6)I(0.0,)
theta[2]~dnorm(0,1.0E-6)I(0.0,)

## In order to get first true location equal to the observed location
(i.e. where released) we do the following:
Y[1,1]~dnorm(Y1[1,1],100000000)
Y[1,2]~dnorm(Y1[1,2],100000000)

## Interate transition equation
for(i in 2:N){  # cycles through locations
for(j in 1:2){     # cycles through two dimensions (lon & lat)
Y[i,j]~dnorm(Y[i-1,j],isigma)
}
}
# Iterate measurement equation
for(i in 1:N){   #cycles through locations
T[i]~dcat(P[])
for(j in 1:2){   #cycles through 2 dimensions (lon & lat)
Y1[i,j]~dnorm(Y[i,j],itau[T[i],j])
}
}
}

----------------------
Ian Jonsen

Biology Department
Dalhousie University
Halifax, NS B3H 4J1
CANADA

office: (902) 494-3910
fax:    (902) 494-3736
[log in to unmask]

-------------------------------------------------------------------
This list is for discussion of modelling issues and the BUGS software.
For help with crashes and error messages, first mail [log in to unmask]

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