% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/kalman.R
\name{filter_svp}
\alias{filter_svp}
\title{Filter Latent Volatility from an Estimated SV(p) Model}
\usage{
filter_svp(
  object,
  method = c("corrected", "mixture", "particle"),
  K = 7,
  M = 1000,
  seed = 42,
  del = 1e-10
)
}
\arguments{
\item{object}{An \code{"svp"}, \code{"svp_t"}, or \code{"svp_ged"} object
from \code{\link{svp}}.}

\item{method}{Character. Filter method: \code{"corrected"} (default) for
standard Kalman with distribution-specific \eqn{\sigma_\varepsilon^2(\nu)},
\code{"mixture"} for the Gaussian Mixture Kalman Filter (GMKF), or
\code{"particle"} for the Bootstrap Particle Filter (BPF).}

\item{K}{Integer. Number of mixture components for GMKF. Default 7.}

\item{M}{Integer. Number of particles for BPF. Default 1000.}

\item{seed}{Integer. Random seed for BPF. Default 42.}

\item{del}{Numeric. Small constant for log transformation. Default \code{1e-10}.}
}
\value{
An object of class \code{"svp_filter"}, a list containing:
\describe{
  \item{w_filtered}{Filtered log-volatility (T-vector).}
  \item{w_smoothed}{Smoothed log-volatility (T-vector).}
  \item{zt}{Filtered standardized residuals.}
  \item{zt_smoothed}{Smoothed standardized residuals.}
  \item{P_filtered}{Filtered MSE of first state component.}
  \item{P_predicted}{Predicted MSE of first state component.}
  \item{xi_filtered}{Full filtered state vectors (p x T matrix).}
  \item{xi_smoothed}{Full smoothed state vectors (p x T matrix).}
  \item{loglik}{Approximate log-likelihood.}
  \item{method}{Filter method used.}
  \item{model}{The input model object.}
}
}
\description{
Applies Kalman filtering (corrected or Gaussian mixture) and RTS smoothing
to extract the latent log-volatility process from an estimated SV(p) model.
}
\examples{
\donttest{
y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2)$y
fit <- svp(y, p = 1)
filt <- filter_svp(fit)
plot(filt$w_smoothed, type = "l")
}

}
