# Toeplitz-class: Constructor and methods for Toeplitz matrix objects. In SuperGauss: Superfast Likelihood Inference for Stationary Gaussian Time Series

## Description

The `Toeplitz` class contains efficient methods for linear algebra with symmetric positive definite (i.e., variance) Toeplitz matrices.

## Usage

 `1` ```Toeplitz(n, acf) ```

## Arguments

 `n` Size of the Toeplitz matrix. `acf` Autocorrelation vector of Toeplitz matrix.

## Details

It is assumed that the autocorrelation of the `Toeplitz` object defines a valid (i.e., positive definite) variance matrix. The multiplication algorithms still work when this is not the case but the other algorithms do not (return values typically contain `NaN`s).

## Value

A `Toeplitz` object.

## Methods

If `Toep` is a `Toeplitz` object with first row/column given by `acf`, then:

`Toep\$setAcf(acf)`

Sets the autocorrelation of the matrix.

`Toep\$getAcf()`

Gets the autocorrelation of the matrix.

`nrow(Toep)`, `ncol(Toep)`, `dim(Toep)`

Selected dimension(s) of the matrix.

`Toep %*% X`, `X %*% Toep`

Toeplitz-Matrix and Matrix-Toeplitz multiplication. Also works if `X` is a vector.

`solve(Toep, X)`, `solve(Toep)`

Solves Toeplitz systems of equations. When second argument is missing, returns the inverse of the Toeplitz matrix.

`determinant(Toep)`

Log-determinant of the Toeplitz matrix, i.e., same thing as `log(det(toeplitz(acf)))`.

`Toep\$traceT2(acf2)`

If `T1 == toeplitz(acf)` and `T2 == toeplitz(acf2)`, computes the trace of `solve(T1, T2)`. This is used in the computation of the gradient of Gaussian likelihoods with Toeplitz variance matrix.

`Toep\$traceT4(acf2, acf3)`

If `T1 == toeplitz(acf)`, `T2 == toeplitz(acf2)`, and `T3 == toeplitz(acf3)`, computes the trace of `solve(T1, T2) %*% solve(T1, T3)`. This is used in the computation of the Hessian of Gaussian likelihoods with Toeplitz variance matrix.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17``` ```# construction acf <- exp(-(1:5)) Toep <- Toeplitz(acf = acf) # alternatively, can allocate space first Toep <- Toeplitz(n = length(acf)) Toep\$setAcf(acf = acf) dim(Toep) # == c(nrow(Toep), ncol(Toep)) Toep # show method Toep\$getAcf() # extract the acf # linear algebra X <- matrix(rnorm(10), 5, 2) Toep %*% X t(X) %*% Toep solve(Toep, X) determinant(Toep) # log-determinant ```

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