% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/mhn.R
\name{rmhn}
\alias{rmhn}
\title{Random generation from the modified half-normal distribution}
\usage{
rmhn(n = 1, alpha, beta, gamma)
}
\arguments{
\item{n}{Number of random draws.}

\item{alpha}{Positive shape parameter.}

\item{beta}{Positive rate parameter multiplying x^2.}

\item{gamma}{Real-valued linear parameter multiplying x.}
}
\value{
A numeric vector of length \code{n} containing random draws from the
modified half-normal distribution.
}
\description{
Generates random samples from the modified half-normal distribution with
density proportional to
\eqn{x^{\alpha - 1} \exp(-\beta x^2 + \gamma x)}
for \eqn{x > 0}.
}
\details{
This distribution arises in latent-scale updates for the generalized
Bayesian adaptive smoothing spline model. The function is intended mainly
for internal model fitting, but it may also be useful on its own.
}
\examples{
x <- rmhn(1000, alpha = 3, beta = 1, gamma = 0.5)
hist(x, breaks = 30, freq = FALSE)

}
