crwSamplePar: Create a weighted importance sample for posterior predictive track
simulation.
Description
The crwSamplePar
function uses a fitted model
object from crwMLE
and a set of prediction times
to construct a list from which crwPostIS
will draw a sample from either the posterior distribution
of the state vectors conditional on fitted parameters or
a full posterior draw from an importance sample of the
parameters.Usage
crwSamplePar(object.sim, method = "IS", size = 1000, df =
Inf, grid.eps = 1, crit = 2.5, scale = 1)
Arguments
method
Method for obtaining weights for movement
parameter samples
size
Size of the parameter importance sample
df
Degrees of freedom for the t approximation to
the parameter posterior
grid.eps
Grid size for method="quadrature"
crit
Criterion for deciding "significance" of
quadrature points (difference in log-likelihood)
scale
Scale multiplier for the covariance matrix
of the t approximation
Value
- List with the following elements:
- xLongitude coordinate with NA at prediction
times
- ySimilar to above for latitude
- locTypeIndicates prediction types with a "p" or
observation times with an "o"
- P1.yInitial state
covariance for latitude
- P1.xInitial state covariance for longitude
- a1.yInitial latitude state
- a1.xInitial longitude state
- n.errXnumber of longitude error model parameters
- n.errYnumber of latitude error model parameters
- deltavector of time differences
- driftModLogical. indicates random drift model
- stopModLogical. Indicated stop model fitted
- stop.mfstop model design matrix
- err.mfXLongitude error model design matrix
- err.mfYLatitude error model design matrix
- mov.mfMovement model design matrix
- fixParFixed values for parameters in model
fitting
- CmatCovaraince matrix for parameter sampling
distribution
- LmatCholesky decomposition of Cmat
- parfitted parameter values
- NTotal number of locations
- logliklog likelihood of the fitted model
- Timevector of observation times
- coordnames of coordinate vectors in original
data
- Time.nameName of the observation times vector in
the original data
- thetaSampListA list containing a data frame of
parameter vectors and their associated probabilities for
a resample
Details
The crwSamplePar function uses the information in a
crwSimulator
object to create a set of
weights for importance sample-resampling of parameters in
a full posterior sample of parameters and locations using
crwPostIS
. This function is usually called
from crwPostIS
. The average user should
have no need to call this function directly.