tsPI
R package for Bayesian prediction intervals for ARIMA and structural time series models with exogenous variables
Science Score: 13.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
○CITATION.cff file
-
✓codemeta.json file
Found codemeta.json file -
○.zenodo.json file
-
○DOI references
-
○Academic publication links
-
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.1%) to scientific vocabulary
Repository
R package for Bayesian prediction intervals for ARIMA and structural time series models with exogenous variables
Statistics
- Stars: 9
- Watchers: 1
- Forks: 1
- Open Issues: 0
- Releases: 0
Metadata Files
README.md
tsPI: R package for improved prediction intervals for ARIMA and structural time series models with exogenous variables
Package tsPI computes prediction intervals for ARIMA and Gaussian structural time series models by using importance sampling approach with uninformative priors for model parameters, leading to more accurate coverage probabilities in frequentist sense. Instead of sampling the future observations and hidden states of the state space representation of the model, only model parameters are sampled, and the method is based solving the equations corresponding to the conditional coverage probability of the prediction intervals. This makes method relatively fast compared to for example MCMC methods, and standard errors of prediction limits can also be computed straightforwardly.
ARIMA case is based on articles
- Jouni Helske and Jukka Nyblom. Improved frequentist prediction intervals for autoregressive models by simulation. In Siem Jan Koopman and Neil Shephard, editors, Unobserved Components and Time Series Econometrics. Oxford University Press, 2015.
- Jouni Helske and Jukka Nyblom. Improved frequentist prediction intervals for ARMA models by simulation. In Johan Knif and Bernd Pape, editors, Contributions to Mathematics, Statistics, Econometrics, and Finance: essays in honour of professor Seppo Pynnönen, number 296 in Acta Wasaensia, pages 71–86. University of Vaasa, 2014.
Structural time series model case is based on a straightforward generalization presented in - Helske, J. (2015). Prediction and interpolation of time series by state space models. University of Jyväskylä. PhD thesis.
Example: 95 % prediction intervals for AR(1) process
```{r, fig.height = 4, fig.width = 8} library(tsPI) library(KFAS) #for plug-in intervals
set.seed(12345) x <- arima.sim(n = 30, model = list(ar = 0.9)) fit <- arima(x, c(1, 0, 0)) model <- SSModel(x ~ SSMarima(ar = fit$coef[1], Q = fit$sigma), H = 0) model$P1inf[1,1] <- 0 model$a1[1] <- fit$coef[2] predplugin <- predict(model, n.ahead = 10, interval = "prediction") predtspi <- arimapi(x, c(1, 0, 0), nahead = 10, se_limits = FALSE, nsim = 1000)
ylim <- round(range(c(predplugin, predtspi, x)) + c(-1, 1))
plot(ts.union(x, predplugin, predtspi), plot.type = "single",
col = c(1, 2, 2, 2, 4, 4, 4), pch = c(19, 15, 15, 15, 15, 15, 15),
lty = c(1, 1, 1, 1, 1), type = "b",
ylim = ylim, xlab = "time", ylab= "value", axes = FALSE)
axis(1, at = 1:40, labels = 1:40)
axis(2, at = ylim[1]:ylim[2])
legend("topleft", c("observations", "plug-in", "tsPI"),
lty = 1, pch= c(19, 15, 15), col = c(1, 2, 4))
```

Installing tsPI
Package is now available at CRAN. The latest development version can be installed from the github using the devtools package:
R
install.packages("devtools")
library(devtools)
install_github("helske/tsPI")
Owner
- Name: Jouni Helske
- Login: helske
- Kind: user
- Location: Finland
- Company: University of Jyväskylä
- Website: https://jounihelske.netlify.app
- Twitter: jouni_helske
- Repositories: 48
- Profile: https://github.com/helske
Bayesian statistics, time series, causal inference, state space models, hidden Markov models, visualization.
GitHub Events
Total
- Watch event: 1
Last Year
- Watch event: 1
Committers
Last synced: over 3 years ago
All Time
- Total Commits: 60
- Total Committers: 2
- Avg Commits per committer: 30.0
- Development Distribution Score (DDS): 0.033
Top Committers
| Name | Commits | |
|---|---|---|
| Jouni Helske | j****e@j****i | 58 |
| helske | j****e@i****i | 2 |
Issues and Pull Requests
Last synced: 11 months ago
All Time
- Total issues: 1
- Total pull requests: 0
- Average time to close issues: 1 minute
- Average time to close pull requests: N/A
- Total issue authors: 1
- Total pull request authors: 0
- Average comments per issue: 0.0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- helske (1)
Pull Request Authors
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- cran 226 last-month
- Total docker downloads: 21,777
- Total dependent packages: 0
- Total dependent repositories: 0
- Total versions: 5
- Total maintainers: 1
cran.r-project.org: tsPI
Improved Prediction Intervals for ARIMA Processes and Structural Time Series
- Documentation: http://cran.r-project.org/web/packages/tsPI/tsPI.pdf
- License: GPL-3
-
Latest release: 1.0.4
published almost 3 years ago
Rankings
Maintainers (1)
Dependencies
- KFAS * imports
- testthat * suggests
