% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sobol_khaos.R
\name{sobol_khaos}
\alias{sobol_khaos}
\title{Compute Sobol Sensitivity Indices for khaos Models}
\usage{
sobol_khaos(obj, plot_it = TRUE, samples = 1000)
}
\arguments{
\item{obj}{An object of class \code{"adaptive_khaos"} returned by \code{adaptive_khaos()} or of class \code{"sparse_khaos"} returned by \code{sparse_khaos()}.}

\item{plot_it}{Logical; if \code{TRUE}, boxplots of the sensitivity indices are shown.}

\item{samples}{How many samples from the posterior (only used for sparse class).}
}
\value{
A list with the following components:
\describe{
\item{S}{A data frame of Sobol indices for all main effects and interactions (MCMC samples).}
\item{T}{A data frame of total-effect Sobol indices (MCMC samples).}
\item{leftover}{A numeric vector of unexplained variance proportions (residuals).}
}
}
\description{
Computes first-order, total-effect, and full interaction Sobol indices
from an adaptive KHAOS model fit. Returns MCMC samples of sensitivity
indices, including all active interaction terms used in the model.
}
\examples{
\donttest{
X <- lhs::maximinLHS(100, 2)
f <- function(x) 10.391*((x[1]-0.4)*(x[2]-0.6) + 0.36)
y <- apply(X, 1, f) + stats::rnorm(100, 0, 0.1)
fit <- adaptive_khaos(X, y)
sob <- sobol_khaos(fit)
head(sob$S)
}

}
