Skip to content

Commit

Permalink
re-resubmit v1.0.0 to cran
Browse files Browse the repository at this point in the history
  • Loading branch information
ygeunkim committed Nov 8, 2023
1 parent 952ee6a commit a087f85
Show file tree
Hide file tree
Showing 28 changed files with 120 additions and 122 deletions.
4 changes: 2 additions & 2 deletions CRAN-SUBMISSION
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
Version: 1.0.0
Date: 2023-11-07 11:22:14 UTC
SHA: fa382376cbbee3dfdf567b1dcdbeb87db0dfebe9
Date: 2023-11-08 05:42:19 UTC
SHA: 952ee6ac28389258abdcd3908b7b821b6f5587da
1 change: 0 additions & 1 deletion NAMESPACE
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,6 @@ export(choose_bvar)
export(choose_bvhar)
export(choose_ssvs)
export(choose_var)
export(compute_cov)
export(compute_dic)
export(compute_logml)
export(conf_fdr)
Expand Down
19 changes: 10 additions & 9 deletions R/RcppExports.R
Original file line number Diff line number Diff line change
Expand Up @@ -300,7 +300,7 @@ estimate_var <- function(x, y, method) {
#' \deqn{\hat{\Sigma}_e = \frac{1}{s - k} (Y_0 - \hat{A} X_0)^T (Y_0 - \hat{A} X_0)}
#'
#' @references Lütkepohl, H. (2007). *New Introduction to Multiple Time Series Analysis*. Springer Publishing.
#' @export
#' @noRd
compute_cov <- function(z, num_design, dim_design) {
.Call(`_bvhar_compute_cov`, z, num_design, dim_design)
}
Expand Down Expand Up @@ -343,7 +343,7 @@ VARcoeftoVMA <- function(var_coef, var_lag, lag_max) {
#' \deqn{W_1 = W_0 B_1 (W_1^T = B_1^T W_0^T)}
#' \deqn{W_2 = W_1 B_1 + W_0 B_2 (W_2^T = B_1^T W_1^T + B_2^T W_0^T)}
#' \deqn{W_j = \sum_{j = 1}^k W_{k - j} B_j (W_j^T = \sum_{j = 1}^k B_j^T W_{k - j}^T)}
#'
#' @return VMA coefficient of k(lag-max + 1) x k dimension
#' @references Lütkepohl, H. (2007). *New Introduction to Multiple Time Series Analysis*. Springer Publishing.
#' @export
VARtoVMA <- function(object, lag_max) {
Expand Down Expand Up @@ -463,7 +463,7 @@ VHARcoeftoVMA <- function(vhar_coef, HARtrans_mat, lag_max, month) {
#'
#' Observe that
#' \deqn{B = \tilde{T}^T \Phi}
#'
#' @return VMA coefficient of k(lag-max + 1) x k dimension
#' @references Lütkepohl, H. (2007). *New Introduction to Multiple Time Series Analysis*. Springer Publishing.
#' @export
VHARtoVMA <- function(object, lag_max) {
Expand Down Expand Up @@ -880,14 +880,14 @@ sim_mstudent <- function(num_sim, df, mu, sig, method) {
#' @param mat_scale_u First scale matrix
#' @param mat_scale_v Second scale matrix
#' @details
#' Consider s x m matrix \eqn{Y_1, \ldots, Y_n \sim MN(M, U, V)} where M is s x m, U is s x s, and V is m x m.
#' Consider n x k matrix \eqn{Y_1, \ldots, Y_n \sim MN(M, U, V)} where M is n x k, U is n x n, and V is k x k.
#'
#' 1. Lower triangular Cholesky decomposition: \eqn{U = P P^T} and \eqn{V = L L^T}
#' 2. Standard normal generation: s x m matrix \eqn{Z_i = [z_{ij} \sim N(0, 1)]} in row-wise direction.
#' 3. \eqn{Y_i = M + P Z_i L^T}
#'
#' This function only generates one matrix, i.e. \eqn{Y_1}.
#'
#' @return One n x k matrix following MN distribution.
#' @export
sim_matgaussian <- function(mat_mean, mat_scale_u, mat_scale_v) {
.Call(`_bvhar_sim_matgaussian`, mat_mean, mat_scale_u, mat_scale_v)
Expand Down Expand Up @@ -916,13 +916,13 @@ sim_iw_tri <- function(mat_scale, shape) {
#' @details
#' Consider \eqn{\Sigma \sim IW(\Psi, \nu)}.
#'
#' 1. Upper triangular Bartlett decomposition: m x m matrix \eqn{Q = [q_{ij}]} upper triangular with
#' 1. Upper triangular Bartlett decomposition: k x k matrix \eqn{Q = [q_{ij}]} upper triangular with
#' 1. \eqn{q_{ii}^2 \chi_{\nu - i + 1}^2}
#' 2. \eqn{q_{ij} \sim N(0, 1)} with i < j (upper triangular)
#' 2. Lower triangular Cholesky decomposition: \eqn{\Psi = L L^T}
#' 3. \eqn{A = L (Q^{-1})^T}
#' 4. \eqn{\Sigma = A A^T \sim IW(\Psi, \nu)}
#'
#' @return One k x k matrix following IW distribution
#' @export
sim_iw <- function(mat_scale, shape) {
.Call(`_bvhar_sim_iw`, mat_scale, shape)
Expand All @@ -941,10 +941,11 @@ sim_iw <- function(mat_scale, shape) {
#' Consider \eqn{(Y_i, \Sigma_i) \sim MIW(M, U, \Psi, \nu)}.
#'
#' 1. Generate upper triangular factor of \eqn{\Sigma_i = C_i C_i^T} in the upper triangular Bartlett decomposition.
#' 2. Standard normal generation: s x m matrix \eqn{Z_i = [z_{ij} \sim N(0, 1)]} in row-wise direction.
#' 2. Standard normal generation: n x k matrix \eqn{Z_i = [z_{ij} \sim N(0, 1)]} in row-wise direction.
#' 3. Lower triangular Cholesky decomposition: \eqn{U = P P^T}
#' 4. \eqn{A_i = M + P Z_i C_i^T}
#'
#' @return List of MN and IW matrices.
#' Multiple samples are column-stacked.
#' @export
sim_mniw <- function(num_sim, mat_mean, mat_scale_u, mat_scale, shape) {
.Call(`_bvhar_sim_mniw`, num_sim, mat_mean, mat_scale_u, mat_scale, shape)
Expand Down
1 change: 1 addition & 0 deletions R/bvar-hierarchical.R
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
#' delta = rep(1, 3),
#' eps = 1e-04 # eps = 1e-04
#' )
#' @return `bvharpriorspec` object
#' @references Giannone, D., Lenza, M., & Primiceri, G. E. (2015). *Prior Selection for Vector Autoregressions*. Review of Economics and Statistics, 97(2).
#' @order 1
#' @export
Expand Down
20 changes: 8 additions & 12 deletions R/criteria.R
Original file line number Diff line number Diff line change
Expand Up @@ -178,7 +178,7 @@ logLik.bvharmn <- function(object, ...) {
#' @param ... not used
#' @details
#' Let \eqn{\tilde{\Sigma}_e} be the MLE
#' and let \eqn{\hat{\Sigma}_e} be the unbiased estimator (from [compute_cov()] and the member named `covmat`) for \eqn{\Sigma_e}.
#' and let \eqn{\hat{\Sigma}_e} be the unbiased estimator (`covmat`) for \eqn{\Sigma_e}.
#' Note that
#'
#' \deqn{\tilde{\Sigma}_e = \frac{s - k}{s} \hat{\Sigma}_e}
Expand Down Expand Up @@ -271,17 +271,16 @@ FPE <- function(object, ...) {
#' @param ... not used
#' @details
#' Let \eqn{\tilde{\Sigma}_e} be the MLE
#' and let \eqn{\hat{\Sigma}_e} be the unbiased estimator (from [compute_cov()] and the member named `covmat`) for \eqn{\Sigma_e}.
#' and let \eqn{\hat{\Sigma}_e} be the unbiased estimator (`covmat`) for \eqn{\Sigma_e}.
#' Note that
#'
#' \deqn{\tilde{\Sigma}_e = \frac{s - k}{n} \hat{\Sigma}_e}
#'
#' Then
#'
#' \deqn{FPE(p) = (\frac{s + k}{s - k})^m \det \tilde{\Sigma}_e}
#'
#' @return FPE value.
#' @references Lütkepohl, H. (2007). *New Introduction to Multiple Time Series Analysis*. Springer Publishing.
#'
#' @export
FPE.varlse <- function(object, ...) {
compute_fpe(object)
Expand All @@ -303,7 +302,7 @@ FPE.vharlse <- function(object, ...) {
#' @param ... not used
#' @details
#' Let \eqn{\tilde{\Sigma}_e} be the MLE
#' and let \eqn{\hat{\Sigma}_e} be the unbiased estimator (from [compute_cov()] and the member named `covmat`) for \eqn{\Sigma_e}.
#' and let \eqn{\hat{\Sigma}_e} be the unbiased estimator (`covmat`) for \eqn{\Sigma_e}.
#' Note that
#'
#' \deqn{\tilde{\Sigma}_e = \frac{s - k}{n} \hat{\Sigma}_e}
Expand Down Expand Up @@ -406,7 +405,7 @@ HQ.logLik <- function(object, ...) {
#' @param ... not used
#' @details
#' Let \eqn{\tilde{\Sigma}_e} be the MLE
#' and let \eqn{\hat{\Sigma}_e} be the unbiased estimator (from [compute_cov()] and the member named `covmat`) for \eqn{\Sigma_e}.
#' and let \eqn{\hat{\Sigma}_e} be the unbiased estimator (`covmat`) for \eqn{\Sigma_e}.
#' Note that
#'
#' \deqn{\tilde{\Sigma}_e = \frac{s - k}{n} \hat{\Sigma}_e}
Expand Down Expand Up @@ -470,9 +469,9 @@ HQ.bvharmn <- function(object, ...) {
AIC()
}

#' Deviance Information Criterion
#' Deviance Information Criterion of Multivariate Time Series Model
#'
#' Generic function that computes DIC.
#' Compute DIC of BVAR and BVHAR.
#'
#' @param object Model fit
#' @param ... not used
Expand All @@ -482,10 +481,7 @@ compute_dic <- function(object, ...) {
UseMethod("compute_dic", object)
}

#' Deviance Information Criterion of Multivariate Time Series Model
#'
#' Compute DIC of BVAR and BVHAR
#'
#' @rdname compute_dic
#' @param object Model fit
#' @param n_iter Number to sample
#' @param ... not used
Expand Down
6 changes: 2 additions & 4 deletions R/stable-process.R
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,8 @@ is.stable <- function(x, ...) {
#' \deqn{\det(I_m - A z) = 0}
#'
#' where \eqn{A} is VAR(1) coefficient matrix representation.
#'
#' @return Numeric vector.
#' @references Lütkepohl, H. (2007). *New Introduction to Multiple Time Series Analysis*. Springer Publishing.
#'
#' @export
stableroot.varlse <- function(x, ...) {
compute_var_stablemat(x) %>%
Expand All @@ -53,9 +52,8 @@ stableroot.varlse <- function(x, ...) {
#' \deqn{\det(I_m - A z) \neq 0}
#'
#' for \eqn{\lvert z \rvert \le 1}.
#'
#' @return logical class
#' @references Lütkepohl, H. (2007). *New Introduction to Multiple Time Series Analysis*. Springer Publishing.
#'
#' @export
is.stable.varlse <- function(x, ...) {
all(stableroot(x) < 1)
Expand Down
1 change: 1 addition & 0 deletions R/tuning.R
Original file line number Diff line number Diff line change
Expand Up @@ -598,6 +598,7 @@ choose_bayes <- function(bayes_bound = bound_bvhar(),
#' In case of \eqn{(\omega_{0ij}, \omega_{1ij})},
#' \deqn{\omega_{kij} = c_k = \hat{VAR(OLS)}}
#' similarly.
#' @return `ssvsinput` object
#' @references
#' George, E. I., & McCulloch, R. E. (1993). *Variable Selection via Gibbs Sampling*. Journal of the American Statistical Association, 88(423), 881–889.
#'
Expand Down
13 changes: 13 additions & 0 deletions cran-comments.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## Re-resubmission v1.0.0
This is second resubmission. Comments are included in italics.

- *We still see: Missing Rd-tags ... Since you are using 'roxygen', please add a @return tag in the corresponding .R-file and re-roxygenize() your .Rd-files.*\
**Response** We have added `@return` to each mentioned document.

## Resubmission
This is a resubmission. Comments are included in italics.

Expand All @@ -15,3 +21,10 @@ This is a resubmission. Comments are included in italics.
0 errors | 0 warnings | 1 note

* This is a new release.

## revdepcheck results

We checked 0 reverse dependencies, comparing R CMD check results across CRAN and dev versions of this package.

* We saw 0 new problems
* We failed to check 0 packages
2 changes: 1 addition & 1 deletion man/AIC.varlse.Rd

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

2 changes: 1 addition & 1 deletion man/BIC.varlse.Rd

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

5 changes: 4 additions & 1 deletion man/FPE.varlse.Rd

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

2 changes: 1 addition & 1 deletion man/HQ.varlse.Rd

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

3 changes: 3 additions & 0 deletions man/VARtoVMA.Rd

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

3 changes: 3 additions & 0 deletions man/VHARtoVMA.Rd

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

3 changes: 3 additions & 0 deletions man/choose_ssvs.Rd

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

32 changes: 0 additions & 32 deletions man/compute_cov.Rd

This file was deleted.

27 changes: 25 additions & 2 deletions man/compute_dic.Rd

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

Loading

0 comments on commit a087f85

Please sign in to comment.