SuperGauss: Superfast inference for stationary Gaussian time series.

Description Details Examples

Description

Superfast inference for stationary Gaussian time series.

Details

While likelihood calculations with stationary Gaussian time series generally scale as O(N^2) in the number of observations, this package implements an algorithm which scales as O(N \log^2 N). "Superfast" algorithms for loglikelihood gradients and Hessians are also provided. The underlying C++ code is distributed through a header-only library found in the installed package's include directory.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
# Superfast inference for the timescale parameter of
# the exponential autocorrelation function
exp.acf <- function(lambda) exp(-(1:N-1)/lambda)

# simulate data
lambda0 <- 1
N <- 1000
X <- rSnorm(n = 1, acf = exp.acf(lambda0))

# loglikelihood function
Toep <- Toeplitz(n = N) # allocate memory for a Toeplitz matrix object
loglik <- function(lambda) {
  Toep$setAcf(acf = exp.acf(lambda))
  dSnorm(X = X, acf = Toep, log = TRUE)
}

# maximum likelihood estimation
optimize(f = loglik, interval = c(.2, 5), maximum = TRUE)

SuperGauss documentation built on May 1, 2019, 7:58 p.m.