From 1dfbcc3f774511b21a17e72e96af522249cd1d5b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tomasz=20Wo=C5=BAniak?= Date: Mon, 24 Jun 2024 09:57:16 +1000 Subject: [PATCH] provide appropriate backup for the use of lm + toget rid of a note! + why are we using lm at all?! let's doe this! --- NAMESPACE | 1 + R/bsvarSIGNs-package.R | 1 + R/specify_bsvarSIGN.R | 2 +- 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/NAMESPACE b/NAMESPACE index 96ea8ba..31d5bd7 100644 --- a/NAMESPACE +++ b/NAMESPACE @@ -17,4 +17,5 @@ importFrom(bsvars,compute_structural_shocks) importFrom(bsvars,compute_variance_decompositions) importFrom(bsvars,estimate) importFrom(bsvars,forecast) +importFrom(stats,lm) useDynLib(bsvarSIGNs, .registration = TRUE) diff --git a/R/bsvarSIGNs-package.R b/R/bsvarSIGNs-package.R index 4187203..63fcf8e 100644 --- a/R/bsvarSIGNs-package.R +++ b/R/bsvarSIGNs-package.R @@ -16,6 +16,7 @@ #' @import bsvars #' @import RcppArmadillo #' @import RcppProgress +#' @importFrom stats lm #' @note This package is currently in active development. We give no #' warranty that anything here works. #' @author Xiaolei Wang \email{adamwang15@gmail.com} Tomasz Woźniak \email{wozniak.tom@pm.me} diff --git a/R/specify_bsvarSIGN.R b/R/specify_bsvarSIGN.R index ffff6e2..ddc2362 100644 --- a/R/specify_bsvarSIGN.R +++ b/R/specify_bsvarSIGN.R @@ -156,7 +156,7 @@ specify_prior_bsvarSIGN = R6::R6Class( Y = data T = nrow(Y) lambda = 0.2 - psi = sapply(1:N, \(i) summary(lm(Y[2:T, i] ~ Y[1:(T - 1), i]))$sigma^2) + psi = sapply(1:N, \(i) summary(stats::lm(Y[2:T, i] ~ Y[1:(T - 1), i]))$sigma^2) hyper = matrix(NA, N + 3, 1) hyper[3, ] = lambda