resample.hmmpars: Resample availability HMM.

View source: R/bootstrap.R

resample.hmmparsR Documentation

Resample availability HMM.

Description

Resamples a hidden Markov model (HMM) data from multiple observed availability time series (one per animal).

Usage

resample.hmmpars(
  availhmm,
  adat,
  animals,
  seed = NULL,
  nperow = 10,
  printprog = TRUE
)

Arguments

availhmm

list with availability HMM paramters, as for the hmm.pars parameter of est.hmltm.

adat

list of availability data time series. The ith element of the list must be named $ai and must be a vector of 0s and 1s, comprising the ith animal's time series, with 0 corresponding to being unavailable and 1 to being available.

animals

a vector of integers indicating which of the elements of adat are to be resampled (e.g. animals=c(1,3,4) means the time series of animals 1, 3 and 4 only will be used).

seed

random number seed (integer).

nperow

number of iterations printed on one row if printprog=TRUE.

printprog

if TRUE, prints progress through animals as it resamples.

Details

Simulates a new series of availability observations (0s and 1s) using functions dthmm and simulate from library HiddenMarkov, then fits a HMM to these data using function BaumWelch from library HiddenMarkov. Constructs a new hmm.pars object from the fitted HMM parameters.

Value

A list with the same format as the input availhmm

Examples

data(bowhead.hmm.pars)
data(bowhead.adat)
animals=1:8
resamp=resample.hmmpars(bowhead.hmm.pars,bowhead.adat,animals)


david-borchers/hmltm documentation built on Oct. 29, 2023, 9:07 p.m.