From 3107caa43d96eb240d7fdddf772a4c28c942d269 Mon Sep 17 00:00:00 2001 From: lehmasve Date: Mon, 5 Jun 2023 16:50:14 +0200 Subject: [PATCH 1/3] Add NEWS.md --- NEWS.md | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 NEWS.md diff --git a/NEWS.md b/NEWS.md new file mode 100644 index 0000000..58df5cf --- /dev/null +++ b/NEWS.md @@ -0,0 +1,3 @@ +# hdflex 0.1.0 + +* Added a `NEWS.md` file to track changes to the package. From df54c3aefc83669d4a93247b396751206b2e2156 Mon Sep 17 00:00:00 2001 From: lehmasve Date: Mon, 5 Jun 2023 17:34:41 +0200 Subject: [PATCH 2/3] Prepare for CRAN submission --- .Rbuildignore | 1 + DESCRIPTION | 46 +++++++++++++++++++----------------------- R/data-documentation.R | 4 ++-- R/dsc.R | 12 +++++------ R/summary_stsc.R | 10 ++++----- R/tvc.R | 11 ++++++---- README.Rmd | 2 +- README.md | 2 +- cran-comments.md | 5 +++++ man/inflation_data.Rd | 2 +- man/tvc.Rd | 2 +- 11 files changed, 51 insertions(+), 46 deletions(-) create mode 100644 cran-comments.md diff --git a/.Rbuildignore b/.Rbuildignore index da72cdc..0f94ab9 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -12,3 +12,4 @@ ^CRAN-SUBMISSION$ ^\.github$ ^codecov\.yml$ +^cran-comments\.md$ diff --git a/DESCRIPTION b/DESCRIPTION index 2594282..b775d07 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,35 +1,31 @@ -Package: hdflex Type: Package +Package: hdflex Title: High-Dimensional Density Forecast Combinations Version: 0.1.0 -Date: 2023-02-06 Authors@R: c( - person("Sven", "Lehmann", - email = "sven.lehmann@uni-rostock.de", - role = c("aut", "cre")), - person("Philipp", "Adämmer", - email = "philipp.adaemmer@uni-greifswald.de", - role = "aut"), - person("Rainer", "Schüssler", - email = "Rainer.schüssler@uni-rostock.de", - role = "aut")) + person("Sven", "Lehmann", , "sven.lehmann@uni-rostock.de", role = c("aut", "cre")), + person("Philipp", "Adämmer", , "philipp.adaemmer@uni-greifswald.de", role = "aut"), + person("Rainer", "Schüssler", , "Rainer.schüssler@uni-rostock.de", role = "aut")) Maintainer: Sven Lehmann -Description: Provides functions to estimate and evaluate density forecast combinations in a high-dimensional setting. The methods are explained in detail in Adämmer et al (2023) . +Description: Provides functions to estimate and evaluate density forecast + combinations in a high-dimensional setting. The methods are explained + in detail in Adaemmer et al. (2023) . License: GPL (>= 2) -Depends: R (>= 4.1.0) -NeedsCompilation: Yes +Depends: + R (>= 4.1.0) Imports: - parallel (>= 4.1.0), - dplyr (>= 1.1.0), - Rcpp (>= 1.0.10), - roll (>= 1.1.6), - stringr (>= 1.5.0), - checkmate (>= 2.1.0) -LinkingTo: Rcpp, RcppArmadillo -RoxygenNote: 7.2.3 -Encoding: UTF-8 + checkmate (>= 2.1.0), + dplyr (>= 1.1.0), + parallel (>= 4.1.0), + Rcpp (>= 1.0.10), + roll (>= 1.1.6), + stats (>= 4.1.0), + stringr (>= 1.5.0) Suggests: - covr, - testthat (>= 3.0.0) + testthat (>= 3.0.0) +LinkingTo: Rcpp, RcppArmadillo Config/testthat/edition: 3 +Encoding: UTF-8 LazyData: true +NeedsCompilation: Yes +RoxygenNote: 7.2.3 diff --git a/R/data-documentation.R b/R/data-documentation.R index 22099a8..640e522 100644 --- a/R/data-documentation.R +++ b/R/data-documentation.R @@ -65,7 +65,7 @@ #' Welch, I. and Goyal, A. (2008) "A comprehensive look at the empirical performance of equity premium prediction." #' \emph{The Review of Financial Studies}, 21 (4): 1455–1508. #' -#' @source \url{https://onlinelibrary.wiley.com/doi/full/10.1111/iere.12623} +#' @source "inflation_data" @@ -89,7 +89,7 @@ #' Koop, G. and Korobilis, D. (2023) "Bayesian dynamic variable selection in high dimensions." #' \emph{International Economic Review}. #' -#' @source \url{https://onlinelibrary.wiley.com/doi/full/10.1111/iere.12623} +#' @source "benchmark_ar2" diff --git a/R/dsc.R b/R/dsc.R index 65c8abc..c7eaaaf 100644 --- a/R/dsc.R +++ b/R/dsc.R @@ -24,12 +24,12 @@ #' to down-weight the past predictive performance of the subset combinations. #' @param n_cores An integer that denotes the number of CPU-cores #' used for the computational estimation. -#' @return A list that contains -#' (1) a vector with the first moments (point forecasts) of the STSC-Model, -#' (2) a vector with the the second moments (variance) of the STSC-Model, -#' (3) a vector that contains the selected values for gamma, -#' (4) a vector that contains the selected values for psi and -#' (5) a matrix that indicates the selected signals for every point in time. +#' @return A list that contains: +#' * (1) a vector with the first moments (point forecasts) of the STSC-Model, +#' * (2) a vector with the the second moments (variance) of the STSC-Model, +#' * (3) a vector that contains the selected values for gamma, +#' * (4) a vector that contains the selected values for psi and +#' * (5) a matrix that indicates the selected signals for every point in time. #' @export #' @import parallel #' @import checkmate diff --git a/R/summary_stsc.R b/R/summary_stsc.R index 5e8d089..b6bf862 100644 --- a/R/summary_stsc.R +++ b/R/summary_stsc.R @@ -14,11 +14,11 @@ #' or numeric vector of length `T` containing the #' out-of-sample forecasts of dsc(). #' @export -#' @return List that contains -#' (1) the Clark-West-Statistic, -#' (2) the Out-of-Sample R2, -#' (3) a vector with the CSSED between the STSC-Forecast and the benchmark and -#' (4) a list with the MSE of the STSC-Model and the benchmark. +#' @return List that contains: +#' * (1) the Clark-West-Statistic, +#' * (2) the Out-of-Sample R2, +#' * (3) a vector with the CSSED between the STSC-Forecast and the benchmark and +#' * (4) a list with the MSE of the STSC-Model and the benchmark. #' @import checkmate #' @importFrom stats t.test #' @examples diff --git a/R/tvc.R b/R/tvc.R index 3768fcc..dd57b40 100644 --- a/R/tvc.R +++ b/R/tvc.R @@ -21,7 +21,7 @@ #' Each signal in combination with each value of #' lambda provides a separate candidate forecast. #' Constant coefficients are nested for the case `lambda = 1`. -#' @param kappa_grid A numeric vector to accomodate time-varying volatility. +#' @param kappa_grid A numeric vector to accommodate time-varying volatility. #' The observational variance is estimated via #' Exponentially Weighted Moving Average. #' Constant variance is nested for the case `kappa = 1`. @@ -31,11 +31,14 @@ #' to initialize the observational variance and the coefficients' variance. #' @param n_cores An integer that denotes the number of CPU-cores used #' for the computation. -#' @return A list that contains -#' (1) a matrix with the first moments (point forecasts) +#' @return A list that contains: +#' +#' * (1) a matrix with the first moments (point forecasts) #' of the conditionally normal predictive distributions and -#' (2) a matrix with the second moments (variance) +#' +#' * (2) a matrix with the second moments (variance) #' of the conditionally normal predictive distributions. +#' #' @export #' @import parallel #' @import checkmate diff --git a/README.Rmd b/README.Rmd index 8633aa7..9f1326b 100644 --- a/README.Rmd +++ b/README.Rmd @@ -8,7 +8,7 @@ output: github_document ⁠⁠ [![R-CMD-check](https://github.com/lehmasve/hdflex/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/lehmasve/hdflex/actions/workflows/R-CMD-check.yaml) -[![codecov](https://codecov.io/gh/lehmasve/hdflex/branch/dev/graph/badge.svg?token=leKtsb0Kub)](https://codecov.io/gh/lehmasve/hdflex) +[![codecov](https://codecov.io/gh/lehmasve/hdflex/branch/dev/graph/badge.svg?token=leKtsb0Kub)](https://app.codecov.io/gh/lehmasve/hdflex) ⁠⁠ ```{r setup, include = FALSE} diff --git a/README.md b/README.md index 24bf8f5..52f727f 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,7 @@ ⁠⁠ [![R-CMD-check](https://github.com/lehmasve/hdflex/actions/workflows/R-CMD-check.yaml/badge.svg)](https://github.com/lehmasve/hdflex/actions/workflows/R-CMD-check.yaml) -[![codecov](https://codecov.io/gh/lehmasve/hdflex/branch/dev/graph/badge.svg?token=leKtsb0Kub)](https://codecov.io/gh/lehmasve/hdflex) +[![codecov](https://codecov.io/gh/lehmasve/hdflex/branch/dev/graph/badge.svg?token=leKtsb0Kub)](https://app.codecov.io/gh/lehmasve/hdflex) ⁠⁠ ## About diff --git a/cran-comments.md b/cran-comments.md new file mode 100644 index 0000000..858617d --- /dev/null +++ b/cran-comments.md @@ -0,0 +1,5 @@ +## R CMD check results + +0 errors | 0 warnings | 1 note + +* This is a new release. diff --git a/man/inflation_data.Rd b/man/inflation_data.Rd index a6c2274..ced5a95 100644 --- a/man/inflation_data.Rd +++ b/man/inflation_data.Rd @@ -10,7 +10,7 @@ A \link{matrix} with 245 quarterly observations (rows) and 516 variables (column \item{Column 1:4}{Transformed target variables: GDP deflator (GDPCTPI), PCE deflator (PCECTPI), - Total CPI (CPIAUCS)L, Core CPI (CPILFES)L} + Total CPI (CPIAUCSL), Core CPI (CPILFESL)} \item{Column 5:8}{First lag of the target variables} diff --git a/man/tvc.Rd b/man/tvc.Rd index 97bd43d..7312f6f 100644 --- a/man/tvc.Rd +++ b/man/tvc.Rd @@ -25,7 +25,7 @@ Each signal in combination with each value of lambda provides a separate candidate forecast. Constant coefficients are nested for the case `lambda = 1`.} -\item{kappa_grid}{A numeric vector to accomodate time-varying volatility. +\item{kappa_grid}{A numeric vector to accommodate time-varying volatility. The observational variance is estimated via Exponentially Weighted Moving Average. Constant variance is nested for the case `kappa = 1`. From f0840fed2631d0491307c0b2793424390fa0356c Mon Sep 17 00:00:00 2001 From: lehmasve Date: Mon, 5 Jun 2023 17:35:10 +0200 Subject: [PATCH 3/3] Prepare for CRAN submission --- src/Makevars.win | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Makevars.win b/src/Makevars.win index d3e3f41..7113f46 100644 --- a/src/Makevars.win +++ b/src/Makevars.win @@ -8,7 +8,7 @@ ## ## And with R 3.4.0, and RcppArmadillo 0.7.960.*, we turn C++11 on as OpenMP ## support within Armadillo prefers / requires it -CXX_STD = CXX11 +## CXX_STD = CXX11 PKG_CXXFLAGS = $(SHLIB_OPENMP_CXXFLAGS) PKG_LIBS = $(SHLIB_OPENMP_CXXFLAGS) $(LAPACK_LIBS) $(BLAS_LIBS) $(FLIBS)