% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/weight_estimation.R
\name{predict.metahunt_weight_model}
\alias{predict.metahunt_weight_model}
\title{Predict simplex weights for new study-level covariates}
\usage{
\method{predict}{metahunt_weight_model}(object, newdata, ...)
}
\arguments{
\item{object}{A fitted \code{"metahunt_weight_model"} from \code{\link[=fit_weight_model]{fit_weight_model()}}.}

\item{newdata}{A matrix or data frame of new study-level covariates with
the same columns used at fitting.}

\item{...}{Ignored.}
}
\value{
An \code{nrow(newdata)}-by-\code{K} numeric matrix of predicted simplex
weights (component means); rows sum to 1.
}
\description{
Predict simplex weights for new study-level covariates
}
\examples{
\donttest{
set.seed(1)
m <- 40; K <- 3
W <- data.frame(w1 = rnorm(m), w2 = rnorm(m))
eta <- cbind(0.5 * W$w1, -0.3 * W$w2, rep(0, m))
pi_true <- exp(eta) / rowSums(exp(eta))
pi_hat <- pi_true + matrix(rnorm(m * K, sd = 0.01), m, K)
pi_hat <- pmax(pi_hat, 0); pi_hat <- pi_hat / rowSums(pi_hat)
model <- fit_weight_model(pi_hat, W)
predict(model, newdata = data.frame(w1 = c(0, 1), w2 = c(0, -1)))
}

}
