From 7e63b22479e9eb8d6c517b9d5d2e1266393682e9 Mon Sep 17 00:00:00 2001 From: "github-actions[bot]" Date: Mon, 31 Jul 2023 19:48:59 +0000 Subject: [PATCH] Style code --- R/id_fevdfd.R | 22 ++++++---------------- R/id_fevdtd.R | 24 +++++++----------------- R/irf.R | 10 ++++------ R/svar_to_svar1.R | 3 +-- 4 files changed, 18 insertions(+), 41 deletions(-) diff --git a/R/id_fevdfd.R b/R/id_fevdfd.R index acaa720..eb6afa8 100644 --- a/R/id_fevdfd.R +++ b/R/id_fevdfd.R @@ -25,11 +25,8 @@ id_fevdfd <- function( freqs, grid_size = 1000, sign = "positive", - sign_horizon = 1 - ) { - + sign_horizon = 1) { UseMethod("id_fevdfd") - } @@ -44,9 +41,7 @@ id_fevdfd.varest <- function( freqs, grid_size = 1000, sign = "positive", - sign_horizon = 1 - ) { - + sign_horizon = 1) { n <- colnames(x$y) k <- length(n) ni <- 1:k @@ -115,9 +110,8 @@ id_fevdfd.varboot <- function( freqs, grid_size = 1000, sign = "positive", - sign_horizon = 1 - ) { - id_fevdfd.varest(x, target, freqs, grid_size, sign, sign_horizon) + sign_horizon = 1) { + id_fevdfd.varest(x, target, freqs, grid_size, sign, sign_horizon) } @@ -133,9 +127,7 @@ id_fevdfd.bvar <- function( freqs, grid_size = 1000, sign = "positive", - sign_horizon = 1 - ) { - + sign_horizon = 1) { n <- colnames(x$meta$Y) k <- length(n) ni <- 1:k @@ -223,9 +215,7 @@ id_fevdfd_findq <- function( sigma, target_index, freqs, - grid_size - ) { - + grid_size) { ## Construct Objects k <- nrow(sigma) ti <- target_index diff --git a/R/id_fevdtd.R b/R/id_fevdtd.R index b06cbef..bf9a5b0 100644 --- a/R/id_fevdtd.R +++ b/R/id_fevdtd.R @@ -23,11 +23,8 @@ id_fevdtd <- function( target, horizon, sign = "positive", - sign_horizon = 1 - ) { - + sign_horizon = 1) { UseMethod("id_fevdtd") - } #' @rdname id_fevdtd @@ -40,9 +37,7 @@ id_fevdtd.varest <- function( target, horizon, sign = "positive", - sign_horizon = 1 - ) { - + sign_horizon = 1) { n <- colnames(x$y) k <- length(n) ni <- 1:k @@ -106,9 +101,8 @@ id_fevdtd.varboot <- function( target, horizon, sign = "positive", - sign_horizon = 1 - ) { - id_fevdtd.varest(x, target, horizon, sign, sign_horizon) + sign_horizon = 1) { + id_fevdtd.varest(x, target, horizon, sign, sign_horizon) } @@ -123,9 +117,7 @@ id_fevdtd.bvar <- function( target, horizon, sign = "positive", - sign_horizon = 1 - ) { - + sign_horizon = 1) { n <- colnames(x$meta$Y) k <- length(n) ni <- 1:k @@ -209,9 +201,7 @@ id_fevdtd_findq <- function( betas, sigma, target_index, - horizon - ) { - + horizon) { k <- nrow(sigma) ti <- target_index @@ -243,4 +233,4 @@ id_fevdtd_findq <- function( q[, 2:k] <- pracma::nullspace(t(evec)) return(q) -} \ No newline at end of file +} diff --git a/R/irf.R b/R/irf.R index 0a75da6..780dba2 100644 --- a/R/irf.R +++ b/R/irf.R @@ -44,8 +44,7 @@ irf.fevdvar <- function( ci = 0.95, runs = 100, seed = NULL, - ... - ) { + ...) { class(x) <- "svars" k <- x$K @@ -89,9 +88,8 @@ irf.fevdvar <- function( #' @param n_ahead integer. How far out to calculate the impulse response. #' irf_ssv <- function( - ssv, - n_ahead = 10 - ){ + ssv, + n_ahead = 10) { k <- nrow(ssv$my) irf <- array(0, dim = c(k, k, n_ahead)) @@ -101,4 +99,4 @@ irf_ssv <- function( } return(irf) -} \ No newline at end of file +} diff --git a/R/svar_to_svar1.R b/R/svar_to_svar1.R index e2cadd1..135ff98 100644 --- a/R/svar_to_svar1.R +++ b/R/svar_to_svar1.R @@ -31,7 +31,6 @@ svar_to_svar1 <- function(svar) { as_statespace_var <- function(betas, sigma) { - k <- nrow(sigma) p <- floor(ncol(betas) / k) @@ -53,7 +52,7 @@ as_statespace_var <- function(betas, sigma) { my = my, mx = mx, me = me - ) + ) class(ssv) <- "statespacevar"