Skip to contents

Computes the exact log-likelihood of a univariate process y under a Gaussian process model with autocovariance structure derived from a B-spline spectral basis. The autocovariance function is reconstructed and used to define a Toeplitz covariance matrix, enabling efficient log-likelihood computation.

Usage

compute_toeplitz_loglik(y, c, knots, k)

Arguments

y

A numeric vector representing the observed time series.

c

A numeric vector of coefficients for the ACF basis functions.

knots

A numeric vector of knot locations defining the B-spline basis.

k

The degree of the B-spline basis functions (here, 0, 1, or 2).

Value

A numeric scalar: the log-likelihood of the data under the implied Toeplitz covariance model.

Details

The autocovariance function is reconstructed using reconstruct_acf and passed to the SuperGauss::NormalToeplitz class for efficient evaluation of the Gaussian likelihood with Toeplitz structure. This method avoids explicit matrix inversion and is well-suited for large univariate processes.

Examples

knots <- seq(0, 0.5, length.out = 6)
k <- 1
c <- rep(1, length(knots) - k - 1)
y <- arima.sim(n = 100, model = list(ar = 0.8))
compute_toeplitz_loglik(y, c, knots, k)
#> [1] -318.8313