% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/whittle.R
\name{htdv_whittle}
\alias{htdv_whittle}
\title{Whittle Likelihood for Stationary Series}
\usage{
htdv_whittle(x, spec_fun, theta, taper = FALSE)
}
\arguments{
\item{x}{Numeric vector.}

\item{spec_fun}{Function \code{function(lambda, theta)} returning spectral
density values at angular frequencies \code{lambda}.}

\item{theta}{Numeric parameter vector passed to \code{spec_fun}.}

\item{taper}{Logical; if \code{TRUE}, a 10-percent cosine taper is applied.}
}
\value{
A list with \code{loglik} (scalar), \code{frequencies},
  \code{periodogram}, and \code{fitted_spectrum}.
}
\description{
Computes the Whittle pseudo-log-likelihood at Fourier frequencies for a
user-supplied spectral density.
}
\examples{
x <- arima.sim(model = list(ar = 0.5), n = 200, rand.gen = rnorm)
ar1_spec <- function(lambda, theta) {
  phi <- theta[1]; sigma2 <- theta[2]
  sigma2 / (2 * pi * (1 - 2 * phi * cos(lambda) + phi^2))
}
htdv_whittle(as.numeric(x), ar1_spec, c(0.5, 1))$loglik

}
\references{
Whittle, P. (1953). Estimation and Information in Stationary Time Series.
Arkiv foer Matematik, 2(5), 423-434.
Dzhaparidze, K. (1986). Parameter Estimation and Hypothesis Testing in
Spectral Analysis of Stationary Time Series. Springer.
}
