Skip to content

Commit

Permalink
Style code
Browse files Browse the repository at this point in the history
  • Loading branch information
github-actions[bot] committed Jul 31, 2023
1 parent 984e48f commit 7e63b22
Show file tree
Hide file tree
Showing 4 changed files with 18 additions and 41 deletions.
22 changes: 6 additions & 16 deletions R/id_fevdfd.R
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,8 @@ id_fevdfd <- function(
freqs,
grid_size = 1000,
sign = "positive",
sign_horizon = 1
) {

sign_horizon = 1) {
UseMethod("id_fevdfd")

}


Expand All @@ -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
Expand Down Expand Up @@ -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)
}


Expand All @@ -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
Expand Down Expand Up @@ -223,9 +215,7 @@ id_fevdfd_findq <- function(
sigma,
target_index,
freqs,
grid_size
) {

grid_size) {
## Construct Objects
k <- nrow(sigma)
ti <- target_index
Expand Down
24 changes: 7 additions & 17 deletions R/id_fevdtd.R
Original file line number Diff line number Diff line change
Expand Up @@ -23,11 +23,8 @@ id_fevdtd <- function(
target,
horizon,
sign = "positive",
sign_horizon = 1
) {

sign_horizon = 1) {
UseMethod("id_fevdtd")

}

#' @rdname id_fevdtd
Expand All @@ -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
Expand Down Expand Up @@ -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)
}


Expand All @@ -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
Expand Down Expand Up @@ -209,9 +201,7 @@ id_fevdtd_findq <- function(
betas,
sigma,
target_index,
horizon
) {

horizon) {
k <- nrow(sigma)
ti <- target_index

Expand Down Expand Up @@ -243,4 +233,4 @@ id_fevdtd_findq <- function(
q[, 2:k] <- pracma::nullspace(t(evec))

return(q)
}
}
10 changes: 4 additions & 6 deletions R/irf.R
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,7 @@ irf.fevdvar <- function(
ci = 0.95,
runs = 100,
seed = NULL,
...
) {
...) {
class(x) <- "svars"

k <- x$K
Expand Down Expand Up @@ -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))
Expand All @@ -101,4 +99,4 @@ irf_ssv <- function(
}

return(irf)
}
}
3 changes: 1 addition & 2 deletions R/svar_to_svar1.R
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ svar_to_svar1 <- function(svar) {


as_statespace_var <- function(betas, sigma) {

k <- nrow(sigma)
p <- floor(ncol(betas) / k)

Expand All @@ -53,7 +52,7 @@ as_statespace_var <- function(betas, sigma) {
my = my,
mx = mx,
me = me
)
)

class(ssv) <- "statespacevar"

Expand Down

0 comments on commit 7e63b22

Please sign in to comment.