% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/svp_test.R
\name{mmc_lev}
\alias{mmc_lev}
\title{MMC Test for Leverage in SV(p) Models}
\usage{
mmc_lev(
  y,
  p = 1,
  J = 10,
  N = 99,
  rho_null = 0,
  burnin = 500,
  eps = NULL,
  threshold = 1,
  method = "pso",
  maxit = NULL,
  rho_type = "pearson",
  del = 1e-10,
  trunc_lev = TRUE,
  wDecay = FALSE,
  Bartlett = FALSE,
  Amat = NULL,
  errorType = "Gaussian",
  logNu = FALSE,
  sigvMethod = "factored",
  winsorize_eps = 0
)
}
\arguments{
\item{y}{Numeric vector. Observed returns.}

\item{p}{Integer. Order of the volatility process. Default 1.}

\item{J}{Integer. Winsorizing parameter. Default 10.}

\item{N}{Integer. Number of Monte Carlo replications. Default 99.}

\item{rho_null}{Numeric. Value of \eqn{\rho} under the null. Default 0.}

\item{burnin}{Integer. Burn-in for simulation. Default 500.}

\item{eps}{Numeric vector. Half-width of the search region around the
estimated nuisance parameters. For Gaussian: length \code{p+2}
(phi, sigma_y, sigma_v). For Student-t/GED: length \code{p+2}
(phi, sigma_y, sigma_v; nu bounds set proportionally at +/-30%) or
length \code{p+3} (phi, sigma_y, sigma_v, nu). Default \code{NULL}
which uses \code{rep(0.3, p+2)} with proportional nu bounds.}

\item{threshold}{Numeric. Target p-value (optimization stops if reached).
Default 1.}

\item{method}{Character. Optimization method: \code{"pso"} (particle swarm),
\code{"GenSA"} (generalized simulated annealing).
Default \code{"pso"}.}

\item{maxit}{Integer or list. Maximum iterations/evaluations for the
optimizer. Default depends on method.}

\item{rho_type}{Character. Correlation type. Default \code{"pearson"}.}

\item{del}{Numeric. Small constant for log transformation. Default \code{1e-10}.}

\item{trunc_lev}{Logical. Truncate leverage correlation estimate to
\code{[-0.999, 0.999]}. Default \code{TRUE}.}

\item{wDecay}{Logical. Use decaying weights. Default \code{FALSE}.}

\item{Bartlett}{Logical. If \code{TRUE}, use Bartlett kernel HAC weighting
matrix. If \code{FALSE}, use identity matrix. Default \code{FALSE}.}

\item{Amat}{Weighting matrix specification. \code{NULL} (default) for identity
weighting, \code{"Weighted"} for data-driven HAC, or a numeric matrix of
dimension \code{(p+3)x(p+3)} (Gaussian) or \code{(p+4)x(p+4)} (heavy-tail).
Takes precedence over \code{Bartlett}.}

\item{errorType}{Character. Error distribution: \code{"Gaussian"} (default),
\code{"Student-t"}, or \code{"GED"}.}

\item{logNu}{Logical. Use log-space for nu estimation (Student-t only).
Default \code{FALSE}.}

\item{sigvMethod}{Method for sigma_v estimation: \code{"factored"} (default),
\code{"direct"}, or \code{"hybrid"}.}

\item{winsorize_eps}{Number of extreme autocovariance lags to winsorize
(0 = none). Default 0.}
}
\value{
A list with the optimization output including:
\describe{
  \item{value}{Maximized p-value.}
  \item{par}{Nuisance parameter values at the maximum.}
}
Additional fields depend on the optimization method used.
}
\description{
Performs a Maximized Monte Carlo (MMC) test of the null hypothesis
\eqn{H_0: \rho = \rho_0} by maximizing the MC p-value over nuisance
parameters (phi, sigma_y, sigma_v).
}
\examples{
\donttest{
y <- sim_svp(1000, phi = 0.95, sigy = 1, sigv = 0.2, leverage = TRUE, rho = -0.3)$y
mmc <- mmc_lev(y, p = 1, J = 10, N = 19, method = "pso", maxit = 10)
mmc$value
}

}
