Skip to content

Commit

Permalink
update doc for fixPar
Browse files Browse the repository at this point in the history
  • Loading branch information
bmcclintock committed Jun 8, 2023
1 parent a753c75 commit 5bf6842
Show file tree
Hide file tree
Showing 4 changed files with 13 additions and 2 deletions.
5 changes: 5 additions & 0 deletions R/fitCTHMM.R
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,11 @@ fitCTHMM <- function(data, ...) {
#' For transition probability parameters, the corresponding element of \code{fixPar} must be named ``beta'' and have the same dimensions as \code{beta0}.
#' For initial distribution parameters, the corresponding element of \code{fixPar} must be named ``delta'' and have the same dimensions as \code{delta0}.
#' Each parameter should either be numeric (the fixed value of the parameter) or NA if the parameter is to be estimated. Corresponding \code{fixPar} parameters must be on the same scale as \code{Par0} (e.g. if \code{DM} is specified for a given data stream, any fixed parameters for this data stream must be on the working scale), \code{beta0}, and \code{delta0}.
#'
#' If \code{optMethod='TMB'} then \code{fixPar} is specified differently. In this case, \code{NA} instead indicates parameters that are fixed (to the value specified by \code{Par0}, \code{beta0}, or \code{delta0}) and the parameters that are not fixed are sequentially indexed (similar to \code{betaCons}) by parameter number (such that parameters can be constrained to be equal). For example, \code{fixPar=list(angle=c(NA,NA,1,2))} indicates the first two parameters of the 'angle' distribution are fixed and the other two parameters are freely estimated. \code{fixPar=list(angle=c(1,NA,2,2,3))} indicates the first angle parameter is freely estimated, the second parameter is fixed, the third and fourth parameters are constrained to be equal, and the fifth parameter is freely estimated.
#' @param retryFits Non-negative integer indicating the number of times to attempt to iteratively fit the model using random perturbations of the current parameter estimates as the
#' initial values for likelihood optimization. Normal(0,\code{retrySD}^2) perturbations are used on the working scale parameters. Default: 0. When \code{retryFits>0}, the model with the largest log likelihood
#' value is returned. Ignored if \code{fit=FALSE}.
#' @param retryFits Non-negative integer indicating the number of times to attempt to iteratively fit the model using random perturbations of the current parameter estimates as the
#' initial values for likelihood optimization. Normal(0,\code{retrySD}^2) perturbations are used on the working scale parameters. Default: 0. When \code{retryFits>0}, the model with the largest log likelihood
#' value is returned. Ignored if \code{fit=FALSE}.
Expand Down
2 changes: 2 additions & 0 deletions R/fitHMM.R
Original file line number Diff line number Diff line change
Expand Up @@ -117,6 +117,8 @@ fitHMM <- function(data, ...) {
#' For transition probability parameters, the corresponding element of \code{fixPar} must be named ``beta'' and have the same dimensions as \code{beta0}.
#' For initial distribution parameters, the corresponding element of \code{fixPar} must be named ``delta'' and have the same dimensions as \code{delta0}.
#' Each parameter should either be numeric (the fixed value of the parameter) or NA if the parameter is to be estimated. Corresponding \code{fixPar} parameters must be on the same scale as \code{Par0} (e.g. if \code{DM} is specified for a given data stream, any fixed parameters for this data stream must be on the working scale), \code{beta0}, and \code{delta0}.
#'
#' If \code{optMethod='TMB'} then \code{fixPar} is specified differently. In this case, \code{NA} instead indicates parameters that are fixed (to the value specified by \code{Par0}, \code{beta0}, or \code{delta0}) and the parameters that are not fixed are sequentially indexed (similar to \code{betaCons}) by parameter number (such that parameters can be constrained to be equal). For example, \code{fixPar=list(angle=c(NA,NA,1,2))} indicates the first two parameters of the 'angle' distribution are fixed and the other two parameters are freely estimated. \code{fixPar=list(angle=c(1,NA,2,2,3))} indicates the first angle parameter is freely estimated, the second parameter is fixed, the third and fourth parameters are constrained to be equal, and the fifth parameter is freely estimated.
#' @param retryFits Non-negative integer indicating the number of times to attempt to iteratively fit the model using random perturbations of the current parameter estimates as the
#' initial values for likelihood optimization. Normal(0,\code{retrySD}^2) perturbations are used on the working scale parameters. Default: 0. When \code{retryFits>0}, the model with the largest log likelihood
#' value is returned. Ignored if \code{fit=FALSE}.
Expand Down
4 changes: 3 additions & 1 deletion man/fitCTHMM.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 3 additions & 1 deletion man/fitHMM.Rd

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit 5bf6842

Please sign in to comment.