|
46 | 46 | #' \item{bic}{Bayesian Information Criterion} |
47 | 47 | #' \item{data}{Input data} |
48 | 48 | #' } |
| 49 | +#' |
| 50 | +#' @srrstats {G1.0} Primary reference: Jacobs & Van Norden (2011) |
| 51 | +#' @srrstats {G1.1} First implementation in R of the Jacobs-Van Norden state-space model |
| 52 | +#' @srrstats {G1.3} Statistical terminology clearly defined (news, noise, spillovers) |
| 53 | +#' @srrstats {G2.0} Input assertions on lengths (e, h, ar_order must be single values) |
| 54 | +#' @srrstats {G2.0a} Documents expectations on input lengths in parameter descriptions |
| 55 | +#' @srrstats {G2.1} Input type assertions (checks for list, numeric types) |
| 56 | +#' @srrstats {G2.1a} Documents data type expectations for all inputs |
| 57 | +#' @srrstats {G2.2} Restricts multivariate input to univariate parameters (e, h, ar_order) |
| 58 | +#' @srrstats {G2.3a} Uses match.arg() equivalent for method parameter validation |
| 59 | +#' @srrstats {G2.3b} Documents case-sensitivity requirements |
| 60 | +#' @srrstats {G2.4} Type conversion mechanisms (round() for ar_order) |
| 61 | +#' @srrstats {G2.4a} Explicit conversion to integer via round() |
| 62 | +#' @srrstats {G2.7} Accepts multiple tabular forms (matrix, data.frame, list) |
| 63 | +#' @srrstats {G2.8} Pre-processing routines (vintages_check, vintages_wide) |
| 64 | +#' @srrstats {G2.9} Diagnostic messages for type conversions (suppressWarnings) |
| 65 | +#' @srrstats {G2.10} Consistent column extraction behavior |
| 66 | +#' @srrstats {G2.13} Checks for missing data (complete.cases in init_params) |
| 67 | +#' @srrstats {G2.14} Options for handling missing data (implicit via KFAS) |
| 68 | +#' @srrstats {G2.15} Never assumes non-missingness |
| 69 | +#' @srrstats {G3.0} Numerical stability considerations (epsilon parameter) |
| 70 | +#' @srrstats {G5.2} Error and warning behavior tested |
| 71 | +#' @srrstats {TS1.0} Uses explicit time series class systems |
| 72 | +#' @srrstats {TS1.1} Documents types/classes of input data |
| 73 | +#' @srrstats {TS1.2} Validation routines for input classes (vintages_check) |
| 74 | +#' @srrstats {TS1.3} Pre-processing to validate and transform input (vintages_wide) |
| 75 | +#' @srrstats {TS1.4} Maintains time/date components of input data |
| 76 | +#' @srrstats {TS1.5} Ensures strict ordering of time index |
| 77 | +#' @srrstats {TS1.6} Catches ordering violations in pre-processing |
| 78 | +#' @srrstats {TS1.8} Explicit about monthly time intervals (frequency calculation) |
| 79 | +#' @srrstats {TS2.0} Handles explicit vs implicit missing values |
| 80 | +#' @srrstats {TS2.1} Options for handling missing data |
| 81 | +#' @srrstats {TS4.0b} Returns unique class-defined format (jvn_model) |
| 82 | +#' @srrstats {TS4.2} Explicitly documents return value types/classes |
| 83 | +#' @srrstats {TS4.3} Return values include time scales |
| 84 | +#' @srrstats {TS4.6b} Forecasting returns first- and second-order moments |
| 85 | +#' @srrstats {TS4.6c} Error indication for forecast estimates (confidence intervals) |
| 86 | +#' @srrstats {TS4.7c} Distinguishes model vs forecast values (sample column) |
49 | 87 | #' |
50 | 88 | #' @references Jacobs, Jan P.A.M. and Van Norden, Simon, "Modeling Data |
51 | 89 | #' Revisions: Measurement Error and Dynamics of 'True' Values", Journal of |
@@ -783,6 +821,11 @@ jvn_nowcast <- function( |
783 | 821 | #' |
784 | 822 | #' Constructs the state-space matrices Z, T, R, H, Q according to the |
785 | 823 | #' Jacobs & Van Norden (2011) specification. |
| 824 | +#' |
| 825 | +#' @srrstats {G1.4a} Internal function documented with @noRd tag |
| 826 | +#' @srrstats {G2.0} Input assertions on parameter dimensions |
| 827 | +#' @srrstats {G2.1} Type checking for parameters |
| 828 | +#' @srrstats {G3.0} Numerical stability in matrix construction |
786 | 829 | #' |
787 | 830 | #' @keywords internal |
788 | 831 | #' @noRd |
@@ -977,6 +1020,9 @@ jvn_matrices <- function( |
977 | 1020 |
|
978 | 1021 |
|
979 | 1022 | #' Update Model Matrices with Estimated Parameters |
| 1023 | +#' @srrstats {G1.4a} Internal function documented with @noRd tag |
| 1024 | +#' @srrstats {G2.1} Parameter type validation |
| 1025 | +#' @srrstats {G3.0} Numerical operations with appropriate precision |
980 | 1026 | #' @keywords internal |
981 | 1027 | #' @noRd |
982 | 1028 | jvn_update_matrices <- function(model_struct, params) { |
@@ -1043,6 +1089,9 @@ jvn_update_matrices <- function(model_struct, params) { |
1043 | 1089 |
|
1044 | 1090 |
|
1045 | 1091 | #' Negative Log-Likelihood Function |
| 1092 | +#' @srrstats {G1.4a} Internal function documented with @noRd tag |
| 1093 | +#' @srrstats {G2.15} Handles missing values appropriately |
| 1094 | +#' @srrstats {G3.0} Numerical stability in likelihood calculation |
1046 | 1095 | #' @keywords internal |
1047 | 1096 | #' @noRd |
1048 | 1097 | jvn_negloglik <- function(params, model_struct, data, transform_se = TRUE) { |
@@ -1434,6 +1483,13 @@ print.jvn_model <- function(x, ...) { |
1434 | 1483 | #' @param state String. The name of the state to visualize. |
1435 | 1484 | #' @param type String. Type of estimate to plot: "filtered" or "smoothed". |
1436 | 1485 | #' @param ... Additional arguments passed to theme_reviser. |
| 1486 | +#' |
| 1487 | +#' @srrstats {TS5.0} Implements default plot methods for class system |
| 1488 | +#' @srrstats {TS5.1} Time axis labeling (delegates to base method) |
| 1489 | +#' @srrstats {TS5.2} Time on horizontal axis (delegates to base method) |
| 1490 | +#' @srrstats {TS5.6} Distributional limits shown (confidence intervals) |
| 1491 | +#' @srrstats {TS5.7} Includes model and forecast values in plot |
| 1492 | +#' @srrstats {TS5.8} Visual distinction between model and forecast values |
1437 | 1493 | #' |
1438 | 1494 | #' @return A ggplot2 object visualizing the specified state estimates. |
1439 | 1495 | #' @examples |
|
0 commit comments