MyNixOS website logo
Description

Continuous Time Autoregressive Models.

Provides tools for fitting continuous-time autoregressive (CAR) and complex CAR (CZAR) models for irregularly sampled time series using an exact Gaussian state-space formulation and Kalman filtering/smoothing. Implements maximum-likelihood estimation with stable parameterizations of characteristic roots, model selection via AIC, residual and spectral diagnostics, forecasting and simulation, and extraction of fitted state estimates. Methods are described in Wang (2013) <doi:10.18637/jss.v053.i05>.

cts

The goal of cts is to fit continuous time autoregressive models with the Kalman filter. See Wang (2013) https://www.jstatsoft.org/article/view/v053i05.

Installation

You can install the development version of cts from GitHub with:

# install.packages("devtools")
devtools::install_github("zhuwang46/cts")

Example

This is a basic example which shows you how to solve a common problem:

library(cts)
#> 
#> Attaching package: 'cts'
#> The following objects are masked from 'package:stats':
#> 
#>     spectrum, tsdiag
## basic example code
data(V22174)
fit <- car(V22174,scale=0.2,order=7, ctrl=car_control(trace=FALSE))
summary(fit)
#> 
#> Call:
#> car(x = V22174, scale = 0.2, order = 7, ctrl = car_control(trace = FALSE))
#> 
#> Order of model = 7, sigma^2 = 1.37e-09 
#> 
#> Estimated coefficients (standard errors):
#>       phi_1 phi_2 phi_3  phi_4 phi_5  phi_6 phi_7
#> coef -0.501 0.355 0.085 -0.022 0.605 -0.371 0.483
#> S.E.  0.108 0.111 0.060  0.071 0.084  0.124 0.112
#> 
#> Estimated mean (standard error):
#> [1] 0.173
#> [1] 0.022
AIC(fit)
#> 
#> Call:
#> car(x = V22174, scale = 0.2, order = 7, ctrl = car_control(trace = FALSE))
#> 
#> Model selection statistics 
#> 
#>  order t.statistic     AIC
#>      1       -4.77  -20.78
#>      2       -4.45  -38.57
#>      3        3.25  -47.15
#>      4        2.37  -50.76
#>      5        6.11  -86.05
#>      6       -0.76  -84.63
#>      7        4.32 -101.27
factab(fit)
#> 
#> Call:
#> factab(object = fit)
#> 
#> Characteristic root of original parameterization in alpha 
#> 
#>              1               2               3               4               5  
#>  -0.006+0.058i   -0.006-0.058i   -0.029+0.300i   -0.029-0.300i   -0.030+0.135i
#>              6               7  
#>  -0.006+0.058i   -0.006-0.058i
#> 
#> Frequency 
#> 
#>     1      2      3      4      5      6      7  
#> 0.009  0.009  0.048  0.048  0.022  0.022  0.000
Metadata

Version

1.0-26

License

Unknown

Platforms (80)

    Darwin
    FreeBSD
    Genode
    GHCJS
    Linux
    MMIXware
    NetBSD
    none
    OpenBSD
    Redox
    Solaris
    uefi
    WASI
    Windows
Show all
  • aarch64-darwin
  • aarch64-freebsd
  • aarch64-genode
  • aarch64-linux
  • aarch64-netbsd
  • aarch64-none
  • aarch64-uefi
  • aarch64-windows
  • aarch64_be-none
  • arc-linux
  • arm-none
  • armv5tel-linux
  • armv6l-linux
  • armv6l-netbsd
  • armv6l-none
  • armv7a-linux
  • armv7a-netbsd
  • armv7l-linux
  • armv7l-netbsd
  • avr-none
  • i686-cygwin
  • i686-freebsd
  • i686-genode
  • i686-linux
  • i686-netbsd
  • i686-none
  • i686-openbsd
  • i686-windows
  • javascript-ghcjs
  • loongarch64-linux
  • m68k-linux
  • m68k-netbsd
  • m68k-none
  • microblaze-linux
  • microblaze-none
  • microblazeel-linux
  • microblazeel-none
  • mips-linux
  • mips-none
  • mips64-linux
  • mips64-none
  • mips64el-linux
  • mipsel-linux
  • mipsel-netbsd
  • mmix-mmixware
  • msp430-none
  • or1k-none
  • powerpc-linux
  • powerpc-netbsd
  • powerpc-none
  • powerpc64-linux
  • powerpc64le-linux
  • powerpcle-none
  • riscv32-linux
  • riscv32-netbsd
  • riscv32-none
  • riscv64-linux
  • riscv64-netbsd
  • riscv64-none
  • rx-none
  • s390-linux
  • s390-none
  • s390x-linux
  • s390x-none
  • sh4-linux
  • vc4-none
  • wasm32-wasi
  • wasm64-wasi
  • x86_64-cygwin
  • x86_64-darwin
  • x86_64-freebsd
  • x86_64-genode
  • x86_64-linux
  • x86_64-netbsd
  • x86_64-none
  • x86_64-openbsd
  • x86_64-redox
  • x86_64-solaris
  • x86_64-uefi
  • x86_64-windows