|
4 | 4 | #' data revisions, allowing for news and noise components and optional |
5 | 5 | #' spillovers. |
6 | 6 | #' |
7 | | -#' @param df A matrix, data frame, or single-ID vintages object. Each vintage |
8 | | -#' must be stored in a separate column. If `df` is a matrix, a synthetic |
9 | | -#' `time` index is created. |
| 7 | +#' @param df A matrix, data frame, or single-ID vintages object. Wide data |
| 8 | +#' should store one vintage per column. Long-format vintages data are also |
| 9 | +#' accepted and are converted internally. If `df` is a matrix, or a data |
| 10 | +#' frame without a `time` column, a synthetic `time` index is created. |
10 | 11 | #' @param e A single integer giving the number of vintages used in estimation. |
11 | 12 | #' The function uses the first `e` vintage columns after `time`, so `e` must |
12 | 13 | #' be greater than `0` and no larger than the number of available vintage |
|
40 | 41 | #' \item `maxiter`: maximum number of optimizer iterations. |
41 | 42 | #' \item `transform_se`: logical; whether standard deviation parameters are |
42 | 43 | #' optimized on the log scale. |
43 | | -#' \item `startvals`: optional numeric vector of starting values. |
| 44 | +#' \item `startvals`: optional numeric vector of starting values. The vector |
| 45 | +#' must have length equal to the number of estimated parameters and must |
| 46 | +#' follow the internal parameter order used by `jvn_param_table()`: AR |
| 47 | +#' coefficients `rho_*`, `sigma_e`, optional `sigma_nu_*`, optional |
| 48 | +#' `sigma_zeta_*`, and optional spillover parameters `T_nu_*` and |
| 49 | +#' `T_zeta_*`. |
44 | 50 | #' \item `se_method`: standard-error method; one of `"hessian"`, `"qml"`, |
45 | 51 | #' or `"none"`. |
46 | 52 | #' \item `n_starts`: number of random starting points for multi-start |
|
64 | 70 | #' \item `ic_n`: sample-size convention used for BIC; `"T"` for the paper |
65 | 71 | #' convention or `"Tp"` for `T * n_vint`. |
66 | 72 | #' } |
| 73 | +#' For backward compatibility, the legacy aliases `score_method` and |
| 74 | +#' `score_eps` are also accepted and mapped to `qml_score_method` and |
| 75 | +#' `qml_eps`. |
67 | 76 | #' |
68 | 77 | #' @return An object of class `"jvn_model"` with components: |
69 | 78 | #' \describe{ |
|
72 | 81 | #' \item{jvn_model_mat}{A list containing the state-space matrices `Z`, |
73 | 82 | #' `Tmat`, `R`, `H`, and `Q`.} |
74 | 83 | #' \item{params}{A data frame of parameter estimates and standard errors.} |
75 | | -#' \item{fit}{The raw optimizer output.} |
| 84 | +#' \item{fit}{The raw optimizer output returned by the selected numerical |
| 85 | +#' optimizer.} |
76 | 86 | #' \item{loglik}{The maximized log-likelihood.} |
77 | 87 | #' \item{aic}{Akaike information criterion.} |
78 | 88 | #' \item{bic}{Bayesian information criterion.} |
@@ -1942,10 +1952,14 @@ print.jvn_model <- function(x, ...) { |
1942 | 1952 | #' `jvn_model`. |
1943 | 1953 | #' |
1944 | 1954 | #' @param x An object of class `jvn_model`. |
1945 | | -#' @param state Character scalar giving the state to visualize. |
| 1955 | +#' @param state Character scalar giving the state to visualize. Defaults to |
| 1956 | +#' `"true_lag_0"`. |
1946 | 1957 | #' @param type Character scalar indicating whether `"filtered"` or `"smoothed"` |
1947 | 1958 | #' estimates should be plotted. |
1948 | 1959 | #' @param ... Additional arguments passed to `plot.revision_model()`. |
| 1960 | +#' @details This method requires `x$states` to be available. If the model was |
| 1961 | +#' fitted with `solver_options$return_states = FALSE`, plotting is not |
| 1962 | +#' possible. |
1949 | 1963 | #' |
1950 | 1964 | #' @srrstats {TS5.0} Implements default plot methods for class system |
1951 | 1965 | #' @srrstats {TS5.1} Time axis labeling (delegates to base method) |
|
0 commit comments