nLogLike | R Documentation |
Negative log-likelihood function
nLogLike(
wpar,
nbStates,
bounds,
parSize,
data,
stepDist = c("gamma", "weibull", "lnorm", "exp"),
angleDist = c("vm", "wrpcauchy", "none"),
angleMean = NULL,
zeroInflation = FALSE,
stationary = FALSE,
knownStates = NULL
)
wpar |
Vector of working parameters. |
nbStates |
Number of states of the HMM. |
bounds |
Matrix with 2 columns and as many rows as there are elements in |
parSize |
Vector of two values: number of parameters of the step length distribution, number of parameters of the turning angle distribution. |
data |
An object |
stepDist |
Name of the distribution of the step lengths (as a character string). Supported distributions are: gamma, weibull, lnorm, exp. Default: gamma. |
angleDist |
Name of the distribution of the turning angles (as a character string).
Supported distributions are: vm, wrpcauchy. Set to |
angleMean |
Vector of means of turning angles if not estimated (one for each state).
Default: |
zeroInflation |
|
stationary |
|
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. |
The negative log-likelihood of the parameters given the data.
## Not run:
# data is a moveData object (as returned by prepData), automatically loaded with the package
data <- example$data
simPar <- example$simPar
par0 <- example$par0
estAngleMean <- is.null(simPar$angleMean)
bounds <- parDef(simPar$stepDist,simPar$angleDist,simPar$nbStates,
estAngleMean,simPar$zeroInflation)$bounds
parSize <- parDef(simPar$stepDist,simPar$angleDist,simPar$nbStates,
estAngleMean,simPar$zeroInflation)$parSize
par <- c(par0$stepPar0,par0$anglePar0)
wpar <- n2w(par,bounds,par0$beta0,par0$delta0,simPar$nbStates,FALSE)
l <- nLogLike(wpar=wpar,nbStates=simPar$nbStates,bounds=bounds,parSize=parSize,data=data,
stepDist=simPar$stepDist,angleDist=simPar$angleDist,angleMean=simPar$angleMean,
zeroInflation=simPar$zeroInflation)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.