-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #10 from IDSIA/vignette_IJF
Vignette ijf
- Loading branch information
Showing
20 changed files
with
901 additions
and
460 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -9,3 +9,4 @@ | |
^codecov\.yml$ | ||
^doc$ | ||
^Meta$ | ||
^data-raw$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
#' Extreme market events dataset | ||
#' | ||
#' Count time series of extreme market events in five economic sectors. | ||
#' The data refer to the trading days between 2004/12/31 and 2018/12/19 (3508 trading days in total). | ||
#' | ||
#' The counts are computed by considering 29 companies included in the Euro Stoxx | ||
#' 50 index and observing if the value of the CDS spread on a given day exceeds | ||
#' the 90-th percentile of its distribution in the last trading year. | ||
#' The companies are divided in the following sectors: Financial (FIN), Information | ||
#' and Communication Technology (ICT), Manufacturing (MFG), Energy (ENG), and Trade (TRD). | ||
#' | ||
#' There are 6 time series: | ||
#' - 5 bottom time series, corresponding to the daily counts for each sector | ||
#' - 1 upper time series, which is the sum of all the bottom (ALL) | ||
#' | ||
#' @format | ||
#' A multivariate time series of class \link[stats]{ts}. | ||
#' | ||
#' @source | ||
#' Zambon, L., Agosto, A., Giudici, P., Corani, G. (2023). *Properties of the reconciled distributions for Gaussian and count forecasts*. \doi{10.48550/arXiv.2303.15135}. | ||
#' | ||
#' @references | ||
#' Zambon, L., Agosto, A., Giudici, P., Corani, G. (2023). *Properties of the reconciled distributions for Gaussian and count forecasts*. \doi{10.48550/arXiv.2303.15135}. | ||
#' | ||
#' Agosto, A. (2022). *Multivariate Score-Driven Models for Count Time Series to Assess Financial Contagion*. \doi{10.2139/ssrn.4119895} | ||
"extr_mkt_events" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
#' Base forecasts for the extreme market events dataset | ||
#' | ||
#' Base forecasts for the `extr_mkt_events` dataset, computed using the model by | ||
#' Agosto, A. (2022). *Multivariate Score-Driven Models for Count Time Series to Assess Financial Contagion*. \doi{10.2139/ssrn.4119895}. | ||
#' | ||
#' The predictive distribution for the bottom time series is a multivariate negative | ||
#' binomial with a static vector of dispersion parameters and a time-varying vector | ||
#' of location parameters following a score-driven dynamics. | ||
#' The base forecasts for the upper time series are computed using a univariate version of this model. | ||
#' They are in-sample forecasts: for each training instant, they are computed for | ||
#' time t+1 by conditioning on the counts observed up to time t. | ||
#' | ||
#' @format | ||
#' A list `extr_mkt_events_basefc` containing | ||
#' \describe{ | ||
#' \item{`extr_mkt_events_basefc$mu`}{data frame of the base forecast means, for each day} | ||
#' \item{`extr_mkt_events_basefc$size`}{data frame of the static base forecast size parameters} | ||
#' } | ||
#' | ||
#' @source | ||
#' Agosto, A. (2022). *Multivariate Score-Driven Models for Count Time Series to Assess Financial Contagion*. \doi{10.2139/ssrn.4119895} | ||
#' | ||
#' @references | ||
#' Agosto, A. (2022). *Multivariate Score-Driven Models for Count Time Series to Assess Financial Contagion*. \doi{10.2139/ssrn.4119895} | ||
#' | ||
#' Zambon, L., Agosto, A., Giudici, P., Corani, G. (2023). *Properties of the reconciled distributions for Gaussian and count forecasts*. \doi{10.48550/arXiv.2303.15135}. | ||
"extr_mkt_events_basefc" |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
library(readxl) | ||
|
||
dir_path <- dirname(rstudioapi::getSourceEditorContext()$path) | ||
setwd(dir_path) | ||
|
||
data <- read_excel("NB_score_driven_forecasts.xlsx", sheet = "Data") | ||
extr_mkt_events <- ts(data) | ||
|
||
usethis::use_data(extr_mkt_events, overwrite = TRUE) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
library(readxl) | ||
|
||
dir_path <- dirname(rstudioapi::getSourceEditorContext()$path) | ||
setwd(dir_path) | ||
|
||
predictions <- read_excel("NB_score_driven_forecasts.xlsx", sheet = "Predictions") | ||
alpha <- read_excel("NB_score_driven_forecasts.xlsx", sheet = "alpha", n_max = 1) | ||
|
||
extr_mkt_events_basefc <- list(mu = data.frame(predictions), | ||
size = data.frame(1 / alpha)) | ||
|
||
usethis::use_data(extr_mkt_events_basefc, overwrite = TRUE) |
Binary file not shown.
Binary file not shown.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
Oops, something went wrong.