% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/sparse_chaos.R
\name{predict.sparse_khaos}
\alias{predict.sparse_khaos}
\title{Predict Method for class sparse_khaos}
\usage{
\method{predict}{sparse_khaos}(object, newdata = NULL, samples = 1000, nugget = FALSE, ...)
}
\arguments{
\item{object}{An object returned by the \code{sparse_khaos()} function.}

\item{newdata}{A dataframe of the same dimension as the training data.}

\item{samples}{How many posterior samples should be taken at each test point? If 0 or FALSE, then the MAP estimate is returned.}

\item{nugget}{logical; should predictions include error? If FALSE, predictions will be for mean.}

\item{...}{Additional arguments to predict}
}
\value{
A numeric matrix of predictive samples (or a vector if \code{samples = FALSE}),
with rows corresponding to samples and columns corresponding to observations.
}
\description{
See \code{sparse_khaos()} for details.
}
\details{
Predict function for sparse_khaos object.
}
\examples{
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 <- sparse_khaos(X, y)
predict(fit)

}
\references{
Shao, Q., Younes, A., Fahs, M., & Mara, T. A. (2017). Bayesian sparse polynomial chaos expansion for global sensitivity analysis. Computer Methods in Applied Mechanics and Engineering, 318, 474-496.
}
