Learn R Programming

HMMoce (version 1.0.0)

makePar: makePar gets parameters for subsequent filter/smoother

Description

Function builds movement kernels for 2 different behavior states and calculates, if desired, switching probability using an expectation maximization routine

Usage

makePar(migr.spd, grid, L.arr, p.guess = c(0.7, 0.8), calcP = FALSE)

Arguments

migr.spd

is numeric input to calc.param

grid

is a grid output by resample.grid that corresponds to the extent and resolution of L.arr (below).

L.arr

is the likelihood array used for state switch probability calculation (see expmax). This is typically the L.mle array returned from make.L because it's typically more coarse (and thus faster) than the higher-resolution L array.

p.guess

is vector of length 2 indicating probability of staying in states 1 and 2, respectively

calcP

is logical indicating whether to use expmax to calculate state-switching probabilities

Value

list of parameters including movement kernels (K1, K2) and switch probability (P.final)

Examples

Run this code
# NOT RUN {
par0 <- makePar(migr.spd=2, grid=g.mle, L.arr=L.mle, p.guess=c(.9,.9), calcP=T)
# }
# NOT RUN {
      
# }

Run the code above in your browser using DataLab