Learn R Programming

crawl (version 1.3-1)

crwSimulator: Construct a posterior simulation object for the CTCRW state vectors

Description

The crwSimulator 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

crwSimulator(object.crwFit, predTime = NULL, method =
  "IS", parIS = 1000, df = Inf, grid.eps = 1, crit = 2.5,
  scale = 1)

Arguments

object.crwFit
A model object from crwMLE.
predTime
vector of additional prediction times.
method
Method for obtaining weights for movement parameter samples
parIS
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 crwSimulator function produces a list and preprocesses the necessary components for repeated track simulation from a fitted CTCRW model from crwMLE. The method argument can be one of "IS" or "quadrature". If method="IS" is chosen standard importance sampling will be used to calculate the appropriate weights via t proposal with df degrees of freedom. If df=Inf (default) then a multivariate normal distribution is used to approximate the parameter posterior. If method="quadrature", then a regular grid over the posterior is used to calculate the weights. The argument grid.eps controls the quadrature grid. The arguments are approximately the upper and lower limit in terms of standard deviations of the posterior. The default is grid.eps, in units of 1sd. If object.crwFit was fitted with crwArgoFilter, then the returned list will also include p.out, which is the approximate probability that the observation is an outlier.

See Also

See northernFurSeal for example.