Learn R Programming

⚠️There's a newer version (0.2.2) of this package.Take me there.

simts Overview

The Time Series Tools (simts) R package provides a series of tools to simulate, plot, estimate, select and forecast different time series models. It is originally conceived as a support to the online textbook “Applied Time Series Analysis with R” and, more specifically, provides tools with the following features:

  • Simulation of time series from SARIMA models to various state-space models that can be expressed as latent time series processes.
  • Visualization of time series data with user specifications.
  • Specific simulation and visualization tools for latent time series models.
  • Easy-to-use functions to estimate and infer on the parameters of time series models through different methods (standard and robust).
  • Diagnostic and statistical tools to assess goodness of fit and select the best model for the data.
  • Estimating and plotting tools to deliver point forecasts and confidence intervals.

To understand the usage of the simts package, please refer to the “Vignettes” tab above.

Install Instructions

To install the simts package, there is currently one option: GitHub. For users who are interested in having the latest developments, this option is ideal although more dependencies are required to run a stable version of the package. Most importantly, users must have a (C++) compiler installed on their machine that is compatible with R (e.g. Clang).

The setup to obtain the development version of simts is platform dependent.

All Systems

The following R packages are also required. Once you’ve made sure that you have a compatible C++ compiler installed on your computer, run the following code in an R session and you will be ready to use the devlopment version of simts.

# Install dependencies
install.packages(c("RcppArmadillo","devtools","knitr","rmarkdown"))

# Install the package from GitHub without Vignettes/User Guides
devtools::install_github("SMAC-Group/simts")

# Install the package with Vignettes/User Guides 
devtools::install_github("SMAC-Group/simts", build_vignettes = TRUE)

License

The license this source code is released under is the GNU AFFERO GENERAL PUBLIC LICENSE (AGPL) v3.0. Please see the LICENSE file for full text. Otherwise, please consult TLDR Legal or GNU which will provide a synopsis of the restrictions placed upon the code.

Copy Link

Version

Install

install.packages('simts')

Monthly Downloads

321

Version

0.1.1

License

AGPL-3 | file LICENSE

Issues

Pull Requests

Stars

Forks

Maintainer

St<c3><a9>phane Guerrier

Last Published

July 21st, 2019

Functions in simts (0.1.1)

ARMA11

Definition of an ARMA(1,1)
AR

Create an Autoregressive P [AR(P)] Process
DR

Create an Drift (DR) Process
ARIMA

Create an Autoregressive Integrated Moving Average (ARIMA) Process
AR1

Definition of an Autoregressive Process of Order 1
ARMA

Create an Autoregressive Moving Average (ARMA) Process
B_matrix

B Matrix
AIC.fitsimts

Akaike's Information Criterion
MAPE

Median Absolute Prediction Error
Mod_cpp

Absolute Value or Modulus of a Complex Number.
Rcpp_ARIMA

Hook into R's ARIMA function
RW2dimension

Function to Compute Direction Random Walk Moves
ARMAtoMA_cpp

Converting an ARMA Process to an Infinite MA Process
ARMAacf_cpp

Compute Theoretical ACF for an ARMA Process
QN

Create an Quantisation Noise (QN) Process
ar1_to_gm

Transform AR1 to GM
RW

Create an Random Walk (RW) Process
best_model

Select the Best Model
ci_eta3

Generate eta3 confidence interval
check

Diagnostics on Fitted Time Series Model
batch_modwt_wvar_cpp

Computes the MO/DWT wavelet variance for multiple processes
D_matrix

Analytic D matrix of Processes
ar1_to_wv

AR(1) process to WV
SARIMA

Create a Seasonal Autoregressive Integrated Moving Average (SARIMA) Process
brick_wall

Removal of Boundary Wavelet Coefficients
GM

Create a Gauss-Markov (GM) Process
SARMA

Create a Seasonal Autoregressive Moving Average (SARMA) Process
build_model_set

Build List of Unique Models
corr_analysis

Correlation Analysis Functions
arma11_to_wv

ARMA(1,1) to WV
all_bootstrapper

Bootstrap for Everything!
ar1_draw

Randomly guess starting parameters for AR1
bl14_filter

bl14 filter construction
ci_eta3_robust

Generate eta3 robust confidence interval
bl20_filter

bl20 filter construction
MA1

Definition of an Moving Average Process of Order 1
MA

Create an Moving Average Q [MA(Q)] Process
WN

Create an White Noise (WN) Process
ci_wave_variance

Generate a Confidence intervval for a Univariate Time Series
comb

Combine math expressions
deriv_arma11

Analytic D matrix for ARMA(1,1) process
code_zero

Optim loses NaN
deriv_ar1

Analytic D matrix for AR(1) process
count_models

Count Models
diag_boxpierce

Box-Pierce
d6_filter

d6 filter construction
diag_ljungbox

Ljung-Box
d8_filter

d8 filter construction
deriv_wn

Analytic D Matrix for a Gaussian White Noise (WN) Process
auto_corr

Empirical ACF and PACF
calculate_psi_matrix

Calculate the Psi matrix
auto_imu_cpp

Find the auto imu result
arma_adapter

ARMA Adapter to ARMA to WV Process function
fk4_filter

fk4 filter construction
fk22_filter

fk22 filter construction
derivative_first_matrix

Analytic D matrix of Processes
arma_draws

Randomly guess starting parameters for ARMA
e_drift

Expected value DR
dwt_cpp

Discrete Wavelet Transform
cfilter

Time Series Convolution Filters
gmwm

Generalized Method of Wavelet Moments (GMWM) for IMUs, ARMA, SSM, and Robust
gen_qn

Generate a Quantisation Noise (QN) or Rounding Error Sequence
gm_to_ar1

Transform GM to AR1
gen_nswn

Generate Non-Stationary White Noise Process
d16_filter

d16 filter construction
fk6_filter

fk6 filter construction
acf_sum

Helper Function for ARMA to WV Approximation
arma_to_wv_app

ARMA process to WV Approximation
d4_filter

d4 filter construction
deriv_2nd_ma1

Analytic second derivative for MA(1) process
deriv_2nd_dr

Analytic second derivative matrix for drift process
desc.to.ts.model

Create a ts.model from desc string
dft_acf

Discrete Fourier Transformation for Autocovariance Function
australia

Quarterly Increase in Stocks Non-Farm Total, Australia
bootstrap_gof_test

Compute the Bootstrapped GoF Test
boot_pval_gof

Generate the Confidence Interval for GOF Bootstrapped
do_polyroot_cpp

Root Finding C++
do_polyroot_arma

Root Finding C++
deriv_qn

Analytic D matrix for Quantization Noise (QN) Process
.acf

Auto-Covariance and Correlation Functions
deriv_rw

Analytic D matrix Random Walk (RW) Process
dr_to_wv

Drift to WV
fk8_filter

fk8 filter construction
compare_acf

Comparison of Classical and Robust Correlation Analysis Functions
compute_cov_cpp

Computes the (MODWT) wavelet covariance matrix
find_full_model

Find the Common Denominator of the Models
gen_arma

Generate Autoregressive Order \(p\) - Moving Average Order \(q\) (ARMA(\(p\),\(q\))) Model
deriv_2nd_ar1

Analytic second derivative matrix for AR(1) process
gen_gts

Simulate a simts TS object using a theoretical model
gen_generic_sarima

Generate Generic Seasonal Autoregressive Order P - Moving Average Order Q (SARMA(p,q)x(P,Q)) Model
gen_ma1

Generate an Moving Average Order 1 (MA(1)) Process
gen_ar1blocks

Generate AR(1) Block Process
fk14_filter

fk14 filter construction
gen_model

Generate Time Series based on Model (Internal)
getObjFun

Retrieve GMWM starting value from Yannick's objective function
deriv_2nd_arma11

Analytic D matrix for ARMA(1,1) process
arma_to_wv

ARMA process to WV
gen_arima

Generate Autoregressive Order p, Integrated d, Moving Average Order q (ARIMA(p,d,q)) Model
custom_legend

Custom legend function
cov_bootstrapper

Bootstrap for Matrix V
gen_wn

Generate a Gaussian White Noise Process (WN(\(\sigma ^2\)))
gen_sarma

Generate Seasonal Autoregressive Order P - Moving Average Order Q (SARMA(p,q)x(P,Q)) Model
get_summary

Routing function for summary info
conv.ar1.to.gm

GM Conversion
gen_sarima

Generate Seasonal Autoregressive Order P - Moving Average Order Q (SARMA(p,q)x(P,Q)) Model
gen_arma11

Generate an ARMA(1,1) sequence
gmwm_master_cpp

Master Wrapper for the GMWM Estimator
has

Obtain the value of an object's properties
gen_rw

Generate a Random Walk without Drift
gmwm_param_bootstrapper

Bootstrap for Estimating Both Theta and Theta SD
gmwm_sd_bootstrapper

Bootstrap for Standard Deviations of Theta Estimates
idf_arma

Indirect Inference for ARMA
logit

Logit Function
mb4_filter

mb4 filter construction
idf_arma_total

Indirect Inference for ARMA
mb8_filter

mb8 filter construction
gmwm_update_cpp

Update Wrapper for the GMWM Estimator
logit2

Logit2 Function
haar_filter

Haar filter construction
mean_diff

Mean of the First Difference of the Data
guess_initial_old

Randomly guess a starting parameter
diag_plot

Diagnostic Plot of Residuals
diag_portmanteau_

Portmanteau Tests
getObjFunStarting

Retrieve GMWM starting value from Yannick's objective function
is.whole

Integer Check
decomp_theoretical_wv

Each Models Process Decomposed to WV
decomp_to_theo_wv

Decomposed WV to Single WV
minroot

Obtain the smallest polynomial root
modwt_cpp

Maximum Overlap Discrete Wavelet Transform
deriv_dr

Analytic D matrix for Drift (DR) Process
deriv_ma1

Analytic D matrix for MA(1) process
diff_cpp

Lagged Differences in Armadillo
imu_time

Pulls the IMU time from the IMU object
hydro

Mean Monthly Precipitation, from 1907 to 1972
is.gts

Is simts Object
logit2_inv

Logit2 Inverse Function
intgr_vec

Discrete Intergral: Inverse Difference
logit_inv

Logit Inverse Function
model_score

Model Score
model_theta

Generate the ts model object's theta vector
plot.lts

Plot Latent Time Series Object
plot.gts

Plot simts Time Series Data
fast_cov_cpp

Computes the (MODWT) wavelet covariance matrix using Chi-square confidence interval bounds
format_ci

Format the Confidence Interval for Estimates
field_to_matrix

Transform an Armadillo field<vec> to a matrix
modwt_wvar_cpp

Computes the (MODWT) wavelet variance
estimate

Fit a Time Series Model to Data
evaluate

Evalute a time series or a list of time series models
rank_models_cpp

Find the Rank Models result
quantile_cpp

Find Quantiles
predict.gmwm

Predict future points in the time series using the solution of the Generalized Method of Wavelet Moments
print.fitsimts

Print fitsimts object
gen_bi

Generate Bias-Instability Process
gen_dr

Generate a Drift Process
invert_check

Check Invertibility Conditions
lts

Generate a Latent Time Series Object from Data
plot_pred

Plot Time Series Forecast Function
orderModel

Order the Model
optimism_bootstrapper

Bootstrap for Optimism
plot.simtsACF

Plot Auto-Covariance and Correlation Functions
rgmwm

GMWM for Robust/Classical Comparison
print.ts.model

Multiply a ts.model by constant
print.imu

Print simts Objects
rw_to_wv

Random Walk to WV
scales_cpp

Computes the MODWT scales
sales

Sales Dataset
mb16_filter

mb16 filter construction
m2_drift

Second moment DR
value

Obtain the value of an object's properties
select

Time Series Model Selection
simts-package

simts: Time Series Analysis Tools
simplified_print_SARIMA

Simplify and print SARIMA model
update_obj

Update the Attributes of Objects
rtruncated_normal

Truncated Normal Distribution Sampling Algorithm
gen_ar1

Generate an Autoregressive Order 1 ( AR(1) ) sequence
summary.gmwm

Summary of GMWM object
summary.fitsimts

Summary of fitsimts object
gen_lts_cpp

Generate Latent Time Series based on Model (Internal)
gen_lts

Generate a Latent Time Series Object Based on a Model
gmwm_engine

Engine for obtaining the GMWM Estimator
mb24_filter

mb24 filter construction
gmwm_imu

GMWM for (Robust) Inertial Measurement Units (IMUs)
sarma_components

Determine parameter expansion based upon objdesc
sarma_calculate_spadding

Calculates Length of Seasonal Padding
gof_test

Compute the GOF Test
gts

Create a simts TS object using time series data
sarma_params_construct

Efficient way to merge items together
savingrt

Personal Saving Rate
order_AR1s

Order AR1s by size of phi.
lm_dr

Linear Regression with Drift
la8_filter

la8 filter construction
lm_arma

MLR in Armadillo
la20_filter

la20 filter construction
plot.PACF

Plot Partial Auto-Covariance and Correlation Functions
pseudo_logit_inv

Pseudo Logit Inverse Function
pseudo_logit

Pseudo Logit Function
theo_pacf

Theoretical Partial Autocorrelation (PACF) of an ARMA process
theo_acf

Theoretical Autocorrelation (ACF) of an ARMA process
*.ts.model

Multiple a ts.model by constant
transform_values

Transform Values for Optimization
obj_extract

Extract Object
var_drift

Variance DR
vector_to_set

Conversion function of Vector to Set
opt_n_gof_bootstrapper

Bootstrap for Optimism and GoF
+.ts.model

Add ts.model objects together
qmf

Quadrature Mirror Filter
seq_cpp

Generate a sequence of values
predict.fitsimts

Time Series Prediction
qn_to_wv

Quantisation Noise (QN) to WV
seq_len_cpp

Generate a sequence of values based on supplied number
guess_initial

Randomly guess a starting parameter
gts_time

Time of a gts object
reverse_vec

Reverse Armadillo Vector
select_arima

Run Model Selection Criteria on ARIMA Models
rfilter

Time Series Recursive Filters
select_filter

Select the Wavelet Filter
jacobian_arma

Calculates the Jacobian for the ARMA process
unitConversion

Convert Unit of Time Series Data
untransform_values

Revert Transform Values for Display
wn_to_wv

Gaussian White Noise to WV
update.gmwm

Update (Robust) GMWM object for IMU or SSM
sort_mat

Sort Matrix by Column
sum_field_vec

Accumulation of Armadillo field<vec>
update.lts

Update Object Attribute
wvar_cpp

Computes the (MODWT) wavelet variance
la16_filter

la16 filter construction
make_frame

Default utility function for various plots titles
ma1_to_wv

Moving Average Order 1 (MA(1)) to WV
model_objdesc

Generate the ts model object description
np_boot_sd_med

Bootstrap standard error for the median
model_process_desc

Generate the ts model object's process desc
num_rep

Replicate a Vector of Elements \(n\) times
print.gmwm

Print gmwm object
print.summary.gmwm

Print summary.gmwm object
read_imu

Read an IMU Binary File into R
rev_row_subset

Reverse Subset Row
rev_col_subset

Reverse Subset Column
resid_plot

Plot the Distribution of (Standardized) Residuals
sarma_expand

Expand Parameters for an SARMA object
sarma_expand_unguided

(Internal) Expand the SARMA Parameters
theta_ci

Generate the Confidence Interval for Theta Estimates
simple_diag_plot

Basic Diagnostic Plot of Residuals
set_seed

Set the RNG Seed from within Rcpp
theoretical_wv

Model Process to WV
w4_filter

w4 filter construction
wave_variance

Generate a Wave Variance for a Univariate Time Series