diff --git a/R/RcppExports.R b/R/RcppExports.R index f4c537b..d5d186d 100644 --- a/R/RcppExports.R +++ b/R/RcppExports.R @@ -623,11 +623,11 @@ post_normal_sur <- function(y, z, sigma_i, a_prior, v_i_prior, svd = FALSE) { #' y <- us_macrodata[, "r"] #' #' # Initialise log-volatilites -#' h_init <- log(var(y)) -#' h <- rep(h_init, length(y)) +#' h_init <- matrix(log(var(y))) +#' h <- matrix(rep(h_init, length(y))) #' #' # Obtain draw -#' stoch_vol(y - mean(y), h, .05, h_init, 0.0001) +#' stoch_vol(y - mean(y), h, matrix(.05), h_init, matrix(0.0001)) #' #' @references #' @@ -681,11 +681,11 @@ stoch_vol <- function(y, h, sigma, h_init, constant) { #' y <- us_macrodata[, "r"] #' #' # Initialise log-volatilites -#' h_init <- log(var(y)) -#' h <- rep(h_init, length(y)) +#' h_init <- matrix(log(var(y))) +#' h <- matrix(rep(h_init, length(y))) #' #' # Obtain draw -#' stochvol_ksc1998(y - mean(y), h, .05, h_init, 0.0001) +#' stochvol_ksc1998(y - mean(y), h, matrix(.05), h_init, matrix(0.0001)) #' #' @references #' @@ -732,11 +732,11 @@ stochvol_ksc1998 <- function(y, h, sigma, h_init, constant) { #' y <- us_macrodata[, "r"] #' #' # Initialise log-volatilites -#' h_init <- log(var(y)) -#' h <- rep(h_init, length(y)) +#' h_init <- matrix(log(var(y))) +#' h <- matrix(rep(h_init, length(y))) #' #' # Obtain draw -#' stochvol_ocsn2007(y - mean(y), h, .05, h_init, 0.0001) +#' stochvol_ocsn2007(y - mean(y), matrix(h), matrix(.05), h_init, matrix(0.0001)) #' #' @references #' diff --git a/man/stoch_vol.Rd b/man/stoch_vol.Rd index 790811a..cbb4e3e 100644 --- a/man/stoch_vol.Rd +++ b/man/stoch_vol.Rd @@ -32,11 +32,11 @@ data("us_macrodata") y <- us_macrodata[, "r"] # Initialise log-volatilites -h_init <- log(var(y)) -h <- rep(h_init, length(y)) +h_init <- matrix(log(var(y))) +h <- matrix(rep(h_init, length(y))) # Obtain draw -stoch_vol(y - mean(y), h, .05, h_init, 0.0001) +stoch_vol(y - mean(y), h, matrix(.05), h_init, matrix(0.0001)) } \references{ diff --git a/man/stochvol_ksc1998.Rd b/man/stochvol_ksc1998.Rd index 45aa942..ac86e85 100644 --- a/man/stochvol_ksc1998.Rd +++ b/man/stochvol_ksc1998.Rd @@ -52,11 +52,11 @@ data("us_macrodata") y <- us_macrodata[, "r"] # Initialise log-volatilites -h_init <- log(var(y)) -h <- rep(h_init, length(y)) +h_init <- matrix(log(var(y))) +h <- matrix(rep(h_init, length(y))) # Obtain draw -stochvol_ksc1998(y - mean(y), h, .05, h_init, 0.0001) +stochvol_ksc1998(y - mean(y), h, matrix(.05), h_init, matrix(0.0001)) } \references{ diff --git a/man/stochvol_ocsn2007.Rd b/man/stochvol_ocsn2007.Rd index 3b7f06f..91cc566 100644 --- a/man/stochvol_ocsn2007.Rd +++ b/man/stochvol_ocsn2007.Rd @@ -45,11 +45,11 @@ data("us_macrodata") y <- us_macrodata[, "r"] # Initialise log-volatilites -h_init <- log(var(y)) -h <- rep(h_init, length(y)) +h_init <- matrix(log(var(y))) +h <- matrix(rep(h_init, length(y))) # Obtain draw -stochvol_ocsn2007(y - mean(y), h, .05, h_init, 0.0001) +stochvol_ocsn2007(y - mean(y), matrix(h), matrix(.05), h_init, matrix(0.0001)) } \references{ diff --git a/src/stoch_vol.cpp b/src/stoch_vol.cpp index 5bdf6b7..d8184ba 100644 --- a/src/stoch_vol.cpp +++ b/src/stoch_vol.cpp @@ -23,11 +23,11 @@ //' y <- us_macrodata[, "r"] //' //' # Initialise log-volatilites -//' h_init <- log(var(y)) -//' h <- rep(h_init, length(y)) +//' h_init <- matrix(log(var(y))) +//' h <- matrix(rep(h_init, length(y))) //' //' # Obtain draw -//' stoch_vol(y - mean(y), h, .05, h_init, 0.0001) +//' stoch_vol(y - mean(y), h, matrix(.05), h_init, matrix(0.0001)) //' //' @references //' diff --git a/src/stochvol_ksc1998.cpp b/src/stochvol_ksc1998.cpp index d8c76e6..5ac505b 100644 --- a/src/stochvol_ksc1998.cpp +++ b/src/stochvol_ksc1998.cpp @@ -42,11 +42,11 @@ //' y <- us_macrodata[, "r"] //' //' # Initialise log-volatilites -//' h_init <- log(var(y)) -//' h <- rep(h_init, length(y)) +//' h_init <- matrix(log(var(y))) +//' h <- matrix(rep(h_init, length(y))) //' //' # Obtain draw -//' stochvol_ksc1998(y - mean(y), h, .05, h_init, 0.0001) +//' stochvol_ksc1998(y - mean(y), h, matrix(.05), h_init, matrix(0.0001)) //' //' @references //' diff --git a/src/stochvol_ocsn2007.cpp b/src/stochvol_ocsn2007.cpp index 65ab80b..94600b7 100644 --- a/src/stochvol_ocsn2007.cpp +++ b/src/stochvol_ocsn2007.cpp @@ -35,11 +35,11 @@ //' y <- us_macrodata[, "r"] //' //' # Initialise log-volatilites -//' h_init <- log(var(y)) -//' h <- rep(h_init, length(y)) +//' h_init <- matrix(log(var(y))) +//' h <- matrix(rep(h_init, length(y))) //' //' # Obtain draw -//' stochvol_ocsn2007(y - mean(y), h, .05, h_init, 0.0001) +//' stochvol_ocsn2007(y - mean(y), matrix(h), matrix(.05), h_init, matrix(0.0001)) //' //' @references //' @@ -98,8 +98,8 @@ arma::mat stochvol_ocsn2007(arma::vec y, arma::vec h, double sigma, double h_ini data("us_macrodata") aud <- us_macrodata[, 1] -h_init <- log(var(aud)) -h <- rep(h_init, length(aud)) -stochvol_ocsn2007(aud - mean(aud), h, .05, h_init, 0.0001) +h_init <- matrix(log(var(aud))) +h <- matrix(rep(h_init, length(aud))) +stochvol_ocsn2007(aud - mean(aud), h, matrix(.05), h_init, matrix(0.0001)) ***/