% Generated by roxygen2: do not edit by hand
% Please edit documentation in R/priors.R
\name{stan_prior_fields_beta}
\alias{stan_prior_fields_beta}
\title{Translate a \code{prior_beta} spec to vector-valued Stan data fields}
\usage{
stan_prior_fields_beta(prior, n_cov, sd_x = NULL, covariate_names = NULL)
}
\arguments{
\item{prior}{A prior list from \code{\link[=prior_normal]{prior_normal()}} / \code{\link[=prior_student_t]{prior_student_t()}} /
\code{\link[=prior_cauchy]{prior_cauchy()}}, OR a list of such priors of length \code{n_cov}.}

\item{n_cov}{Number of covariates.}

\item{sd_x}{Optional numeric vector of covariate SDs (length \code{n_cov}).
Required when any prior has \code{autoscale = TRUE}; ignored otherwise.}

\item{covariate_names}{Optional character vector of covariate names
(length \code{n_cov}). Used only to produce informative warnings when
\code{autoscale = TRUE} meets a zero-SD covariate.}
}
\value{
A list with numeric vectors \code{mean} and \code{sd} (length \code{n_cov})
and scalars \code{dist}, \code{df}, and a logical vector \code{autoscale} recording
which elements were autoscaled (for \code{prior_summary()}).
}
\description{
The Stan models declare \code{prior_beta_mean} and \code{prior_beta_sd} as
\code{vector[n_cov]} so the same data contract supports:
}
\details{
\itemize{
\item (i) a single prior broadcast to all covariates (scalar user input),
\item (ii) per-coefficient priors (a list of prior lists, length \code{n_cov}),
\item (iii) autoscaling: each covariate's scale is divided by \code{sd(x_j)}
so the prior is weakly-informative on the standardized scale.
}

For a list of per-coefficient priors, all elements must use the same
\code{distribution} family and \code{df} (Stan branches on a single dist code).
}
\keyword{internal}
