Skip to content

Commit f5df282

Browse files
committed
fixes for CRAN submission
1 parent f5ea40d commit f5df282

File tree

6 files changed

+10
-14
lines changed

6 files changed

+10
-14
lines changed

DESCRIPTION

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
Package: tsissm
22
Type: Package
33
Title: Linear Innovations State Space Unobserved Components Model
4-
Version: 1.0.0
4+
Version: 1.0.1
55
Authors@R: c(person("Alexios", "Galanos", role = c("aut", "cre"), comment = c(ORCID = "0009-0000-9308-0457"), email = "alexios@4dscape.com"))
66
Maintainer: Alexios Galanos <alexios@4dscape.com>
77
Description: Unobserved components time series model using the linear innovations state space representation (single source of error) with choice of error distributions and option for dynamic variance. Methods for estimation using automatic differentiation, automatic model selection and ensembling, prediction, filtering, simulation and backtesting. Based on the model described in Hyndman et al (2012) <doi:10.1198/jasa.2011.tm09771>.
@@ -18,5 +18,5 @@ Encoding: UTF-8
1818
RoxygenNote: 7.3.2
1919
VignetteBuilder: knitr
2020
LazyData: true
21-
URL: https://github.com/tsmodels/tsissm
21+
URL: https://github.com/tsmodels/tsissm, https://www.nopredict.com/packages/tsissm
2222
Config/testthat/edition: 3

NEWS.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# tsissm 1.0.0
1+
# tsissm 1.0.1
22

33
* Initial CRAN submission based on complete re-write of model on github which was
44
originally created on 2020-09-16.

R/estimation.R

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,3 @@
1-
log_parameters <- function(pars, file = "~/parameters.txt") {
2-
write.table(matrix(pars, nrow = 1), file = file, append = TRUE, sep = ",", col.names = FALSE, row.names = FALSE)
3-
}
4-
51
#' Model Estimation
62
#'
73
#' @description Estimates a model given a specification object using
@@ -584,7 +580,6 @@ tmb_inputs_issm_constant <- function(spec)
584580
valid_index <- which(good > 0) - 1
585581
# create function for ARMA and non ARMA models
586582
llh_fun <- function(pars, fun, issmenv) {
587-
log_parameters(pars, file = "~/parameters.txt")
588583
names(pars) <- issmenv$tmb_names
589584
lik <- fun$fn(pars)
590585
if (is.na(lik) | !is.finite(lik)) {

man/tsissm-package.Rd

Lines changed: 1 addition & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

vignettes/demo_ensembling.Rmd

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,13 +67,13 @@ par(opar)
6767

6868
## Model Selection
6969

70-
For this demonstration, we reserve the last 26 months of data for forecasting
70+
For this demonstration, we reserve the last 38 months of data for forecasting
7171
evaluation and select the top 4 models for ensembling.
7272

7373

7474
```{r}
75-
train <- y["/2022"]
76-
test <- y["2023/"]
75+
train <- y["/2021"]
76+
test <- y["2022/"]
7777
lambda_pre_estimate <- box_cox(lambda = NA)$transform(train) |> attr("lambda")
7878
xreg <- auto_regressors(train, frequency = 12, lambda = lambda_pre_estimate, sampling = "months", h = 26, method = "sequential",
7979
check.rank = TRUE, discard.cval = 3.5, maxit.iloop = 10, maxit.oloop = 10,
@@ -119,8 +119,8 @@ Below, we generate forecasts from the top model and from all 4 models,
119119
and then ensemble them using equal weights:
120120

121121
```{r}
122-
p_top <- mod$models[[1]] |> predict(h = nrow(test), seed = 100, nsim = 2000, newxreg = xreg$xreg[index(test),])
123-
p_all <- mod |> predict(h = nrow(test), seed = 100, nsim = 2000, newxreg = xreg$xreg[index(test),])
122+
p_top <- mod$models[[1]] |> predict(h = nrow(test), seed = 200, nsim = 4000, newxreg = xreg$xreg[index(test),])
123+
p_all <- mod |> predict(h = nrow(test), seed = 200, nsim = 4000, newxreg = xreg$xreg[index(test),])
124124
p_ensemble <- p_all |> tsensemble(weights = rep(1/4,4))
125125
```
126126

vignettes/demo_missing_data.Rmd

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ co2_full <- co2_full[,-1]
122122
```
123123

124124
This new dataset now spans a regular daily grid. The percentage increase in data
125-
points (mostly NA) is: `r print(paste0(round(100 * (NROW(co2_full)/NROW(co2) - 1),0), "%"))` more data points which are all missing values.
125+
points (mostly NA) is: `r paste0(round(100 * (NROW(co2_full)/NROW(co2) - 1),0), "%")` more data points which are all missing values.
126126

127127
## Re-estimating with Regularized Calendar Time
128128

0 commit comments

Comments
 (0)