Learn R Programming

moveHMM (version 1.10)

allProbs: Matrix of all probabilities

Description

Used in functions viterbi, logAlpha, logBeta.

Usage

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

Value

Matrix of all probabilities.

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.

Examples

Run this code
if (FALSE) {
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)
}

Run the code above in your browser using DataLab