allProbs: Matrix of all probabilities

View source: R/allProbs.R

allProbsR Documentation

Matrix of all probabilities

Description

Used in functions viterbi, logAlpha, logBeta.

Usage

allProbs(
  data,
  nbStates,
  stepDist,
  angleDist,
  stepPar,
  anglePar = NULL,
  zeroInflation = FALSE,
  knownStates = NULL
)

Arguments

data

Object moveData.

nbStates

Number of states of the HMM.

stepDist

Name of the distribution of the step lengths.

angleDist

Name of the distribution of the turning angles. Set to "none" if the angle distribution should not be estimated.

stepPar

Parameters of the step length distribution. Must be provided in a matrix with one row for each parameter (in the order expected by the pdf of stepDist), and one column for each state.

anglePar

Parameters of the turning angle distribution. Must be provided in a matrix with one row for each parameter (in the order expected by the pdf of angleDist), and one column for each state. Default: NULL ; if the turning angles distribution is not estimated.

zeroInflation

TRUE if the step length distribution is inflated in zero. Default: FALSE.

knownStates

Vector of values of the state process which are known prior to fitting the model (if any). Default: NULL (states are not known). This should be a vector with length the number of rows of 'data'; each element should either be an integer (the value of the known states) or NA if the state is not known.

Value

Matrix of all probabilities.

Examples

## Not run: 
stepPar <- c(1,10,1,5,0.2,0.3)
anglePar <- c(0,pi,0.5,2)
stepDist <- "gamma"
angleDist <- "vm"
data <- simData(nbAnimals=5,nbStates=2,stepDist=stepDist,angleDist=angleDist,stepPar=stepPar,
                 anglePar=anglePar,nbCovs=2,zeroInflation=TRUE)
P <- allProbs(data=data,nbStates=2,stepDist=stepDist,angleDist=angleDist,
               stepPar=matrix(stepPar,ncol=2,byrow=TRUE),anglePar=matrix(anglePar,ncol=2,
               byrow=TRUE),zeroInflation=TRUE)

## End(Not run)

moveHMM documentation built on May 31, 2023, 6:13 p.m.