% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/density_wrappers.R
\name{aedl_stat_density}
\alias{aedl_stat_density}
\title{Approximate density of the DL test statistic}
\usage{
aedl_stat_density(
  t_grid,
  vi,
  tau2,
  theta = 0,
  nsim = 10000,
  nsim_chi = 1e+05,
  n_tau = 1000
)
}
\arguments{
\item{t_grid}{Numeric grid for the DerSimonian-Laird test statistic.}

\item{vi}{Numeric vector of known within-study variances.}

\item{tau2}{Non-negative value of the between-study variance.}

\item{theta}{Mean parameter used in the conditional normal approximation.}

\item{nsim}{Number of Monte Carlo samples for conditional quantities.}

\item{nsim_chi}{Number of Monte Carlo samples for the chi-square mixture.}

\item{n_tau}{Number of grid intervals for the untruncated DL estimator.}
}
\value{
A list with grid values \code{x}, density values \code{y}, and auxiliary
quantities used in the approximation.
}
\description{
\code{aedl_stat_density()} evaluates the almost-exact density approximation of
the DerSimonian-Laird test statistic on a user-supplied grid.
}
\examples{
vi <- c(0.04, 0.05, 0.03, 0.06)
d_stat <- aedl_stat_density(
  t_grid = seq(-4, 4, by = 0.5),
  vi = vi,
  tau2 = 0.01,
  nsim = 100,
  nsim_chi = 500,
  n_tau = 50
)
str(d_stat[c("x", "y")])
}
