
Gradient of Toeplitz Log-Likelihood
compute_toeplitz_loglik_grad.Rd
Computes the gradient of the Gaussian log-likelihood of a univariate process under a model with autocovariance structure defined via B-spline basis functions, either with respect to the coefficients or their logarithms.
Arguments
- y
A numeric vector representing the observed time series.
- c
A numeric vector of spectral coefficients.
- knots
A numeric vector of knot locations defining the B-spline basis.
- k
The degree of the B-spline basis functions.
- log_coef
Logical; if
TRUE
(default), returns the gradient with respect tolog(c)
.
Details
When log_coef = TRUE
, this function returns the gradient with respect to the log-transformed
spectral coefficients \(\theta = \log(c)\), applying the chain rule. This is useful for optimization
in an unconstrained parameter space. When log_coef = FALSE
, it returns the gradient with respect
to the original coefficients c
.