HMMfilterSDE computes the state estimation for a discretely observed stochastic differential equation

HMMfilterSDE(
  u,
  D,
  xi,
  bc,
  x0dist,
  tvec,
  yvec,
  lfun,
  do.smooth = FALSE,
  N.sample = 0,
  do.Viterbi = FALSE,
  pfun = NULL
)

Arguments

u

function mapping state (numeric scalar) to advective term (numeric scalar)

D

function mapping state (numeric scalar) to diffusivity (numeric scalar)

xi

The numerical grid. Numeric vector of increasing values, giving cell boundaries

bc

String indicating boundary conditions. See details.

x0dist

Prior distribution of the initial state. See details.

tvec

Vector of (increasing) time points where observations are taken

yvec

Vector of observations at each time point

lfun

Likelihood function so that lfun(x,y) gives the likelihood of y given x

do.smooth

Do we want smoothing, or only predictive filtering / estimation?

N.sample

Number of "typical tracks" sampled (defaults to 0)

do.Viterbi

Do we want the most probable state sequence, found with the Viterbi algorithm?

pfun

C.d.f. of observations given states, i.e. pfun(x,y) gives P(Y<=y | X = x). If supplied, pseudo-prediction residuals will be computed

Value

A list containing: phi A tabulation of the predicitive probability densities psi A tabulation of the estimated probability densities pi (If do.smooth==TRUE) A tabulation of the smoothed probability densities c A vector containing the normalization constants at each time step loglik The total log-likelihood of the model Xmpt A vector containing the most probabile path (if do.Viterbi==TRUE) U A vector containint the pseudo-prediction residuals (if pfun is supplied)

Details

The distribution of the initial condition x0 can be specified in a number of ways: . If x0dist is a function, it is interpreted as the c.d.f. of the initial state . If x0dist is a single number, it is interpreted as a deterministic initial state . If x0dist is a numeric vector of the same length as xi, then it is interpreted as a c.d.f. . If x0dist is a numeric vector with one less element than xi, then it is interpreted as cell probabilities.

Author

Uffe Høgsbro Thygesen