Skip to content

Commit d7ea5f4

Browse files
committed
align notation and solvers across nowcasting routines
1 parent 2608c56 commit d7ea5f4

14 files changed

Lines changed: 1774 additions & 1357 deletions

.Rbuildignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
^.*\.Rproj$
22
^\.Rproj\.user$
3+
^\.Rprofile$
4+
^\.R-lib$
5+
^\.R-lib/.*$
36
^data-raw$
47
^LICENSE\.md$
58
^README\.Rmd$

.gitignore

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,10 @@ reviser.Rproj
44
.Rhistory
55
.RData
66
.Ruserdata
7+
.R-lib/
8+
.Rprofile
79
docs
810
inst/doc
911
.DS_Store
1012
/doc/
11-
/Meta/
13+
/Meta/

R/jvn.R

Lines changed: 20 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,10 @@
44
#' data revisions, allowing for news and noise components and optional
55
#' spillovers.
66
#'
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.
1011
#' @param e A single integer giving the number of vintages used in estimation.
1112
#' The function uses the first `e` vintage columns after `time`, so `e` must
1213
#' be greater than `0` and no larger than the number of available vintage
@@ -40,7 +41,12 @@
4041
#' \item `maxiter`: maximum number of optimizer iterations.
4142
#' \item `transform_se`: logical; whether standard deviation parameters are
4243
#' 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_*`.
4450
#' \item `se_method`: standard-error method; one of `"hessian"`, `"qml"`,
4551
#' or `"none"`.
4652
#' \item `n_starts`: number of random starting points for multi-start
@@ -64,6 +70,9 @@
6470
#' \item `ic_n`: sample-size convention used for BIC; `"T"` for the paper
6571
#' convention or `"Tp"` for `T * n_vint`.
6672
#' }
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`.
6776
#'
6877
#' @return An object of class `"jvn_model"` with components:
6978
#' \describe{
@@ -72,7 +81,8 @@
7281
#' \item{jvn_model_mat}{A list containing the state-space matrices `Z`,
7382
#' `Tmat`, `R`, `H`, and `Q`.}
7483
#' \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.}
7686
#' \item{loglik}{The maximized log-likelihood.}
7787
#' \item{aic}{Akaike information criterion.}
7888
#' \item{bic}{Bayesian information criterion.}
@@ -1942,10 +1952,14 @@ print.jvn_model <- function(x, ...) {
19421952
#' `jvn_model`.
19431953
#'
19441954
#' @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"`.
19461957
#' @param type Character scalar indicating whether `"filtered"` or `"smoothed"`
19471958
#' estimates should be plotted.
19481959
#' @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.
19491963
#'
19501964
#' @srrstats {TS5.0} Implements default plot methods for class system
19511965
#' @srrstats {TS5.1} Time axis labeling (delegates to base method)

0 commit comments

Comments
 (0)