|
46 | 46 | #' |
47 | 47 | #' The probability (or likelihood) of observation \code{x[t, o]} depends on |
48 | 48 | #' the occupancy status of the site at time t-1, the transitition |
49 | | -#' probability of persistence (\code{probPersist} or \code{probPersist[t]}), |
50 | | -#' colonization (\code{probColonize} or \code{probColonize[t]}), and a |
| 49 | +#' probability of persistence (\code{probPersist} or \code{probPersist[t-1]}), |
| 50 | +#' colonization (\code{probColonize} or \code{probColonize[t-1]}), and a |
51 | 51 | #' detection probability (\code{p}, \code{p[t]}, or \code{p[t, o]}). |
52 | 52 | #' |
53 | 53 | #' The first two letters following the 'dDynOcc_' indicate whether the |
|
57 | 57 | #' probabilities \code{probColonize[1:(T-1)]}. |
58 | 58 | #' |
59 | 59 | #' When vectors, \code{probColonize} and \code{probPersist} may be of any |
60 | | -#' length greater than \code{length(x) - 1}. Only the first \code{length(x) - 1} |
| 60 | +#' length greater than or equal to \code{length(x) - 1}. Only the first \code{length(x) - 1} |
61 | 61 | #' indices are used, each corresponding to the transition from time t to t+1 |
62 | 62 | #' (e.g. \code{probColonize[2]} describes the transition probability from |
63 | 63 | #' t = 2 to t = 3). All extra values are ignored. This is to make it easier to |
|
76 | 76 | #' \code{end = c(4,4,3)}. In this case, the value of \code{x[4,4]} would |
77 | 77 | #' be ignored. |
78 | 78 | #' |
79 | | -#' For more explanation, see |
80 | | -#' \href{../doc/Introduction_to_nimbleEcology.html}{package vignette} (or |
81 | | -#' \code{vignette("Introduction_to_nimbleEcology")}). |
| 79 | +#' For more explanation, see package vignette |
| 80 | +#' (\code{vignette("Introduction_to_nimbleEcology")}). |
82 | 81 | #' |
83 | 82 | #' Compared to writing \code{nimble} models with a discrete latent state for |
84 | 83 | #' true occupancy status and a separate scalar datum for each observation, use |
|
115 | 114 | #' |
116 | 115 | #' If an algorithm using a \code{nimble} model with this declaration |
117 | 116 | #' needs to generate a random draw for \code{detections[1:T, 1:O]}, it |
118 | | -#' will make a similar invocation of \code{rDynOcc_svm}, with \code{n = 1}. |
| 117 | +#' will make a similar invocation of \code{rDynOcc_ssm}, with \code{n = 1}. |
119 | 118 | #' |
120 | 119 | #' If the colonization probabilities are time-dependent, one would use: |
121 | 120 | #' |
122 | 121 | #' \code{detections[1:T] ~ dDynOcc_svm(nrep, init = init_prob, |
123 | 122 | #' probPersist = persistence_prob, |
124 | | -#' probColonize = colonization_prob[1:(T-1)], p = p[1:S, 1:T])} |
| 123 | +#' probColonize = colonization_prob[1:(T-1)], p = p[1:T, 1:O])} |
125 | 124 | #' |
126 | 125 | #' @return |
127 | 126 | #' For \code{dDynOcc_***}: the probability (or likelihood) or log probability |
|
131 | 130 | #' @seealso For basic occupancy models, see documentation for |
132 | 131 | #' \code{\link{dOcc}}. |
133 | 132 | #' @examples |
134 | | -#' \donttest{ |
135 | 133 | #' # Set up constants and initial values for defining the model |
136 | 134 | #' x <- matrix(c(0,0,0,0, |
137 | 135 | #' 1,1,1,0, |
|
176 | 174 | #' # Calculate log probability of data from the model |
177 | 175 | #' DynOcc_model$calculate("x") |
178 | 176 | #' # Use the model for a variety of other purposes... |
179 | | -#' } |
180 | 177 |
|
181 | 178 | NULL |
182 | 179 | #' @rdname dDynOcc |
|
0 commit comments