diff --git a/.Rbuildignore b/.Rbuildignore index d6b5235..15f1077 100644 --- a/.Rbuildignore +++ b/.Rbuildignore @@ -9,6 +9,8 @@ speedtest_sessioninfo.txt .undodir pre-commit.sh +.gdbinit + ^.*\.Rproj$ ^\.Rproj\.user$ @@ -16,6 +18,8 @@ Session.vim dic-example.R speedtest_output.txt +debug.Rprofile + .lintr compile_flags.txt diff --git a/.Rinstignore b/.Rinstignore index e1f83b4..0476fe1 100644 --- a/.Rinstignore +++ b/.Rinstignore @@ -1,4 +1,4 @@ bib$ RData$ predlik -Figures2 +jss3813 diff --git a/DESCRIPTION b/DESCRIPTION index bcfeabc..a64c24d 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -2,7 +2,7 @@ Encoding: UTF-8 Package: stochvol Type: Package Title: Efficient Bayesian Inference for Stochastic Volatility (SV) Models -Version: 3.0.10 +Version: 3.1.0 Authors@R: c( person("Darjus", "Hosszejni", role = c("aut", "cre"), email = "darjus.hosszejni@wu.ac.at", comment = c(ORCID = "0000-0002-3803-691X")), person("Gregor", "Kastner", role = c("aut"), email = "gregor.kastner@aau.at", comment = c(ORCID = "0000-0002-8237-8271"))) diff --git a/NEWS.md b/NEWS.md index 63ce097..7c51df7 100644 --- a/NEWS.md +++ b/NEWS.md @@ -1,4 +1,4 @@ -# stochvol 3.0.10 +# stochvol 3.1.0 - NEW FUNCTION 'svlm', which has a formula interface; it is a wrapper around 'svsample'; many thanks diff --git a/tests/testthat/test-cpp.R b/tests/testthat/test-cpp.R index 3243bef..d3a8a44 100644 --- a/tests/testthat/test-cpp.R +++ b/tests/testthat/test-cpp.R @@ -1,4 +1,3 @@ -context("C++") test_that("Catch unit tests pass", { skip_on_cran() expect_cpp_tests_pass("stochvol") diff --git a/tests/testthat/test-samplers.R b/tests/testthat/test-samplers.R index 8bcc2cf..5633749 100644 --- a/tests/testthat/test-samplers.R +++ b/tests/testthat/test-samplers.R @@ -47,6 +47,9 @@ test_that("vanilla SV passes Geweke test", { }) test_that("general SV passes Geweke test", { + skip_on_cran() + skip_on_ci() + set.seed(60) result <- .Call(`_stochvol_geweke_general_cpp`, PACKAGE = "stochvol") draws <- result$draws / result$thin @@ -106,6 +109,9 @@ test_that("general SV passes Geweke test", { }) test_that("default fast SV is efficient", { + skip_on_cran() + skip_on_ci() + set.seed(61) n <- 150L # Pro-centered @@ -147,6 +153,9 @@ test_that("default fast SV is efficient", { }) test_that("default general SV is efficient", { + skip_on_cran() + skip_on_ci() + set.seed(61) n <- 150L # Pro-centered diff --git a/vignettes/.install_extras b/vignettes/.install_extras index 0fd0613..e3ca556 100644 --- a/vignettes/.install_extras +++ b/vignettes/.install_extras @@ -1,4 +1,4 @@ predlik bib$ RData$ -Figures2/jss3813-.*\.pdf$ +jss3813 diff --git a/vignettes/article2.Rnw b/vignettes/article2.Rnw index cfc4a80..ce5a6ab 100644 --- a/vignettes/article2.Rnw +++ b/vignettes/article2.Rnw @@ -98,8 +98,6 @@ \def\svpars{\bm{\vartheta}} \def\svlpars{\bm{\zeta}} -\graphicspath{{Figures2/}} - \author{Darjus Hosszejni\\[.3em]WU Vienna University\\[-.1em]of Economics and Business \And Gregor Kastner\\[.3em]University of Klagenfurt} \Plainauthor{Darjus Hosszejni, Gregor Kastner} @@ -180,7 +178,7 @@ knitr::opts_chunk$set(prompt = TRUE, message = FALSE, echo = FALSE, #cache = TRUE, - fig.path = "Figures2/jss3813-", + fig.path = "jss3813-", tidy = FALSE) base::options(continue = "+ ", prompt = "R> ", width = 70, useFancyQuotes = FALSE) @@ -926,7 +924,7 @@ Using \fct{covmat}, one can extract the MCMC draws of the implied covariance mat <>= dim(cov_n <- covmat(res)) @ -shows that we have stored $\Sexpr{res$config$draws/res$config$thin}$ posterior draws of a $\Sexpr{m}\times\Sexpr{m}$ covariance matrix at one point in time, $t = n = \Sexpr{n}$. To check convergence, one can take a look at the trace plot and the autocorrelation function of the log determinant, i.e., +shows that we have stored $300$ posterior draws of a $6\times6$ covariance matrix at one point in time, $t = n = 200$. To check convergence, one can take a look at the trace plot and the autocorrelation function of the log determinant, i.e., <>= par(mfrow = c(1, 2), mgp = c(1.7, 0.5, 0), mar = c(3, 3, 1, 1)) logdet <- function (x) log(det(x)) @@ -943,21 +941,21 @@ The results are visualized in Figure~\ref{fig:logdetcovn}; decent mixing for thi \label{fig:logdetcovn} \end{figure} -To assess the mixing speed of each individual covariance matrix element, one can check, e.g., the estimated effective sample size (out of $\Sexpr{res$config$draws/res$config$thin}$ draws kept) which is implemented in \pkg{coda}. +To assess the mixing speed of each individual covariance matrix element, one can check, e.g., the estimated effective sample size (out of $300$ draws kept) which is implemented in \pkg{coda}. Again, no major convergence problems are apparent. <>= round(apply(cov_n, 1:2, coda::effectiveSize)) @ Assuming that \code{runningstore} was set sufficiently high when sampling, several convenience functions can be used for quick visualizations without having to post-process the MCMC draws. For example, to visualize the time-varying correlation matrices, consider -<>= +<>= par(mfrow = c(1, 3), xpd = TRUE) corimageplot(res, these = seq(1, n, length.out = 3), plotCI = "circle", plotdatedist = 2, date.cex = 1.1) @ \begin{figure}[tp] \centering - \includegraphics[width=\textwidth, clip, trim=22 185 0 174]{jss3813-corimageplot-1} + \includegraphics[width=\textwidth, clip, trim=0 167 0 159]{jss3813-corimageplot-1} \caption{Three estimated correlation matrices and their posterior uncertainty depicted using circles. Inner (outer) radii of the circles illustrate to the posterior mean minus (plus) two standard deviations. Colors blue and red represent negative and positive values, respectively. diff --git a/vignettes/Figures2/jss3813-comtimeplot-1.pdf b/vignettes/jss3813-comtimeplot-1.pdf similarity index 100% rename from vignettes/Figures2/jss3813-comtimeplot-1.pdf rename to vignettes/jss3813-comtimeplot-1.pdf diff --git a/vignettes/Figures2/jss3813-corimageplot-1.pdf b/vignettes/jss3813-corimageplot-1.pdf similarity index 100% rename from vignettes/Figures2/jss3813-corimageplot-1.pdf rename to vignettes/jss3813-corimageplot-1.pdf diff --git a/vignettes/Figures2/jss3813-cortimeplot-1.pdf b/vignettes/jss3813-cortimeplot-1.pdf similarity index 100% rename from vignettes/Figures2/jss3813-cortimeplot-1.pdf rename to vignettes/jss3813-cortimeplot-1.pdf diff --git a/vignettes/Figures2/jss3813-evdiag-1.pdf b/vignettes/jss3813-evdiag-1.pdf similarity index 100% rename from vignettes/Figures2/jss3813-evdiag-1.pdf rename to vignettes/jss3813-evdiag-1.pdf diff --git a/vignettes/Figures2/jss3813-fsvprepdata-1.pdf b/vignettes/jss3813-fsvprepdata-1.pdf similarity index 100% rename from vignettes/Figures2/jss3813-fsvprepdata-1.pdf rename to vignettes/jss3813-fsvprepdata-1.pdf diff --git a/vignettes/Figures2/jss3813-loadplot2-1.png b/vignettes/jss3813-loadplot2-1.png similarity index 100% rename from vignettes/Figures2/jss3813-loadplot2-1.png rename to vignettes/jss3813-loadplot2-1.png diff --git a/vignettes/Figures2/jss3813-loadplot2-2.pdf b/vignettes/jss3813-loadplot2-2.pdf similarity index 100% rename from vignettes/Figures2/jss3813-loadplot2-2.pdf rename to vignettes/jss3813-loadplot2-2.pdf diff --git a/vignettes/Figures2/jss3813-logdetcovn-1.pdf b/vignettes/jss3813-logdetcovn-1.pdf similarity index 100% rename from vignettes/Figures2/jss3813-logdetcovn-1.pdf rename to vignettes/jss3813-logdetcovn-1.pdf diff --git a/vignettes/Figures2/jss3813-preddist-1.png b/vignettes/jss3813-preddist-1.png similarity index 100% rename from vignettes/Figures2/jss3813-preddist-1.png rename to vignettes/jss3813-preddist-1.png diff --git a/vignettes/Figures2/jss3813-varplot-1.pdf b/vignettes/jss3813-varplot-1.pdf similarity index 100% rename from vignettes/Figures2/jss3813-varplot-1.pdf rename to vignettes/jss3813-varplot-1.pdf diff --git a/vignettes/Figures2/jss3813-varplot2-1.pdf b/vignettes/jss3813-varplot2-1.pdf similarity index 100% rename from vignettes/Figures2/jss3813-varplot2-1.pdf rename to vignettes/jss3813-varplot2-1.pdf diff --git a/vignettes/Figures2/jss3813-voltimeplot-1.pdf b/vignettes/jss3813-voltimeplot-1.pdf similarity index 100% rename from vignettes/Figures2/jss3813-voltimeplot-1.pdf rename to vignettes/jss3813-voltimeplot-1.pdf