Automatic Differentiation
Probability Distributions

Detailed Description

Modules

 Multivariate Distributions
 Distributions with Matrix inputs.
 
 Univariate Distributions
 Distributions with scalar, vector, or array input.
 

Functions

template<typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > stan::math::bernoulli_cdf (const T_n_cl &n, const T_prob_cl &theta)
 Returns the CDF of the Bernoulli distribution. More...
 
template<typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > stan::math::bernoulli_lccdf (const T_n_cl &n, const T_prob_cl &theta)
 Returns the log CCDF of the Bernoulli distribution. More...
 
template<typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > stan::math::bernoulli_lcdf (const T_n_cl &n, const T_prob_cl &theta)
 Returns the log CDF of the Bernoulli distribution. More...
 
template<bool propto, typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > stan::math::bernoulli_logit_lpmf (const T_n_cl &n, const T_prob_cl &theta)
 Returns the log PMF of the logit-parametrized Bernoulli distribution. More...
 
template<typename T_n , typename T_prob >
return_type_t< T_prob > stan::math::bernoulli_ccdf_log (const T_n &n, const T_prob &theta)
 
template<typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr>
return_type_t< T_prob > stan::math::bernoulli_cdf (const T_n &n, const T_prob &theta)
 Returns the CDF of the Bernoulli distribution. More...
 
template<typename T_n , typename T_prob >
return_type_t< T_prob > stan::math::bernoulli_cdf_log (const T_n &n, const T_prob &theta)
 
template<typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr>
return_type_t< T_prob > stan::math::bernoulli_lccdf (const T_n &n, const T_prob &theta)
 Returns the log CCDF of the Bernoulli distribution. More...
 
template<typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr>
return_type_t< T_prob > stan::math::bernoulli_lcdf (const T_n &n, const T_prob &theta)
 Returns the log CDF of the Bernoulli distribution. More...
 
template<bool propto, typename T_n , typename T_prob >
return_type_t< T_prob > stan::math::bernoulli_log (const T_n &n, const T_prob &theta)
 
template<typename T_y , typename T_prob >
return_type_t< T_prob > stan::math::bernoulli_log (const T_y &n, const T_prob &theta)
 
template<bool propto, typename T_n , typename T_prob >
return_type_t< T_prob > stan::math::bernoulli_logit_log (const T_n &n, const T_prob &theta)
 
template<typename T_n , typename T_prob >
return_type_t< T_prob > stan::math::bernoulli_logit_log (const T_n &n, const T_prob &theta)
 
template<bool propto, typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr>
return_type_t< T_prob > stan::math::bernoulli_logit_lpmf (const T_n &n, const T_prob &theta)
 Returns the log PMF of the logit-parametrized Bernoulli distribution. More...
 
template<typename T_t , class RNG >
VectorBuilder< true, int, T_t >::type stan::math::bernoulli_logit_rng (const T_t &t, RNG &rng)
 Return a Bernoulli random variate with logit-parameterized chance of success using the specified random number generator. More...
 
template<bool propto, typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr>
return_type_t< T_prob > stan::math::bernoulli_lpmf (const T_n &n, const T_prob &theta)
 Returns the log PMF of the Bernoulli distribution. More...
 
template<typename T_theta , class RNG >
VectorBuilder< true, int, T_theta >::type stan::math::bernoulli_rng (const T_theta &theta, RNG &rng)
 Return a Bernoulli random variate with specified chance of success parameter using the specified random number generator. More...
 
template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t< T_size1, T_size2 > stan::math::beta_binomial_ccdf_log (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta)
 
template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t< T_size1, T_size2 > stan::math::beta_binomial_cdf (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta)
 Returns the CDF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters. More...
 
template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t< T_size1, T_size2 > stan::math::beta_binomial_cdf_log (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta)
 
template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t< T_size1, T_size2 > stan::math::beta_binomial_lccdf (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta)
 Returns the log CCDF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters. More...
 
template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t< T_size1, T_size2 > stan::math::beta_binomial_lcdf (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta)
 Returns the log CDF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters. More...
 
template<bool propto, typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t< T_size1, T_size2 > stan::math::beta_binomial_log (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta)
 
template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t< T_size1, T_size2 > stan::math::beta_binomial_log (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta)
 
template<bool propto, typename T_n , typename T_N , typename T_size1 , typename T_size2 , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_N, T_size1, T_size2 > * = nullptr>
return_type_t< T_size1, T_size2 > stan::math::beta_binomial_lpmf (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta)
 Returns the log PMF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters. More...
 
template<typename T_N , typename T_shape1 , typename T_shape2 , class RNG >
VectorBuilder< true, int, T_N, T_shape1, T_shape2 >::type stan::math::beta_binomial_rng (const T_N &N, const T_shape1 &alpha, const T_shape2 &beta, RNG &rng)
 Return a beta-binomial random variate with the specified population size, success, and failure parameters using the given random number generator. More...
 
template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t< T_y, T_scale_succ, T_scale_fail > stan::math::beta_ccdf_log (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta)
 
template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t< T_y, T_scale_succ, T_scale_fail > stan::math::beta_cdf (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta)
 Calculates the beta cumulative distribution function for the given variate and scale variables. More...
 
template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t< T_y, T_scale_succ, T_scale_fail > stan::math::beta_cdf_log (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta)
 
template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t< T_y, T_scale_succ, T_scale_fail > stan::math::beta_lccdf (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta_param)
 Returns the beta log complementary cumulative distribution function for the given probability, success, and failure parameters. More...
 
template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t< T_y, T_scale_succ, T_scale_fail > stan::math::beta_lcdf (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta_param)
 Returns the beta log cumulative distribution function for the given probability, success, and failure parameters. More...
 
template<bool propto, typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t< T_y, T_scale_succ, T_scale_fail > stan::math::beta_log (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta)
 
template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t< T_y, T_scale_succ, T_scale_fail > stan::math::beta_log (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta)
 
template<bool propto, typename T_y , typename T_scale_succ , typename T_scale_fail , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale_succ, T_scale_fail > * = nullptr>
return_type_t< T_y, T_scale_succ, T_scale_fail > stan::math::beta_lpdf (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta)
 The log of the beta density for the specified scalar(s) given the specified sample stan::math::size(s). More...
 
template<typename T_y , typename T_loc , typename T_prec >
return_type_t< T_y, T_loc, T_prec > stan::math::beta_proportion_ccdf_log (const T_y &y, const T_loc &mu, const T_prec &kappa)
 
template<typename T_y , typename T_loc , typename T_prec >
return_type_t< T_y, T_loc, T_prec > stan::math::beta_proportion_cdf_log (const T_y &y, const T_loc &mu, const T_prec &kappa)
 
template<typename T_y , typename T_loc , typename T_prec >
return_type_t< T_y, T_loc, T_prec > stan::math::beta_proportion_lccdf (const T_y &y, const T_loc &mu, const T_prec &kappa)
 Returns the beta log complementary cumulative distribution function for specified probability, location, and precision parameters: beta_proportion_lccdf(y | mu, kappa) = beta_lccdf(y | mu * kappa, (1 - mu) * kappa). More...
 
template<typename T_y , typename T_loc , typename T_prec >
return_type_t< T_y, T_loc, T_prec > stan::math::beta_proportion_lcdf (const T_y &y, const T_loc &mu, const T_prec &kappa)
 Returns the beta log cumulative distribution function for specified probability, location, and precision parameters: beta_proportion_lcdf(y | mu, kappa) = beta_lcdf(y | mu * kappa, (1 - mu) * kappa). More...
 
template<bool propto, typename T_y , typename T_loc , typename T_prec >
return_type_t< T_y, T_loc, T_prec > stan::math::beta_proportion_log (const T_y &y, const T_loc &mu, const T_prec &kappa)
 
template<typename T_y , typename T_loc , typename T_prec >
return_type_t< T_y, T_loc, T_prec > stan::math::beta_proportion_log (const T_y &y, const T_loc &mu, const T_prec &kappa)
 
template<bool propto, typename T_y , typename T_loc , typename T_prec , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_prec > * = nullptr>
return_type_t< T_y, T_loc, T_prec > stan::math::beta_proportion_lpdf (const T_y &y, const T_loc &mu, const T_prec &kappa)
 The log of the beta density for specified y, location, and precision: beta_proportion_lpdf(y | mu, kappa) = beta_lpdf(y | mu * kappa, (1 - mu) * kappa). More...
 
template<typename T_loc , typename T_prec , class RNG >
VectorBuilder< true, double, T_loc, T_prec >::type stan::math::beta_proportion_rng (const T_loc &mu, const T_prec &kappa, RNG &rng)
 Return a Beta random variate specified probability, location, and precision parameters: beta_proportion_rng(y | mu, kappa) = beta_rng(y | mu * kappa, (1 - mu) * kappa). More...
 
template<typename T_shape1 , typename T_shape2 , class RNG >
VectorBuilder< true, double, T_shape1, T_shape2 >::type stan::math::beta_rng (const T_shape1 &alpha, const T_shape2 &beta, RNG &rng)
 Return a Beta random variate with the supplied success and failure parameters using the given random number generator. More...
 
template<typename T_n , typename T_N , typename T_prob >
return_type_t< T_prob > stan::math::binomial_ccdf_log (const T_n &n, const T_N &N, const T_prob &theta)
 
template<typename T_n , typename T_N , typename T_prob >
return_type_t< T_prob > stan::math::binomial_cdf (const T_n &n, const T_N &N, const T_prob &theta)
 Returns the CDF for the binomial distribution evaluated at the specified success, population size, and chance of success. More...
 
template<typename T_n , typename T_N , typename T_prob >
return_type_t< T_prob > stan::math::binomial_cdf_log (const T_n &n, const T_N &N, const T_prob &theta)
 
template<typename T_n , typename T_N , typename T_prob >
return_type_t< T_prob > stan::math::binomial_lccdf (const T_n &n, const T_N &N, const T_prob &theta)
 Returns the log CCDF for the binomial distribution evaluated at the specified success, population size, and chance of success. More...
 
template<typename T_n , typename T_N , typename T_prob >
return_type_t< T_prob > stan::math::binomial_lcdf (const T_n &n, const T_N &N, const T_prob &theta)
 Returns the log CDF for the binomial distribution evaluated at the specified success, population size, and chance of success. More...
 
template<bool propto, typename T_n , typename T_N , typename T_prob >
return_type_t< T_prob > stan::math::binomial_log (const T_n &n, const T_N &N, const T_prob &theta)
 
template<typename T_n , typename T_N , typename T_prob >
return_type_t< T_prob > stan::math::binomial_log (const T_n &n, const T_N &N, const T_prob &theta)
 
template<bool propto, typename T_n , typename T_N , typename T_prob >
return_type_t< T_prob > stan::math::binomial_logit_log (const T_n &n, const T_N &N, const T_prob &alpha)
 
template<typename T_n , typename T_N , typename T_prob >
return_type_t< T_prob > stan::math::binomial_logit_log (const T_n &n, const T_N &N, const T_prob &alpha)
 
template<bool propto, typename T_n , typename T_N , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_N, T_prob > * = nullptr>
return_type_t< T_prob > stan::math::binomial_logit_lpmf (const T_n &n, const T_N &N, const T_prob &alpha)
 Binomial log PMF in logit parametrization. More...
 
template<bool propto, typename T_n , typename T_N , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_N, T_prob > * = nullptr>
return_type_t< T_prob > stan::math::binomial_lpmf (const T_n &n, const T_N &N, const T_prob &theta)
 Returns the log PMF for the binomial distribution evaluated at the specified success, population size, and chance of success. More...
 
template<typename T_N , typename T_theta , class RNG >
VectorBuilder< true, int, T_N, T_theta >::type stan::math::binomial_rng (const T_N &N, const T_theta &theta, RNG &rng)
 Return a pseudorandom binomial random variable for the given population size and chance of success parameters using the specified random number generator. More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::cauchy_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::cauchy_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma)
 Returns the cauchy cumulative distribution function for the given location, and scale. More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::cauchy_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::cauchy_lccdf (const T_y &y, const T_loc &mu, const T_scale &sigma)
 Returns the cauchy log complementary cumulative distribution function for the given location, and scale. More...
 
template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::cauchy_lcdf (const T_y &y, const T_loc &mu, const T_scale &sigma)
 Returns the cauchy log cumulative distribution function for the given location, and scale. More...
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::cauchy_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 The log of the Cauchy density for the specified scalar(s) given the specified location parameter(s) and scale parameter(s). More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::cauchy_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::cauchy_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma)
 The log of the Cauchy density for the specified scalar(s) given the specified location parameter(s) and scale parameter(s). More...
 
template<typename T_loc , typename T_scale , class RNG >
VectorBuilder< true, double, T_loc, T_scale >::type stan::math::cauchy_rng (const T_loc &mu, const T_scale &sigma, RNG &rng)
 Return a Cauchy random variate for the given location and scale using the specified random number generator. More...
 
template<typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::chi_square_ccdf_log (const T_y &y, const T_dof &nu)
 
template<typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::chi_square_cdf (const T_y &y, const T_dof &nu)
 Returns the chi square cumulative distribution function for the given variate and degrees of freedom. More...
 
template<typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::chi_square_cdf_log (const T_y &y, const T_dof &nu)
 
template<typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::chi_square_lccdf (const T_y &y, const T_dof &nu)
 Returns the chi square log complementary cumulative distribution function for the given variate and degrees of freedom. More...
 
template<typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::chi_square_lcdf (const T_y &y, const T_dof &nu)
 Returns the chi square log cumulative distribution function for the given variate and degrees of freedom. More...
 
template<bool propto, typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::chi_square_log (const T_y &y, const T_dof &nu)
 The log of a chi-squared density for y with the specified degrees of freedom parameter. More...
 
template<typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::chi_square_log (const T_y &y, const T_dof &nu)
 
template<bool propto, typename T_y , typename T_dof , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof > * = nullptr>
return_type_t< T_y, T_dof > stan::math::chi_square_lpdf (const T_y &y, const T_dof &nu)
 The log of a chi-squared density for y with the specified degrees of freedom parameter. More...
 
template<typename T_deg , class RNG >
VectorBuilder< true, double, T_deg >::type stan::math::chi_square_rng (const T_deg &nu, RNG &rng)
 Return a chi squared random variate with nu degrees of freedom using the specified random number generator. More...
 
template<typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_ccdf_log (const T_y &y, const T_lower &lower, const T_upper &upper)
 
template<typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_cdf (const T_y &y, const T_lower &lower, const T_upper &upper)
 Return the CDF of a discrete range distribution for the given y, lower and upper bounds (all integers). More...
 
template<typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_cdf_log (const T_y &y, const T_lower &lower, const T_upper &upper)
 
template<typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_lccdf (const T_y &y, const T_lower &lower, const T_upper &upper)
 Return the log CCDF of a discrete range distribution for the given y, lower and upper bounds (all integers). More...
 
template<typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_lcdf (const T_y &y, const T_lower &lower, const T_upper &upper)
 Return the log CDF of a discrete range distribution for the given y, lower and upper bounds (all integers). More...
 
template<bool propto, typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_log (const T_y &y, const T_lower &lower, const T_upper &upper)
 
template<typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_log (const T_y &y, const T_lower &lower, const T_upper &upper)
 
template<bool propto, typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_lpmf (const T_y &y, const T_lower &lower, const T_upper &upper)
 Return the log PMF of a discrete range for the given y, lower and upper bound (all integers). More...
 
template<typename T_lower , typename T_upper , class RNG >
VectorBuilder< true, int, T_lower, T_upper >::type stan::math::discrete_range_rng (const T_lower &lower, const T_upper &upper, RNG &rng)
 Return an integer random variate between the given lower and upper bounds (inclusive) using the specified random number generator. More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::double_exponential_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::double_exponential_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma)
 Returns the double exponential cumulative density function. More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::double_exponential_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::double_exponential_lccdf (const T_y &y, const T_loc &mu, const T_scale &sigma)
 Returns the double exponential log complementary cumulative density function. More...
 
template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::double_exponential_lcdf (const T_y &y, const T_loc &mu, const T_scale &sigma)
 Returns the double exponential log cumulative density function. More...
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::double_exponential_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::double_exponential_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::double_exponential_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma)
 Returns the double exponential log probability density function. More...
 
template<typename T_loc , typename T_scale , class RNG >
VectorBuilder< true, double, T_loc, T_scale >::type stan::math::double_exponential_rng (const T_loc &mu, const T_scale &sigma, RNG &rng)
 Return a double exponential random variate with the given location and scale using the specified random number generator. More...
 
template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type_t< T_y, T_loc, T_scale, T_inv_scale > stan::math::exp_mod_normal_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda)
 
template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type_t< T_y, T_loc, T_scale, T_inv_scale > stan::math::exp_mod_normal_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type_t< T_y, T_loc, T_scale, T_inv_scale > stan::math::exp_mod_normal_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda)
 
template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type_t< T_y, T_loc, T_scale, T_inv_scale > stan::math::exp_mod_normal_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda)
 
template<typename T_loc , typename T_scale , typename T_inv_scale , class RNG >
VectorBuilder< true, double, T_loc, T_scale, T_inv_scale >::type stan::math::exp_mod_normal_rng (const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda, RNG &rng)
 Return an exponentially modified normal random variate for the given location, scale, and inverse scale using the specified random number generator. More...
 
template<typename T_y , typename T_inv_scale >
return_type_t< T_y, T_inv_scale > stan::math::exponential_ccdf_log (const T_y &y, const T_inv_scale &beta)
 
template<typename T_y , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_inv_scale > * = nullptr>
return_type_t< T_y, T_inv_scale > stan::math::exponential_cdf (const T_y &y, const T_inv_scale &beta)
 Calculates the exponential cumulative distribution function for the given y and beta. More...
 
template<typename T_y , typename T_inv_scale >
return_type_t< T_y, T_inv_scale > stan::math::exponential_cdf_log (const T_y &y, const T_inv_scale &beta)
 
template<bool propto, typename T_y , typename T_inv_scale >
return_type_t< T_y, T_inv_scale > stan::math::exponential_log (const T_y &y, const T_inv_scale &beta)
 
template<typename T_y , typename T_inv_scale >
return_type_t< T_y, T_inv_scale > stan::math::exponential_log (const T_y &y, const T_inv_scale &beta)
 
template<bool propto, typename T_y , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_inv_scale > * = nullptr>
return_type_t< T_y, T_inv_scale > stan::math::exponential_lpdf (const T_y &y, const T_inv_scale &beta)
 The log of an exponential density for y with the specified inverse scale parameter. More...
 
template<typename T_inv , class RNG >
VectorBuilder< true, double, T_inv >::type stan::math::exponential_rng (const T_inv &beta, RNG &rng)
 Return a exponential random variate with inverse scale beta using the specified random number generator. More...
 
template<typename T_y , typename T_shape , typename T_scale >
return_type_t< T_y, T_shape, T_scale > stan::math::frechet_ccdf_log (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 
template<typename T_y , typename T_shape , typename T_scale >
return_type_t< T_y, T_shape, T_scale > stan::math::frechet_cdf_log (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 
template<bool propto, typename T_y , typename T_shape , typename T_scale >
return_type_t< T_y, T_shape, T_scale > stan::math::frechet_log (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 
template<typename T_y , typename T_shape , typename T_scale >
return_type_t< T_y, T_shape, T_scale > stan::math::frechet_log (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 
template<typename T_shape , typename T_scale , class RNG >
VectorBuilder< true, double, T_shape, T_scale >::type stan::math::frechet_rng (const T_shape &alpha, const T_scale &sigma, RNG &rng)
 Return a pseudorandom Frechet variate for the given shape and scale parameters using the specified random number generator. More...
 
template<typename T_y , typename T_shape , typename T_inv_scale >
return_type_t< T_y, T_shape, T_inv_scale > stan::math::gamma_ccdf_log (const T_y &y, const T_shape &alpha, const T_inv_scale &beta)
 
template<typename T_y , typename T_shape , typename T_inv_scale >
return_type_t< T_y, T_shape, T_inv_scale > stan::math::gamma_cdf (const T_y &y, const T_shape &alpha, const T_inv_scale &beta)
 The cumulative density function for a gamma distribution for y with the specified shape and inverse scale parameters. More...
 
template<typename T_y , typename T_shape , typename T_inv_scale >
return_type_t< T_y, T_shape, T_inv_scale > stan::math::gamma_cdf_log (const T_y &y, const T_shape &alpha, const T_inv_scale &beta)
 
template<bool propto, typename T_y , typename T_shape , typename T_inv_scale >
return_type_t< T_y, T_shape, T_inv_scale > stan::math::gamma_log (const T_y &y, const T_shape &alpha, const T_inv_scale &beta)
 The log of a gamma density for y with the specified shape and inverse scale parameters. More...
 
template<typename T_y , typename T_shape , typename T_inv_scale >
return_type_t< T_y, T_shape, T_inv_scale > stan::math::gamma_log (const T_y &y, const T_shape &alpha, const T_inv_scale &beta)
 
template<bool propto, typename T_y , typename T_shape , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_inv_scale > * = nullptr>
return_type_t< T_y, T_shape, T_inv_scale > stan::math::gamma_lpdf (const T_y &y, const T_shape &alpha, const T_inv_scale &beta)
 The log of a gamma density for y with the specified shape and inverse scale parameters. More...
 
template<typename T_shape , typename T_inv , class RNG >
VectorBuilder< true, double, T_shape, T_inv >::type stan::math::gamma_rng (const T_shape &alpha, const T_inv &beta, RNG &rng)
 Return a gamma random variate for the given shape and inverse scale parameters using the specified random number generator. More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::gumbel_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &beta)
 
template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::gumbel_cdf (const T_y &y, const T_loc &mu, const T_scale &beta)
 Returns the Gumbel distribution cumulative distribution for the given location and scale. More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::gumbel_cdf_log (const T_y &y, const T_loc &mu, const T_scale &beta)
 
template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::gumbel_lccdf (const T_y &y, const T_loc &mu, const T_scale &beta)
 Returns the Gumbel log complementary cumulative distribution for the given location and scale. More...
 
template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::gumbel_lcdf (const T_y &y, const T_loc &mu, const T_scale &beta)
 Returns the Gumbel log cumulative distribution for the given location and scale. More...
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::gumbel_log (const T_y &y, const T_loc &mu, const T_scale &beta)
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::gumbel_log (const T_y &y, const T_loc &mu, const T_scale &beta)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::gumbel_lpdf (const T_y &y, const T_loc &mu, const T_scale &beta)
 Returns the Gumbel log probability density for the given location and scale. More...
 
template<typename T_loc , typename T_scale , class RNG >
VectorBuilder< true, double, T_loc, T_scale >::type stan::math::gumbel_rng (const T_loc &mu, const T_scale &beta, RNG &rng)
 Return a Gumbel random variate with the given location and scale using the specified random number generator. More...
 
template<bool propto, typename T_n , typename T_N , typename T_a , typename T_b >
double stan::math::hypergeometric_log (const T_n &n, const T_N &N, const T_a &a, const T_b &b)
 
template<typename T_n , typename T_N , typename T_a , typename T_b >
double stan::math::hypergeometric_log (const T_n &n, const T_N &N, const T_a &a, const T_b &b)
 
template<typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::inv_chi_square_ccdf_log (const T_y &y, const T_dof &nu)
 
template<typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::inv_chi_square_cdf (const T_y &y, const T_dof &nu)
 Returns the inverse chi square cumulative distribution function for the given variate and degrees of freedom. More...
 
template<typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::inv_chi_square_cdf_log (const T_y &y, const T_dof &nu)
 
template<typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::inv_chi_square_lccdf (const T_y &y, const T_dof &nu)
 Returns the inverse chi square log complementary cumulative distribution function for the given variate and degrees of freedom. More...
 
template<typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::inv_chi_square_lcdf (const T_y &y, const T_dof &nu)
 Returns the inverse chi square log cumulative distribution function for the given variate and degrees of freedom. More...
 
template<bool propto, typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::inv_chi_square_log (const T_y &y, const T_dof &nu)
 The log of an inverse chi-squared density for y with the specified degrees of freedom parameter. More...
 
template<typename T_y , typename T_dof >
return_type_t< T_y, T_dof > stan::math::inv_chi_square_log (const T_y &y, const T_dof &nu)
 
template<bool propto, typename T_y , typename T_dof , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof > * = nullptr>
return_type_t< T_y, T_dof > stan::math::inv_chi_square_lpdf (const T_y &y, const T_dof &nu)
 The log of an inverse chi-squared density for y with the specified degrees of freedom parameter. More...
 
template<typename T_deg , class RNG >
VectorBuilder< true, double, T_deg >::type stan::math::inv_chi_square_rng (const T_deg &nu, RNG &rng)
 Return a pseudorandom inverse chi squared variate with the nu degrees of freedom using the specified random number generator. More...
 
template<typename T_y , typename T_shape , typename T_scale >
return_type_t< T_y, T_shape, T_scale > stan::math::inv_gamma_ccdf_log (const T_y &y, const T_shape &alpha, const T_scale &beta)
 
template<typename T_y , typename T_shape , typename T_scale >
return_type_t< T_y, T_shape, T_scale > stan::math::inv_gamma_cdf (const T_y &y, const T_shape &alpha, const T_scale &beta)
 The CDF of an inverse gamma density for y with the specified shape and scale parameters. More...
 
template<typename T_y , typename T_shape , typename T_scale >
return_type_t< T_y, T_shape, T_scale > stan::math::inv_gamma_cdf_log (const T_y &y, const T_shape &alpha, const T_scale &beta)
 
template<bool propto, typename T_y , typename T_shape , typename T_scale >
return_type_t< T_y, T_shape, T_scale > stan::math::inv_gamma_log (const T_y &y, const T_shape &alpha, const T_scale &beta)
 The log of an inverse gamma density for y with the specified shape and scale parameters. More...
 
template<typename T_y , typename T_shape , typename T_scale >
return_type_t< T_y, T_shape, T_scale > stan::math::inv_gamma_log (const T_y &y, const T_shape &alpha, const T_scale &beta)
 
template<bool propto, typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr>
return_type_t< T_y, T_shape, T_scale > stan::math::inv_gamma_lpdf (const T_y &y, const T_shape &alpha, const T_scale &beta)
 The log of an inverse gamma density for y with the specified shape and scale parameters. More...
 
template<typename T_shape , typename T_scale , class RNG >
VectorBuilder< true, double, T_shape, T_scale >::type stan::math::inv_gamma_rng (const T_shape &alpha, const T_scale &beta, RNG &rng)
 Return a pseudorandom inverse gamma variate for the given shape and scale parameters using the specified random number generator. More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::logistic_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::logistic_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::logistic_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::logistic_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<typename T_loc , typename T_scale , class RNG >
VectorBuilder< true, double, T_loc, T_scale >::type stan::math::logistic_rng (const T_loc &mu, const T_scale &sigma, RNG &rng)
 Return a Logistic random variate for the given location and scale using the specified random number generator. More...
 
template<typename T_y , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale, T_shape > * = nullptr>
return_type_t< T_y, T_scale, T_shape > stan::math::loglogistic_cdf (const T_y &y, const T_scale &alpha, const T_shape &beta)
 The loglogistic cumulative distribution function for the specified scalar(s) given the specified scales(s) and shape(s). More...
 
template<bool propto, typename T_y , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale, T_shape > * = nullptr>
return_type_t< T_y, T_scale, T_shape > stan::math::loglogistic_lpdf (const T_y &y, const T_scale &alpha, const T_shape &beta)
 The log of the loglogistic density for the specified scalar(s) given the specified scales(s) and shape(s). More...
 
template<typename T_scale , typename T_shape , class RNG >
VectorBuilder< true, double, T_scale, T_shape >::type stan::math::loglogistic_rng (const T_scale &alpha, const T_shape &beta, RNG &rng)
 Return a loglogistic random variate for the given scale and shape parameters using the specified random number generator. More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::lognormal_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::lognormal_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::lognormal_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::lognormal_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<typename T_loc , typename T_scale , class RNG >
VectorBuilder< true, double, T_loc, T_scale >::type stan::math::lognormal_rng (const T_loc &mu, const T_scale &sigma, RNG &rng)
 Return a lognormal random variate for the given location and scale using the specified random number generator. More...
 
template<typename T_n , typename T_location , typename T_precision >
return_type_t< T_location, T_precision > stan::math::neg_binomial_2_ccdf_log (const T_n &n, const T_location &mu, const T_precision &phi)
 
template<typename T_n , typename T_location , typename T_precision >
return_type_t< T_location, T_precision > stan::math::neg_binomial_2_cdf_log (const T_n &n, const T_location &mu, const T_precision &phi)
 
template<bool propto, typename T_n , typename T_location , typename T_precision >
return_type_t< T_location, T_precision > stan::math::neg_binomial_2_log (const T_n &n, const T_location &mu, const T_precision &phi)
 
template<typename T_n , typename T_location , typename T_precision >
return_type_t< T_location, T_precision > stan::math::neg_binomial_2_log (const T_n &n, const T_location &mu, const T_precision &phi)
 
template<bool propto, typename T_n , typename T_log_location , typename T_precision >
return_type_t< T_log_location, T_precision > stan::math::neg_binomial_2_log_log (const T_n &n, const T_log_location &eta, const T_precision &phi)
 
template<typename T_n , typename T_log_location , typename T_precision >
return_type_t< T_log_location, T_precision > stan::math::neg_binomial_2_log_log (const T_n &n, const T_log_location &eta, const T_precision &phi)
 
template<typename T_loc , typename T_inv , class RNG >
VectorBuilder< true, int, T_loc, T_inv >::type stan::math::neg_binomial_2_log_rng (const T_loc &eta, const T_inv &phi, RNG &rng)
 Return a negative binomial random variate with the specified log-location and inverse dispersion parameters using the given random number generator. More...
 
template<typename T_loc , typename T_prec , class RNG >
VectorBuilder< true, int, T_loc, T_prec >::type stan::math::neg_binomial_2_rng (const T_loc &mu, const T_prec &phi, RNG &rng)
 Return a negative binomial random variate with the specified location and precision parameters using the given random number generator. More...
 
template<typename T_n , typename T_shape , typename T_inv_scale >
return_type_t< T_shape, T_inv_scale > stan::math::neg_binomial_ccdf_log (const T_n &n, const T_shape &alpha, const T_inv_scale &beta)
 
template<typename T_n , typename T_shape , typename T_inv_scale >
return_type_t< T_shape, T_inv_scale > stan::math::neg_binomial_cdf_log (const T_n &n, const T_shape &alpha, const T_inv_scale &beta)
 
template<bool propto, typename T_n , typename T_shape , typename T_inv_scale >
return_type_t< T_shape, T_inv_scale > stan::math::neg_binomial_log (const T_n &n, const T_shape &alpha, const T_inv_scale &beta)
 
template<typename T_n , typename T_shape , typename T_inv_scale >
return_type_t< T_shape, T_inv_scale > stan::math::neg_binomial_log (const T_n &n, const T_shape &alpha, const T_inv_scale &beta)
 
template<typename T_shape , typename T_inv , class RNG >
VectorBuilder< true, int, T_shape, T_inv >::type stan::math::neg_binomial_rng (const T_shape &alpha, const T_inv &beta, RNG &rng)
 Return a negative binomial random variate with the specified shape and inverse scale parameters using the given random number generator. More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::normal_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::normal_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma)
 Calculates the normal cumulative distribution function for the given variate, location, and scale. More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::normal_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::normal_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 The log of the normal density for the specified scalar(s) given the specified mean(s) and deviation(s). More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::normal_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_loc, T_scale > stan::math::normal_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma)
 The log of the normal density for the specified scalar(s) given the specified mean(s) and deviation(s). More...
 
template<typename T_loc , typename T_scale , class RNG >
VectorBuilder< true, double, T_loc, T_scale >::type stan::math::normal_rng (const T_loc &mu, const T_scale &sigma, RNG &rng)
 Return a Normal random variate for the given location and scale using the specified random number generator. More...
 
template<bool propto, typename T_y , typename T_s , typename T_n , typename T_loc , typename T_scale >
return_type_t< T_y, T_s, T_loc, T_scale > stan::math::normal_sufficient_log (const T_y &y_bar, const T_s &s_squared, const T_n &n_obs, const T_loc &mu, const T_scale &sigma)
 
template<typename T_y , typename T_s , typename T_n , typename T_loc , typename T_scale >
return_type_t< T_y, T_s, T_loc, T_scale > stan::math::normal_sufficient_log (const T_y &y_bar, const T_s &s_squared, const T_n &n_obs, const T_loc &mu, const T_scale &sigma)
 
template<bool propto, typename T_y , typename T_s , typename T_n , typename T_loc , typename T_scale >
return_type_t< T_y, T_s, T_loc, T_scale > stan::math::normal_sufficient_lpdf (const T_y &y_bar, const T_s &s_squared, const T_n &n_obs, const T_loc &mu, const T_scale &sigma)
 The log of the normal density for the specified scalar(s) given the specified mean(s) and deviation(s). More...
 
template<typename T_y , typename T_scale , typename T_shape >
return_type_t< T_y, T_scale, T_shape > stan::math::pareto_ccdf_log (const T_y &y, const T_scale &y_min, const T_shape &alpha)
 
template<typename T_y , typename T_scale , typename T_shape >
return_type_t< T_y, T_scale, T_shape > stan::math::pareto_cdf_log (const T_y &y, const T_scale &y_min, const T_shape &alpha)
 
template<bool propto, typename T_y , typename T_scale , typename T_shape >
return_type_t< T_y, T_scale, T_shape > stan::math::pareto_log (const T_y &y, const T_scale &y_min, const T_shape &alpha)
 
template<typename T_y , typename T_scale , typename T_shape >
return_type_t< T_y, T_scale, T_shape > stan::math::pareto_log (const T_y &y, const T_scale &y_min, const T_shape &alpha)
 
template<typename T_shape , typename T_scale , class RNG >
VectorBuilder< true, double, T_shape, T_scale >::type stan::math::pareto_rng (const T_scale &y_min, const T_shape &alpha, RNG &rng)
 Return a Pareto random variate for the given shape and scale parameters using the specified random number generator. More...
 
template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t< T_y, T_loc, T_scale, T_shape > stan::math::pareto_type_2_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha)
 
template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t< T_y, T_loc, T_scale, T_shape > stan::math::pareto_type_2_cdf_log (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t< T_y, T_loc, T_scale, T_shape > stan::math::pareto_type_2_log (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha)
 
template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t< T_y, T_loc, T_scale, T_shape > stan::math::pareto_type_2_log (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha)
 
template<typename T_loc , typename T_scale , typename T_shape , class RNG >
VectorBuilder< true, double, T_loc, T_scale, T_shape >::type stan::math::pareto_type_2_rng (const T_loc &mu, const T_scale &lambda, const T_shape &alpha, RNG &rng)
 Return a Pareto type 2 random variate for the given location, scale, and shape using the specified random number generator. More...
 
template<typename T_y , typename T_theta >
return_type_t< T_theta > stan::math::poisson_binomial_ccdf_log (const T_y &y, const T_theta &theta)
 
template<bool propto, typename T_y , typename T_theta >
return_type_t< T_theta > stan::math::poisson_binomial_cdf (const T_y &y, const T_theta &theta)
 Returns the CDF for the Poisson-binomial distribution evaluated at the specified number of successes and probabilities of successes. More...
 
template<typename T_y , typename T_theta >
return_type_t< T_theta > stan::math::poisson_binomial_cdf_log (const T_y &y, const T_theta &theta)
 
template<bool propto, typename T_y , typename T_theta >
return_type_t< T_theta > stan::math::poisson_binomial_lccdf (const T_y &y, const T_theta &theta)
 Returns the log CCDF for the Poisson-binomial distribution evaluated at the specified number of successes and probabilities of successes. More...
 
template<bool propto, typename T_y , typename T_theta >
return_type_t< T_theta > stan::math::poisson_binomial_lcdf (const T_y &y, const T_theta &theta)
 Returns the log CDF for the Poisson-binomial distribution evaluated at the specified number of successes and probabilities of successes. More...
 
template<bool propto, typename T_y , typename T_theta >
return_type_t< T_theta > stan::math::poisson_binomial_log (const T_y &y, const T_theta &theta)
 
template<typename T_y , typename T_theta >
return_type_t< T_theta > stan::math::poisson_binomial_log (const T_y &y, const T_theta &theta)
 
template<bool propto, typename T_y , typename T_theta >
return_type_t< T_theta > stan::math::poisson_binomial_lpmf (const T_y &y, const T_theta &theta)
 Returns the log PMF for the Poisson-binomial distribution evaluated at an specified array of numbers of successes and probabilities of successes. More...
 
template<typename T_theta , typename RNG , require_eigen_vt< std::is_arithmetic, T_theta > * = nullptr>
int stan::math::poisson_binomial_rng (const T_theta &theta, RNG &rng)
 Return a pseudorandom Poisson binomial random variable for the given vector of success parameters using the specified random number generator. More...
 
template<typename T_n , typename T_rate >
return_type_t< T_rate > stan::math::poisson_ccdf_log (const T_n &n, const T_rate &lambda)
 
template<typename T_n , typename T_rate >
return_type_t< T_rate > stan::math::poisson_cdf_log (const T_n &n, const T_rate &lambda)
 
template<bool propto, typename T_n , typename T_rate >
return_type_t< T_rate > stan::math::poisson_log (const T_n &n, const T_rate &lambda)
 
template<typename T_n , typename T_rate >
return_type_t< T_rate > stan::math::poisson_log (const T_n &n, const T_rate &lambda)
 
template<bool propto, typename T_n , typename T_log_rate >
return_type_t< T_log_rate > stan::math::poisson_log_log (const T_n &n, const T_log_rate &alpha)
 
template<typename T_n , typename T_log_rate >
return_type_t< T_log_rate > stan::math::poisson_log_log (const T_n &n, const T_log_rate &alpha)
 
template<typename T_rate , class RNG >
VectorBuilder< true, int, T_rate >::type stan::math::poisson_log_rng (const T_rate &alpha, RNG &rng)
 Return a Poisson random variate with specified log rate parameter using the given random number generator. More...
 
template<typename T_rate , class RNG >
VectorBuilder< true, int, T_rate >::type stan::math::poisson_rng (const T_rate &lambda, RNG &rng)
 Return a Poisson random variate with specified rate parameter using the given random number generator. More...
 
template<typename T_y , typename T_scale >
return_type_t< T_y, T_scale > stan::math::rayleigh_ccdf_log (const T_y &y, const T_scale &sigma)
 
template<typename T_y , typename T_scale >
return_type_t< T_y, T_scale > stan::math::rayleigh_cdf_log (const T_y &y, const T_scale &sigma)
 
template<bool propto, typename T_y , typename T_scale >
return_type_t< T_y, T_scale > stan::math::rayleigh_log (const T_y &y, const T_scale &sigma)
 
template<typename T_y , typename T_scale >
return_type_t< T_y, T_scale > stan::math::rayleigh_log (const T_y &y, const T_scale &sigma)
 
template<typename T_scale , class RNG >
VectorBuilder< true, double, T_scale >::type stan::math::rayleigh_rng (const T_scale &sigma, RNG &rng)
 Return a Rayleigh random variate with scale parameter sigma using the specified random number generator. More...
 
template<typename T_y , typename T_dof , typename T_scale >
return_type_t< T_y, T_dof, T_scale > stan::math::scaled_inv_chi_square_ccdf_log (const T_y &y, const T_dof &nu, const T_scale &s)
 
template<typename T_y , typename T_dof , typename T_scale >
return_type_t< T_y, T_dof, T_scale > stan::math::scaled_inv_chi_square_cdf (const T_y &y, const T_dof &nu, const T_scale &s)
 The CDF of a scaled inverse chi-squared density for y with the specified degrees of freedom parameter and scale parameter. More...
 
template<typename T_y , typename T_dof , typename T_scale >
return_type_t< T_y, T_dof, T_scale > stan::math::scaled_inv_chi_square_cdf_log (const T_y &y, const T_dof &nu, const T_scale &s)
 
template<bool propto, typename T_y , typename T_dof , typename T_scale >
return_type_t< T_y, T_dof, T_scale > stan::math::scaled_inv_chi_square_log (const T_y &y, const T_dof &nu, const T_scale &s)
 The log of a scaled inverse chi-squared density for y with the specified degrees of freedom parameter and scale parameter. More...
 
template<typename T_y , typename T_dof , typename T_scale >
return_type_t< T_y, T_dof, T_scale > stan::math::scaled_inv_chi_square_log (const T_y &y, const T_dof &nu, const T_scale &s)
 
template<bool propto, typename T_y , typename T_dof , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof, T_scale > * = nullptr>
return_type_t< T_y, T_dof, T_scale > stan::math::scaled_inv_chi_square_lpdf (const T_y &y, const T_dof &nu, const T_scale &s)
 The log of a scaled inverse chi-squared density for y with the specified degrees of freedom parameter and scale parameter. More...
 
template<typename T_deg , typename T_scale , class RNG >
VectorBuilder< true, double, T_deg, T_scale >::type stan::math::scaled_inv_chi_square_rng (const T_deg &nu, const T_scale &s, RNG &rng)
 Return a scaled chi square random variate for the given number of degrees of freedom and scale using the specified random number generator. More...
 
template<typename T_y , typename T_loc , typename T_scale , typename T_skewness >
return_type_t< T_y, T_loc, T_scale, T_skewness > stan::math::skew_double_exponential_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau)
 
template<typename T_y , typename T_loc , typename T_scale , typename T_skewness , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_skewness > * = nullptr>
return_type_t< T_y, T_loc, T_scale, T_skewness > stan::math::skew_double_exponential_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau)
 Returns the skew double exponential cumulative density function. More...
 
template<typename T_y , typename T_loc , typename T_scale , typename T_skewness >
return_type_t< T_y, T_loc, T_scale, T_skewness > stan::math::skew_double_exponential_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau)
 
template<typename T_y , typename T_loc , typename T_scale , typename T_skewness , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_skewness > * = nullptr>
return_type_t< T_y, T_loc, T_scale, T_skewness > stan::math::skew_double_exponential_lccdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau)
 Returns the skew double exponential log complementary cumulative density function. More...
 
template<typename T_y , typename T_loc , typename T_scale , typename T_skewness , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_skewness > * = nullptr>
return_type_t< T_y, T_loc, T_scale, T_skewness > stan::math::skew_double_exponential_lcdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau)
 Returns the skew double exponential log cumulative density function. More...
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_skewness >
return_type_t< T_y, T_loc, T_scale, T_skewness > stan::math::skew_double_exponential_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau)
 
template<typename T_y , typename T_loc , typename T_scale , typename T_skewness >
return_type_t< T_y, T_loc, T_scale, T_skewness > stan::math::skew_double_exponential_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_skewness , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_skewness > * = nullptr>
return_type_t< T_y, T_loc, T_scale, T_skewness > stan::math::skew_double_exponential_lpdf (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_skewness &tau)
 Returns the skew double exponential log probability density function. More...
 
template<typename T_loc , typename T_scale , typename T_skewness , class RNG >
VectorBuilder< true, double, T_loc, T_scale, T_skewness >::type stan::math::skew_double_exponential_rng (const T_loc &mu, const T_scale &sigma, const T_skewness &tau, RNG &rng)
 Return a skew double exponential random variate with the given location scale and skewness using the specified random number generator. More...
 
template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t< T_y, T_loc, T_scale, T_shape > stan::math::skew_normal_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha)
 
template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t< T_y, T_loc, T_scale, T_shape > stan::math::skew_normal_cdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t< T_y, T_loc, T_scale, T_shape > stan::math::skew_normal_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha)
 
template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t< T_y, T_loc, T_scale, T_shape > stan::math::skew_normal_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha)
 
template<typename T_loc , typename T_scale , typename T_shape , class RNG >
VectorBuilder< true, double, T_loc, T_scale, T_shape >::type stan::math::skew_normal_rng (const T_loc &mu, const T_scale &sigma, const T_shape &alpha, RNG &rng)
 Return a Skew-normal random variate for the given location, scale, and shape using the specified random number generator. More...
 
template<typename T_y >
return_type_t< T_y > stan::math::std_normal_ccdf_log (const T_y &y)
 
template<typename T_y , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y > * = nullptr>
return_type_t< T_y > stan::math::std_normal_cdf (const T_y &y)
 Calculates the standard normal cumulative distribution function for the given variate. More...
 
template<typename T_y >
return_type_t< T_y > stan::math::std_normal_cdf_log (const T_y &y)
 
template<bool propto, typename T_y >
return_type_t< T_y > stan::math::std_normal_log (const T_y &y)
 The log of a standard normal density for the specified scalar(s). More...
 
template<typename T_y >
return_type_t< T_y > stan::math::std_normal_log (const T_y &y)
 
template<bool propto, typename T_y , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y > * = nullptr>
return_type_t< T_y > stan::math::std_normal_lpdf (const T_y &y)
 The log of the normal density for the specified scalar(s) given a location of 0 and a scale of 1. More...
 
template<class RNG >
double stan::math::std_normal_rng (RNG &rng)
 Return a standard Normal random variate using the specified random number generator. More...
 
template<typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type_t< T_y, T_dof, T_loc, T_scale > stan::math::student_t_ccdf_log (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma)
 
template<typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type_t< T_y, T_dof, T_loc, T_scale > stan::math::student_t_cdf_log (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma)
 
template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type_t< T_y, T_dof, T_loc, T_scale > stan::math::student_t_log (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma)
 The log of the Student-t density for the given y, nu, mean, and scale parameter. More...
 
template<typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type_t< T_y, T_dof, T_loc, T_scale > stan::math::student_t_log (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma)
 
template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof, T_loc, T_scale > * = nullptr>
return_type_t< T_y, T_dof, T_loc, T_scale > stan::math::student_t_lpdf (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma)
 The log of the Student-t density for the given y, nu, mean, and scale parameter. More...
 
template<typename T_deg , typename T_loc , typename T_scale , class RNG >
VectorBuilder< true, double, T_deg, T_loc, T_scale >::type stan::math::student_t_rng (const T_deg &nu, const T_loc &mu, const T_scale &sigma, RNG &rng)
 Return a student-t random variate for the given degrees of freedom, location, and scale using the specified random number generator. More...
 
template<typename T_y , typename T_low , typename T_high >
return_type_t< T_y, T_low, T_high > stan::math::uniform_ccdf_log (const T_y &y, const T_low &alpha, const T_high &beta)
 
template<typename T_y , typename T_low , typename T_high >
return_type_t< T_y, T_low, T_high > stan::math::uniform_cdf_log (const T_y &y, const T_low &alpha, const T_high &beta)
 
template<bool propto, typename T_y , typename T_low , typename T_high >
return_type_t< T_y, T_low, T_high > stan::math::uniform_log (const T_y &y, const T_low &alpha, const T_high &beta)
 The log of a uniform density for the given y, lower, and upper bound. More...
 
template<typename T_y , typename T_low , typename T_high >
return_type_t< T_y, T_low, T_high > stan::math::uniform_log (const T_y &y, const T_low &alpha, const T_high &beta)
 
template<bool propto, typename T_y , typename T_low , typename T_high , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_low, T_high > * = nullptr>
return_type_t< T_y, T_low, T_high > stan::math::uniform_lpdf (const T_y &y, const T_low &alpha, const T_high &beta)
 The log of a uniform density for the given y, lower, and upper bound. More...
 
template<typename T_alpha , typename T_beta , class RNG >
VectorBuilder< true, double, T_alpha, T_beta >::type stan::math::uniform_rng (const T_alpha &alpha, const T_beta &beta, RNG &rng)
 Return a uniform random variate for the given upper and lower bounds using the specified random number generator. More...
 
template<typename T_x , typename T_mu , typename T_k >
return_type_t< T_x, T_mu, T_k > stan::math::von_mises_cdf (const T_x &x, const T_mu &mu, const T_k &k)
 Calculates the cumulative distribution function of the von Mises distribution: More...
 
template<typename T_x , typename T_mu , typename T_k >
return_type_t< T_x, T_mu, T_k > stan::math::von_mises_lccdf (const T_x &x, const T_mu &mu, const T_k &k)
 Calculates the log of the complement of the cumulative distribution function of the von Mises distribution: More...
 
template<typename T_x , typename T_mu , typename T_k >
return_type_t< T_x, T_mu, T_k > stan::math::von_mises_lcdf (const T_x &x, const T_mu &mu, const T_k &k)
 Calculates the log of the cumulative distribution function of the von Mises distribution: More...
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::von_mises_log (T_y const &y, T_loc const &mu, T_scale const &kappa)
 
template<typename T_y , typename T_loc , typename T_scale >
return_type_t< T_y, T_loc, T_scale > stan::math::von_mises_log (T_y const &y, T_loc const &mu, T_scale const &kappa)
 
template<typename T_loc , typename T_conc , class RNG >
VectorBuilder< true, double, T_loc, T_conc >::type stan::math::von_mises_rng (const T_loc &mu, const T_conc &kappa, RNG &rng)
 Return a von Mises random variate for the given location and concentration using the specified random number generator. More...
 
template<typename T_y , typename T_shape , typename T_scale >
return_type_t< T_y, T_shape, T_scale > stan::math::weibull_ccdf_log (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 
template<typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr>
return_type_t< T_y, T_shape, T_scale > stan::math::weibull_cdf (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 Returns the Weibull cumulative distribution function for the given location and scale. More...
 
template<typename T_y , typename T_shape , typename T_scale >
return_type_t< T_y, T_shape, T_scale > stan::math::weibull_cdf_log (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 
template<typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr>
return_type_t< T_y, T_shape, T_scale > stan::math::weibull_lccdf (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 Returns the Weibull log complementary cumulative distribution function for the given location and scale. More...
 
template<typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr>
return_type_t< T_y, T_shape, T_scale > stan::math::weibull_lcdf (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 Returns the Weibull log cumulative distribution function for the given location and scale. More...
 
template<bool propto, typename T_y , typename T_shape , typename T_scale >
return_type_t< T_y, T_shape, T_scale > stan::math::weibull_log (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 
template<typename T_y , typename T_shape , typename T_scale >
return_type_t< T_y, T_shape, T_scale > stan::math::weibull_log (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 
template<bool propto, typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr>
return_type_t< T_y, T_shape, T_scale > stan::math::weibull_lpdf (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 Returns the Weibull log probability density for the given location and scale. More...
 
template<typename T_shape , typename T_scale , class RNG >
VectorBuilder< true, double, T_shape, T_scale >::type stan::math::weibull_rng (const T_shape &alpha, const T_scale &sigma, RNG &rng)
 Return a Weibull random variate for the given shape and scale parameters using the specified random number generator. More...
 
template<bool propto, typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta >
return_type_t< T_y, T_alpha, T_tau, T_beta, T_delta > stan::math::wiener_log (const T_y &y, const T_alpha &alpha, const T_tau &tau, const T_beta &beta, const T_delta &delta)
 The log of the first passage time density function for a (Wiener) drift diffusion model for the given \(y\), boundary separation \(\alpha\), nondecision time \(\tau\), relative bias \(\beta\), and drift rate \(\delta\). More...
 
template<typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta >
return_type_t< T_y, T_alpha, T_tau, T_beta, T_delta > stan::math::wiener_log (const T_y &y, const T_alpha &alpha, const T_tau &tau, const T_beta &beta, const T_delta &delta)
 
template<bool propto, typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta >
return_type_t< T_y, T_alpha, T_tau, T_beta, T_delta > stan::math::wiener_lpdf (const T_y &y, const T_alpha &alpha, const T_tau &tau, const T_beta &beta, const T_delta &delta)
 The log of the first passage time density function for a (Wiener) drift diffusion model for the given \(y\), boundary separation \(\alpha\), nondecision time \(\tau\), relative bias \(\beta\), and drift rate \(\delta\). More...
 

Adding A New Distribution

Before reading this section it's a good idea to at least skim over the getting started guide. Stan's univariate distribution functions must work with mixes of scalars and vectors. This requirement can make the code for the distributions look a bit daunting, but in the below we'll cover each of the general steps needed to add a new distribution.
  1. Get the distribution working in the Stan language.
  2. Write out the partial derivatives for each input
  3. Writing the function
  4. Testing the function

Get the Distribution Working In Stan

We will use the normal distribution as an example and adding the lpdf function, though note for acceptance into Stan math a function must have its respective lpdf, lcdf, cdf, lccdf and rng implemented. Though we will only be doing the lpdf in the below all of the notes here will apply to the other functions.So for the normal distribution probability density function

\[ \text{Normal}(y|\mu,\sigma)=\frac{1}{\sigma \sqrt{2\pi}} e^{-\frac{1}{2}\left(\frac{y-\mu}{\sigma}\right)^2} \]

to get the log probability density function we log the above to get

\[ \ln{\left(\text{Normal}(y|\mu,\sigma)\right)}=-\frac{1}{2} \left(\frac{y-\mu}{\sigma}\right)^2 - \ln{\left(\sigma\right)} - \frac{1}{2}\ln{\left(2\pi\right)} \]

Now we can directly plug this into Stan as a custom lpdf function
1 real new_normal_lpdf (real y, real mu, real sigma){
2  return -0.5 * pow((y - mu) / sigma, 2) - log(sigma) - 0.5 * log(2*pi());
3 }
This is nice because now we can test this function against another implementations to verify its correctness. At this point it is a good idea to post something on discourse or file an issue to let folks know you would like to add this distribution.

Writing out the Partials

For an efficient implimentation of the distribution we want to calculate each of its partials with respect to the distributions inputs. This is easy for normal but can be rough for other distributions. In that case then matrixcalculus.org or wolframalpha is your friend. There we can plug in the lpdf and get back each of the partials.Note that for univariate distributions wolfram handles things a bit simpler, though for multivariate distributions you'll have to use matrixcalculus. Though for both you'll have a much nicer time if you plug in the log'd version of the function. One other nice thing about the matrixcalculus site is that it can generate latex which is nice for documentation.

\begin{aligned} f = \text{ln}\left(\text{Normal}(y|\mu,\sigma)\right) &= -\frac{1}{2} \left(\frac{y-\mu}{\sigma}\right)^2 - \ln\left(\sigma\right) - \frac{1}{2}\ln{\left(2\pi\right)} \cr \frac{\partial f}{\partial y} &= -\frac{y-\mu}{\sigma^{2}} \cr \frac{\partial f}{\partial \mu} &= \frac{y-\mu}{\sigma^{2}} \cr \frac{\partial f}{\partial \sigma} &= -\frac{1}{\sigma} + \frac{(y-\mu)^{2}}{\sigma^{3}} \end{aligned}

It's a little early, but once we get the lpdf function working with the above we will want to get out a pen and paper to simplify and find common subexpressions we only need to calculate once. For instance in the normal we can compute y - mu and 1/sigma

\begin{aligned} f(y|\mu,\sigma) = \text{ln}\left(\text{Normal}(y|\mu,\sigma)\right) &= -\frac{1}{2} \left(\frac{y-\mu}{\sigma}\right)^2 - \ln{\left(\sigma\right)} - \frac{1}{2}\ln{\left(2\pi\right)} \cr \frac{\partial f}{\partial y} &= -t_3 \cr \frac{\partial f}{\partial \mu} &= t_3 \cr \frac{\partial f}{\partial \sigma} &= \frac{t_{2}^2}{t_1} \cdot t_0 - t_0 \cr \text{Where} \cr t_0 &= \frac{1}{\sigma} \cr t_1 &= t_{0}^2 \cr t_2 &= y - \mu \cr t_3 &= \frac{t_2}{t_1} \end{aligned}

Writing the function

So now let's add the lpdf function in stan/math/prim/dist/new_normal_lpdf.hpp. First we'll go over what we have to do before we start doing any math. We'll be breaking down Stan's current normal_lpdf function which you can find here.

Distribution Signature

template <bool propto, typename T_y, typename T_loc, typename T_scale>
inline return_type_t<T_y, T_loc, T_scale> normal_lpdf(const T_y& y,
const T_loc& mu,
const T_scale& sigma) {}
Each of the input arguments represent the inputs to the Normal function we wrote out above. The template parameters for univariate distributions are very general and they must work for all of Stan's scalar types double, var, and fvar<T> while accepting mixtures of scalars and vectors. The return of the function is the joint log probability accumulated over all of the inputs which is a scalar of the least upper bound of all the parameters scalar types. That's a lot of big words, but in essence means that if one of the inputs is a var and the others are double the return type needs to be a var. If the input signature contained fvar<var>, var, double then the return type would be fvar<var>. See the Common pitfalls for an explanation of return_type_t.Notice the bool propto template parameter, this is used by the function to decide whether or not the function needs to propagate constants to the joint log probability we'll be calculating.

Preparing the Parameters

At the start of the function we need to take each argument, deduce whether it is an unevaluated Eigen expression, and extract the values from them and then convert them into Eigen::Array types. ref_type_t is the return type of to_ref() which is explained in the getting started guide. ret_type_if_t<> will conditionally evaluate Eigen expressions if both the Eigen type passed is an Eigen expression and the compile time conditional passed to the function is also true.
// Making aliases for partials and unevaluated expressions
using T_partials_return = partials_return_t<T_y, T_loc, T_scale>;
using T_y_ref = ref_type_if_t<!is_constant<T_y>::value, T_y>;
using T_mu_ref = ref_type_if_t<!is_constant<T_loc>::value, T_loc>;
using T_sigma_ref = ref_type_if_t<!is_constant<T_scale>::value, T_scale>;
// Evaluating unevaluated eigen expressions
T_y_ref y_ref = y;
T_mu_ref mu_ref = mu;
T_sigma_ref sigma_ref = sigma;
// Extracting values from arguments
decltype(auto) y_val = to_ref(as_value_column_array_or_scalar(y_ref));
decltype(auto) mu_val = to_ref(as_value_column_array_or_scalar(mu_ref));
decltype(auto) sigma_val = to_ref(as_value_column_array_or_scalar(sigma_ref));

Checking Correctness of the Inputs and Early Return

Then we need to check that all the vector inputs sizes match, and then check that each of the inputs satisfies the conditions of the distribution. For the normal distribution we need to check that y does not contain nan values, mu is finite, and sigma is positive.
check_consistent_sizes(function, "Random variable", y, "Location parameter",
mu, "Scale parameter", sigma);
check_not_nan(function, "Random variable", y_val);
check_finite(function, "Location parameter", mu_val);
check_positive(function, "Scale parameter", sigma_val);
if (size_zero(y, mu, sigma)) {
return 0.0;
}
if (!include_summand<propto, T_y, T_loc, T_scale>::value) {
return 0.0;
}
The if statements here are checking if
  1. Any of the inputs are length zero
  2. Either the function drops constants propto=true and all of the inputs are constant (aka if they are all of type double).
If either of the two conditions are met then there's no need to calculate the rest of the lpdf function and we can return back zero.

Actually Doing The Math

Woof! That was a good bit of stuff just to get to the math, but here we are! Our goal is to calculate the partial adjoints using our stuff above, but we only want to bother ourselves to calculate adjoints of parameters which are not constant (double). There's some more technical bits to building the log joint probability, but those are all hidden away in the operands_and_partials class so we won't cover those here. For now you can take the evaluated inputs and pass them to the operands_and_partials class
operands_and_partials<T_y_ref, T_mu_ref, T_sigma_ref> ops_partials(
y_ref, mu_ref, sigma_ref);
This sets up each of the input operand's partials so that we only store and calculate the ones we need.


On a side note it would be nice to have a helper function like make_ops_partials which would construct that class and then we could simply write
auto ops_partials = make_ops_partials(y_ref, mu_ref, sigma_ref);
This would let us also cleanup the aliases for the unevaluated Eigen expressions so we could use to_ref_if() such as
decltype(auto) y_ref = to_ref_if<!is_constant<T_y>::value>(y);
decltype(auto) mu_ref = to_ref_if<!is_constant<T_mu>::value>(mu);
decltype(auto) sigma_ref = to_ref_if<!is_constant<T_sigma>::value>(sigma);

There's two ways of doing the math, one using a simple loop and another utilizing Eigen expressions. Below I will cover both starting with the loop version.

Doing The Math With A Loop

The loop version requires one other piece of overhead to make sure that vectors and scalars can both be iterated over in the loop.
// Make scalars and vectors iterable
scalar_seq_view<decltype(y_val)> y_vec(y_val);
scalar_seq_view<decltype(mu_val)> mu_vec(mu_val);
scalar_seq_view<decltype(sigma_val)> sigma_vec(sigma_val);
For vectors, scalar_seq_view simply holds a reference to the vector it's passed and calling scalar_seq_view's method .val(i) will return element i in the vector after calling value_of() on the element. The actual element can be accessed with operator[]. For scalars, scalar_seq_view's .val(i) and operator[] will just return the scalar no matter what index is passed.But with that now we can get the maximum size of the input arguments and run a loop calculating the partials for each input argument's values.
size_t N = max_size(y, mu, sigma);
// Stores the accumulated value from the lpdf from operands
T_partials_return logp(0.0);
constexpr double NEGATIVE_HALF = -0.5;
// Include constant if user asked for them.
if (include_summand<propto>::value) {
logp += NEG_LOG_SQRT_TWO_PI * N;
}
for (size_t n = 0; n < N; n++) {
// Do the intermediate calculations from above
const T_partials_return y_dbl = y_vec.val(n);
const T_partials_return mu_dbl = mu_vec.val(n));
const T_partials_return inv_sigma = 1.0 / sigma_vec.val(n);
const T_partials_return log_sigma = log(sigma_vec.val(n));
const T_partials_return y_minus_mu_over_sigma
= (y_dbl - mu_dbl) * inv_sigma;
const T_partials_return y_minus_mu_over_sigma_squared
= y_minus_mu_over_sigma * y_minus_mu_over_sigma;
// Include constants if user asked for them.
if (include_summand<propto, T_scale>::value) {
logp -= log_sigma;
}
logp += NEGATIVE_HALF * y_minus_mu_over_sigma_squared;
// Add partial calculations to each edge
T_partials_return scaled_diff = inv_sigma * y_minus_mu_over_sigma;
if (!is_constant<T_y>::value) {
ops_partials.edge1_.partials_[n] -= scaled_diff;
}
if (!is_constant<T_loc>::value) {
ops_partials.edge2_.partials_[n] += scaled_diff;
}
if (!is_constant<T_scale>::value) {
ops_partials.edge3_.partials_[n]
+= -inv_sigma + inv_sigma * y_minus_mu_over_sigma_squared;
}
}
// return `logp` and handle rules for propagating partials for each autodiff type.
return ops_partials.build(logp);
The logp is used to accumulate the log probability density function's value, where propto is used to decide whether or not that value should have constants added or dropped.The odd bits here are mostly the ifs that include include_summand<propto> and !is_constant_all<T_loc>. We want to only compute the partials and accumulate the constants if those values are not constant (double), so we have an if statement here, which since the conditional is a type trait whose value is known at compile time we won't pay for any of these if they are constant. And the compiler will remove the ifs that are false during the dead code elimination phase of optimization.We collect the partials for each of our inputs via their respective edge*_ in the operands_and_partials class. The first argument will have edge1_, the second edge2_ and so on. One important question to ask here is, what if the edge is a scalar? It seems odd that we are able to call partials_[n] when the operand can be either a vector or scalar. Under the hood, operands_and_partials wraps the partials for Scalar types in what's called a broadcast_array which has an overloaded operator[] for scalars such that it just simply returns back the partials scalar. Similarly, broadcast_array has an overloaded operator= which when assigning a vector to the partial the overloaded operator= will sum the vector before assigning it to the partial.
if (!is_constant<T_loc>::value) {
// pretend partials_ is a scalar and scaled_diff is a vector
ops_partials.edge2_.partials_ = scaled_diff;
}
Finally once the loop is finished we call ops_partials.build() passing it the joint log probability value. For reverse mode this will place a callback on the callback stack that takes the edge for each partial_ and accumulates them into operands adjoint.The for loop version is nice and simple, but there's a few things for performance that we can do better. For instance, in the for loop version we are constantly reading and writing to memory from a bunch of different places. We can fix that by rewriting the above to use multiple loops, but unless we have separate loops that turn on and off for when combinations of partials need to be calculated then we lose places where we can share calculations between partials.For a more efficient version we can do the math for the partials with no loop and possibly sharing computation.

Doing The Math With Eigen

The below code replaces the loop above with Eigen. It uses most of the same tricks we've used previously.
// Only evaluate inv_sigma here if it's going to be used more than once
const auto& inv_sigma
= to_ref_if<!is_constant_all<T_y, T_scale, T_loc>::value>(inv(sigma_val));
const auto& y_scaled = to_ref((y_val - mu_val) * inv_sigma);
// Only evaluate y_scaled_sq here if T_scale is not constant
const auto& y_scaled_sq
= to_ref_if<!is_constant<T_scale>::value>(y_scaled * y_scaled);
size_t N = max_size(y, mu, sigma);
T_partials_return logp = -0.5 * sum(y_scaled_sq);
if (include_summand<propto>::value) {
logp += NEG_LOG_SQRT_TWO_PI * N;
}
// division by size of sigma is a trick to work with vectors and scalars
if (include_summand<propto, T_scale>::value) {
logp -= sum(log(sigma_val)) * N / size(sigma);
}
if (!is_constant_all<T_y, T_scale, T_loc>::value) {
// Evaluate this if it's only used once
auto scaled_diff = to_ref_if<!is_constant<T_y>::value
+ !is_constant<T_scale>::value
+ !is_constant<T_loc>::value
>= 2>(inv_sigma * y_scaled);
if (!is_constant<T_y>::value) {
ops_partials.edge1_.partials_ = -scaled_diff;
}
if (!is_constant<T_scale>::value) {
ops_partials.edge3_.partials_ = inv_sigma * y_scaled_sq - inv_sigma;
}
if (!is_constant<T_loc>::value) {
ops_partials.edge2_.partials_ = std::move(scaled_diff);
}
}
return ops_partials.build(logp);
}
Some of the same tricks from the above sections are used here in clever ways. For instance, when calculating inv_sigma, if that expression is used for calculating multiple partials then we want to evaluate it once on that line and reuse the precomputed operation multiple times in the preceding code. However if it's not used multiple times then we just want an expression that will then later be evaluated at its final destination. The same happens for y_scaled_sq and scaled_diff.One odd piece of code here is
// division by size of sigma is a trick to work with vectors and scalars
if (include_summand<propto, T_scale>::value) {
logp -= sum(log(sigma_val)) * N / size(sigma);
}
If sigma_val is a scalar then we want to decrement the joint log probability by log(sigma_val) * N, but if it's a vector we want to decrement it by sum(log(sigma_val)). In Stan, passing a scalar to sum() is a no-op that just returns back the scalar, so we can use that to have the left hand side of the multiply work with both vectors and scalars. We always multiply the returned scalar from sum() by N, which we don't want if sigma_val is a vector. So then we just divide by the size() of sigma, which for a scalar will be 1 and for a vector will be N.It might be easier to see how this would look if Stan used C++17
if (include_summand<propto, T_scale>::value) {
if constexpr (is_vector<T_scale>::value) {
logp -= sum(log(sigma_val));
} else {
logp -= log(sigma_val) * N;
}
}

Side Note: We should make size() constexpr for scalars so then tricks like this let the compiler see we are doing division by 1 and will remove the operation.


But that's it, you can see the full normal_lpdf function here in Stan that uses the Eigen version.One other little piece you'll want to do is add a normal_lpdf function with the exact same signature but without the propto parameter. Unless told otherwise we don't assume users want the proportional constants added so we have a default signature that does not require setting the propto parameter.
template <typename T_y, typename T_loc, typename T_scale>
inline return_type_t<T_y, T_loc, T_scale> normal_lpdf(const T_y& y,
const T_loc& mu,
const T_scale& sigma) {
return normal_lpdf<false>(y, mu, sigma);
}

Testing The Distribution

For testing the new distribution you'll be adding to the Distribution Testing Framework. In test/prob you will add a new folder with the name of your distribution with the .hpp files for generating the tests inside of it. Looking at the normal distribution testing files you'll see you need
  • mydist_test.hpp containing a class inheriting from AgradDistributionTest containing methods
    • valid_values() which fills the [in/out] params argument with valued testing values for your distribution and the [in/out] log_prob argument with the log probability given those parameters.
    • invalid_values() which fills the [in/out] value argument with testing values that should fail.
    • Two log_prob() methods which calls your distribution, one with propto and the other without.
    • log_prob_function() which is the log probability density function's simple implementation much like the one you wrote in Stan.
The other test files are quite similar, though note the normal cdf test uses some extra numeric tricks where for example the tests for gumbel_lcdf are very similar to the normal_lpdf test.Once you've added those files you can run your tests for your distribution with ./runTests.py pointing it to the folder containing your tests. This will generate all of the tests for each of Stan's scalar types and mixes of scalars and vectors.
1 ./runTests.py ./test/prob/mydist/
For more details see the distribution testing docs.

That's it!

The above should cover all of the lpdf, lcdf, cdf, lccdf and rng functions needed to add a new distribution to Stan. If you have further questions please reach out on our discourse or file an issue!

Function Documentation

template<typename T_n , typename T_prob >
return_type_t<T_prob> stan::math::bernoulli_ccdf_log ( const T_n &  n,
const T_prob &  theta 
)
Deprecated:
use bernoulli_lccdf

Definition at line 14 of file bernoulli_ccdf_log.hpp.

template<typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t<T_prob_cl> stan::math::bernoulli_cdf ( const T_n_cl &  n,
const T_prob_cl &  theta 
)

Returns the CDF of the Bernoulli distribution.

If containers are supplied, returns the product of the probabilities.

Template Parameters
T_n_cltype of integer parameter
T_prob_cltype of chance of success parameter
Parameters
ninteger parameter
thetalogit-transformed chance of success parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif theta is not a valid probability
std::invalid_argumentif container sizes mismatch.

Definition at line 30 of file bernoulli_cdf.hpp.

template<typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr>
return_type_t<T_prob> stan::math::bernoulli_cdf ( const T_n &  n,
const T_prob &  theta 
)

Returns the CDF of the Bernoulli distribution.

If containers are supplied, returns the product of the probabilities.

Template Parameters
T_ntype of integer parameter
T_probtype of chance of success parameter
Parameters
ninteger parameter
thetachance of success parameter
Returns
probability or product of probabilities
Exceptions
std::domain_errorif theta is not a valid probability
std::invalid_argumentif container sizes mismatch.

Definition at line 32 of file bernoulli_cdf.hpp.

template<typename T_n , typename T_prob >
return_type_t<T_prob> stan::math::bernoulli_cdf_log ( const T_n &  n,
const T_prob &  theta 
)
Deprecated:
use bernoulli_lcdf

Definition at line 14 of file bernoulli_cdf_log.hpp.

template<typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t<T_prob_cl> stan::math::bernoulli_lccdf ( const T_n_cl &  n,
const T_prob_cl &  theta 
)

Returns the log CCDF of the Bernoulli distribution.

If containers are supplied, returns the log sum of the probabilities.

Template Parameters
T_n_cltype of integer parameter
T_prob_cltype of chance of success parameter
Parameters
ninteger parameter
thetalogit-transformed chance of success parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif theta is not a valid probability
std::invalid_argumentif container sizes mismatch.

Definition at line 31 of file bernoulli_lccdf.hpp.

template<typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr>
return_type_t<T_prob> stan::math::bernoulli_lccdf ( const T_n &  n,
const T_prob &  theta 
)

Returns the log CCDF of the Bernoulli distribution.

If containers are supplied, returns the log sum of the probabilities.

Template Parameters
T_ntype of integer parameter
T_probtype of chance of success parameter
Parameters
ninteger parameter
thetachance of success parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif theta is not a valid probability
std::invalid_argumentif container sizes mismatch.

Definition at line 35 of file bernoulli_lccdf.hpp.

template<typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t<T_prob_cl> stan::math::bernoulli_lcdf ( const T_n_cl &  n,
const T_prob_cl &  theta 
)

Returns the log CDF of the Bernoulli distribution.

If containers are supplied, returns the log sum of the probabilities.

Template Parameters
T_n_cltype of integer parameter
T_prob_cltype of chance of success parameter
Parameters
ninteger parameter
thetalogit-transformed chance of success parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif theta is not a valid probability
std::invalid_argumentif container sizes mismatch.

Definition at line 31 of file bernoulli_lcdf.hpp.

template<typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr>
return_type_t<T_prob> stan::math::bernoulli_lcdf ( const T_n &  n,
const T_prob &  theta 
)

Returns the log CDF of the Bernoulli distribution.

If containers are supplied, returns the log sum of the probabilities.

Template Parameters
T_ntype of integer parameter
T_probtype of chance of success parameter
Parameters
ninteger parameter
thetachance of success parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif theta is not a valid probability
std::invalid_argumentif container sizes mismatch.

Definition at line 35 of file bernoulli_lcdf.hpp.

template<bool propto, typename T_n , typename T_prob >
return_type_t<T_prob> stan::math::bernoulli_log ( const T_n &  n,
const T_prob &  theta 
)
Deprecated:
use bernoulli_lpmf

Definition at line 14 of file bernoulli_log.hpp.

template<typename T_y , typename T_prob >
return_type_t<T_prob> stan::math::bernoulli_log ( const T_y &  n,
const T_prob &  theta 
)
inline
Deprecated:
use bernoulli_lpmf

Definition at line 22 of file bernoulli_log.hpp.

template<bool propto, typename T_n , typename T_prob >
return_type_t<T_prob> stan::math::bernoulli_logit_log ( const T_n &  n,
const T_prob &  theta 
)
Deprecated:
use bernoulli_logit_lpmf

Definition at line 14 of file bernoulli_logit_log.hpp.

template<typename T_n , typename T_prob >
return_type_t<T_prob> stan::math::bernoulli_logit_log ( const T_n &  n,
const T_prob &  theta 
)
inline
Deprecated:
use bernoulli_logit_lpmf

Definition at line 22 of file bernoulli_logit_log.hpp.

template<bool propto, typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t<T_prob_cl> stan::math::bernoulli_logit_lpmf ( const T_n_cl &  n,
const T_prob_cl &  theta 
)

Returns the log PMF of the logit-parametrized Bernoulli distribution.

If containers are supplied, returns the log sum of the probabilities.

Template Parameters
T_n_cltype of integer parameter
T_prob_cltype of chance of success parameter
Parameters
ninteger parameter
thetalogit-transformed chance of success parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif theta is infinite.
std::invalid_argumentif container sizes mismatch.

Definition at line 29 of file bernoulli_logit_lpmf.hpp.

template<bool propto, typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr>
return_type_t<T_prob> stan::math::bernoulli_logit_lpmf ( const T_n &  n,
const T_prob &  theta 
)

Returns the log PMF of the logit-parametrized Bernoulli distribution.

If containers are supplied, returns the log sum of the probabilities.

Template Parameters
T_ntype of integer parameter
T_probtype of chance of success parameter
Parameters
ninteger parameter
thetalogit-transformed chance of success parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif theta is infinite.
std::invalid_argumentif container sizes mismatch.

Definition at line 36 of file bernoulli_logit_lpmf.hpp.

template<typename T_t , class RNG >
VectorBuilder<true, int, T_t>::type stan::math::bernoulli_logit_rng ( const T_t &  t,
RNG &  rng 
)
inline

Return a Bernoulli random variate with logit-parameterized chance of success using the specified random number generator.

t can be a scalar or a one-dimensional container.

Template Parameters
T_ttype of logit-parameterized chance of success parameter
RNGtype of random number generator
Parameters
t(Sequence of) logit-parameterized chance of success parameter(s)
rngrandom number generator
Returns
(Sequence of) Bernoulli random variate(s)
Exceptions
std::domain_errorif logit-parameterized chance of success parameter is not finite

Definition at line 30 of file bernoulli_logit_rng.hpp.

template<bool propto, typename T_n , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_prob > * = nullptr>
return_type_t<T_prob> stan::math::bernoulli_lpmf ( const T_n &  n,
const T_prob &  theta 
)

Returns the log PMF of the Bernoulli distribution.

If containers are supplied, returns the log sum of the probabilities.

Template Parameters
T_ntype of integer parameters
T_probtype of chance of success parameters
Parameters
ninteger parameter
thetachance of success parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif theta is not a valid probability
std::invalid_argumentif container sizes mismatch.

Definition at line 34 of file bernoulli_lpmf.hpp.

template<typename T_theta , class RNG >
VectorBuilder<true, int, T_theta>::type stan::math::bernoulli_rng ( const T_theta &  theta,
RNG &  rng 
)
inline

Return a Bernoulli random variate with specified chance of success parameter using the specified random number generator.

theta can be a scalar or a one-dimensional container.

Template Parameters
T_thetatype of chance of success parameter
RNGtype of random number generator
Parameters
theta(Sequence of) chance of success parameter(s)
rngrandom number generator
Returns
(Sequence of) Bernoulli random variate(s)
Exceptions
std::domain_errorif chance of success parameter is less than zero or greater than one.

Definition at line 29 of file bernoulli_rng.hpp.

template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t<T_size1, T_size2> stan::math::beta_binomial_ccdf_log ( const T_n &  n,
const T_N &  N,
const T_size1 &  alpha,
const T_size2 &  beta 
)
Deprecated:
use beta_binomial_lccdf

Definition at line 14 of file beta_binomial_ccdf_log.hpp.

template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t<T_size1, T_size2> stan::math::beta_binomial_cdf ( const T_n &  n,
const T_N &  N,
const T_size1 &  alpha,
const T_size2 &  beta 
)

Returns the CDF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters.

Given containers of matching sizes, returns the product of probabilities.

Template Parameters
T_ntype of success parameter
T_Ntype of population size parameter
T_size1type of prior success parameter
T_size2type of prior failure parameter
Parameters
nsuccess parameter
Npopulation size parameter
alphaprior success parameter
betaprior failure parameter
Returns
probability or product of probabilities
Exceptions
std::domain_errorif N, alpha, or beta fails to be positive
std::invalid_argumentif container sizes mismatch

Definition at line 43 of file beta_binomial_cdf.hpp.

template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t<T_size1, T_size2> stan::math::beta_binomial_cdf_log ( const T_n &  n,
const T_N &  N,
const T_size1 &  alpha,
const T_size2 &  beta 
)
Deprecated:
use beta_binomial_lcdf

Definition at line 14 of file beta_binomial_cdf_log.hpp.

template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t<T_size1, T_size2> stan::math::beta_binomial_lccdf ( const T_n &  n,
const T_N &  N,
const T_size1 &  alpha,
const T_size2 &  beta 
)

Returns the log CCDF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters.

Given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ntype of success parameter
T_Ntype of population size parameter
T_size1type of prior success parameter
T_size2type of prior failure parameter
Parameters
nsuccess parameter
Npopulation size parameter
alphaprior success parameter
betaprior failure parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif N, alpha, or beta fails to be positive
std::invalid_argumentif container sizes mismatch

Definition at line 44 of file beta_binomial_lccdf.hpp.

template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t<T_size1, T_size2> stan::math::beta_binomial_lcdf ( const T_n &  n,
const T_N &  N,
const T_size1 &  alpha,
const T_size2 &  beta 
)

Returns the log CDF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters.

Given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ntype of success parameter
T_Ntype of population size parameter
T_size1type of prior success parameter
T_size2type of prior failure parameter
Parameters
nsuccess parameter
Npopulation size parameter
alphaprior success parameter
betaprior failure parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif N, alpha, or beta fails to be positive
std::invalid_argumentif container sizes mismatch

Definition at line 44 of file beta_binomial_lcdf.hpp.

template<bool propto, typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t<T_size1, T_size2> stan::math::beta_binomial_log ( const T_n &  n,
const T_N &  N,
const T_size1 &  alpha,
const T_size2 &  beta 
)
Deprecated:
use beta_binomial_lpmf

Definition at line 15 of file beta_binomial_log.hpp.

template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type_t<T_size1, T_size2> stan::math::beta_binomial_log ( const T_n &  n,
const T_N &  N,
const T_size1 &  alpha,
const T_size2 &  beta 
)
Deprecated:
use beta_binomial_lpmf

Definition at line 26 of file beta_binomial_log.hpp.

template<bool propto, typename T_n , typename T_N , typename T_size1 , typename T_size2 , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_N, T_size1, T_size2 > * = nullptr>
return_type_t<T_size1, T_size2> stan::math::beta_binomial_lpmf ( const T_n &  n,
const T_N &  N,
const T_size1 &  alpha,
const T_size2 &  beta 
)

Returns the log PMF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters.

Given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ntype of success parameter
T_Ntype of population size parameter
T_size1type of prior success parameter
T_size2type of prior failure parameter
Parameters
nsuccess parameter
Npopulation size parameter
alphaprior success parameter
betaprior failure parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif N, alpha, or beta fails to be positive
std::invalid_argumentif container sizes mismatch

Definition at line 44 of file beta_binomial_lpmf.hpp.

template<typename T_N , typename T_shape1 , typename T_shape2 , class RNG >
VectorBuilder<true, int, T_N, T_shape1, T_shape2>::type stan::math::beta_binomial_rng ( const T_N &  N,
const T_shape1 &  alpha,
const T_shape2 &  beta,
RNG &  rng 
)
inline

Return a beta-binomial random variate with the specified population size, success, and failure parameters using the given random number generator.

N, alpha, and beta can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_NType of population size parameter
T_shape1Type of success parameter
T_shape2Type of failure parameter
RNGtype of random number generator
Parameters
N(Sequence of) population size parameter(s)
alpha(Sequence of) positive success parameter(s)
beta(Sequence of) positive failure parameter(s)
rngrandom number generator
Returns
(Sequence of) beta-binomial random variate(s)
Exceptions
std::domain_errorif N is negative, or alpha or beta are nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 33 of file beta_binomial_rng.hpp.

template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t<T_y, T_scale_succ, T_scale_fail> stan::math::beta_ccdf_log ( const T_y &  y,
const T_scale_succ &  alpha,
const T_scale_fail &  beta 
)
Deprecated:
use beta_lccdf

Definition at line 14 of file beta_ccdf_log.hpp.

template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t<T_y, T_scale_succ, T_scale_fail> stan::math::beta_cdf ( const T_y &  y,
const T_scale_succ &  alpha,
const T_scale_fail &  beta 
)

Calculates the beta cumulative distribution function for the given variate and scale variables.

Parameters
yA scalar variate.
alphaPrior sample size.
betaPrior sample size.
Returns
The beta cdf evaluated at the specified arguments.
Template Parameters
T_yType of y.
T_scale_succType of alpha.
T_scale_failType of beta.

Definition at line 36 of file beta_cdf.hpp.

template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t<T_y, T_scale_succ, T_scale_fail> stan::math::beta_cdf_log ( const T_y &  y,
const T_scale_succ &  alpha,
const T_scale_fail &  beta 
)
Deprecated:
use beta_lcdf

Definition at line 14 of file beta_cdf_log.hpp.

template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t<T_y, T_scale_succ, T_scale_fail> stan::math::beta_lccdf ( const T_y &  y,
const T_scale_succ &  alpha,
const T_scale_fail &  beta_param 
)

Returns the beta log complementary cumulative distribution function for the given probability, success, and failure parameters.

Any arguments other than scalars must be containers of the same size. With non-scalar arguments, the return is the sum of the log ccdfs with scalars broadcast as necessary.

Template Parameters
T_ytype of y
T_scale_succtype of success parameter
T_scale_failtype of failure parameter
Parameters
y(Sequence of) scalar(s) between zero and one
alpha(Sequence of) success parameter(s)
beta_param(Sequence of) failure parameter(s)
Returns
log probability or sum of log of probabilities
Exceptions
std::domain_errorif alpha or beta is negative
std::domain_errorif y is not a valid probability
std::invalid_argumentif container sizes mismatch

Definition at line 41 of file beta_lccdf.hpp.

template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t<T_y, T_scale_succ, T_scale_fail> stan::math::beta_lcdf ( const T_y &  y,
const T_scale_succ &  alpha,
const T_scale_fail &  beta_param 
)

Returns the beta log cumulative distribution function for the given probability, success, and failure parameters.

Any arguments other than scalars must be containers of the same size. With non-scalar arguments, the return is the sum of the log cdfs with scalars broadcast as necessary.

Template Parameters
T_ytype of y
T_scale_succtype of success parameter
T_scale_failtype of failure parameter
Parameters
y(Sequence of) scalar(s) between zero and one
alpha(Sequence of) success parameter(s)
beta_param(Sequence of) failure parameter(s)
Returns
log probability or sum of log of probabilities
Exceptions
std::domain_errorif alpha or beta is negative
std::domain_errorif y is not a valid probability
std::invalid_argumentif container sizes mismatch

Definition at line 41 of file beta_lcdf.hpp.

template<bool propto, typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t<T_y, T_scale_succ, T_scale_fail> stan::math::beta_log ( const T_y &  y,
const T_scale_succ &  alpha,
const T_scale_fail &  beta 
)
Deprecated:
use beta_lpdf

Definition at line 15 of file beta_log.hpp.

template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type_t<T_y, T_scale_succ, T_scale_fail> stan::math::beta_log ( const T_y &  y,
const T_scale_succ &  alpha,
const T_scale_fail &  beta 
)
inline
Deprecated:
use beta_lpdf

Definition at line 24 of file beta_log.hpp.

template<bool propto, typename T_y , typename T_scale_succ , typename T_scale_fail , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale_succ, T_scale_fail > * = nullptr>
return_type_t<T_y, T_scale_succ, T_scale_fail> stan::math::beta_lpdf ( const T_y &  y,
const T_scale_succ &  alpha,
const T_scale_fail &  beta 
)

The log of the beta density for the specified scalar(s) given the specified sample stan::math::size(s).

y, alpha, or beta can each either be scalar or a vector. Any vector inputs must be the same length.

The result log probability is defined to be the sum of the log probabilities for each observation/alpha/beta triple.

Prior sample sizes, alpha and beta, must be greater than 0.

Template Parameters
T_ytype of scalar outcome
T_scale_succtype of prior scale for successes
T_scale_failtype of prior scale for failures
Parameters
y(Sequence of) scalar(s).
alpha(Sequence of) prior sample stan::math::size(s).
beta(Sequence of) prior sample stan::math::size(s).
Returns
The log of the product of densities.

Definition at line 47 of file beta_lpdf.hpp.

template<typename T_y , typename T_loc , typename T_prec >
return_type_t<T_y, T_loc, T_prec> stan::math::beta_proportion_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_prec &  kappa 
)
Deprecated:
use beta_proportion_lccdf

Definition at line 14 of file beta_proportion_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_prec >
return_type_t<T_y, T_loc, T_prec> stan::math::beta_proportion_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_prec &  kappa 
)
Deprecated:
use beta_proportion_lcdf

Definition at line 14 of file beta_proportion_cdf_log.hpp.

template<typename T_y , typename T_loc , typename T_prec >
return_type_t<T_y, T_loc, T_prec> stan::math::beta_proportion_lccdf ( const T_y &  y,
const T_loc &  mu,
const T_prec &  kappa 
)

Returns the beta log complementary cumulative distribution function for specified probability, location, and precision parameters: beta_proportion_lccdf(y | mu, kappa) = beta_lccdf(y | mu * kappa, (1 - mu) * kappa).

Any arguments other than scalars must be containers of the same size. With non-scalar arguments, the return is the sum of the log ccdfs with scalars broadcast as necessary.

Template Parameters
T_ytype of y
T_loctype of location parameter
T_prectype of precision parameter
Parameters
y(Sequence of) scalar(s) between zero and one
mu(Sequence of) location parameter(s)
kappa(Sequence of) precision parameter(s)
Returns
log probability or sum of log of probabilities
Exceptions
std::domain_errorif mu is outside (0, 1)
std::domain_errorif kappa is nonpositive
std::domain_errorif 1 - y is not a valid probability
std::invalid_argumentif container sizes mismatch

Definition at line 44 of file beta_proportion_lccdf.hpp.

template<typename T_y , typename T_loc , typename T_prec >
return_type_t<T_y, T_loc, T_prec> stan::math::beta_proportion_lcdf ( const T_y &  y,
const T_loc &  mu,
const T_prec &  kappa 
)

Returns the beta log cumulative distribution function for specified probability, location, and precision parameters: beta_proportion_lcdf(y | mu, kappa) = beta_lcdf(y | mu * kappa, (1 - mu) * kappa).

Any arguments other than scalars must be containers of the same size. With non-scalar arguments, the return is the sum of the log cdfs with scalars broadcast as necessary.

Template Parameters
T_ytype of y
T_loctype of location parameter
T_prectype of precision parameter
Parameters
y(Sequence of) scalar(s) between zero and one
mu(Sequence of) location parameter(s)
kappa(Sequence of) precision parameter(s)
Returns
log probability or sum of log of probabilities
Exceptions
std::domain_errorif mu is outside of (0, 1)
std::domain_errorif kappa is nonpositive
std::domain_errorif y is not a valid probability
std::invalid_argumentif container sizes mismatch

Definition at line 45 of file beta_proportion_lcdf.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_prec >
return_type_t<T_y, T_loc, T_prec> stan::math::beta_proportion_log ( const T_y &  y,
const T_loc &  mu,
const T_prec &  kappa 
)
Deprecated:
use beta_proportion_lpdf

Definition at line 14 of file beta_proportion_log.hpp.

template<typename T_y , typename T_loc , typename T_prec >
return_type_t<T_y, T_loc, T_prec> stan::math::beta_proportion_log ( const T_y &  y,
const T_loc &  mu,
const T_prec &  kappa 
)
inline
Deprecated:
use beta_proportion_lpdf

Definition at line 24 of file beta_proportion_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_prec , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_prec > * = nullptr>
return_type_t<T_y, T_loc, T_prec> stan::math::beta_proportion_lpdf ( const T_y &  y,
const T_loc &  mu,
const T_prec &  kappa 
)

The log of the beta density for specified y, location, and precision: beta_proportion_lpdf(y | mu, kappa) = beta_lpdf(y | mu * kappa, (1 - mu) * kappa).

Any arguments other than scalars must be containers of the same size. With non-scalar arguments, the return is the sum of the log pdfs with scalars broadcast as necessary.

The result log probability is defined to be the sum of the log probabilities for each observation/mu/kappa triple.

Prior location, mu, must be contained in (0, 1). Prior precision must be positive.

Template Parameters
T_ytype of scalar outcome
T_loctype of prior location
T_prectype of prior precision
Parameters
y(Sequence of) scalar(s) between zero and one
mu(Sequence of) location parameter(s)
kappa(Sequence of) precision parameter(s)
Returns
The log of the product of densities.

Definition at line 51 of file beta_proportion_lpdf.hpp.

template<typename T_loc , typename T_prec , class RNG >
VectorBuilder<true, double, T_loc, T_prec>::type stan::math::beta_proportion_rng ( const T_loc &  mu,
const T_prec &  kappa,
RNG &  rng 
)
inline

Return a Beta random variate specified probability, location, and precision parameters: beta_proportion_rng(y | mu, kappa) = beta_rng(y | mu * kappa, (1 - mu) * kappa).

Any arguments other than scalars must be containers of the same size. With non-scalar arguments, the return is a container matching the size of the arguments with scalars broadcast as necessary.

Template Parameters
T_locType of location parameter
T_precType of precision parameter
RNGtype of random number generator
Parameters
mu(Sequence of) location parameter(s) in (0, 1)
kappa(Sequence of) positive finite precision parameter(s)
rngrandom number generator
Returns
(Sequence of) beta random variate(s)
Exceptions
std::domain_errorif mu is outside of (0, 1)
std::domain_errorif kappa is nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 36 of file beta_proportion_rng.hpp.

template<typename T_shape1 , typename T_shape2 , class RNG >
VectorBuilder<true, double, T_shape1, T_shape2>::type stan::math::beta_rng ( const T_shape1 &  alpha,
const T_shape2 &  beta,
RNG &  rng 
)
inline

Return a Beta random variate with the supplied success and failure parameters using the given random number generator.

alpha and beta can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_shape1type of success parameter
T_shape2type of failure parameter
RNGtype of random number generator
Parameters
alpha(Sequence of) positive finite success parameter(s)
beta(Sequence of) positive finite failure parameter(s)
rngrandom number generator
Returns
(Sequence of) beta random variate(s)
Exceptions
std::domain_errorif alpha or beta are nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 36 of file beta_rng.hpp.

template<typename T_n , typename T_N , typename T_prob >
return_type_t<T_prob> stan::math::binomial_ccdf_log ( const T_n &  n,
const T_N &  N,
const T_prob &  theta 
)
Deprecated:
use binomial_lccdf

Definition at line 14 of file binomial_ccdf_log.hpp.

template<typename T_n , typename T_N , typename T_prob >
return_type_t<T_prob> stan::math::binomial_cdf ( const T_n &  n,
const T_N &  N,
const T_prob &  theta 
)

Returns the CDF for the binomial distribution evaluated at the specified success, population size, and chance of success.

If given containers of matching lengths, returns the product of probabilities.

Template Parameters
T_ntype of successes parameter
T_Ntype of population size parameter
thetatype of chance of success parameter
Parameters
nsuccesses parameter
Npopulation size parameter
thetachance of success parameter
Returns
probability or product of probabilities
Exceptions
std::domain_errorif N is negative
std::domain_errorif theta is not a valid probability
std::invalid_argumentif container sizes mismatch

Definition at line 36 of file binomial_cdf.hpp.

template<typename T_n , typename T_N , typename T_prob >
return_type_t<T_prob> stan::math::binomial_cdf_log ( const T_n &  n,
const T_N &  N,
const T_prob &  theta 
)
Deprecated:
use binomial_lcdf

Definition at line 14 of file binomial_cdf_log.hpp.

template<typename T_n , typename T_N , typename T_prob >
return_type_t<T_prob> stan::math::binomial_lccdf ( const T_n &  n,
const T_N &  N,
const T_prob &  theta 
)

Returns the log CCDF for the binomial distribution evaluated at the specified success, population size, and chance of success.

If given containers of matching lengths, returns the log sum of probabilities.

Template Parameters
T_ntype of successes parameter
T_Ntype of population size parameter
thetatype of chance of success parameter
Parameters
nsuccesses parameter
Npopulation size parameter
thetachance of success parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif N is negative
std::domain_errorif theta is not a valid probability
std::invalid_argumentif container sizes mismatch

Definition at line 38 of file binomial_lccdf.hpp.

template<typename T_n , typename T_N , typename T_prob >
return_type_t<T_prob> stan::math::binomial_lcdf ( const T_n &  n,
const T_N &  N,
const T_prob &  theta 
)

Returns the log CDF for the binomial distribution evaluated at the specified success, population size, and chance of success.

If given containers of matching lengths, returns the log sum of probabilities.

Template Parameters
T_ntype of successes parameter
T_Ntype of population size parameter
thetatype of chance of success parameter
Parameters
nsuccesses parameter
Npopulation size parameter
thetachance of success parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif N is negative
std::domain_errorif theta is not a valid probability
std::invalid_argumentif container sizes mismatch

Definition at line 38 of file binomial_lcdf.hpp.

template<bool propto, typename T_n , typename T_N , typename T_prob >
return_type_t<T_prob> stan::math::binomial_log ( const T_n &  n,
const T_N &  N,
const T_prob &  theta 
)
Deprecated:
use binomial_lpmf

Definition at line 14 of file binomial_log.hpp.

template<typename T_n , typename T_N , typename T_prob >
return_type_t<T_prob> stan::math::binomial_log ( const T_n &  n,
const T_N &  N,
const T_prob &  theta 
)
inline
Deprecated:
use binomial_lpmf

Definition at line 23 of file binomial_log.hpp.

template<bool propto, typename T_n , typename T_N , typename T_prob >
return_type_t<T_prob> stan::math::binomial_logit_log ( const T_n &  n,
const T_N &  N,
const T_prob &  alpha 
)
Deprecated:
use binomial_logit_lpmf

Definition at line 14 of file binomial_logit_log.hpp.

template<typename T_n , typename T_N , typename T_prob >
return_type_t<T_prob> stan::math::binomial_logit_log ( const T_n &  n,
const T_N &  N,
const T_prob &  alpha 
)
inline
Deprecated:
use binomial_logit_lpmf

Definition at line 23 of file binomial_logit_log.hpp.

template<bool propto, typename T_n , typename T_N , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_N, T_prob > * = nullptr>
return_type_t<T_prob> stan::math::binomial_logit_lpmf ( const T_n &  n,
const T_N &  N,
const T_prob &  alpha 
)

Binomial log PMF in logit parametrization.

Binomial(n|n, inv_logit(alpha))

If given vectors of matching lengths, returns the log sum of probabilities.

Parameters
nsuccesses variable
Npopulation size parameter
alphalogit transformed probability parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif N is negative or probability parameter is invalid
std::invalid_argumentif vector sizes do not match

Definition at line 40 of file binomial_logit_lpmf.hpp.

template<bool propto, typename T_n , typename T_N , typename T_prob , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_n, T_N, T_prob > * = nullptr>
return_type_t<T_prob> stan::math::binomial_lpmf ( const T_n &  n,
const T_N &  N,
const T_prob &  theta 
)

Returns the log PMF for the binomial distribution evaluated at the specified success, population size, and chance of success.

If given containers of matching lengths, returns the log sum of probabilities.

Template Parameters
T_ntype of successes parameter
T_Ntype of population size parameter
T_probtype of chance of success parameter
Parameters
nsuccesses parameter
Npopulation size parameter
thetachance of success parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif n is negative or greater than N
std::domain_errorif N is negative
std::domain_errorif theta is not a valid probability
std::invalid_argumentif container sizes mismatch

Definition at line 39 of file binomial_lpmf.hpp.

template<typename T_N , typename T_theta , class RNG >
VectorBuilder<true, int, T_N, T_theta>::type stan::math::binomial_rng ( const T_N &  N,
const T_theta &  theta,
RNG &  rng 
)
inline

Return a pseudorandom binomial random variable for the given population size and chance of success parameters using the specified random number generator.

beta can be a scalar or a one-dimensional container.

Template Parameters
T_NType of population size parameter
T_thetaType of change of success parameter
RNGclass of rng
Parameters
N(Sequence of) population size parameter(s)
theta(Sequence of) chance of success parameter(s)
rngrandom number generator
Returns
(Sequence of) binomial random variate(s)
Exceptions
std::domain_errorif N is negative
std::domain_errorif theta is not a valid probability

Definition at line 32 of file binomial_rng.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::cauchy_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use cauchy_lccdf

Definition at line 14 of file cauchy_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::cauchy_cdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Returns the cauchy cumulative distribution function for the given location, and scale.

If given containers of matching sizes returns the product of probabilities.

Template Parameters
T_ytype of real parameter
T_loctype of location parameter
T_scaletype of scale parameter
Parameters
yreal parameter
mulocation parameter
sigmascale parameter
Returns
probability or product of probabilities
Exceptions
std::domain_errorif sigma is nonpositive or y, mu are nan
std::invalid_argumentif container sizes mismatch

Definition at line 35 of file cauchy_cdf.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::cauchy_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use cauchy_lcdf

Definition at line 14 of file cauchy_cdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::cauchy_lccdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Returns the cauchy log complementary cumulative distribution function for the given location, and scale.

If given containers of matching sizes returns the log sum of probabilities.

Template Parameters
T_ytype of real parameter
T_loctype of location parameter
T_scaletype of scale parameter
Parameters
yreal parameter
mulocation parameter
sigmascale parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif sigma is nonpositive or y, mu are nan
std::invalid_argumentif container sizes mismatch

Definition at line 36 of file cauchy_lccdf.hpp.

template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::cauchy_lcdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Returns the cauchy log cumulative distribution function for the given location, and scale.

If given containers of matching sizes returns the log sum of probabilities.

Template Parameters
T_ytype of real parameter
T_loctype of location parameter
T_scaletype of scale parameter
Parameters
yreal parameter
mulocation parameter
sigmascale parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif sigma is nonpositive or y, mu are nan
std::invalid_argumentif container sizes mismatch

Definition at line 36 of file cauchy_lcdf.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::cauchy_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

The log of the Cauchy density for the specified scalar(s) given the specified location parameter(s) and scale parameter(s).

y, mu, or sigma can each either be scalar a vector. Any vector inputs must be the same length.

The result log probability is defined to be the sum of the log probabilities for each observation/mu/sigma triple.

Deprecated:
use cauchy_lpdf
Parameters
y(Sequence of) scalar(s).
mu(Sequence of) location(s).
sigma(Sequence of) scale(s).
Returns
The log of the product of densities.
Template Parameters
T_scaleType of scale.
T_yType of scalar outcome.
T_locType of location.

Definition at line 30 of file cauchy_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::cauchy_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
inline
Deprecated:
use cauchy_lpdf

Definition at line 39 of file cauchy_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::cauchy_lpdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

The log of the Cauchy density for the specified scalar(s) given the specified location parameter(s) and scale parameter(s).

y, mu, or sigma can each either be scalar a vector. Any vector inputs must be the same length.

The result log probability is defined to be the sum of the log probabilities for each observation/mu/sigma triple.

Template Parameters
T_ytype of scalar outcome
T_loctype of location
T_scaletype of scale
Parameters
y(Sequence of) scalar(s).
mu(Sequence of) location(s).
sigma(Sequence of) scale(s).
Returns
The log of the product of densities.

Definition at line 43 of file cauchy_lpdf.hpp.

template<typename T_loc , typename T_scale , class RNG >
VectorBuilder<true, double, T_loc, T_scale>::type stan::math::cauchy_rng ( const T_loc &  mu,
const T_scale &  sigma,
RNG &  rng 
)
inline

Return a Cauchy random variate for the given location and scale using the specified random number generator.

mu and sigma can each be a scalar or a vector. Any non-scalar inputs must be the same length.

Template Parameters
T_loctype of location parameter
T_scaletype of scale parameter
RNGtype of random number generator
Parameters
mu(Sequence of) location parameter(s)
sigma(Sequence of) scale parameter(s)
rngrandom number generator
Returns
(Sequence of) Cauchy random variate(s)
Exceptions
std::domain_errorif mu is infinite or sigma is nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 33 of file cauchy_rng.hpp.

template<typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::chi_square_ccdf_log ( const T_y &  y,
const T_dof &  nu 
)
Deprecated:
use chi_square_lccdf

Definition at line 14 of file chi_square_ccdf_log.hpp.

template<typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::chi_square_cdf ( const T_y &  y,
const T_dof &  nu 
)

Returns the chi square cumulative distribution function for the given variate and degrees of freedom.

If given containers of matching sizes, returns the product of probabilities.

Template Parameters
T_ytype of scalar parameter
T_doftype of degrees of freedom parameter
Parameters
yscalar parameter
nudegrees of freedom parameter
Returns
probability or product of probabilities
Exceptions
std::domain_errorif y is negative or nu is nonpositive
std::invalid_argumentif container sizes mismatch

Definition at line 37 of file chi_square_cdf.hpp.

template<typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::chi_square_cdf_log ( const T_y &  y,
const T_dof &  nu 
)
Deprecated:
use chi_square_lcdf

Definition at line 14 of file chi_square_cdf_log.hpp.

template<typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::chi_square_lccdf ( const T_y &  y,
const T_dof &  nu 
)

Returns the chi square log complementary cumulative distribution function for the given variate and degrees of freedom.

If given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ytype of scalar parameter
T_doftype of degrees of freedom parameter
Parameters
yscalar parameter
nudegrees of freedom parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif y is negative or nu is nonpositive
std::invalid_argumentif container sizes mismatch

Definition at line 38 of file chi_square_lccdf.hpp.

template<typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::chi_square_lcdf ( const T_y &  y,
const T_dof &  nu 
)

Returns the chi square log cumulative distribution function for the given variate and degrees of freedom.

If given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ytype of scalar parameter
T_doftype of degrees of freedom parameter
Parameters
yscalar parameter
nudegrees of freedom parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif y is negative or nu is nonpositive
std::invalid_argumentif container sizes mismatch

Definition at line 38 of file chi_square_lcdf.hpp.

template<bool propto, typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::chi_square_log ( const T_y &  y,
const T_dof &  nu 
)

The log of a chi-squared density for y with the specified degrees of freedom parameter.

The degrees of freedom parameter must be greater than 0. y must be greater than or equal to 0.

\begin{eqnarray*} y &\sim& \chi^2_\nu \\ \log (p (y \, |\, \nu)) &=& \log \left( \frac{2^{-\nu / 2}}{\Gamma (\nu / 2)} y^{\nu / 2 - 1} \exp^{- y / 2} \right) \\ &=& - \frac{\nu}{2} \log(2) - \log (\Gamma (\nu / 2)) + (\frac{\nu}{2} - 1) \log(y) - \frac{y}{2} \\ & & \mathrm{ where } \; y \ge 0 \end{eqnarray*}

Deprecated:
use chi_square_lpdf
Parameters
yA scalar variable.
nuDegrees of freedom.
Exceptions
std::domain_errorif nu is not greater than or equal to 0
std::domain_errorif y is not greater than or equal to 0.
Template Parameters
T_yType of scalar.
T_dofType of degrees of freedom.

Definition at line 32 of file chi_square_log.hpp.

template<typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::chi_square_log ( const T_y &  y,
const T_dof &  nu 
)
inline
Deprecated:
use chi_square_lpdf

Definition at line 40 of file chi_square_log.hpp.

template<bool propto, typename T_y , typename T_dof , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof > * = nullptr>
return_type_t<T_y, T_dof> stan::math::chi_square_lpdf ( const T_y &  y,
const T_dof &  nu 
)

The log of a chi-squared density for y with the specified degrees of freedom parameter.

The degrees of freedom parameter must be greater than 0. y must be greater than or equal to 0.

\begin{eqnarray*} y &\sim& \chi^2_\nu \\ \log (p (y \, |\, \nu)) &=& \log \left( \frac{2^{-\nu / 2}}{\Gamma (\nu / 2)} y^{\nu / 2 - 1} \exp^{- y / 2} \right) \\ &=& - \frac{\nu}{2} \log(2) - \log (\Gamma (\nu / 2)) + (\frac{\nu}{2} - 1) \log(y) - \frac{y}{2} \\ & & \mathrm{ where } \; y \ge 0 \end{eqnarray*}

Template Parameters
T_ytype of scalar
T_doftype of degrees of freedom
Parameters
yA scalar variable.
nuDegrees of freedom.
Exceptions
std::domain_errorif nu is not greater than or equal to 0
std::domain_errorif y is not greater than or equal to 0.

Definition at line 46 of file chi_square_lpdf.hpp.

template<typename T_deg , class RNG >
VectorBuilder<true, double, T_deg>::type stan::math::chi_square_rng ( const T_deg &  nu,
RNG &  rng 
)
inline

Return a chi squared random variate with nu degrees of freedom using the specified random number generator.

nu can be a scalar or a one-dimensional container.

Template Parameters
T_degtype of degrees of freedom parameter
RNGclass of random number generator
Parameters
nu(Sequence of) positive degrees of freedom parameter(s)
rngrandom number generator
Returns
(Sequence of) chi squared random variate(s)
Exceptions
std::domain_errorif nu is nonpositive

Definition at line 28 of file chi_square_rng.hpp.

template<typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_ccdf_log ( const T_y &  y,
const T_lower &  lower,
const T_upper &  upper 
)
Deprecated:
use discrete_range_lccdf

Definition at line 13 of file discrete_range_ccdf_log.hpp.

template<typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_cdf ( const T_y &  y,
const T_lower &  lower,
const T_upper &  upper 
)

Return the CDF of a discrete range distribution for the given y, lower and upper bounds (all integers).

y, lower and upper can each be a scalar or a one-dimensional container. Any container arguments must be the same size.

Template Parameters
T_ytype of scalar, either int or std::vector<int>
T_lowertype of lower bound, either int or std::vector<int>
T_uppertype of upper bound, either int or std::vector<int>
Parameters
yinteger random variable
lowerinteger lower bound
upperinteger upper bound
Returns
The CDF evaluated at the specified arguments. If containers are supplied, returns the product of the CDFs.
Exceptions
std::domain_errorif upper is smaller than lower.
std::invalid_argumentif non-scalar arguments are of different sizes.

Definition at line 38 of file discrete_range_cdf.hpp.

template<typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_cdf_log ( const T_y &  y,
const T_lower &  lower,
const T_upper &  upper 
)
Deprecated:
use discrete_range_lcdf

Definition at line 13 of file discrete_range_cdf_log.hpp.

template<typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_lccdf ( const T_y &  y,
const T_lower &  lower,
const T_upper &  upper 
)

Return the log CCDF of a discrete range distribution for the given y, lower and upper bounds (all integers).

y, lower and upper can each be a scalar or a one-dimensional container. Any container arguments must be the same size.

Template Parameters
T_ytype of scalar, either int or std::vector<int>
T_lowertype of lower bound, either int or std::vector<int>
T_uppertype of upper bound, either int or std::vector<int>
Parameters
yinteger random variable
lowerinteger lower bound
upperinteger upper bound
Returns
The log CCDF evaluated at the specified arguments. If containers are supplied, returns the sum of the log CCDFs.
Exceptions
std::domain_errorif upper is smaller than lower.
std::invalid_argumentif non-scalar arguments are of different sizes.

Definition at line 38 of file discrete_range_lccdf.hpp.

template<typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_lcdf ( const T_y &  y,
const T_lower &  lower,
const T_upper &  upper 
)

Return the log CDF of a discrete range distribution for the given y, lower and upper bounds (all integers).

y, lower and upper can each be a scalar or a one-dimensional container. Any container arguments must be the same size.

Template Parameters
T_ytype of scalar, either int or std::vector<int>
T_lowertype of lower bound, either int or std::vector<int>
T_uppertype of upper bound, either int or std::vector<int>
Parameters
yinteger random variable
lowerinteger lower bound
upperinteger upper bound
Returns
The log CDF evaluated at the specified arguments. If containers are supplied, returns the sum of the log CDFs.
Exceptions
std::domain_errorif upper is smaller than lower.
std::invalid_argumentif non-scalar arguments are of different sizes.

Definition at line 38 of file discrete_range_lcdf.hpp.

template<bool propto, typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_log ( const T_y &  y,
const T_lower &  lower,
const T_upper &  upper 
)
Deprecated:
use discrete_range_lpmf

Definition at line 13 of file discrete_range_log.hpp.

template<typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_log ( const T_y &  y,
const T_lower &  lower,
const T_upper &  upper 
)
inline
Deprecated:
use discrete_range_lpmf

Definition at line 22 of file discrete_range_log.hpp.

template<bool propto, typename T_y , typename T_lower , typename T_upper >
double stan::math::discrete_range_lpmf ( const T_y &  y,
const T_lower &  lower,
const T_upper &  upper 
)

Return the log PMF of a discrete range for the given y, lower and upper bound (all integers).

\begin{eqnarray*} y &\sim& \mbox{\sf{discrete\_range}}(lower, upper) \\ \log(p (y \, |\, lower, upper)) &=& \log \left( \frac{1}{upper - lower + 1} \right) \\ &=& -\log (upper - lower + 1) \end{eqnarray*}

lower and upper can each be a scalar or a one-dimensional container. Any container arguments must be the same size.

Template Parameters
T_ytype of scalar, either int or std::vector<int>
T_lowertype of lower bound, either int or std::vector<int>
T_uppertype of upper bound, either int or std::vector<int>
Parameters
yinteger random variable
lowerinteger lower bound
upperinteger upper bound
Returns
Log probability. If containers are supplied, returns the log sum of the probabilities.
Exceptions
std::domain_errorif upper is smaller than lower.
std::invalid_argumentif non-scalar arguments are of different sizes.

Definition at line 46 of file discrete_range_lpmf.hpp.

template<typename T_lower , typename T_upper , class RNG >
VectorBuilder<true, int, T_lower, T_upper>::type stan::math::discrete_range_rng ( const T_lower &  lower,
const T_upper &  upper,
RNG &  rng 
)
inline

Return an integer random variate between the given lower and upper bounds (inclusive) using the specified random number generator.

lower and upper can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_lowertype of lower bound, either int or std::vector<int>
T_uppertype of upper bound, either int or std::vector<int>
RNGtype of random number generator
Parameters
lowerlower bound
upperupper bound
rngrandom number generator
Returns
A (sequence of) integer random variate(s) between lower and upper, both bounds included.
Exceptions
std::domain_errorif upper is smaller than lower.
std::invalid_argumentif non-scalar arguments are of different sizes.

Definition at line 36 of file discrete_range_rng.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::double_exponential_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use double_exponential_lccdf

Definition at line 14 of file double_exponential_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::double_exponential_cdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Returns the double exponential cumulative density function.

Given containers of matching sizes, returns the product of probabilities.

Template Parameters
T_ytype of real parameter.
T_loctype of location parameter.
T_scaletype of scale parameter.
Parameters
yreal parameter
mulocation parameter
sigmascale parameter
Returns
probability or product of probabilities
Exceptions
std::domain_errorif y is nan, mu is infinite, or sigma is nonpositive

Definition at line 39 of file double_exponential_cdf.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::double_exponential_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use double_exponential_lcdf

Definition at line 14 of file double_exponential_cdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::double_exponential_lccdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Returns the double exponential log complementary cumulative density function.

Given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ytype of real parameter.
T_loctype of location parameter.
T_scaletype of scale parameter.
Parameters
yreal parameter
mulocation parameter
sigmascale parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif y is nan, mu is infinite, or sigma is nonpositive
std::invalid_argumentif container sizes mismatch

Definition at line 38 of file double_exponential_lccdf.hpp.

template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::double_exponential_lcdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Returns the double exponential log cumulative density function.

Given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ytype of real parameter.
T_loctype of location parameter.
T_scaletype of scale parameter.
Parameters
yreal parameter
mulocation parameter
sigmascale parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif y is nan, mu is infinite, or sigma is nonpositive
std::invalid_argumentif container sizes mismatch

Definition at line 37 of file double_exponential_lcdf.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::double_exponential_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use double_exponential_lpdf

Definition at line 14 of file double_exponential_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::double_exponential_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use double_exponential_lpdf

Definition at line 23 of file double_exponential_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::double_exponential_lpdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Returns the double exponential log probability density function.

Given containers of matching sizes, returns the log sum of densities.

Template Parameters
T_ytype of real parameter.
T_loctype of location parameter.
T_scaletype of scale parameter.
Parameters
yreal parameter
mulocation parameter
sigmascale parameter
Returns
log probability density or log sum of probability densities
Exceptions
std::domain_errorif y is nan, mu is infinite, or sigma is nonpositive
std::invalid_argumentif container sizes mismatch

Definition at line 42 of file double_exponential_lpdf.hpp.

template<typename T_loc , typename T_scale , class RNG >
VectorBuilder<true, double, T_loc, T_scale>::type stan::math::double_exponential_rng ( const T_loc &  mu,
const T_scale &  sigma,
RNG &  rng 
)
inline

Return a double exponential random variate with the given location and scale using the specified random number generator.

mu and sigma can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_locType of location parameter
T_scaleType of scale parameter
RNGclass of random number generator
Parameters
mu(Sequence of) location parameter(s)
sigma(Sequence of) scale parameter(s)
rngrandom number generator
Returns
(Sequence of) double exponential random variate(s)
Exceptions
std::domain_errorif mu is infinite or sigma is nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 36 of file double_exponential_rng.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type_t<T_y, T_loc, T_scale, T_inv_scale> stan::math::exp_mod_normal_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_inv_scale &  lambda 
)
Deprecated:
use exp_mod_normal_lccdf

Definition at line 14 of file exp_mod_normal_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type_t<T_y, T_loc, T_scale, T_inv_scale> stan::math::exp_mod_normal_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_inv_scale &  lambda 
)
Deprecated:
use exp_mod_normal_lcdf

Definition at line 14 of file exp_mod_normal_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type_t<T_y, T_loc, T_scale, T_inv_scale> stan::math::exp_mod_normal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_inv_scale &  lambda 
)
Deprecated:
use exp_mod_normal_lpdf

Definition at line 15 of file exp_mod_normal_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type_t<T_y, T_loc, T_scale, T_inv_scale> stan::math::exp_mod_normal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_inv_scale &  lambda 
)
inline
Deprecated:
use exp_mod_normal_lpdf

Definition at line 26 of file exp_mod_normal_log.hpp.

template<typename T_loc , typename T_scale , typename T_inv_scale , class RNG >
VectorBuilder<true, double, T_loc, T_scale, T_inv_scale>::type stan::math::exp_mod_normal_rng ( const T_loc &  mu,
const T_scale &  sigma,
const T_inv_scale &  lambda,
RNG &  rng 
)
inline

Return an exponentially modified normal random variate for the given location, scale, and inverse scale using the specified random number generator.

mu, sigma, and lambda can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_locType of location parameter
T_scaleType of scale parameter
T_inv_scaleType of inverse scale parameter
RNGtype of random number generator
Parameters
mu(Sequence of) location parameter(s)
sigma(Sequence of) scale parameter(s)
lambda(Sequence of) inverse scale parameter(s)
rngrandom number generator
Returns
(Sequence of) Exponentially modified normal random variate(s)
Exceptions
std::domain_errorif mu is infinite, sigma is nonpositive, or lambda is nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 40 of file exp_mod_normal_rng.hpp.

template<typename T_y , typename T_inv_scale >
return_type_t<T_y, T_inv_scale> stan::math::exponential_ccdf_log ( const T_y &  y,
const T_inv_scale &  beta 
)
Deprecated:
use exponential_lccdf

Definition at line 14 of file exponential_ccdf_log.hpp.

template<typename T_y , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_inv_scale > * = nullptr>
return_type_t<T_y, T_inv_scale> stan::math::exponential_cdf ( const T_y &  y,
const T_inv_scale &  beta 
)

Calculates the exponential cumulative distribution function for the given y and beta.

Inverse scale parameter must be greater than 0. y must be greater than or equal to 0.

Template Parameters
T_ytype of scalar
T_inv_scaletype of inverse scale
Parameters
yA scalar variable.
betaInverse scale parameter.

Definition at line 35 of file exponential_cdf.hpp.

template<typename T_y , typename T_inv_scale >
return_type_t<T_y, T_inv_scale> stan::math::exponential_cdf_log ( const T_y &  y,
const T_inv_scale &  beta 
)
Deprecated:
use exponential_lcdf

Definition at line 14 of file exponential_cdf_log.hpp.

template<bool propto, typename T_y , typename T_inv_scale >
return_type_t<T_y, T_inv_scale> stan::math::exponential_log ( const T_y &  y,
const T_inv_scale &  beta 
)
Deprecated:
use exponential_lpdf

Definition at line 14 of file exponential_log.hpp.

template<typename T_y , typename T_inv_scale >
return_type_t<T_y, T_inv_scale> stan::math::exponential_log ( const T_y &  y,
const T_inv_scale &  beta 
)
inline
Deprecated:
use exponential_lpdf

Definition at line 23 of file exponential_log.hpp.

template<bool propto, typename T_y , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_inv_scale > * = nullptr>
return_type_t<T_y, T_inv_scale> stan::math::exponential_lpdf ( const T_y &  y,
const T_inv_scale &  beta 
)

The log of an exponential density for y with the specified inverse scale parameter.

Inverse scale parameter must be greater than 0. y must be greater than or equal to 0.

\begin{eqnarray*} y &\sim& \mbox{\sf{Expon}}(\beta) \\ \log (p (y \, |\, \beta) ) &=& \log \left( \beta \exp^{-\beta y} \right) \\ &=& \log (\beta) - \beta y \\ & & \mathrm{where} \; y > 0 \end{eqnarray*}

Template Parameters
T_ytype of scalar
T_inv_scaletype of inverse scale
Parameters
yA scalar variable.
betaInverse scale parameter.
Exceptions
std::domain_errorif beta is not greater than 0.
std::domain_errorif y is not greater than or equal to 0.

Definition at line 52 of file exponential_lpdf.hpp.

template<typename T_inv , class RNG >
VectorBuilder<true, double, T_inv>::type stan::math::exponential_rng ( const T_inv &  beta,
RNG &  rng 
)
inline

Return a exponential random variate with inverse scale beta using the specified random number generator.

beta can be a scalar or a one-dimensional container.

Template Parameters
T_invType of inverse scale parameter
RNGclass of random number generator
Parameters
beta(Sequence of) positive inverse scale parameter(s)
rngrandom number generator
Returns
(Sequence of) exponential random variate(s)
Exceptions
std::domain_errorif beta is nonpositive

Definition at line 28 of file exponential_rng.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type_t<T_y, T_shape, T_scale> stan::math::frechet_ccdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)
Deprecated:
use frechet_lccdf

Definition at line 14 of file frechet_ccdf_log.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type_t<T_y, T_shape, T_scale> stan::math::frechet_cdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)
Deprecated:
use frechet_lcdf

Definition at line 14 of file frechet_cdf_log.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_scale >
return_type_t<T_y, T_shape, T_scale> stan::math::frechet_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)
Deprecated:
use frechet_lpdf

Definition at line 14 of file frechet_log.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type_t<T_y, T_shape, T_scale> stan::math::frechet_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)
inline
Deprecated:
use frechet_lpdf

Definition at line 24 of file frechet_log.hpp.

template<typename T_shape , typename T_scale , class RNG >
VectorBuilder<true, double, T_shape, T_scale>::type stan::math::frechet_rng ( const T_shape &  alpha,
const T_scale &  sigma,
RNG &  rng 
)
inline

Return a pseudorandom Frechet variate for the given shape and scale parameters using the specified random number generator.

alpha and sigma can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_shapetype of shape parameter
T_scaletype of scale parameter
RNGtype of random number generator
Parameters
alpha(Sequence of) positive shape parameter(s)
sigma(Sequence of) positive scale parameter(s)
rngrandom number generator
Returns
(Sequence of) Frechet random variate(s)
Exceptions
std::domain_errorif alpha is nonpositive or sigma is nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 32 of file frechet_rng.hpp.

template<typename T_y , typename T_shape , typename T_inv_scale >
return_type_t<T_y, T_shape, T_inv_scale> stan::math::gamma_ccdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_inv_scale &  beta 
)
Deprecated:
use gamma_lccdf

Definition at line 14 of file gamma_ccdf_log.hpp.

template<typename T_y , typename T_shape , typename T_inv_scale >
return_type_t<T_y, T_shape, T_inv_scale> stan::math::gamma_cdf ( const T_y &  y,
const T_shape &  alpha,
const T_inv_scale &  beta 
)

The cumulative density function for a gamma distribution for y with the specified shape and inverse scale parameters.

Template Parameters
T_ytype of scalar
T_shapetype of shape
T_inv_scaletype of inverse scale
Parameters
yA scalar variable.
alphaShape parameter.
betaInverse scale parameter.
Exceptions
std::domain_errorif alpha is not greater than 0.
std::domain_errorif beta is not greater than 0.
std::domain_errorif y is not greater than or equal to 0.

Definition at line 41 of file gamma_cdf.hpp.

template<typename T_y , typename T_shape , typename T_inv_scale >
return_type_t<T_y, T_shape, T_inv_scale> stan::math::gamma_cdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_inv_scale &  beta 
)
Deprecated:
use gamma_lcdf

Definition at line 14 of file gamma_cdf_log.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_inv_scale >
return_type_t<T_y, T_shape, T_inv_scale> stan::math::gamma_log ( const T_y &  y,
const T_shape &  alpha,
const T_inv_scale &  beta 
)

The log of a gamma density for y with the specified shape and inverse scale parameters.

Shape and inverse scale parameters must be greater than 0. y must be greater than or equal to 0.

\begin{eqnarray*} y &\sim& \mbox{\sf{Gamma}}(\alpha, \beta) \\ \log (p (y \, |\, \alpha, \beta) ) &=& \log \left( \frac{\beta^\alpha}{\Gamma(\alpha)} y^{\alpha - 1} \exp^{- \beta y} \right) \\ &=& \alpha \log(\beta) - \log(\Gamma(\alpha)) + (\alpha - 1) \log(y) - \beta y\\ & & \mathrm{where} \; y > 0 \end{eqnarray*}

Deprecated:
use gamma_lpdf
Parameters
yA scalar variable.
alphaShape parameter.
betaInverse scale parameter.
Exceptions
std::domain_errorif alpha is not greater than 0.
std::domain_errorif beta is not greater than 0.
std::domain_errorif y is not greater than or equal to 0.
Template Parameters
T_yType of scalar.
T_shapeType of shape.
T_inv_scaleType of inverse scale.

Definition at line 36 of file gamma_log.hpp.

template<typename T_y , typename T_shape , typename T_inv_scale >
return_type_t<T_y, T_shape, T_inv_scale> stan::math::gamma_log ( const T_y &  y,
const T_shape &  alpha,
const T_inv_scale &  beta 
)
inline
Deprecated:
use gamma_lpdf

Definition at line 46 of file gamma_log.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_inv_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_inv_scale > * = nullptr>
return_type_t<T_y, T_shape, T_inv_scale> stan::math::gamma_lpdf ( const T_y &  y,
const T_shape &  alpha,
const T_inv_scale &  beta 
)

The log of a gamma density for y with the specified shape and inverse scale parameters.

Shape and inverse scale parameters must be greater than 0. y must be greater than or equal to 0.

\begin{eqnarray*} y &\sim& \mbox{\sf{Gamma}}(\alpha, \beta) \\ \log (p (y \, |\, \alpha, \beta) ) &=& \log \left( \frac{\beta^\alpha}{\Gamma(\alpha)} y^{\alpha - 1} \exp^{- \beta y} \right) \\ &=& \alpha \log(\beta) - \log(\Gamma(\alpha)) + (\alpha - 1) \log(y) - \beta y\\ & & \mathrm{where} \; y > 0 \end{eqnarray*}

Template Parameters
T_ytype of scalar
T_shapetype of shape
T_inv_scaletype of inverse scale
Parameters
yA scalar variable.
alphaShape parameter.
betaInverse scale parameter.
Exceptions
std::domain_errorif alpha is not greater than 0.
std::domain_errorif beta is not greater than 0.
std::domain_errorif y is not greater than or equal to 0.

Definition at line 52 of file gamma_lpdf.hpp.

template<typename T_shape , typename T_inv , class RNG >
VectorBuilder<true, double, T_shape, T_inv>::type stan::math::gamma_rng ( const T_shape &  alpha,
const T_inv &  beta,
RNG &  rng 
)
inline

Return a gamma random variate for the given shape and inverse scale parameters using the specified random number generator.

alpha and beta can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_shapetype of shape parameter
T_invtype of inverse scale parameter
RNGtype of random number generator
Parameters
alpha(Sequence of) positive shape parameter(s)
beta(Sequence of) positive inverse scale parameter(s)
rngrandom number generator
Returns
(Sequence of) gamma random variate(s)
Exceptions
std::domain_errorif alpha or beta are nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 33 of file gamma_rng.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::gumbel_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  beta 
)
Deprecated:
use gumbel_lccdf

Definition at line 14 of file gumbel_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::gumbel_cdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  beta 
)

Returns the Gumbel distribution cumulative distribution for the given location and scale.

Given containers of matching sizes, returns the product of probabilities.

Template Parameters
T_ytype of real parameter
T_loctype of location parameter
T_scaletype of scale parameter
Parameters
yreal parameter
mulocation parameter
betascale parameter
Returns
probability or product of probabilities
Exceptions
std::domain_errorif y is nan, mu is infinite, or beta is nonpositive
std::invalid_argumentif container sizes mismatch

Definition at line 39 of file gumbel_cdf.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::gumbel_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  beta 
)
Deprecated:
use gumbel_lcdf

Definition at line 14 of file gumbel_cdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::gumbel_lccdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  beta 
)

Returns the Gumbel log complementary cumulative distribution for the given location and scale.

Given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ytype of real parameter
T_loctype of location parameter
T_scaletype of scale parameter
Parameters
yreal parameter
mulocation parameter
betascale parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif y is nan, mu is infinite, or beta is nonpositive
std::invalid_argumentif container sizes mismatch

Definition at line 39 of file gumbel_lccdf.hpp.

template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::gumbel_lcdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  beta 
)

Returns the Gumbel log cumulative distribution for the given location and scale.

Given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ytype of real parameter
T_loctype of location parameter
T_scaletype of scale parameter
Parameters
yreal parameter
mulocation parameter
betascale parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif y is nan, mu is infinite, or beta is nonpositive
std::invalid_argumentif container sizes mismatch

Definition at line 38 of file gumbel_lcdf.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::gumbel_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  beta 
)
Deprecated:
use gumbel_lpdf

Definition at line 14 of file gumbel_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::gumbel_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  beta 
)
inline
Deprecated:
use gumbel_lpdf

Definition at line 23 of file gumbel_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::gumbel_lpdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  beta 
)

Returns the Gumbel log probability density for the given location and scale.

Given containers of matching sizes, returns the log sum of densities.

Template Parameters
T_ytype of real parameter
T_loctype of location parameter
T_scaletype of scale parameter
Parameters
yreal parameter
mulocation parameter
betascale parameter
Returns
log probability density or log sum of probability densities
Exceptions
std::domain_errorif y is nan, mu is infinite, or beta is nonpositive
std::invalid_argumentif container sizes mismatch

Definition at line 40 of file gumbel_lpdf.hpp.

template<typename T_loc , typename T_scale , class RNG >
VectorBuilder<true, double, T_loc, T_scale>::type stan::math::gumbel_rng ( const T_loc &  mu,
const T_scale &  beta,
RNG &  rng 
)
inline

Return a Gumbel random variate with the given location and scale using the specified random number generator.

mu and beta can each be a scalar or a vector. Any non-scalar inputs must be the same length.

Template Parameters
T_loctype of location parameter
T_scaletype of scale parameter
RNGtype of random number generator
Parameters
mu(Sequence of) location parameter(s)
beta(Sequence of) scale parameter(s)
rngrandom number generator
Returns
(Sequence of) Gumbel random variate(s)
Exceptions
std::domain_errorif mu is infinite or beta is nonpositive.
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 34 of file gumbel_rng.hpp.

template<bool propto, typename T_n , typename T_N , typename T_a , typename T_b >
double stan::math::hypergeometric_log ( const T_n &  n,
const T_N &  N,
const T_a &  a,
const T_b &  b 
)
Deprecated:
use hypergeometric_lpmf

Definition at line 14 of file hypergeometric_log.hpp.

template<typename T_n , typename T_N , typename T_a , typename T_b >
double stan::math::hypergeometric_log ( const T_n &  n,
const T_N &  N,
const T_a &  a,
const T_b &  b 
)
inline
Deprecated:
use hypergeometric_lpmf

Definition at line 23 of file hypergeometric_log.hpp.

template<typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::inv_chi_square_ccdf_log ( const T_y &  y,
const T_dof &  nu 
)
Deprecated:
use inv_chi_square_lccdf

Definition at line 14 of file inv_chi_square_ccdf_log.hpp.

template<typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::inv_chi_square_cdf ( const T_y &  y,
const T_dof &  nu 
)

Returns the inverse chi square cumulative distribution function for the given variate and degrees of freedom.

If given containers of matching sizes, returns the product of probabilities.

Template Parameters
T_ytype of scalar parameter
T_doftype of degrees of freedom parameter
Parameters
yscalar parameter
nudegrees of freedom parameter
Returns
probability or product of probabilities
Exceptions
std::domain_errorif y is negative or nu is nonpositive
std::invalid_argumentif container sizes mismatch

Definition at line 37 of file inv_chi_square_cdf.hpp.

template<typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::inv_chi_square_cdf_log ( const T_y &  y,
const T_dof &  nu 
)
Deprecated:
use inv_chi_square_lcdf

Definition at line 14 of file inv_chi_square_cdf_log.hpp.

template<typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::inv_chi_square_lccdf ( const T_y &  y,
const T_dof &  nu 
)

Returns the inverse chi square log complementary cumulative distribution function for the given variate and degrees of freedom.

If given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ytype of scalar parameter
T_doftype of degrees of freedom parameter
Parameters
yscalar parameter
nudegrees of freedom parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif y is negative or nu is nonpositive
std::invalid_argumentif container sizes mismatch

Definition at line 38 of file inv_chi_square_lccdf.hpp.

template<typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::inv_chi_square_lcdf ( const T_y &  y,
const T_dof &  nu 
)

Returns the inverse chi square log cumulative distribution function for the given variate and degrees of freedom.

If given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ytype of scalar parameter
T_doftype of degrees of freedom parameter
Parameters
yscalar parameter
nudegrees of freedom parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif y is negative or nu is nonpositive
std::invalid_argumentif container sizes mismatch

Definition at line 38 of file inv_chi_square_lcdf.hpp.

template<bool propto, typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::inv_chi_square_log ( const T_y &  y,
const T_dof &  nu 
)

The log of an inverse chi-squared density for y with the specified degrees of freedom parameter.

The degrees of freedom parameter must be greater than 0. y must be greater than 0.

\begin{eqnarray*} y &\sim& \mbox{\sf{Inv-}}\chi^2_\nu \\ \log (p (y \, |\, \nu)) &=& \log \left( \frac{2^{-\nu / 2}}{\Gamma (\nu / 2)} y^{- (\nu / 2 + 1)} \exp^{-1 / (2y)} \right) \\ &=& - \frac{\nu}{2} \log(2) - \log (\Gamma (\nu / 2)) - (\frac{\nu}{2} + 1) \log(y) - \frac{1}{2y} \\ & & \mathrm{ where } \; y > 0 \end{eqnarray*}

Deprecated:
use inv_chi_square_lpdf
Parameters
yA scalar variable.
nuDegrees of freedom.
Exceptions
std::domain_errorif nu is not greater than or equal to 0
std::domain_errorif y is not greater than or equal to 0.
Template Parameters
T_yType of scalar.
T_dofType of degrees of freedom.

Definition at line 33 of file inv_chi_square_log.hpp.

template<typename T_y , typename T_dof >
return_type_t<T_y, T_dof> stan::math::inv_chi_square_log ( const T_y &  y,
const T_dof &  nu 
)
inline
Deprecated:
use inv_chi_square_lpdf

Definition at line 41 of file inv_chi_square_log.hpp.

template<bool propto, typename T_y , typename T_dof , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof > * = nullptr>
return_type_t<T_y, T_dof> stan::math::inv_chi_square_lpdf ( const T_y &  y,
const T_dof &  nu 
)

The log of an inverse chi-squared density for y with the specified degrees of freedom parameter.

The degrees of freedom parameter must be greater than 0. y must be greater than 0.

\begin{eqnarray*} y &\sim& \mbox{\sf{Inv-}}\chi^2_\nu \\ \log (p (y \, |\, \nu)) &=& \log \left( \frac{2^{-\nu / 2}}{\Gamma (\nu / 2)} y^{- (\nu / 2 + 1)} \exp^{-1 / (2y)} \right) \\ &=& - \frac{\nu}{2} \log(2) - \log (\Gamma (\nu / 2)) - (\frac{\nu}{2} + 1) \log(y) - \frac{1}{2y} \\ & & \mathrm{ where } \; y > 0 \end{eqnarray*}

Template Parameters
T_ytype of scalar
T_doftype of degrees of freedom
Parameters
yA scalar variable.
nuDegrees of freedom.
Exceptions
std::domain_errorif nu is not greater than or equal to 0
std::domain_errorif y is not greater than or equal to 0.

Definition at line 49 of file inv_chi_square_lpdf.hpp.

template<typename T_deg , class RNG >
VectorBuilder<true, double, T_deg>::type stan::math::inv_chi_square_rng ( const T_deg &  nu,
RNG &  rng 
)
inline

Return a pseudorandom inverse chi squared variate with the nu degrees of freedom using the specified random number generator.

nu can be a scalar or a one-dimensional container.

Template Parameters
T_degType of degrees of freedom parameter
RNGclass of random number generator
Parameters
nu(Sequence of) positive degrees of freedom parameter(s)
rngrandom number generator
Returns
(Sequence of) inverse chi squared random variate(s)
Exceptions
std::domain_errorif nu is nonpositive

Definition at line 28 of file inv_chi_square_rng.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type_t<T_y, T_shape, T_scale> stan::math::inv_gamma_ccdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  beta 
)
Deprecated:
use inv_gamma_lccdf

Definition at line 14 of file inv_gamma_ccdf_log.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type_t<T_y, T_shape, T_scale> stan::math::inv_gamma_cdf ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  beta 
)

The CDF of an inverse gamma density for y with the specified shape and scale parameters.

y, shape, and scale parameters must be greater than 0.

Template Parameters
T_ytype of scalar
T_shapetype of shape
T_scaletype of scale
Parameters
yA scalar variable.
alphaShape parameter.
betaScale parameter.
Exceptions
std::domain_errorif alpha is not greater than 0.
std::domain_errorif beta is not greater than 0.
std::domain_errorif y is not greater than 0.

Definition at line 40 of file inv_gamma_cdf.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type_t<T_y, T_shape, T_scale> stan::math::inv_gamma_cdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  beta 
)
Deprecated:
use inv_gamma_lcdf

Definition at line 14 of file inv_gamma_cdf_log.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_scale >
return_type_t<T_y, T_shape, T_scale> stan::math::inv_gamma_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  beta 
)

The log of an inverse gamma density for y with the specified shape and scale parameters.

Shape and scale parameters must be greater than 0. y must be greater than 0.

Deprecated:
use inv_gamma_lpdf
Parameters
yA scalar variable.
alphaShape parameter.
betaScale parameter.
Exceptions
std::domain_errorif alpha is not greater than 0.
std::domain_errorif beta is not greater than 0.
std::domain_errorif y is not greater than 0.
Template Parameters
T_yType of scalar.
T_shapeType of shape.
T_scaleType of scale.

Definition at line 29 of file inv_gamma_log.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type_t<T_y, T_shape, T_scale> stan::math::inv_gamma_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  beta 
)
inline
Deprecated:
use inv_gamma_lpdf

Definition at line 39 of file inv_gamma_log.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr>
return_type_t<T_y, T_shape, T_scale> stan::math::inv_gamma_lpdf ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  beta 
)

The log of an inverse gamma density for y with the specified shape and scale parameters.

Shape and scale parameters must be greater than 0. y must be greater than 0.

Parameters
yA scalar variable.
alphaShape parameter.
betaScale parameter.
Exceptions
std::domain_errorif alpha is not greater than 0.
std::domain_errorif beta is not greater than 0.
std::domain_errorif y is not greater than 0.
Template Parameters
T_yType of scalar.
T_shapeType of shape.
T_scaleType of scale.

Definition at line 44 of file inv_gamma_lpdf.hpp.

template<typename T_shape , typename T_scale , class RNG >
VectorBuilder<true, double, T_shape, T_scale>::type stan::math::inv_gamma_rng ( const T_shape &  alpha,
const T_scale &  beta,
RNG &  rng 
)
inline

Return a pseudorandom inverse gamma variate for the given shape and scale parameters using the specified random number generator.

alpha and beta can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_shapeType of shape parameter
T_scaleType of scale parameter
RNGtype of random number generator
Parameters
alpha(Sequence of) positive shape parameter(s)
beta(Sequence of) positive scale parameter(s)
rngrandom number generator
Returns
(Sequence of) inverse gamma random variate(s)
Exceptions
std::domain_errorif alpha or beta are nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 34 of file inv_gamma_rng.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::logistic_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use logistic_lccdf

Definition at line 14 of file logistic_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::logistic_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use logistic_lcdf

Definition at line 14 of file logistic_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::logistic_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use logistic_lpdf

Definition at line 14 of file logistic_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::logistic_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
inline
Deprecated:
use logistic_lpdf

Definition at line 23 of file logistic_log.hpp.

template<typename T_loc , typename T_scale , class RNG >
VectorBuilder<true, double, T_loc, T_scale>::type stan::math::logistic_rng ( const T_loc &  mu,
const T_scale &  sigma,
RNG &  rng 
)
inline

Return a Logistic random variate for the given location and scale using the specified random number generator.

mu and sigma can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_loctype of location parameter
T_scaletype of scale parameter
RNGtype of random number generator
Parameters
mu(Sequence of) location parameter(s)
sigma(Sequence of) scale parameter(s)
rngrandom number generator
Returns
(Sequence of) Logistic random variate(s)
Exceptions
std::domain_errorif mu is infinite or sigma is nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 34 of file logistic_rng.hpp.

template<typename T_y , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale, T_shape > * = nullptr>
return_type_t<T_y, T_scale, T_shape> stan::math::loglogistic_cdf ( const T_y &  y,
const T_scale &  alpha,
const T_shape &  beta 
)

The loglogistic cumulative distribution function for the specified scalar(s) given the specified scales(s) and shape(s).

y, alpha, or beta can each be either a scalar or a vector. Any vector inputs must be the same length.

Template Parameters
T_ytype of scalar.
T_scaletype of scale parameter.
T_shapetype of shape parameter.
Parameters
y(Sequence of) scalar(s).
alpha(Sequence of) scale parameter(s) for the loglogistic distribution.
beta(Sequence of) shape parameter(s) for the loglogistic distribution.
Returns
The loglogistic cdf evaluated at the specified arguments.
Exceptions
std::domain_errorif any of the inputs are not positive or if and of the parameters are not finite.

Definition at line 46 of file loglogistic_cdf.hpp.

template<bool propto, typename T_y , typename T_scale , typename T_shape , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_scale, T_shape > * = nullptr>
return_type_t<T_y, T_scale, T_shape> stan::math::loglogistic_lpdf ( const T_y &  y,
const T_scale &  alpha,
const T_shape &  beta 
)

The log of the loglogistic density for the specified scalar(s) given the specified scales(s) and shape(s).

y, alpha, or beta can each be either a scalar or a vector. Any vector inputs must be the same length.

The result log probability is defined to be the sum of the log probabilities for each observation/scale/shape triple.

Template Parameters
T_ytype of scalar.
T_scaletype of scale parameter.
T_shapetype of shape parameter.
Parameters
y(Sequence of) scalar(s).
alpha(Sequence of) scale parameter(s) for the loglogistic distribution.
beta(Sequence of) shape parameter(s) for the loglogistic distribution.
Returns
The log of the product of the densities.
Exceptions
std::domain_errorif any of the inputs are not positive and finite.

Definition at line 45 of file loglogistic_lpdf.hpp.

template<typename T_scale , typename T_shape , class RNG >
VectorBuilder<true, double, T_scale, T_shape>::type stan::math::loglogistic_rng ( const T_scale &  alpha,
const T_shape &  beta,
RNG &  rng 
)
inline

Return a loglogistic random variate for the given scale and shape parameters using the specified random number generator.

alpha and beta can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_scaletype of scale parameter
T_shapetype of shape parameter
RNGtype of random number generator
Parameters
alpha(Sequence of) positive scale parameter(s)
beta(Sequence of) positive shape parameter(s)
rngrandom number generator
Returns
(Sequence of) loglogistic random variate(s)
Exceptions
std::domain_errorif alpha or beta are nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 34 of file loglogistic_rng.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::lognormal_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use lognormal_lccdf

Definition at line 14 of file lognormal_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::lognormal_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use lognormal_lcdf

Definition at line 14 of file lognormal_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::lognormal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use lognormal_lpdf

Definition at line 14 of file lognormal_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::lognormal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
inline
Deprecated:
use lognormal_lpdf

Definition at line 23 of file lognormal_log.hpp.

template<typename T_loc , typename T_scale , class RNG >
VectorBuilder<true, double, T_loc, T_scale>::type stan::math::lognormal_rng ( const T_loc &  mu,
const T_scale &  sigma,
RNG &  rng 
)
inline

Return a lognormal random variate for the given location and scale using the specified random number generator.

mu and sigma can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_loctype of location parameter
T_scaletype of scale parameter
RNGtype of random number generator
Parameters
mu(Sequence of) location parameter(s)
sigma(Sequence of) positive scale parameter(s)
rngrandom number generator
Returns
(Sequence of) Normal random variate(s)
Exceptions
std::domain_errorif mu is infinite or sigma is nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 33 of file lognormal_rng.hpp.

template<typename T_n , typename T_location , typename T_precision >
return_type_t<T_location, T_precision> stan::math::neg_binomial_2_ccdf_log ( const T_n &  n,
const T_location &  mu,
const T_precision &  phi 
)
Deprecated:
use neg_binomial_2_lccdf

Definition at line 14 of file neg_binomial_2_ccdf_log.hpp.

template<typename T_n , typename T_location , typename T_precision >
return_type_t<T_location, T_precision> stan::math::neg_binomial_2_cdf_log ( const T_n &  n,
const T_location &  mu,
const T_precision &  phi 
)
Deprecated:
use neg_binomial_2_lcdf

Definition at line 14 of file neg_binomial_2_cdf_log.hpp.

template<bool propto, typename T_n , typename T_location , typename T_precision >
return_type_t<T_location, T_precision> stan::math::neg_binomial_2_log ( const T_n &  n,
const T_location &  mu,
const T_precision &  phi 
)
Deprecated:
use neg_binomial_2_lpmf

Definition at line 14 of file neg_binomial_2_log.hpp.

template<typename T_n , typename T_location , typename T_precision >
return_type_t<T_location, T_precision> stan::math::neg_binomial_2_log ( const T_n &  n,
const T_location &  mu,
const T_precision &  phi 
)
inline
Deprecated:
use neg_binomial_2_lpmf

Definition at line 23 of file neg_binomial_2_log.hpp.

template<bool propto, typename T_n , typename T_log_location , typename T_precision >
return_type_t<T_log_location, T_precision> stan::math::neg_binomial_2_log_log ( const T_n &  n,
const T_log_location &  eta,
const T_precision &  phi 
)
Deprecated:
use neg_binomial_2_log_lpmf

Definition at line 15 of file neg_binomial_2_log_log.hpp.

template<typename T_n , typename T_log_location , typename T_precision >
return_type_t<T_log_location, T_precision> stan::math::neg_binomial_2_log_log ( const T_n &  n,
const T_log_location &  eta,
const T_precision &  phi 
)
inline
Deprecated:
use neg_binomial_2_log_lpmf

Definition at line 25 of file neg_binomial_2_log_log.hpp.

template<typename T_loc , typename T_inv , class RNG >
VectorBuilder<true, int, T_loc, T_inv>::type stan::math::neg_binomial_2_log_rng ( const T_loc &  eta,
const T_inv &  phi,
RNG &  rng 
)
inline

Return a negative binomial random variate with the specified log-location and inverse dispersion parameters using the given random number generator.

eta and phi can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_locType of log-location parameter
T_invType of inverse overdispersion parameter
RNGtype of random number generator
Parameters
eta(Sequence of) positive log-location parameter(s)
phi(Sequence of) positive inverse dispersion parameter(s)
rngrandom number generator
Returns
(Sequence of) negative binomial random variate(s)
Exceptions
std::domain_errorif eta is non-finite or phi is nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 37 of file neg_binomial_2_log_rng.hpp.

template<typename T_loc , typename T_prec , class RNG >
VectorBuilder<true, int, T_loc, T_prec>::type stan::math::neg_binomial_2_rng ( const T_loc &  mu,
const T_prec &  phi,
RNG &  rng 
)
inline

Return a negative binomial random variate with the specified location and precision parameters using the given random number generator.

mu and phi can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_loctype of location parameter
T_prectype of precision parameter
RNGtype of random number generator
Parameters
mu(Sequence of) positive location parameter(s)
phi(Sequence of) positive precision parameter(s)
rngrandom number generator
Returns
(Sequence of) negative binomial random variate(s)
Exceptions
std::domain_errorif mu or phi are nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 36 of file neg_binomial_2_rng.hpp.

template<typename T_n , typename T_shape , typename T_inv_scale >
return_type_t<T_shape, T_inv_scale> stan::math::neg_binomial_ccdf_log ( const T_n &  n,
const T_shape &  alpha,
const T_inv_scale &  beta 
)
Deprecated:
use neg_binomial_lccdf

Definition at line 14 of file neg_binomial_ccdf_log.hpp.

template<typename T_n , typename T_shape , typename T_inv_scale >
return_type_t<T_shape, T_inv_scale> stan::math::neg_binomial_cdf_log ( const T_n &  n,
const T_shape &  alpha,
const T_inv_scale &  beta 
)
Deprecated:
use neg_binomial_lcdf

Definition at line 14 of file neg_binomial_cdf_log.hpp.

template<bool propto, typename T_n , typename T_shape , typename T_inv_scale >
return_type_t<T_shape, T_inv_scale> stan::math::neg_binomial_log ( const T_n &  n,
const T_shape &  alpha,
const T_inv_scale &  beta 
)
Deprecated:
use neg_binomial_lpmf

Definition at line 14 of file neg_binomial_log.hpp.

template<typename T_n , typename T_shape , typename T_inv_scale >
return_type_t<T_shape, T_inv_scale> stan::math::neg_binomial_log ( const T_n &  n,
const T_shape &  alpha,
const T_inv_scale &  beta 
)
inline
Deprecated:
use neg_binomial_lpmf

Definition at line 24 of file neg_binomial_log.hpp.

template<typename T_shape , typename T_inv , class RNG >
VectorBuilder<true, int, T_shape, T_inv>::type stan::math::neg_binomial_rng ( const T_shape &  alpha,
const T_inv &  beta,
RNG &  rng 
)
inline

Return a negative binomial random variate with the specified shape and inverse scale parameters using the given random number generator.

alpha and beta can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_shapetype of shape parameter
T_invtype of inverse scale parameter
RNGtype of random number generator
Parameters
alpha(Sequence of) positive shape parameter(s)
beta(Sequence of) positive inverse scale parameter(s)
rngrandom number generator
Returns
(Sequence of) negative binomial random variate(s)
Exceptions
std::domain_errorif alpha or beta are nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 35 of file neg_binomial_rng.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::normal_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
inline
Deprecated:
use normal_lccdf

Definition at line 14 of file normal_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::normal_cdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
inline

Calculates the normal cumulative distribution function for the given variate, location, and scale.

\(\Phi(x) = \frac{1}{\sqrt{2 \pi}} \int_{-\inf}^x e^{-t^2/2} dt\).

Template Parameters
T_ytype of y
T_loctype of mean parameter
T_scaletype of standard deviation parameter
Parameters
yA scalar variate.
muThe location of the normal distribution.
sigmaThe scale of the normal distribution
Returns
The unit normal cdf evaluated at the specified arguments.

Definition at line 38 of file normal_cdf.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::normal_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
inline
Deprecated:
use normal_lcdf

Definition at line 14 of file normal_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::normal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
inline

The log of the normal density for the specified scalar(s) given the specified mean(s) and deviation(s).

y, mu, or sigma can each be either a scalar or a vector. Any vector inputs must be the same length.

The result log probability is defined to be the sum of the log probabilities for each observation/mean/deviation triple.

Deprecated:
use normal_lpdf
Parameters
y(Sequence of) scalar(s).
mu(Sequence of) location parameter(s) for the normal distribution.
sigma(Sequence of) scale parameters for the normal distribution.
Returns
The log of the product of the densities.
Exceptions
std::domain_errorif the scale is not positive.
Template Parameters
T_yUnderlying type of scalar in sequence.
T_locType of location parameter.

Definition at line 32 of file normal_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::normal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
inline
Deprecated:
use normal_lpdf

Definition at line 42 of file normal_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_loc, T_scale> stan::math::normal_lpdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
inline

The log of the normal density for the specified scalar(s) given the specified mean(s) and deviation(s).

y, mu, or sigma can each be either a scalar or a vector. Any vector inputs must be the same length.

The result log probability is defined to be the sum of the log probabilities for each observation/mean/deviation triple.

Template Parameters
T_ytype of scalar
T_loctype of location parameter
T_scaletype of scale parameter
Parameters
y(Sequence of) scalar(s).
mu(Sequence of) location parameter(s) for the normal distribution.
sigma(Sequence of) scale parameters for the normal distribution.
Returns
The log of the product of the densities.
Exceptions
std::domain_errorif the scale is not positive.

Definition at line 44 of file normal_lpdf.hpp.

template<typename T_loc , typename T_scale , class RNG >
VectorBuilder<true, double, T_loc, T_scale>::type stan::math::normal_rng ( const T_loc &  mu,
const T_scale &  sigma,
RNG &  rng 
)
inline

Return a Normal random variate for the given location and scale using the specified random number generator.

mu and sigma can each be a scalar or a vector. Any non-scalar inputs must be the same length.

Template Parameters
T_loctype of location parameter
T_scaletype of scale parameter
RNGtype of random number generator
Parameters
mu(Sequence of) location parameter(s)
sigma(Sequence of) positive scale parameter(s)
rngrandom number generator
Returns
(Sequence of) normal random variate(s)
Exceptions
std::domain_errorif mu is infinite or sigma is nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 33 of file normal_rng.hpp.

template<bool propto, typename T_y , typename T_s , typename T_n , typename T_loc , typename T_scale >
return_type_t<T_y, T_s, T_loc, T_scale> stan::math::normal_sufficient_log ( const T_y &  y_bar,
const T_s &  s_squared,
const T_n &  n_obs,
const T_loc &  mu,
const T_scale &  sigma 
)
inline
Deprecated:
use normal_lpdf

Definition at line 15 of file normal_sufficient_log.hpp.

template<typename T_y , typename T_s , typename T_n , typename T_loc , typename T_scale >
return_type_t<T_y, T_s, T_loc, T_scale> stan::math::normal_sufficient_log ( const T_y &  y_bar,
const T_s &  s_squared,
const T_n &  n_obs,
const T_loc &  mu,
const T_scale &  sigma 
)
inline
Deprecated:
use normal_lpdf

Definition at line 27 of file normal_sufficient_log.hpp.

template<bool propto, typename T_y , typename T_s , typename T_n , typename T_loc , typename T_scale >
return_type_t<T_y, T_s, T_loc, T_scale> stan::math::normal_sufficient_lpdf ( const T_y &  y_bar,
const T_s &  s_squared,
const T_n &  n_obs,
const T_loc &  mu,
const T_scale &  sigma 
)

The log of the normal density for the specified scalar(s) given the specified mean(s) and deviation(s).

y, s_squared, mu, or sigma can each be either a scalar, a std vector or Eigen vector. n can be either a single int or an std vector of ints. Any vector inputs must be the same length.

The result log probability is defined to be the sum of the log probabilities for each observation/mean/deviation triple.

Template Parameters
T_ytype of sample average parameter
T_stype of sample squared errors parameter
T_ntype of sample size parameter
T_loctype of location parameter
T_scaletype of scale parameter
Parameters
y_bar(Sequence of) scalar(s) (sample average(s)).
s_squared(Sequence of) sum(s) of sample squared errors
n_obs(Sequence of) sample size(s)
mu(Sequence of) location parameter(s) for the normal distribution.
sigma(Sequence of) scale parameters for the normal distribution.
Returns
The log of the product of the densities.
Exceptions
std::domain_errorif either n or sigma are not positive, if s_squared is negative or if any parameter is not finite.

Definition at line 54 of file normal_sufficient_lpdf.hpp.

template<typename T_y , typename T_scale , typename T_shape >
return_type_t<T_y, T_scale, T_shape> stan::math::pareto_ccdf_log ( const T_y &  y,
const T_scale &  y_min,
const T_shape &  alpha 
)
Deprecated:
use pareto_lccdf

Definition at line 14 of file pareto_ccdf_log.hpp.

template<typename T_y , typename T_scale , typename T_shape >
return_type_t<T_y, T_scale, T_shape> stan::math::pareto_cdf_log ( const T_y &  y,
const T_scale &  y_min,
const T_shape &  alpha 
)
Deprecated:
use pareto_lcdf

Definition at line 14 of file pareto_cdf_log.hpp.

template<bool propto, typename T_y , typename T_scale , typename T_shape >
return_type_t<T_y, T_scale, T_shape> stan::math::pareto_log ( const T_y &  y,
const T_scale &  y_min,
const T_shape &  alpha 
)
Deprecated:
use pareto_lpdf

Definition at line 14 of file pareto_log.hpp.

template<typename T_y , typename T_scale , typename T_shape >
return_type_t<T_y, T_scale, T_shape> stan::math::pareto_log ( const T_y &  y,
const T_scale &  y_min,
const T_shape &  alpha 
)
inline
Deprecated:
use pareto_lpdf

Definition at line 24 of file pareto_log.hpp.

template<typename T_shape , typename T_scale , class RNG >
VectorBuilder<true, double, T_shape, T_scale>::type stan::math::pareto_rng ( const T_scale &  y_min,
const T_shape &  alpha,
RNG &  rng 
)
inline

Return a Pareto random variate for the given shape and scale parameters using the specified random number generator.

y_min and alpha can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_scaletype of scale parameter
T_shapetype of shape parameter
RNGtype of random number generator
Parameters
y_min(Sequence of) positive scale parameter(s)
alpha(Sequence of) positive shape parameter(s)
rngrandom number generator
Returns
(Sequence of) Pareto random variate(s)
Exceptions
std::domain_errorif y_min or alpha are nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 35 of file pareto_rng.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::pareto_type_2_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  lambda,
const T_shape &  alpha 
)
Deprecated:
use pareto_type_2_lccdf

Definition at line 14 of file pareto_type_2_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::pareto_type_2_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  lambda,
const T_shape &  alpha 
)
Deprecated:
use pareto_type_2_lcdf

Definition at line 14 of file pareto_type_2_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::pareto_type_2_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  lambda,
const T_shape &  alpha 
)
Deprecated:
use pareto_type_2_lpdf

Definition at line 15 of file pareto_type_2_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::pareto_type_2_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  lambda,
const T_shape &  alpha 
)
inline
Deprecated:
use pareto_type_2_lpdf

Definition at line 26 of file pareto_type_2_log.hpp.

template<typename T_loc , typename T_scale , typename T_shape , class RNG >
VectorBuilder<true, double, T_loc, T_scale, T_shape>::type stan::math::pareto_type_2_rng ( const T_loc &  mu,
const T_scale &  lambda,
const T_shape &  alpha,
RNG &  rng 
)
inline

Return a Pareto type 2 random variate for the given location, scale, and shape using the specified random number generator.

mu, lambda, and alpha can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_loctype of location parameter
T_scaletype of scale parameter
T_shapetype of shape parameter
RNGtype of random number generator
Parameters
mu(Sequence of) location parameter(s)
lambda(Sequence of) scale parameter(s)
alpha(Sequence of) shape parameter(s)
rngrandom number generator
Returns
(Sequence of) Pareto type 2 random variate(s)
Exceptions
std::domain_errorif mu is infinite or lambda or alpha are nonpositive,
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 42 of file pareto_type_2_rng.hpp.

template<typename T_y , typename T_theta >
return_type_t<T_theta> stan::math::poisson_binomial_ccdf_log ( const T_y &  y,
const T_theta &  theta 
)
Deprecated:
use poisson_binomial_lccdf

Definition at line 14 of file poisson_binomial_ccdf_log.hpp.

template<bool propto, typename T_y , typename T_theta >
return_type_t<T_theta> stan::math::poisson_binomial_cdf ( const T_y &  y,
const T_theta &  theta 
)

Returns the CDF for the Poisson-binomial distribution evaluated at the specified number of successes and probabilities of successes.

Template Parameters
T_ytype of number of successes parameter
T_thetatype of chance of success parameters
Parameters
yinput scalar, vector, or nested vector of numbers of successes
thetaarray of chances of success parameters
Returns
sum of log probabilities
Exceptions
std::domain_errorif y is out of bounds
std::domain_errorif theta is not a valid vector of probabilities
std::invalid_argumentIf y and theta are different lengths

Definition at line 36 of file poisson_binomial_cdf.hpp.

template<typename T_y , typename T_theta >
return_type_t<T_theta> stan::math::poisson_binomial_cdf_log ( const T_y &  y,
const T_theta &  theta 
)
Deprecated:
use poisson_binomial_lcdf

Definition at line 14 of file poisson_binomial_cdf_log.hpp.

template<bool propto, typename T_y , typename T_theta >
return_type_t<T_theta> stan::math::poisson_binomial_lccdf ( const T_y &  y,
const T_theta &  theta 
)

Returns the log CCDF for the Poisson-binomial distribution evaluated at the specified number of successes and probabilities of successes.

Template Parameters
T_ytype of number of successes parameter
T_thetatype of chance of success parameters
Parameters
yinput scalar, vector, or nested vector of numbers of successes
thetaarray of chances of success parameters
Returns
sum of log probabilities
Exceptions
std::domain_errorif y is out of bounds
std::domain_errorif theta is not a valid vector of probabilities
std::invalid_argumentIf y and theta are different lengths

Definition at line 37 of file poisson_binomial_lccdf.hpp.

template<bool propto, typename T_y , typename T_theta >
return_type_t<T_theta> stan::math::poisson_binomial_lcdf ( const T_y &  y,
const T_theta &  theta 
)

Returns the log CDF for the Poisson-binomial distribution evaluated at the specified number of successes and probabilities of successes.

Template Parameters
T_ytype of number of successes parameter
T_thetatype of chance of success parameters
Parameters
yinput scalar, vector, or nested vector of numbers of successes
thetaarray of chances of success parameters
Returns
sum of log probabilities
Exceptions
std::domain_errorif y is out of bounds
std::domain_errorif theta is not a valid vector of probabilities
std::invalid_argumentIf y and theta are different lengths

Definition at line 36 of file poisson_binomial_lcdf.hpp.

template<bool propto, typename T_y , typename T_theta >
return_type_t<T_theta> stan::math::poisson_binomial_log ( const T_y &  y,
const T_theta &  theta 
)
Deprecated:
use poisson_binomial_lpmf

Definition at line 14 of file poisson_binomial_log.hpp.

template<typename T_y , typename T_theta >
return_type_t<T_theta> stan::math::poisson_binomial_log ( const T_y &  y,
const T_theta &  theta 
)
inline
Deprecated:
use poisson_binomial_lpmf

Definition at line 23 of file poisson_binomial_log.hpp.

template<bool propto, typename T_y , typename T_theta >
return_type_t<T_theta> stan::math::poisson_binomial_lpmf ( const T_y &  y,
const T_theta &  theta 
)

Returns the log PMF for the Poisson-binomial distribution evaluated at an specified array of numbers of successes and probabilities of successes.

Template Parameters
T_ytype of number of successes parameter
T_thetatype of chance of success parameters
Parameters
yinput scalar, vector, or nested vector of numbers of successes
thetaarray of chances of success parameters
Returns
sum of log probabilities
Exceptions
std::domain_errorif y is out of bounds
std::domain_errorif theta is not a valid vector of probabilities
std::invalid_argumentIf y and theta are different lengths

Definition at line 28 of file poisson_binomial_lpmf.hpp.

template<typename T_theta , typename RNG , require_eigen_vt< std::is_arithmetic, T_theta > * = nullptr>
int stan::math::poisson_binomial_rng ( const T_theta &  theta,
RNG &  rng 
)
inline

Return a pseudorandom Poisson binomial random variable for the given vector of success parameters using the specified random number generator.

Template Parameters
RNGclass of rng
Parameters
theta(Sequence of) chance of success parameter(s)
rngrandom number generator
Returns
a Poisson binomial distribution random variable
Exceptions
std::domain_errorif theta is not a valid probability

Definition at line 26 of file poisson_binomial_rng.hpp.

template<typename T_n , typename T_rate >
return_type_t<T_rate> stan::math::poisson_ccdf_log ( const T_n &  n,
const T_rate &  lambda 
)
Deprecated:
use poisson_lccdf

Definition at line 14 of file poisson_ccdf_log.hpp.

template<typename T_n , typename T_rate >
return_type_t<T_rate> stan::math::poisson_cdf_log ( const T_n &  n,
const T_rate &  lambda 
)
Deprecated:
use poisson_lcdf

Definition at line 14 of file poisson_cdf_log.hpp.

template<bool propto, typename T_n , typename T_rate >
return_type_t<T_rate> stan::math::poisson_log ( const T_n &  n,
const T_rate &  lambda 
)
Deprecated:
use poisson_lpmf

Definition at line 14 of file poisson_log.hpp.

template<typename T_n , typename T_rate >
return_type_t<T_rate> stan::math::poisson_log ( const T_n &  n,
const T_rate &  lambda 
)
inline
Deprecated:
use poisson_lpmf

Definition at line 22 of file poisson_log.hpp.

template<bool propto, typename T_n , typename T_log_rate >
return_type_t<T_log_rate> stan::math::poisson_log_log ( const T_n &  n,
const T_log_rate &  alpha 
)
Deprecated:
use poisson_log_lpmf

Definition at line 14 of file poisson_log_log.hpp.

template<typename T_n , typename T_log_rate >
return_type_t<T_log_rate> stan::math::poisson_log_log ( const T_n &  n,
const T_log_rate &  alpha 
)
inline
Deprecated:
use poisson_log_lpmf

Definition at line 23 of file poisson_log_log.hpp.

template<typename T_rate , class RNG >
VectorBuilder<true, int, T_rate>::type stan::math::poisson_log_rng ( const T_rate &  alpha,
RNG &  rng 
)
inline

Return a Poisson random variate with specified log rate parameter using the given random number generator.

lambda can be a scalar or a one-dimensional container.

Template Parameters
T_ratetype of log rate parameter
RNGtype of random number generator
Parameters
alpha(Sequence of) log rate parameter(s)
rngrandom number generator
Returns
(Sequence of) Poisson random variate(s)
Exceptions
std::domain_errorif alpha is nonfinite

Definition at line 31 of file poisson_log_rng.hpp.

template<typename T_rate , class RNG >
VectorBuilder<true, int, T_rate>::type stan::math::poisson_rng ( const T_rate &  lambda,
RNG &  rng 
)
inline

Return a Poisson random variate with specified rate parameter using the given random number generator.

lambda can be a scalar or a one-dimensional container.

Template Parameters
T_ratetype of rate parameter
RNGtype of random number generator
Parameters
lambda(Sequence of) rate parameter(s)
rngrandom number generator
Returns
(Sequence of) Poisson random variate(s)
Exceptions
std::domain_errorif lambda is nonpositive

Definition at line 30 of file poisson_rng.hpp.

template<typename T_y , typename T_scale >
return_type_t<T_y, T_scale> stan::math::rayleigh_ccdf_log ( const T_y &  y,
const T_scale &  sigma 
)
Deprecated:
use rayleigh_lccdf

Definition at line 14 of file rayleigh_ccdf_log.hpp.

template<typename T_y , typename T_scale >
return_type_t<T_y, T_scale> stan::math::rayleigh_cdf_log ( const T_y &  y,
const T_scale &  sigma 
)
Deprecated:
use rayleigh_lcdf

Definition at line 14 of file rayleigh_cdf_log.hpp.

template<bool propto, typename T_y , typename T_scale >
return_type_t<T_y, T_scale> stan::math::rayleigh_log ( const T_y &  y,
const T_scale &  sigma 
)
Deprecated:
use rayleigh_lpdf

Definition at line 14 of file rayleigh_log.hpp.

template<typename T_y , typename T_scale >
return_type_t<T_y, T_scale> stan::math::rayleigh_log ( const T_y &  y,
const T_scale &  sigma 
)
inline
Deprecated:
use rayleigh_lpdf

Definition at line 22 of file rayleigh_log.hpp.

template<typename T_scale , class RNG >
VectorBuilder<true, double, T_scale>::type stan::math::rayleigh_rng ( const T_scale &  sigma,
RNG &  rng 
)
inline

Return a Rayleigh random variate with scale parameter sigma using the specified random number generator.

sigma can be a scalar or a one-dimensional container.

Template Parameters
T_scaleType of scale parameter
RNGclass of random number generator
Parameters
sigma(Sequence of) positive scale parameter(s)
rngrandom number generator
Returns
(Sequence of) Rayleigh random variate(s)
Exceptions
std::domain_errorif sigma is nonpositive

Definition at line 30 of file rayleigh_rng.hpp.

template<typename T_y , typename T_dof , typename T_scale >
return_type_t<T_y, T_dof, T_scale> stan::math::scaled_inv_chi_square_ccdf_log ( const T_y &  y,
const T_dof &  nu,
const T_scale &  s 
)
Deprecated:
use scaled_inv_chi_square_lccdf

Definition at line 14 of file scaled_inv_chi_square_ccdf_log.hpp.

template<typename T_y , typename T_dof , typename T_scale >
return_type_t<T_y, T_dof, T_scale> stan::math::scaled_inv_chi_square_cdf ( const T_y &  y,
const T_dof &  nu,
const T_scale &  s 
)

The CDF of a scaled inverse chi-squared density for y with the specified degrees of freedom parameter and scale parameter.

Template Parameters
T_ytype of scalar
T_doftype of degrees of freedom
Parameters
yA scalar variable.
nuDegrees of freedom.
sScale parameter.
Exceptions
std::domain_errorif nu is not greater than 0
std::domain_errorif s is not greater than 0.
std::domain_errorif y is not greater than 0.

Definition at line 38 of file scaled_inv_chi_square_cdf.hpp.

template<typename T_y , typename T_dof , typename T_scale >
return_type_t<T_y, T_dof, T_scale> stan::math::scaled_inv_chi_square_cdf_log ( const T_y &  y,
const T_dof &  nu,
const T_scale &  s 
)
Deprecated:
use scaled_inv_chi_square_lcdf

Definition at line 14 of file scaled_inv_chi_square_cdf_log.hpp.

template<bool propto, typename T_y , typename T_dof , typename T_scale >
return_type_t<T_y, T_dof, T_scale> stan::math::scaled_inv_chi_square_log ( const T_y &  y,
const T_dof &  nu,
const T_scale &  s 
)

The log of a scaled inverse chi-squared density for y with the specified degrees of freedom parameter and scale parameter.

\begin{eqnarray*} y &\sim& \mbox{\sf{Inv-}}\chi^2(\nu, s^2) \\ \log (p (y \, |\, \nu, s)) &=& \log \left( \frac{(\nu / 2)^{\nu / 2}}{\Gamma (\nu / 2)} s^\nu y^{- (\nu / 2 + 1)} \exp^{-\nu s^2 / (2y)} \right) \\ &=& \frac{\nu}{2} \log(\frac{\nu}{2}) - \log (\Gamma (\nu / 2)) + \nu \log(s) - (\frac{\nu}{2} + 1) \log(y) - \frac{\nu s^2}{2y} \\ & & \mathrm{ where } \; y > 0 \end{eqnarray*}

Deprecated:
use scaled_inv_chi_square_lpdf
Parameters
yA scalar variable.
nuDegrees of freedom.
sScale parameter.
Exceptions
std::domain_errorif nu is not greater than 0
std::domain_errorif s is not greater than 0.
std::domain_errorif y is not greater than 0.
Template Parameters
T_yType of scalar.
T_dofType of degrees of freedom.

Definition at line 34 of file scaled_inv_chi_square_log.hpp.

template<typename T_y , typename T_dof , typename T_scale >
return_type_t<T_y, T_dof, T_scale> stan::math::scaled_inv_chi_square_log ( const T_y &  y,
const T_dof &  nu,
const T_scale &  s 
)
inline
Deprecated:
use scaled_inv_chi_square_lpdf

Definition at line 44 of file scaled_inv_chi_square_log.hpp.

template<bool propto, typename T_y , typename T_dof , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof, T_scale > * = nullptr>
return_type_t<T_y, T_dof, T_scale> stan::math::scaled_inv_chi_square_lpdf ( const T_y &  y,
const T_dof &  nu,
const T_scale &  s 
)

The log of a scaled inverse chi-squared density for y with the specified degrees of freedom parameter and scale parameter.

\begin{eqnarray*} y &\sim& \mbox{\sf{Inv-}}\chi^2(\nu, s^2) \\ \log (p (y \, |\, \nu, s)) &=& \log \left( \frac{(\nu / 2)^{\nu / 2}}{\Gamma (\nu / 2)} s^\nu y^{- (\nu / 2 + 1)} \exp^{-\nu s^2 / (2y)} \right) \\ &=& \frac{\nu}{2} \log(\frac{\nu}{2}) - \log (\Gamma (\nu / 2)) + \nu \log(s) - (\frac{\nu}{2} + 1) \log(y) - \frac{\nu s^2}{2y} \\ & & \mathrm{ where } \; y > 0 \end{eqnarray*}

Template Parameters
T_ytype of scalar
T_doftype of degrees of freedom
T_Scaletype of scale
Parameters
yA scalar variable.
nuDegrees of freedom.
sScale parameter.
Exceptions
std::domain_errorif nu is not greater than 0
std::domain_errorif s is not greater than 0.
std::domain_errorif y is not greater than 0.

Definition at line 47 of file scaled_inv_chi_square_lpdf.hpp.

template<typename T_deg , typename T_scale , class RNG >
VectorBuilder<true, double, T_deg, T_scale>::type stan::math::scaled_inv_chi_square_rng ( const T_deg &  nu,
const T_scale &  s,
RNG &  rng 
)
inline

Return a scaled chi square random variate for the given number of degrees of freedom and scale using the specified random number generator.

nu and sigma can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_degtype of degrees of freedom parameter
T_scaletype of scale parameter
RNGtype of random number generator
Parameters
nu(Sequence of) positive degrees of freedom parameter(s)
s(Sequence of) positive scale parameter(s)
rngrandom number generator
Returns
(Sequence of) scaled chi square random variate(s)
Exceptions
std::domain_errorif nu or sigma are nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 36 of file scaled_inv_chi_square_rng.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_skewness >
return_type_t<T_y, T_loc, T_scale, T_skewness> stan::math::skew_double_exponential_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_skewness &  tau 
)
inline
Deprecated:
use skew_double_exponential_lccdf

Definition at line 15 of file skew_double_exponential_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_skewness , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_skewness > * = nullptr>
return_type_t<T_y, T_loc, T_scale, T_skewness> stan::math::skew_double_exponential_cdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_skewness &  tau 
)

Returns the skew double exponential cumulative density function.

Given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ytype of real parameter.
T_loctype of location parameter.
T_scaletype of scale parameter.
T_skewnesstype of skewness parameter.
Parameters
yreal parameter
mulocation parameter
sigmascale parameter
tauskewness parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif mu is infinite or sigma is nonpositive or tau is not bound between 0.0 and 1.0
std::invalid_argumentif container sizes mismatch

Definition at line 41 of file skew_double_exponential_cdf.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_skewness >
return_type_t<T_y, T_loc, T_scale, T_skewness> stan::math::skew_double_exponential_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_skewness &  tau 
)
inline
Deprecated:
use skew_double_exponential_lcdf

Definition at line 15 of file skew_double_exponential_cdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_skewness , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_skewness > * = nullptr>
return_type_t<T_y, T_loc, T_scale, T_skewness> stan::math::skew_double_exponential_lccdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_skewness &  tau 
)

Returns the skew double exponential log complementary cumulative density function.

Given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ytype of real parameter.
T_loctype of location parameter.
T_scaletype of scale parameter.
T_skewnesstype of skewness parameter.
Parameters
yreal parameter
mulocation parameter
sigmascale parameter
tauskewness parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif mu is infinite or sigma is nonpositive or tau is not bound between 0.0 and 1.0
std::invalid_argumentif container sizes mismatch

Definition at line 40 of file skew_double_exponential_lccdf.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_skewness , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_skewness > * = nullptr>
return_type_t<T_y, T_loc, T_scale, T_skewness> stan::math::skew_double_exponential_lcdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_skewness &  tau 
)

Returns the skew double exponential log cumulative density function.

Given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ytype of real parameter.
T_loctype of location parameter.
T_scaletype of scale parameter.
T_skewnesstype of skewness parameter.
Parameters
yreal parameter
mulocation parameter
sigmascale parameter
tauskewness parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif mu is infinite or sigma is nonpositive or tau is not bound between 0.0 and 1.0
std::invalid_argumentif container sizes mismatch

Definition at line 41 of file skew_double_exponential_lcdf.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_skewness >
return_type_t<T_y, T_loc, T_scale, T_skewness> stan::math::skew_double_exponential_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_skewness &  tau 
)
Deprecated:
use skew_double_exponential_log

Definition at line 15 of file skew_double_exponential_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_skewness >
return_type_t<T_y, T_loc, T_scale, T_skewness> stan::math::skew_double_exponential_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_skewness &  tau 
)
inline
Deprecated:
use skew_double_exponential_log

Definition at line 27 of file skew_double_exponential_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_skewness , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_loc, T_scale, T_skewness > * = nullptr>
return_type_t<T_y, T_loc, T_scale, T_skewness> stan::math::skew_double_exponential_lpdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_skewness &  tau 
)

Returns the skew double exponential log probability density function.

Given containers of matching sizes, returns the log sum of densities.

Template Parameters
T_ytype of real parameter.
T_loctype of location parameter.
T_scaletype of scale parameter.
T_skewnesstype of skewness parameter.
Parameters
yreal parameter
mulocation parameter
sigmascale parameter
tauskewness parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif mu is infinite or sigma is nonpositive or tau is not bound between 0.0 and 1.0
std::invalid_argumentif container sizes mismatch

Definition at line 43 of file skew_double_exponential_lpdf.hpp.

template<typename T_loc , typename T_scale , typename T_skewness , class RNG >
VectorBuilder<true, double, T_loc, T_scale, T_skewness>::type stan::math::skew_double_exponential_rng ( const T_loc &  mu,
const T_scale &  sigma,
const T_skewness &  tau,
RNG &  rng 
)
inline

Return a skew double exponential random variate with the given location scale and skewness using the specified random number generator.

mu, sigma and tau can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_locType of location parameter
T_scaleType of scale parameter
T_skewnessType of skewness parameter
RNGclass of random number generator
Parameters
mu(Sequence of) location parameter(s)
sigma(Sequence of) scale parameter(s)
tau(Sequence of) skewness parameter(s)
rngrandom number generator
Returns
(Sequence of) double exponential random variate(s)
Exceptions
std::domain_errorif mu is infinite or sigma is nonpositive or tau is not bound between 0.0 and 1.0
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 38 of file skew_double_exponential_rng.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::skew_normal_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_shape &  alpha 
)
Deprecated:
use skew_normal_lccdf

Definition at line 14 of file skew_normal_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::skew_normal_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_shape &  alpha 
)
Deprecated:
use skew_normal_lcdf

Definition at line 14 of file skew_normal_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::skew_normal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_shape &  alpha 
)
Deprecated:
use skew_normal_lpdf

Definition at line 15 of file skew_normal_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type_t<T_y, T_loc, T_scale, T_shape> stan::math::skew_normal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_shape &  alpha 
)
inline
Deprecated:
use skew_normal_lpdf

Definition at line 25 of file skew_normal_log.hpp.

template<typename T_loc , typename T_scale , typename T_shape , class RNG >
VectorBuilder<true, double, T_loc, T_scale, T_shape>::type stan::math::skew_normal_rng ( const T_loc &  mu,
const T_scale &  sigma,
const T_shape &  alpha,
RNG &  rng 
)
inline

Return a Skew-normal random variate for the given location, scale, and shape using the specified random number generator.

mu, sigma, and alpha can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_loctype of location parameter
T_scaletype of scale parameter
T_shapetype of shape parameter
RNGtype of random number generator
Parameters
mu(Sequence of) location parameter(s)
sigma(Sequence of) scale parameter(s)
alpha(Sequence of) shape parameter(s)
rngrandom number generator
Returns
(Sequence of) Skew-normal random variate(s)
Exceptions
std::domain_errorif mu is infinite, sigma is nonpositive, or alpha is infinite
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 40 of file skew_normal_rng.hpp.

template<typename T_y >
return_type_t<T_y> stan::math::std_normal_ccdf_log ( const T_y &  y)
inline
Deprecated:
use std_normal_lccdf

Definition at line 14 of file std_normal_ccdf_log.hpp.

template<typename T_y , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y > * = nullptr>
return_type_t<T_y> stan::math::std_normal_cdf ( const T_y &  y)
inline

Calculates the standard normal cumulative distribution function for the given variate.

\(\Phi(x) = \frac{1}{\sqrt{2 \pi}} \int_{-\inf}^x e^{-t^2/2} dt\).

Template Parameters
T_ytype of y
Parameters
yscalar variate
Returns
The standard normal cdf evaluated at the specified argument.

Definition at line 33 of file std_normal_cdf.hpp.

template<typename T_y >
return_type_t<T_y> stan::math::std_normal_cdf_log ( const T_y &  y)
inline
Deprecated:
use std_normal_lcdf

Definition at line 14 of file std_normal_cdf_log.hpp.

template<bool propto, typename T_y >
return_type_t<T_y> stan::math::std_normal_log ( const T_y &  y)

The log of a standard normal density for the specified scalar(s).

y can be either a scalar or a vector.

The result log probability is defined to be the sum of the log probabilities for each observation.

Deprecated:
use std_normal_lpdf
Template Parameters
T_yUnderlying type of scalar in sequence.
Parameters
y(Sequence of) scalar(s).
Returns
The log of the product of the densities.
Exceptions
std::domain_errorif any scalar is nan.

Definition at line 25 of file std_normal_log.hpp.

template<typename T_y >
return_type_t<T_y> stan::math::std_normal_log ( const T_y &  y)
inline
Deprecated:
use std_normal_lpdf

Definition at line 33 of file std_normal_log.hpp.

template<bool propto, typename T_y , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y > * = nullptr>
return_type_t<T_y> stan::math::std_normal_lpdf ( const T_y &  y)

The log of the normal density for the specified scalar(s) given a location of 0 and a scale of 1.

y can be either a scalar or a vector.

The result log probability is defined to be the sum of the log probabilities for each observation.

Template Parameters
T_ytype of scalar
Parameters
y(Sequence of) scalar(s).
Returns
The log of the product of the densities.
Exceptions
std::domain_errorif any scalar is nan.

Definition at line 32 of file std_normal_lpdf.hpp.

template<class RNG >
double stan::math::std_normal_rng ( RNG &  rng)
inline

Return a standard Normal random variate using the specified random number generator.

Template Parameters
RNGtype of random number generator
Parameters
rngrandom number generator
Returns
A standard normal random variate

Definition at line 20 of file std_normal_rng.hpp.

template<typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type_t<T_y, T_dof, T_loc, T_scale> stan::math::student_t_ccdf_log ( const T_y &  y,
const T_dof &  nu,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use student_t_lccdf

Definition at line 14 of file student_t_ccdf_log.hpp.

template<typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type_t<T_y, T_dof, T_loc, T_scale> stan::math::student_t_cdf_log ( const T_y &  y,
const T_dof &  nu,
const T_loc &  mu,
const T_scale &  sigma 
)
Deprecated:
use student_t_lcdf

Definition at line 14 of file student_t_cdf_log.hpp.

template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type_t<T_y, T_dof, T_loc, T_scale> stan::math::student_t_log ( const T_y &  y,
const T_dof &  nu,
const T_loc &  mu,
const T_scale &  sigma 
)

The log of the Student-t density for the given y, nu, mean, and scale parameter.

The scale parameter must be greater than 0.

\begin{eqnarray*} y &\sim& t_{\nu} (\mu, \sigma^2) \\ \log (p (y \, |\, \nu, \mu, \sigma) ) &=& \log \left( \frac{\Gamma((\nu + 1) /2)} {\Gamma(\nu/2)\sqrt{\nu \pi} \sigma} \left( 1 + \frac{1}{\nu} (\frac{y - \mu}{\sigma})^2 \right)^{-(\nu + 1)/2} \right) \\ &=& \log( \Gamma( (\nu+1)/2 )) - \log (\Gamma (\nu/2) - \frac{1}{2} \log(\nu \pi) - \log(\sigma) -\frac{\nu + 1}{2} \log (1 + \frac{1}{\nu} (\frac{y - \mu}{\sigma})^2) \end{eqnarray*}

Deprecated:
use student_t_lpdf
Parameters
yA scalar variable.
nuDegrees of freedom.
muThe mean of the Student-t distribution.
sigmaThe scale parameter of the Student-t distribution.
Returns
The log of the Student-t density at y.
Exceptions
std::domain_errorif sigma is not greater than 0.
std::domain_errorif nu is not greater than 0.
Template Parameters
T_yType of scalar.
T_dofType of degrees of freedom.
T_locType of location.
T_scaleType of scale.

Definition at line 42 of file student_t_log.hpp.

template<typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type_t<T_y, T_dof, T_loc, T_scale> stan::math::student_t_log ( const T_y &  y,
const T_dof &  nu,
const T_loc &  mu,
const T_scale &  sigma 
)
inline
Deprecated:
use student_t_lpdf

Definition at line 53 of file student_t_log.hpp.

template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_dof, T_loc, T_scale > * = nullptr>
return_type_t<T_y, T_dof, T_loc, T_scale> stan::math::student_t_lpdf ( const T_y &  y,
const T_dof &  nu,
const T_loc &  mu,
const T_scale &  sigma 
)

The log of the Student-t density for the given y, nu, mean, and scale parameter.

The scale parameter must be greater than 0.

\begin{eqnarray*} y &\sim& t_{\nu} (\mu, \sigma^2) \\ \log (p (y \, |\, \nu, \mu, \sigma) ) &=& \log \left( \frac{\Gamma((\nu + 1) /2)} {\Gamma(\nu/2)\sqrt{\nu \pi} \sigma} \left( 1 + \frac{1}{\nu} (\frac{y - \mu}{\sigma})^2 \right)^{-(\nu + 1)/2} \right) \\ &=& \log( \Gamma( (\nu+1)/2 )) - \log (\Gamma (\nu/2) - \frac{1}{2} \log(\nu \pi) - \log(\sigma) -\frac{\nu + 1}{2} \log (1 + \frac{1}{\nu} (\frac{y - \mu}{\sigma})^2) \end{eqnarray*}

Template Parameters
T_ytype of scalar
T_doftype of degrees of freedom
T_loctype of location
T_scaletype of scale
Parameters
yA scalar variable.
nuDegrees of freedom.
muThe mean of the Student-t distribution.
sigmaThe scale parameter of the Student-t distribution.
Returns
The log of the Student-t density at y.
Exceptions
std::domain_errorif sigma is not greater than 0.
std::domain_errorif nu is not greater than 0.

Definition at line 59 of file student_t_lpdf.hpp.

template<typename T_deg , typename T_loc , typename T_scale , class RNG >
VectorBuilder<true, double, T_deg, T_loc, T_scale>::type stan::math::student_t_rng ( const T_deg &  nu,
const T_loc &  mu,
const T_scale &  sigma,
RNG &  rng 
)
inline

Return a student-t random variate for the given degrees of freedom, location, and scale using the specified random number generator.

nu, mu, and sigma can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_degtype of degrees of freedom parameter
T_loctype of location parameter
T_scaletype of scale parameter
RNGtype of random number generator
Parameters
nu(Sequence of) degrees of freedom parameter(s)
mu(Sequence of) location parameter(s)
sigma(Sequence of) scale parameter(s)
rngrandom number generator
Returns
Student-t random variate
Exceptions
std::domain_errorif nu is nonpositive, mu is infinite, or sigma is nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 38 of file student_t_rng.hpp.

template<typename T_y , typename T_low , typename T_high >
return_type_t<T_y, T_low, T_high> stan::math::uniform_ccdf_log ( const T_y &  y,
const T_low &  alpha,
const T_high &  beta 
)
Deprecated:
use uniform_lccdf

Definition at line 14 of file uniform_ccdf_log.hpp.

template<typename T_y , typename T_low , typename T_high >
return_type_t<T_y, T_low, T_high> stan::math::uniform_cdf_log ( const T_y &  y,
const T_low &  alpha,
const T_high &  beta 
)
Deprecated:
use uniform_lcdf

Definition at line 14 of file uniform_cdf_log.hpp.

template<bool propto, typename T_y , typename T_low , typename T_high >
return_type_t<T_y, T_low, T_high> stan::math::uniform_log ( const T_y &  y,
const T_low &  alpha,
const T_high &  beta 
)

The log of a uniform density for the given y, lower, and upper bound.

\begin{eqnarray*} y &\sim& \mbox{\sf{U}}(\alpha, \beta) \\ \log (p (y \, |\, \alpha, \beta)) &=& \log \left( \frac{1}{\beta-\alpha} \right) \\ &=& \log (1) - \log (\beta - \alpha) \\ &=& -\log (\beta - \alpha) \\ & & \mathrm{ where } \; y \in [\alpha, \beta], \log(0) \; \mathrm{otherwise} \end{eqnarray*}

Deprecated:
use uniform_lpdf
Parameters
yA scalar variable.
alphaLower bound.
betaUpper bound.
Exceptions
std::invalid_argumentif the lower bound is greater than or equal to the lower bound
Template Parameters
T_yType of scalar.
T_lowType of lower bound.
T_highType of upper bound.

Definition at line 35 of file uniform_log.hpp.

template<typename T_y , typename T_low , typename T_high >
return_type_t<T_y, T_low, T_high> stan::math::uniform_log ( const T_y &  y,
const T_low &  alpha,
const T_high &  beta 
)
inline
Deprecated:
use uniform_lpdf

Definition at line 44 of file uniform_log.hpp.

template<bool propto, typename T_y , typename T_low , typename T_high , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_low, T_high > * = nullptr>
return_type_t<T_y, T_low, T_high> stan::math::uniform_lpdf ( const T_y &  y,
const T_low &  alpha,
const T_high &  beta 
)

The log of a uniform density for the given y, lower, and upper bound.

\begin{eqnarray*} y &\sim& \mbox{\sf{U}}(\alpha, \beta) \\ \log (p (y \, |\, \alpha, \beta)) &=& \log \left( \frac{1}{\beta-\alpha} \right) \\ &=& \log (1) - \log (\beta - \alpha) \\ &=& -\log (\beta - \alpha) \\ & & \mathrm{ where } \; y \in [\alpha, \beta], \log(0) \; \mathrm{otherwise} \end{eqnarray*}

Template Parameters
T_ytype of scalar
T_lowtype of lower bound
T_hightype of upper bound
Parameters
yA scalar variable.
alphaLower bound.
betaUpper bound.
Exceptions
std::invalid_argumentif the lower bound is greater than or equal to the lower bound

Definition at line 47 of file uniform_lpdf.hpp.

template<typename T_alpha , typename T_beta , class RNG >
VectorBuilder<true, double, T_alpha, T_beta>::type stan::math::uniform_rng ( const T_alpha &  alpha,
const T_beta &  beta,
RNG &  rng 
)
inline

Return a uniform random variate for the given upper and lower bounds using the specified random number generator.

alpha and beta can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_alphatype of shape parameter
T_betatype of inverse scale parameter
RNGtype of random number generator
Parameters
alpha(Sequence of) lower bound parameter(s)
beta(Sequence of) upper bound parameter(s)
rngrandom number generator
Returns
(Sequence of) uniform random variate(s)
Exceptions
std::domain_errorif alpha or beta are non-finite
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 35 of file uniform_rng.hpp.

template<typename T_x , typename T_mu , typename T_k >
return_type_t<T_x, T_mu, T_k> stan::math::von_mises_cdf ( const T_x &  x,
const T_mu &  mu,
const T_k &  k 
)
inline

Calculates the cumulative distribution function of the von Mises distribution:

\(VonMisesCDF(x, \mu, \kappa) = \frac{1}{2\pi I_0(\kappa)} \int_{-\pi}^x\) \(e^{\kappa cos(t - \mu)} dt\)

where

\(x \in [-\pi, \pi]\), \(\mu \in \mathbb{R}\), and \(\kappa \in \mathbb{R}^+\).

Parameters
xVariate on the interval \([-pi, pi]\)
muThe mean of the distribution
kThe inverse scale of the distriubtion
Returns
The von Mises cdf evaluated at the specified arguments
Template Parameters
T_xType of x
T_muType of mean parameter
T_kType of inverse scale parameter

Definition at line 119 of file von_mises_cdf.hpp.

template<typename T_x , typename T_mu , typename T_k >
return_type_t<T_x, T_mu, T_k> stan::math::von_mises_lccdf ( const T_x &  x,
const T_mu &  mu,
const T_k &  k 
)
inline

Calculates the log of the complement of the cumulative distribution function of the von Mises distribution:

\(VonMisesLCCDF(x, \mu, \kappa) = \log ( 1.0 - \frac{1}{2\pi I_0(\kappa)} \int_{-\pi}^x\) \(e^{\kappa cos(t - \mu)} dt )\)

where

\(x \in [-\pi, \pi]\), \(\mu \in \mathbb{R}\), and \(\kappa \in \mathbb{R}^+\).

Parameters
xVariate on the interval \([-pi, pi]\)
muThe mean of the distribution
kThe inverse scale of the distriubtion
Returns
The log of the von Mises cdf evaluated at the specified arguments
Template Parameters
T_xType of x
T_muType of mean parameter
T_kType of inverse scale parameter

Definition at line 32 of file von_mises_lccdf.hpp.

template<typename T_x , typename T_mu , typename T_k >
return_type_t<T_x, T_mu, T_k> stan::math::von_mises_lcdf ( const T_x &  x,
const T_mu &  mu,
const T_k &  k 
)
inline

Calculates the log of the cumulative distribution function of the von Mises distribution:

\(VonMisesLCDF(x, \mu, \kappa) = \log ( \frac{1}{2\pi I_0(\kappa)} \int_{-\pi}^x\) \(e^{\kappa cos(t - \mu)} dt )\)

where

\(x \in [-\pi, \pi]\), \(\mu \in \mathbb{R}\), and \(\kappa \in \mathbb{R}^+\).

Parameters
xVariate on the interval \([-pi, pi]\)
muThe mean of the distribution
kThe inverse scale of the distriubtion
Returns
The log of the von Mises cdf evaluated at the specified arguments
Template Parameters
T_xType of x
T_muType of mean parameter
T_kType of inverse scale parameter

Definition at line 32 of file von_mises_lcdf.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::von_mises_log ( T_y const &  y,
T_loc const &  mu,
T_scale const &  kappa 
)
Deprecated:
use von_mises_lpdf

Definition at line 14 of file von_mises_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type_t<T_y, T_loc, T_scale> stan::math::von_mises_log ( T_y const &  y,
T_loc const &  mu,
T_scale const &  kappa 
)
inline
Deprecated:
use von_mises_lpdf

Definition at line 23 of file von_mises_log.hpp.

template<typename T_loc , typename T_conc , class RNG >
VectorBuilder<true, double, T_loc, T_conc>::type stan::math::von_mises_rng ( const T_loc &  mu,
const T_conc &  kappa,
RNG &  rng 
)
inline

Return a von Mises random variate for the given location and concentration using the specified random number generator.

mu and kappa can each be a scalar or a vector. Any non-scalar inputs must be the same length.

The algorithm used in von_mises_rng is a modified version of the algorithm in:

Efficient Simulation of the von Mises Distribution D. J. Best and N. I. Fisher Journal of the Royal Statistical Society. Series C (Applied Statistics), Vol. 28, No. 2 (1979), pp. 152-157

For kappa < 1.4e-8, this reduces to a uniform distribution.

Template Parameters
T_loctype of location parameter
T_conctype of scale (concentration) parameter
RNGtype of random number generator
Parameters
mu(Sequence of) location parameter(s)
kappa(Sequence of) non-negative scale (concentration) parameter(s)
rngrandom number generator
Returns
(Sequence of) von Mises random variate(s)
Exceptions
std::domain_errorif mu is infinite or kappa is negative
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 46 of file von_mises_rng.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type_t<T_y, T_shape, T_scale> stan::math::weibull_ccdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)
Deprecated:
use weibull_lccdf

Definition at line 14 of file weibull_ccdf_log.hpp.

template<typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr>
return_type_t<T_y, T_shape, T_scale> stan::math::weibull_cdf ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)

Returns the Weibull cumulative distribution function for the given location and scale.

Given containers of matching sizes, returns the product of probabilities.

Template Parameters
T_ytype of real parameter
T_shapetype of shape parameter
T_scaletype of scale parameter
Parameters
yreal parameter
alphashape parameter
sigmascale parameter
Returns
probability or product of probabilities
Exceptions
std::domain_errorif y is negative, alpha sigma is nonpositive

Definition at line 39 of file weibull_cdf.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type_t<T_y, T_shape, T_scale> stan::math::weibull_cdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)
Deprecated:
use weibull_lcdf

Definition at line 14 of file weibull_cdf_log.hpp.

template<typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr>
return_type_t<T_y, T_shape, T_scale> stan::math::weibull_lccdf ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)

Returns the Weibull log complementary cumulative distribution function for the given location and scale.

Given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ytype of real parameter
T_shapetype of shape parameter
T_scaletype of scale parameter
Parameters
yreal parameter
alphashape parameter
sigmascale parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif y is negative, alpha sigma is nonpositive

Definition at line 37 of file weibull_lccdf.hpp.

template<typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr>
return_type_t<T_y, T_shape, T_scale> stan::math::weibull_lcdf ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)

Returns the Weibull log cumulative distribution function for the given location and scale.

Given containers of matching sizes, returns the log sum of probabilities.

Template Parameters
T_ytype of real parameter
T_shapetype of shape parameter
T_scaletype of scale parameter
Parameters
yreal parameter
alphashape parameter
sigmascale parameter
Returns
log probability or log sum of probabilities
Exceptions
std::domain_errorif y is negative, alpha sigma is nonpositive

Definition at line 38 of file weibull_lcdf.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_scale >
return_type_t<T_y, T_shape, T_scale> stan::math::weibull_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)
Deprecated:
use weibull_lpdf

Definition at line 14 of file weibull_log.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type_t<T_y, T_shape, T_scale> stan::math::weibull_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)
inline
Deprecated:
use weibull_lpdf

Definition at line 24 of file weibull_log.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_scale , require_all_not_nonscalar_prim_or_rev_kernel_expression_t< T_y, T_shape, T_scale > * = nullptr>
return_type_t<T_y, T_shape, T_scale> stan::math::weibull_lpdf ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)

Returns the Weibull log probability density for the given location and scale.

Given containers of matching sizes, returns the log sum of probability densities.

Template Parameters
T_ytype of real parameter
T_shapetype of shape parameter
T_scaletype of scale parameter
Parameters
yreal parameter
alphashape parameter
sigmascale parameter
Returns
log probability density or log sum of probability densities
Exceptions
std::domain_errorif y is negative, alpha or sigma are nonpositive

Definition at line 40 of file weibull_lpdf.hpp.

template<typename T_shape , typename T_scale , class RNG >
VectorBuilder<true, double, T_shape, T_scale>::type stan::math::weibull_rng ( const T_shape &  alpha,
const T_scale &  sigma,
RNG &  rng 
)
inline

Return a Weibull random variate for the given shape and scale parameters using the specified random number generator.

alpha and sigma can each be a scalar or a one-dimensional container. Any non-scalar inputs must be the same size.

Template Parameters
T_shapetype of shape parameter
T_scaletype of scale parameter
RNGtype of random number generator
Parameters
alpha(Sequence of) positive shape parameter(s)
sigma(Sequence of) positive scale parameter(s)
rngrandom number generator
Returns
(Sequence of) Weibull random variate(s)
Exceptions
std::domain_errorif alpha is nonpositive or sigma is nonpositive
std::invalid_argumentif non-scalar arguments are of different sizes

Definition at line 33 of file weibull_rng.hpp.

template<bool propto, typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta >
return_type_t<T_y, T_alpha, T_tau, T_beta, T_delta> stan::math::wiener_log ( const T_y &  y,
const T_alpha &  alpha,
const T_tau &  tau,
const T_beta &  beta,
const T_delta &  delta 
)

The log of the first passage time density function for a (Wiener) drift diffusion model for the given \(y\), boundary separation \(\alpha\), nondecision time \(\tau\), relative bias \(\beta\), and drift rate \(\delta\).

\(\alpha\) and \(\tau\) must be greater than 0, and \(\beta\) must be between 0 and 1. \(y\) should contain reaction times in seconds (strictly positive) with upper-boundary responses.

Deprecated:
use wiener_lpdf
Parameters
yA scalar variate.
alphaThe boundary separation.
tauThe nondecision time.
betaThe relative bias.
deltaThe drift rate.
Returns
The log of the Wiener first passage time density of the specified arguments.

Definition at line 32 of file wiener_log.hpp.

template<typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta >
return_type_t<T_y, T_alpha, T_tau, T_beta, T_delta> stan::math::wiener_log ( const T_y &  y,
const T_alpha &  alpha,
const T_tau &  tau,
const T_beta &  beta,
const T_delta &  delta 
)
inline
Deprecated:
use wiener_lpdf

Definition at line 44 of file wiener_log.hpp.

template<bool propto, typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta >
return_type_t<T_y, T_alpha, T_tau, T_beta, T_delta> stan::math::wiener_lpdf ( const T_y &  y,
const T_alpha &  alpha,
const T_tau &  tau,
const T_beta &  beta,
const T_delta &  delta 
)

The log of the first passage time density function for a (Wiener) drift diffusion model for the given \(y\), boundary separation \(\alpha\), nondecision time \(\tau\), relative bias \(\beta\), and drift rate \(\delta\).

\(\alpha\) and \(\tau\) must be greater than 0, and \(\beta\) must be between 0 and 1. \(y\) should contain reaction times in seconds (strictly positive) with upper-boundary responses.

Template Parameters
T_ytype of scalar
T_alphatype of alpha parameter
T_tautype of tau parameter
T_betatype of beta parameter
T_deltatype of delta parameter
Parameters
yA scalar variate.
alphaThe boundary separation.
tauThe nondecision time.
betaThe relative bias.
deltaThe drift rate.
Returns
The log of the Wiener first passage time density of the specified arguments.

Definition at line 77 of file wiener_lpdf.hpp.