% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/fit.R
\name{beta_mixture_density}
\alias{beta_mixture_density}
\title{Beta-mixture density on [0, 1]}
\usage{
beta_mixture_density(m, weights, shape1, shape2)
}
\arguments{
\item{m}{Numeric vector of finite evaluation points in \eqn{[0,1]}.}

\item{weights}{Numeric vector of mixture weights (length \eqn{K}).}

\item{shape1}{Numeric vector of Beta \eqn{a_k} parameters.}

\item{shape2}{Numeric vector of Beta \eqn{b_k} parameters.}
}
\value{
Numeric vector of densities at \code{m}.
}
\description{
Evaluates a weighted mixture of Beta densities
\deqn{f(m) \;=\; \sum_{k=1}^{K} w_k\,\mathrm{Beta}(m; a_k, b_k),}
renormalised on \eqn{[0,1]}.  Weights are coerced to be nonnegative
and to sum to one.
}
\examples{
m <- seq(0, 1, length.out = 101)
beta_mixture_density(m,
                     weights = c(0.5, 0.3, 0.2),
                     shape1  = c(2, 5, 9),
                     shape2  = c(8, 3, 2))

}
