Stan  2.5.0
probability, sampling & optimization
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Classes | Functions | Variables
stan::prob Namespace Reference

Templated probability distributions. More...

Classes

struct  include_summand
 Template metaprogram to calculate whether a summand needs to be included in a proportional (log) probability calculation. More...
 
class  welford_covar_estimator
 
class  welford_var_estimator
 

Functions

template<bool propto, typename T_y , typename T_loc , typename T_scale >
boost::enable_if_c
< contains_fvar< T_y, T_loc,
T_scale >::value, typename
return_type< T_y, T_loc,
T_scale >::type >::type 
normal_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<typename T >
void autocorrelation (const std::vector< T > &y, std::vector< T > &ac, Eigen::FFT< T > &fft)
 Write autocorrelation estimates for every lag for the specified input sequence into the specified result using the specified FFT engine. More...
 
template<typename T >
void autocorrelation (const std::vector< T > &y, std::vector< T > &ac)
 Write autocorrelation estimates for every lag for the specified input sequence into the specified result. More...
 
template<typename T >
void autocovariance (const std::vector< T > &y, std::vector< T > &acov, Eigen::FFT< T > &fft)
 Write autocovariance estimates for every lag for the specified input sequence into the specified result using the specified FFT engine. More...
 
template<typename T >
void autocovariance (const std::vector< T > &y, std::vector< T > &acov)
 Write autocovariance estimates for every lag for the specified input sequence into the specified result. More...
 
template<bool propto, typename T_prob , typename T_prior_sample_size >
boost::math::tools::promote_args
< T_prob, T_prior_sample_size >
::type 
dirichlet_log (const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta, const Eigen::Matrix< T_prior_sample_size, Eigen::Dynamic, 1 > &alpha)
 The log of the Dirichlet density for the given theta and a vector of prior sample sizes, alpha. More...
 
template<typename T_prob , typename T_prior_sample_size >
boost::math::tools::promote_args
< T_prob, T_prior_sample_size >
::type 
dirichlet_log (const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta, const Eigen::Matrix< T_prior_sample_size, Eigen::Dynamic, 1 > &alpha)
 
template<class RNG >
Eigen::VectorXd dirichlet_rng (const Eigen::Matrix< double, Eigen::Dynamic, 1 > &alpha, RNG &rng)
 
template<bool propto, typename T_y , typename T_F , typename T_G , typename T_V , typename T_W , typename T_m0 , typename T_C0 >
return_type< T_y, typename
return_type< T_F, T_G, T_V,
T_W, T_m0, T_C0 >::type >
::type 
gaussian_dlm_obs_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const Eigen::Matrix< T_F, Eigen::Dynamic, Eigen::Dynamic > &F, const Eigen::Matrix< T_G, Eigen::Dynamic, Eigen::Dynamic > &G, const Eigen::Matrix< T_V, Eigen::Dynamic, Eigen::Dynamic > &V, const Eigen::Matrix< T_W, Eigen::Dynamic, Eigen::Dynamic > &W, const Eigen::Matrix< T_m0, Eigen::Dynamic, 1 > &m0, const Eigen::Matrix< T_C0, Eigen::Dynamic, Eigen::Dynamic > &C0)
 The log of a Gaussian dynamic linear model (GDLM). More...
 
template<typename T_y , typename T_F , typename T_G , typename T_V , typename T_W , typename T_m0 , typename T_C0 >
return_type< T_y, typename
return_type< T_F, T_G, T_V,
T_W, T_m0, T_C0 >::type >
::type 
gaussian_dlm_obs_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const Eigen::Matrix< T_F, Eigen::Dynamic, Eigen::Dynamic > &F, const Eigen::Matrix< T_G, Eigen::Dynamic, Eigen::Dynamic > &G, const Eigen::Matrix< T_V, Eigen::Dynamic, Eigen::Dynamic > &V, const Eigen::Matrix< T_W, Eigen::Dynamic, Eigen::Dynamic > &W, const Eigen::Matrix< T_m0, Eigen::Dynamic, 1 > &m0, const Eigen::Matrix< T_C0, Eigen::Dynamic, Eigen::Dynamic > &C0)
 
template<bool propto, typename T_y , typename T_F , typename T_G , typename T_V , typename T_W , typename T_m0 , typename T_C0 >
return_type< T_y, typename
return_type< T_F, T_G, T_V,
T_W, T_m0, T_C0 >::type >
::type 
gaussian_dlm_obs_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const Eigen::Matrix< T_F, Eigen::Dynamic, Eigen::Dynamic > &F, const Eigen::Matrix< T_G, Eigen::Dynamic, Eigen::Dynamic > &G, const Eigen::Matrix< T_V, Eigen::Dynamic, 1 > &V, const Eigen::Matrix< T_W, Eigen::Dynamic, Eigen::Dynamic > &W, const Eigen::Matrix< T_m0, Eigen::Dynamic, 1 > &m0, const Eigen::Matrix< T_C0, Eigen::Dynamic, Eigen::Dynamic > &C0)
 The log of a Gaussian dynamic linear model (GDLM) with uncorrelated observation disturbances. More...
 
template<typename T_y , typename T_F , typename T_G , typename T_V , typename T_W , typename T_m0 , typename T_C0 >
return_type< T_y, typename
return_type< T_F, T_G, T_V,
T_W, T_m0, T_C0 >::type >
::type 
gaussian_dlm_obs_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const Eigen::Matrix< T_F, Eigen::Dynamic, Eigen::Dynamic > &F, const Eigen::Matrix< T_G, Eigen::Dynamic, Eigen::Dynamic > &G, const Eigen::Matrix< T_V, Eigen::Dynamic, 1 > &V, const Eigen::Matrix< T_W, Eigen::Dynamic, Eigen::Dynamic > &W, const Eigen::Matrix< T_m0, Eigen::Dynamic, 1 > &m0, const Eigen::Matrix< T_C0, Eigen::Dynamic, Eigen::Dynamic > &C0)
 
template<bool propto, typename T_y , typename T_dof , typename T_scale >
boost::math::tools::promote_args
< T_y, T_dof, T_scale >::type 
inv_wishart_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &W, const T_dof &nu, const Eigen::Matrix< T_scale, Eigen::Dynamic, Eigen::Dynamic > &S)
 The log of the Inverse-Wishart density for the given W, degrees of freedom, and scale matrix. More...
 
template<typename T_y , typename T_dof , typename T_scale >
boost::math::tools::promote_args
< T_y, T_dof, T_scale >::type 
inv_wishart_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &W, const T_dof &nu, const Eigen::Matrix< T_scale, Eigen::Dynamic, Eigen::Dynamic > &S)
 
template<class RNG >
Eigen::Matrix< double,
Eigen::Dynamic, Eigen::Dynamic > 
inv_wishart_rng (const double nu, const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &S, RNG &rng)
 
template<typename T_shape >
T_shape do_lkj_constant (const T_shape &eta, const unsigned int &K)
 
template<bool propto, typename T_covar , typename T_shape >
boost::math::tools::promote_args
< T_covar, T_shape >::type 
lkj_corr_cholesky_log (const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &L, const T_shape &eta)
 
template<typename T_covar , typename T_shape >
boost::math::tools::promote_args
< T_covar, T_shape >::type 
lkj_corr_cholesky_log (const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &L, const T_shape &eta)
 
template<bool propto, typename T_y , typename T_shape >
boost::math::tools::promote_args
< T_y, T_shape >::type 
lkj_corr_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const T_shape &eta)
 
template<typename T_y , typename T_shape >
boost::math::tools::promote_args
< T_y, T_shape >::type 
lkj_corr_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const T_shape &eta)
 
template<class RNG >
Eigen::MatrixXd lkj_corr_cholesky_rng (const size_t K, const double eta, RNG &rng)
 
template<class RNG >
Eigen::MatrixXd lkj_corr_rng (const size_t K, const double eta, RNG &rng)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >
boost::math::tools::promote_args
< T_y, T_loc, T_scale, T_shape >
::type 
lkj_cov_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const Eigen::Matrix< T_loc, Eigen::Dynamic, 1 > &mu, const Eigen::Matrix< T_scale, Eigen::Dynamic, 1 > &sigma, const T_shape &eta)
 
template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
boost::math::tools::promote_args
< T_y, T_loc, T_scale, T_shape >
::type 
lkj_cov_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const Eigen::Matrix< T_loc, Eigen::Dynamic, 1 > &mu, const Eigen::Matrix< T_scale, Eigen::Dynamic, 1 > &sigma, const T_shape &eta)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >
boost::math::tools::promote_args
< T_y, T_loc, T_scale, T_shape >
::type 
lkj_cov_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const T_loc &mu, const T_scale &sigma, const T_shape &eta)
 
template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
boost::math::tools::promote_args
< T_y, T_loc, T_scale, T_shape >
::type 
lkj_cov_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const T_loc &mu, const T_scale &sigma, const T_shape &eta)
 
template<bool propto, typename T_y , typename T_Mu , typename T_Sigma , typename T_D >
boost::math::tools::promote_args
< T_y, T_Mu, T_Sigma, T_D >
::type 
matrix_normal_prec_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const Eigen::Matrix< T_Mu, Eigen::Dynamic, Eigen::Dynamic > &Mu, const Eigen::Matrix< T_Sigma, Eigen::Dynamic, Eigen::Dynamic > &Sigma, const Eigen::Matrix< T_D, Eigen::Dynamic, Eigen::Dynamic > &D)
 The log of the matrix normal density for the given y, mu, Sigma and D where Sigma and D are given as precision matrices, not covariance matrices. More...
 
template<typename T_y , typename T_Mu , typename T_Sigma , typename T_D >
boost::math::tools::promote_args
< T_y, T_Mu, T_Sigma, T_D >
::type 
matrix_normal_prec_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const Eigen::Matrix< T_Mu, Eigen::Dynamic, Eigen::Dynamic > &Mu, const Eigen::Matrix< T_Sigma, Eigen::Dynamic, Eigen::Dynamic > &Sigma, const Eigen::Matrix< T_D, Eigen::Dynamic, Eigen::Dynamic > &D)
 
template<bool propto, typename T_y , typename T_covar , typename T_w >
boost::math::tools::promote_args
< T_y, T_covar, T_w >::type 
multi_gp_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &Sigma, const Eigen::Matrix< T_w, Eigen::Dynamic, 1 > &w)
 The log of a multivariate Gaussian Process for the given y, Sigma, and w. More...
 
template<typename T_y , typename T_covar , typename T_w >
boost::math::tools::promote_args
< T_y, T_covar, T_w >::type 
multi_gp_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &Sigma, const Eigen::Matrix< T_w, Eigen::Dynamic, 1 > &w)
 
template<bool propto, typename T_y , typename T_covar , typename T_w >
boost::math::tools::promote_args
< T_y, T_covar, T_w >::type 
multi_gp_cholesky_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &L, const Eigen::Matrix< T_w, Eigen::Dynamic, 1 > &w)
 The log of a multivariate Gaussian Process for the given y, w, and a Cholesky factor L of the kernel matrix Sigma. More...
 
template<typename T_y , typename T_covar , typename T_w >
boost::math::tools::promote_args
< T_y, T_covar, T_w >::type 
multi_gp_cholesky_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &L, const Eigen::Matrix< T_w, Eigen::Dynamic, 1 > &w)
 
template<bool propto, typename T_y , typename T_loc , typename T_covar >
boost::math::tools::promote_args
< typename scalar_type< T_y >
::type, typename scalar_type
< T_loc >::type, T_covar >
::type 
multi_normal_log (const T_y &y, const T_loc &mu, const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &Sigma)
 
template<typename T_y , typename T_loc , typename T_covar >
boost::math::tools::promote_args
< typename scalar_type< T_y >
::type, typename scalar_type
< T_loc >::type, T_covar >
::type 
multi_normal_log (const T_y &y, const T_loc &mu, const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &Sigma)
 
template<class RNG >
Eigen::VectorXd multi_normal_rng (const Eigen::Matrix< double, Eigen::Dynamic, 1 > &mu, const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &S, RNG &rng)
 
template<bool propto, typename T_y , typename T_loc , typename T_covar >
boost::math::tools::promote_args
< typename scalar_type< T_y >
::type, typename scalar_type
< T_loc >::type, T_covar >
::type 
multi_normal_cholesky_log (const T_y &y, const T_loc &mu, const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &L)
 The log of the multivariate normal density for the given y, mu, and a Cholesky factor L of the variance matrix. More...
 
template<typename T_y , typename T_loc , typename T_covar >
boost::math::tools::promote_args
< typename scalar_type< T_y >
::type, typename scalar_type
< T_loc >::type, T_covar >
::type 
multi_normal_cholesky_log (const T_y &y, const T_loc &mu, const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &L)
 
template<class RNG >
Eigen::VectorXd multi_normal_cholesky_rng (const Eigen::Matrix< double, Eigen::Dynamic, 1 > &mu, const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &S, RNG &rng)
 
template<bool propto, typename T_y , typename T_loc , typename T_covar >
boost::math::tools::promote_args
< typename scalar_type< T_y >
::type, typename scalar_type
< T_loc >::type, T_covar >
::type 
multi_normal_prec_log (const T_y &y, const T_loc &mu, const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &Sigma)
 
template<typename T_y , typename T_loc , typename T_covar >
boost::math::tools::promote_args
< typename scalar_type< T_y >
::type, typename scalar_type
< T_loc >::type, T_covar >
::type 
multi_normal_prec_log (const T_y &y, const T_loc &mu, const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &Sigma)
 
template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale >
boost::math::tools::promote_args
< typename scalar_type< T_y >
::type, T_dof, typename
scalar_type< T_loc >::type,
T_scale >::type 
multi_student_t_log (const T_y &y, const T_dof &nu, const T_loc &mu, const Eigen::Matrix< T_scale, Eigen::Dynamic, Eigen::Dynamic > &Sigma)
 Return the log of the multivariate Student t distribution at the specified arguments. More...
 
template<typename T_y , typename T_dof , typename T_loc , typename T_scale >
boost::math::tools::promote_args
< typename scalar_type< T_y >
::type, T_dof, typename
scalar_type< T_loc >::type,
T_scale >::type 
multi_student_t_log (const T_y &y, const T_dof &nu, const T_loc &mu, const Eigen::Matrix< T_scale, Eigen::Dynamic, Eigen::Dynamic > &Sigma)
 
template<class RNG >
Eigen::VectorXd multi_student_t_rng (const double nu, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &mu, const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &s, RNG &rng)
 
template<bool propto, typename T_y , typename T_dof , typename T_scale >
boost::math::tools::promote_args
< T_y, T_dof, T_scale >::type 
wishart_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &W, const T_dof &nu, const Eigen::Matrix< T_scale, Eigen::Dynamic, Eigen::Dynamic > &S)
 The log of the Wishart density for the given W, degrees of freedom, and scale matrix. More...
 
template<typename T_y , typename T_dof , typename T_scale >
boost::math::tools::promote_args
< T_y, T_dof, T_scale >::type 
wishart_log (const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &W, const T_dof &nu, const Eigen::Matrix< T_scale, Eigen::Dynamic, Eigen::Dynamic > &S)
 
template<class RNG >
Eigen::Matrix< double,
Eigen::Dynamic, Eigen::Dynamic > 
wishart_rng (const double nu, const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &S, RNG &rng)
 
template<bool propto, typename T_prob >
boost::math::tools::promote_args
< T_prob >::type 
categorical_log (int n, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta)
 
template<typename T_prob >
boost::math::tools::promote_args
< T_prob >::type 
categorical_log (const typename math::index_type< Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > >::type n, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta)
 
template<bool propto, typename T_prob >
boost::math::tools::promote_args
< T_prob >::type 
categorical_log (const std::vector< int > &ns, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta)
 
template<typename T_prob >
boost::math::tools::promote_args
< T_prob >::type 
categorical_log (const std::vector< int > &ns, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta)
 
template<class RNG >
int categorical_rng (const Eigen::Matrix< double, Eigen::Dynamic, 1 > &theta, RNG &rng)
 
template<bool propto, typename T_prob >
boost::math::tools::promote_args
< T_prob >::type 
categorical_logit_log (int n, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &beta)
 
template<typename T_prob >
boost::math::tools::promote_args
< T_prob >::type 
categorical_logit_log (int n, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &beta)
 
template<bool propto, typename T_prob >
boost::math::tools::promote_args
< T_prob >::type 
categorical_logit_log (const std::vector< int > &ns, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &beta)
 
template<typename T_prob >
boost::math::tools::promote_args
< T_prob >::type 
categorical_logit_log (const std::vector< int > &ns, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &beta)
 
template<bool propto, typename T_prob >
boost::math::tools::promote_args
< T_prob >::type 
multinomial_log (const std::vector< int > &ns, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta)
 
template<typename T_prob >
boost::math::tools::promote_args
< T_prob >::type 
multinomial_log (const std::vector< int > &ns, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta)
 
template<class RNG >
std::vector< int > multinomial_rng (const Eigen::Matrix< double, Eigen::Dynamic, 1 > &theta, const int N, RNG &rng)
 
template<bool propto, typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type< T_y, T_scale_succ,
T_scale_fail >::type 
beta_log (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 size(s). More...
 
template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type< T_y, T_scale_succ,
T_scale_fail >::type 
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_y, T_scale_succ,
T_scale_fail >::type 
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_y, T_scale_succ,
T_scale_fail >::type 
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_y, T_scale_succ,
T_scale_fail >::type 
beta_ccdf_log (const T_y &y, const T_scale_succ &alpha, const T_scale_fail &beta)
 
template<class RNG >
double beta_rng (const double alpha, const double beta, RNG &rng)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type< T_y, T_loc,
T_scale >::type 
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_y, T_loc,
T_scale >::type 
cauchy_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_y, T_loc,
T_scale >::type 
cauchy_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma)
 Calculates the cauchy cumulative distribution function for the given variate, location, and scale. More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type< T_y, T_loc,
T_scale >::type 
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 >
return_type< T_y, T_loc,
T_scale >::type 
cauchy_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<class RNG >
double cauchy_rng (const double mu, const double sigma, RNG &rng)
 
template<bool propto, typename T_y , typename T_dof >
return_type< T_y, T_dof >::type 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_y, T_dof >::type chi_square_log (const T_y &y, const T_dof &nu)
 
template<typename T_y , typename T_dof >
return_type< T_y, T_dof >::type chi_square_cdf (const T_y &y, const T_dof &nu)
 Calculates 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_y, T_dof >::type chi_square_cdf_log (const T_y &y, const T_dof &nu)
 
template<typename T_y , typename T_dof >
return_type< T_y, T_dof >::type chi_square_ccdf_log (const T_y &y, const T_dof &nu)
 
template<class RNG >
double chi_square_rng (const double nu, RNG &rng)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type< T_y, T_loc,
T_scale >::type 
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_y, T_loc,
T_scale >::type 
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_y, T_loc,
T_scale >::type 
double_exponential_cdf (const T_y &y, const T_loc &mu, const T_scale &sigma)
 Calculates the double exponential cumulative density function. More...
 
template<typename T_y , typename T_loc , typename T_scale >
return_type< T_y, T_loc,
T_scale >::type 
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 >
return_type< T_y, T_loc,
T_scale >::type 
double_exponential_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<class RNG >
double double_exponential_rng (const double mu, const double sigma, RNG &rng)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type< T_y, T_loc,
T_scale, T_inv_scale >::type 
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_y, T_loc,
T_scale, T_inv_scale >::type 
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_y, T_loc,
T_scale, T_inv_scale >::type 
exp_mod_normal_cdf (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_y, T_loc,
T_scale, T_inv_scale >::type 
exp_mod_normal_cdf_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_y, T_loc,
T_scale, T_inv_scale >::type 
exp_mod_normal_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_inv_scale &lambda)
 
template<class RNG >
double exp_mod_normal_rng (const double mu, const double sigma, const double lambda, RNG &rng)
 
template<bool propto, typename T_y , typename T_inv_scale >
return_type< T_y, T_inv_scale >
::type 
exponential_log (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_y , typename T_inv_scale >
return_type< T_y, T_inv_scale >
::type 
exponential_log (const T_y &y, const T_inv_scale &beta)
 
template<typename T_y , typename T_inv_scale >
return_type< T_y, T_inv_scale >
::type 
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_y, T_inv_scale >
::type 
exponential_cdf_log (const T_y &y, const T_inv_scale &beta)
 
template<typename T_y , typename T_inv_scale >
return_type< T_y, T_inv_scale >
::type 
exponential_ccdf_log (const T_y &y, const T_inv_scale &beta)
 
template<class RNG >
double exponential_rng (const double beta, RNG &rng)
 
template<bool propto, typename T_y , typename T_shape , typename T_scale >
return_type< T_y, T_shape,
T_scale >::type 
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_y, T_shape,
T_scale >::type 
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_y, T_shape,
T_scale >::type 
frechet_cdf (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_y, T_shape,
T_scale >::type 
frechet_cdf_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_y, T_shape,
T_scale >::type 
frechet_ccdf_log (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 
template<class RNG >
double frechet_rng (const double alpha, const double sigma, RNG &rng)
 
template<bool propto, typename T_y , typename T_shape , typename T_inv_scale >
return_type< T_y, T_shape,
T_inv_scale >::type 
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_y, T_shape,
T_inv_scale >::type 
gamma_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_y, T_shape,
T_inv_scale >::type 
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_y, T_shape,
T_inv_scale >::type 
gamma_cdf_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_y, T_shape,
T_inv_scale >::type 
gamma_ccdf_log (const T_y &y, const T_shape &alpha, const T_inv_scale &beta)
 
template<class RNG >
double gamma_rng (const double alpha, const double beta, RNG &rng)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type< T_y, T_loc,
T_scale >::type 
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_y, T_loc,
T_scale >::type 
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_y, T_loc,
T_scale >::type 
gumbel_cdf (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_y, T_loc,
T_scale >::type 
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 >
return_type< T_y, T_loc,
T_scale >::type 
gumbel_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &beta)
 
template<class RNG >
double gumbel_rng (const double mu, const double beta, RNG &rng)
 
template<bool propto, typename T_y , typename T_dof >
return_type< T_y, T_dof >::type 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_y, T_dof >::type inv_chi_square_log (const T_y &y, const T_dof &nu)
 
template<typename T_y , typename T_dof >
return_type< T_y, T_dof >::type inv_chi_square_cdf (const T_y &y, const T_dof &nu)
 
template<typename T_y , typename T_dof >
return_type< T_y, T_dof >::type inv_chi_square_cdf_log (const T_y &y, const T_dof &nu)
 
template<typename T_y , typename T_dof >
return_type< T_y, T_dof >::type inv_chi_square_ccdf_log (const T_y &y, const T_dof &nu)
 
template<class RNG >
double inv_chi_square_rng (const double nu, RNG &rng)
 
template<bool propto, typename T_y , typename T_shape , typename T_scale >
return_type< T_y, T_shape,
T_scale >::type 
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_y, T_shape,
T_scale >::type 
inv_gamma_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_y, T_shape,
T_scale >::type 
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_y, T_shape,
T_scale >::type 
inv_gamma_cdf_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_y, T_shape,
T_scale >::type 
inv_gamma_ccdf_log (const T_y &y, const T_shape &alpha, const T_scale &beta)
 
template<class RNG >
double inv_gamma_rng (const double alpha, const double beta, RNG &rng)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type< T_y, T_loc,
T_scale >::type 
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_y, T_loc,
T_scale >::type 
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_y, T_loc,
T_scale >::type 
logistic_cdf (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_y, T_loc,
T_scale >::type 
logistic_cdf_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_y, T_loc,
T_scale >::type 
logistic_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<class RNG >
double logistic_rng (const double mu, const double sigma, RNG &rng)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type< T_y, T_loc,
T_scale >::type 
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_y, T_loc,
T_scale >::type 
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_y, T_loc,
T_scale >::type 
lognormal_cdf (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_y, T_loc,
T_scale >::type 
lognormal_cdf_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_y, T_loc,
T_scale >::type 
lognormal_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<class RNG >
double lognormal_rng (const double mu, const double sigma, RNG &rng)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
boost::enable_if_c
< is_var_or_arithmetic< T_y,
T_loc, T_scale >::value,
typename return_type< T_y,
T_loc, T_scale >::type >::type 
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_y, T_loc,
T_scale >::type 
normal_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_y, T_loc,
T_scale >::type 
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_y, T_loc,
T_scale >::type 
normal_cdf_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_y, T_loc,
T_scale >::type 
normal_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma)
 
template<class RNG >
double normal_rng (const double mu, const double sigma, RNG &rng)
 
template<bool propto, typename T_y , typename T_scale , typename T_shape >
return_type< T_y, T_scale,
T_shape >::type 
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_y, T_scale,
T_shape >::type 
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_y, T_scale,
T_shape >::type 
pareto_cdf (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_y, T_scale,
T_shape >::type 
pareto_cdf_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_y, T_scale,
T_shape >::type 
pareto_ccdf_log (const T_y &y, const T_scale &y_min, const T_shape &alpha)
 
template<class RNG >
double pareto_rng (const double y_min, const double alpha, RNG &rng)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type< T_y, T_loc,
T_scale, T_shape >::type 
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_y, T_loc,
T_scale, T_shape >::type 
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_y, T_loc,
T_scale, T_shape >::type 
pareto_type_2_cdf (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_y, T_loc,
T_scale, T_shape >::type 
pareto_type_2_cdf_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_y, T_loc,
T_scale, T_shape >::type 
pareto_type_2_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &lambda, const T_shape &alpha)
 
template<class RNG >
double pareto_type_2_rng (const double mu, const double lambda, const double alpha, RNG &rng)
 
template<bool propto, typename T_y , typename T_scale >
return_type< T_y, T_scale >::type rayleigh_log (const T_y &y, const T_scale &sigma)
 
template<typename T_y , typename T_scale >
return_type< T_y, T_scale >::type rayleigh_log (const T_y &y, const T_scale &sigma)
 
template<typename T_y , typename T_scale >
return_type< T_y, T_scale >::type rayleigh_cdf (const T_y &y, const T_scale &sigma)
 
template<typename T_y , typename T_scale >
return_type< T_y, T_scale >::type rayleigh_cdf_log (const T_y &y, const T_scale &sigma)
 
template<typename T_y , typename T_scale >
return_type< T_y, T_scale >::type rayleigh_ccdf_log (const T_y &y, const T_scale &sigma)
 
template<class RNG >
double rayleigh_rng (const double sigma, RNG &rng)
 
template<bool propto, typename T_y , typename T_dof , typename T_scale >
return_type< T_y, T_dof,
T_scale >::type 
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_y, T_dof,
T_scale >::type 
scaled_inv_chi_square_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_y, T_dof,
T_scale >::type 
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_y, T_dof,
T_scale >::type 
scaled_inv_chi_square_cdf_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_y, T_dof,
T_scale >::type 
scaled_inv_chi_square_ccdf_log (const T_y &y, const T_dof &nu, const T_scale &s)
 
template<class RNG >
double scaled_inv_chi_square_rng (const double nu, const double s, RNG &rng)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type< T_y, T_loc,
T_scale, T_shape >::type 
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_y, T_loc,
T_scale, T_shape >::type 
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_y, T_loc,
T_scale, T_shape >::type 
skew_normal_cdf (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_y, T_loc,
T_scale, T_shape >::type 
skew_normal_cdf_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_y, T_loc,
T_scale, T_shape >::type 
skew_normal_ccdf_log (const T_y &y, const T_loc &mu, const T_scale &sigma, const T_shape &alpha)
 
template<class RNG >
double skew_normal_rng (const double mu, const double sigma, const double alpha, RNG &rng)
 
template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type< T_y, T_dof, T_loc,
T_scale >::type 
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_y, T_dof, T_loc,
T_scale >::type 
student_t_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_y, T_dof, T_loc,
T_scale >::type 
student_t_cdf (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_y, T_dof, T_loc,
T_scale >::type 
student_t_cdf_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_y, T_dof, T_loc,
T_scale >::type 
student_t_ccdf_log (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &sigma)
 
template<class RNG >
double student_t_rng (const double nu, const double mu, const double sigma, RNG &rng)
 
template<bool propto, typename T_y , typename T_low , typename T_high >
return_type< T_y, T_low,
T_high >::type 
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_y, T_low,
T_high >::type 
uniform_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_y, T_low,
T_high >::type 
uniform_cdf (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_y, T_low,
T_high >::type 
uniform_cdf_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_y, T_low,
T_high >::type 
uniform_ccdf_log (const T_y &y, const T_low &alpha, const T_high &beta)
 
template<class RNG >
double uniform_rng (const double alpha, const double beta, RNG &rng)
 
template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type< T_y, T_loc,
T_scale >::type 
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_y, T_loc,
T_scale >::type 
von_mises_log (T_y const &y, T_loc const &mu, T_scale const &kappa)
 
template<class RNG >
double von_mises_rng (const double mu, const double kappa, RNG &rng)
 
template<bool propto, typename T_y , typename T_shape , typename T_scale >
return_type< T_y, T_shape,
T_scale >::type 
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_y, T_shape,
T_scale >::type 
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_y, T_shape,
T_scale >::type 
weibull_cdf (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_y, T_shape,
T_scale >::type 
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 >
return_type< T_y, T_shape,
T_scale >::type 
weibull_ccdf_log (const T_y &y, const T_shape &alpha, const T_scale &sigma)
 
template<class RNG >
double weibull_rng (const double alpha, const double sigma, RNG &rng)
 
template<bool propto, typename T_n , typename T_prob >
return_type< T_prob >::type bernoulli_log (const T_n &n, const T_prob &theta)
 
template<typename T_y , typename T_prob >
return_type< T_prob >::type bernoulli_log (const T_y &n, const T_prob &theta)
 
template<bool propto, typename T_n , typename T_prob >
return_type< T_prob >::type bernoulli_logit_log (const T_n &n, const T_prob &theta)
 
template<typename T_n , typename T_prob >
return_type< T_prob >::type bernoulli_logit_log (const T_n &n, const T_prob &theta)
 
template<typename T_n , typename T_prob >
return_type< T_prob >::type bernoulli_cdf (const T_n &n, const T_prob &theta)
 
template<typename T_n , typename T_prob >
return_type< T_prob >::type bernoulli_cdf_log (const T_n &n, const T_prob &theta)
 
template<typename T_n , typename T_prob >
return_type< T_prob >::type bernoulli_ccdf_log (const T_n &n, const T_prob &theta)
 
template<class RNG >
int bernoulli_rng (const double theta, RNG &rng)
 
template<bool propto, typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type< T_size1, T_size2 >
::type 
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_size1, T_size2 >
::type 
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_size1, T_size2 >
::type 
beta_binomial_cdf (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_size1, T_size2 >
::type 
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_size1, T_size2 >
::type 
beta_binomial_ccdf_log (const T_n &n, const T_N &N, const T_size1 &alpha, const T_size2 &beta)
 
template<class RNG >
int beta_binomial_rng (const int N, const double alpha, const double beta, RNG &rng)
 
template<bool propto, typename T_n , typename T_N , typename T_prob >
return_type< T_prob >::type 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_prob >::type 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_prob >::type 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_prob >::type 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_prob >::type binomial_cdf (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_prob >::type 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_prob >::type binomial_ccdf_log (const T_n &n, const T_N &N, const T_prob &theta)
 
template<class RNG >
int binomial_rng (const int N, const double theta, RNG &rng)
 
template<bool propto, typename T_n , typename T_N , typename T_a , typename T_b >
double 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 hypergeometric_log (const T_n &n, const T_N &N, const T_a &a, const T_b &b)
 
template<class RNG >
int hypergeometric_rng (const int N, const int a, const int b, RNG &rng)
 
template<bool propto, typename T_n , typename T_shape , typename T_inv_scale >
return_type< T_shape,
T_inv_scale >::type 
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_shape,
T_inv_scale >::type 
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_shape,
T_inv_scale >::type 
neg_binomial_cdf (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_shape,
T_inv_scale >::type 
neg_binomial_cdf_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_shape,
T_inv_scale >::type 
neg_binomial_ccdf_log (const T_n &n, const T_shape &alpha, const T_inv_scale &beta)
 
template<class RNG >
int neg_binomial_rng (const double alpha, const double beta, RNG &rng)
 
template<bool propto, typename T_n , typename T_location , typename T_inv_scale >
return_type< T_location,
T_inv_scale >::type 
neg_binomial_2_log (const T_n &n, const T_location &mu, const T_inv_scale &phi)
 
template<typename T_n , typename T_location , typename T_inv_scale >
return_type< T_location,
T_inv_scale >::type 
neg_binomial_2_log (const T_n &n, const T_location &mu, const T_inv_scale &phi)
 
template<bool propto, typename T_n , typename T_log_location , typename T_inv_scale >
return_type< T_log_location,
T_inv_scale >::type 
neg_binomial_2_log_log (const T_n &n, const T_log_location &eta, const T_inv_scale &phi)
 
template<typename T_n , typename T_log_location , typename T_inv_scale >
return_type< T_log_location,
T_inv_scale >::type 
neg_binomial_2_log_log (const T_n &n, const T_log_location &eta, const T_inv_scale &phi)
 
template<class RNG >
int neg_binomial_2_rng (const double mu, const double phi, RNG &rng)
 
template<class RNG >
int neg_binomial_2_log_rng (const double eta, const double phi, RNG &rng)
 
template<typename T >
log_inv_logit_diff (const T &alpha, const T &beta)
 
template<bool propto, typename T_lambda , typename T_cut >
boost::math::tools::promote_args
< T_lambda, T_cut >::type 
ordered_logistic_log (int y, const T_lambda &lambda, const Eigen::Matrix< T_cut, Eigen::Dynamic, 1 > &c)
 Returns the (natural) log probability of the specified integer outcome given the continuous location and specified cutpoints in an ordered logistic model. More...
 
template<typename T_lambda , typename T_cut >
boost::math::tools::promote_args
< T_lambda, T_cut >::type 
ordered_logistic_log (int y, const T_lambda &lambda, const Eigen::Matrix< T_cut, Eigen::Dynamic, 1 > &c)
 
template<class RNG >
int ordered_logistic_rng (const double eta, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &c, RNG &rng)
 
template<bool propto, typename T_n , typename T_rate >
return_type< T_rate >::type poisson_log (const T_n &n, const T_rate &lambda)
 
template<typename T_n , typename T_rate >
return_type< T_rate >::type poisson_log (const T_n &n, const T_rate &lambda)
 
template<bool propto, typename T_n , typename T_log_rate >
return_type< T_log_rate >::type poisson_log_log (const T_n &n, const T_log_rate &alpha)
 
template<typename T_n , typename T_log_rate >
return_type< T_log_rate >::type poisson_log_log (const T_n &n, const T_log_rate &alpha)
 
template<typename T_n , typename T_rate >
return_type< T_rate >::type poisson_cdf (const T_n &n, const T_rate &lambda)
 
template<typename T_n , typename T_rate >
return_type< T_rate >::type poisson_cdf_log (const T_n &n, const T_rate &lambda)
 
template<typename T_n , typename T_rate >
return_type< T_rate >::type poisson_ccdf_log (const T_n &n, const T_rate &lambda)
 
template<class RNG >
int poisson_rng (const double lambda, RNG &rng)
 
template<typename T >
void factor_U (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &U, Eigen::Array< T, Eigen::Dynamic, 1 > &CPCs)
 This function is intended to make starting values, given a unit upper-triangular matrix U such that U'DU is a correlation matrix. More...
 
template<typename T >
bool factor_cov_matrix (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &Sigma, Eigen::Array< T, Eigen::Dynamic, 1 > &CPCs, Eigen::Array< T, Eigen::Dynamic, 1 > &sds)
 This function is intended to make starting values, given a covariance matrix Sigma. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
read_corr_L (const Eigen::Array< T, Eigen::Dynamic, 1 > &CPCs, const size_t K)
 Return the Cholesky factor of the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
read_corr_matrix (const Eigen::Array< T, Eigen::Dynamic, 1 > &CPCs, const size_t K)
 Return the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
read_corr_L (const Eigen::Array< T, Eigen::Dynamic, 1 > &CPCs, const size_t K, T &log_prob)
 Return the Cholesky factor of the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations, incrementing the specified scalar reference with the log absolute determinant of the Jacobian of the transformation. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
read_corr_matrix (const Eigen::Array< T, Eigen::Dynamic, 1 > &CPCs, const size_t K, T &log_prob)
 Return the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations, incrementing the specified scalar reference with the log absolute determinant of the Jacobian of the transformation. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
read_cov_L (const Eigen::Array< T, Eigen::Dynamic, 1 > &CPCs, const Eigen::Array< T, Eigen::Dynamic, 1 > &sds, T &log_prob)
 This is the function that should be called prior to evaluating the density of any elliptical distribution. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
read_cov_matrix (const Eigen::Array< T, Eigen::Dynamic, 1 > &CPCs, const Eigen::Array< T, Eigen::Dynamic, 1 > &sds, T &log_prob)
 A generally worse alternative to call prior to evaluating the density of an elliptical distribution. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
read_cov_matrix (const Eigen::Array< T, Eigen::Dynamic, 1 > &CPCs, const Eigen::Array< T, Eigen::Dynamic, 1 > &sds)
 Builds a covariance matrix from CPCs and standard deviations. More...
 
template<typename T >
const Eigen::Array< T,
Eigen::Dynamic, 1 > 
make_nu (const T eta, const size_t K)
 This function calculates the degrees of freedom for the t distribution that corresponds to the shape parameter in the Lewandowski et. More...
 
template<typename T >
identity_constrain (T x)
 Returns the result of applying the identity constraint transform to the input. More...
 
template<typename T >
identity_constrain (const T x, T &)
 Returns the result of applying the identity constraint transform to the input and increments the log probability reference with the log absolute Jacobian determinant. More...
 
template<typename T >
identity_free (const T y)
 Returns the result of applying the inverse of the identity constraint transform to the input. More...
 
template<typename T >
positive_constrain (const T x)
 Return the positive value for the specified unconstrained input. More...
 
template<typename T >
positive_constrain (const T x, T &lp)
 Return the positive value for the specified unconstrained input, incrementing the scalar reference with the log absolute Jacobian determinant. More...
 
template<typename T >
positive_free (const T y)
 Return the unconstrained value corresponding to the specified positive-constrained value. More...
 
template<typename T , typename TL >
lb_constrain (const T x, const TL lb)
 Return the lower-bounded value for the specified unconstrained input and specified lower bound. More...
 
template<typename T , typename TL >
boost::math::tools::promote_args
< T, TL >::type 
lb_constrain (const T x, const TL lb, T &lp)
 Return the lower-bounded value for the speicifed unconstrained input and specified lower bound, incrementing the specified reference with the log absolute Jacobian determinant of the transform. More...
 
template<typename T , typename TL >
boost::math::tools::promote_args
< T, TL >::type 
lb_free (const T y, const TL lb)
 Return the unconstrained value that produces the specified lower-bound constrained value. More...
 
template<typename T , typename TU >
boost::math::tools::promote_args
< T, TU >::type 
ub_constrain (const T x, const TU ub)
 Return the upper-bounded value for the specified unconstrained scalar and upper bound. More...
 
template<typename T , typename TU >
boost::math::tools::promote_args
< T, TU >::type 
ub_constrain (const T x, const TU ub, T &lp)
 Return the upper-bounded value for the specified unconstrained scalar and upper bound and increment the specified log probability reference with the log absolute Jacobian determinant of the transform. More...
 
template<typename T , typename TU >
boost::math::tools::promote_args
< T, TU >::type 
ub_free (const T y, const TU ub)
 Return the free scalar that corresponds to the specified upper-bounded value with respect to the specified upper bound. More...
 
template<typename T , typename TL , typename TU >
boost::math::tools::promote_args
< T, TL, TU >::type 
lub_constrain (const T x, TL lb, TU ub)
 Return the lower- and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds. More...
 
template<typename T , typename TL , typename TU >
boost::math::tools::promote_args
< T, TL, TU >::type 
lub_constrain (const T x, const TL lb, const TU ub, T &lp)
 Return the lower- and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds and increment the specified log probability with the log absolute Jacobian determinant. More...
 
template<typename T , typename TL , typename TU >
boost::math::tools::promote_args
< T, TL, TU >::type 
lub_free (const T y, TL lb, TU ub)
 Return the unconstrained scalar that transforms to the specified lower- and upper-bounded scalar given the specified bounds. More...
 
template<typename T >
prob_constrain (const T x)
 Return a probability value constrained to fall between 0 and 1 (inclusive) for the specified free scalar. More...
 
template<typename T >
prob_constrain (const T x, T &lp)
 Return a probability value constrained to fall between 0 and 1 (inclusive) for the specified free scalar and increment the specified log probability reference with the log absolute Jacobian determinant of the transform. More...
 
template<typename T >
prob_free (const T y)
 Return the free scalar that when transformed to a probability produces the specified scalar. More...
 
template<typename T >
corr_constrain (const T x)
 Return the result of transforming the specified scalar to have a valid correlation value between -1 and 1 (inclusive). More...
 
template<typename T >
corr_constrain (const T x, T &lp)
 Return the result of transforming the specified scalar to have a valid correlation value between -1 and 1 (inclusive). More...
 
template<typename T >
corr_free (const T y)
 Return the unconstrained scalar that when transformed to a valid correlation produces the specified value. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
unit_vector_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y)
 Return the unit length vector corresponding to the free vector y. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
unit_vector_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y, T &lp)
 Return the unit length vector corresponding to the free vector y. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
unit_vector_free (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x)
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
simplex_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y)
 Return the simplex corresponding to the specified free vector. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
simplex_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y, T &lp)
 Return the simplex corresponding to the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
simplex_free (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x)
 Return an unconstrained vector that when transformed produces the specified simplex. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
ordered_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x)
 Return an increasing ordered vector derived from the specified free vector. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
ordered_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, T &lp)
 Return a positive valued, increasing ordered vector derived from the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
ordered_free (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y)
 Return the vector of unconstrained scalars that transform to the specified positive ordered vector. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
positive_ordered_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x)
 Return an increasing positive ordered vector derived from the specified free vector. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
positive_ordered_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, T &lp)
 Return a positive valued, increasing positive ordered vector derived from the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
positive_ordered_free (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y)
 Return the vector of unconstrained scalars that transform to the specified positive ordered vector. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
cholesky_factor_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, int M, int N)
 Return the Cholesky factor of the specified size read from the specified vector. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
cholesky_factor_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, int M, int N, T &lp)
 Return the Cholesky factor of the specified size read from the specified vector and increment the specified log probability reference with the log Jacobian adjustment of the transform. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
cholesky_factor_free (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &y)
 Return the unconstrained vector of parameters correspdonding to the specified Cholesky factor. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
cholesky_corr_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y, int K)
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
cholesky_corr_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y, int K, T &lp)
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
cholesky_corr_free (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &x)
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
corr_matrix_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, typename math::index_type< Eigen::Matrix< T, Eigen::Dynamic, 1 > >::type k)
 Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
corr_matrix_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, typename math::index_type< Eigen::Matrix< T, Eigen::Dynamic, 1 > >::type k, T &lp)
 Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
corr_matrix_free (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &y)
 Return the vector of unconstrained partial correlations that define the specified correlation matrix when transformed. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
cov_matrix_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, typename math::index_type< Eigen::Matrix< T, Eigen::Dynamic, 1 > >::type K)
 Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2). More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
cov_matrix_constrain (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, typename math::index_type< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > >::type K, T &lp)
 Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2). More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
cov_matrix_free (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &y)
 The covariance matrix derived from the symmetric view of the lower-triangular view of the K by K specified matrix is freed to return a vector of size K + (K choose 2). More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
cov_matrix_constrain_lkj (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, size_t k)
 Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, Eigen::Dynamic > 
cov_matrix_constrain_lkj (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, size_t k, T &lp)
 Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values and increment the specified log probability reference with the log absolute Jacobian determinant. More...
 
template<typename T >
Eigen::Matrix< T,
Eigen::Dynamic, 1 > 
cov_matrix_free_lkj (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &y)
 Return the vector of unconstrained partial correlations and deviations that transform to the specified covariance matrix. More...
 

Variables

const double CONSTRAINT_TOLERANCE = 1E-8
 

Detailed Description

Templated probability distributions.

All paramaterizations are based on Bayesian Data Analysis. Error handling for the distributions is described in Error Handling Policies.

Function Documentation

template<typename T >
void stan::prob::autocorrelation ( const std::vector< T > &  y,
std::vector< T > &  ac,
Eigen::FFT< T > &  fft 
)

Write autocorrelation estimates for every lag for the specified input sequence into the specified result using the specified FFT engine.

The return vector be resized to the same length as the input sequence with lags given by array index.

The implementation involves a fast Fourier transform, followed by a normalization, followed by an inverse transform.

An FFT engine can be created for reuse for type double with:

    Eigen::FFT<double> fft;
Template Parameters
TScalar type.
Parameters
yInput sequence.
acAutocorrelations.
fftFFT engine instance.

Definition at line 56 of file autocorrelation.hpp.

template<typename T >
void stan::prob::autocorrelation ( const std::vector< T > &  y,
std::vector< T > &  ac 
)

Write autocorrelation estimates for every lag for the specified input sequence into the specified result.

The return vector be resized to the same length as the input sequence with lags given by array index.

The implementation involves a fast Fourier transform, followed by a normalization, followed by an inverse transform.

This method is just a light wrapper around the three-argument autocorrelation function

Template Parameters
TScalar type.
Parameters
yInput sequence.
acAutocorrelations.

Definition at line 126 of file autocorrelation.hpp.

template<typename T >
void stan::prob::autocovariance ( const std::vector< T > &  y,
std::vector< T > &  acov,
Eigen::FFT< T > &  fft 
)

Write autocovariance estimates for every lag for the specified input sequence into the specified result using the specified FFT engine.

The return vector be resized to the same length as the input sequence with lags given by array index.

The implementation involves a fast Fourier transform, followed by a normalization, followed by an inverse transform.

An FFT engine can be created for reuse for type double with:

    Eigen::FFT<double> fft;
Template Parameters
TScalar type.
Parameters
yInput sequence.
acovAutocovariance.
fftFFT engine instance.

Definition at line 33 of file autocovariance.hpp.

template<typename T >
void stan::prob::autocovariance ( const std::vector< T > &  y,
std::vector< T > &  acov 
)

Write autocovariance estimates for every lag for the specified input sequence into the specified result.

The return vector be resized to the same length as the input sequence with lags given by array index.

The implementation involves a fast Fourier transform, followed by a normalization, followed by an inverse transform.

This method is just a light wrapper around the three-argument autocovariance function

Template Parameters
TScalar type.
Parameters
yInput sequence.
acovAutocovariances.

Definition at line 62 of file autocovariance.hpp.

template<typename T_n , typename T_prob >
return_type<T_prob>::type stan::prob::bernoulli_ccdf_log ( const T_n &  n,
const T_prob &  theta 
)

Definition at line 333 of file bernoulli.hpp.

template<typename T_n , typename T_prob >
return_type<T_prob>::type stan::prob::bernoulli_cdf ( const T_n &  n,
const T_prob &  theta 
)

Definition at line 212 of file bernoulli.hpp.

template<typename T_n , typename T_prob >
return_type<T_prob>::type stan::prob::bernoulli_cdf_log ( const T_n &  n,
const T_prob &  theta 
)

Definition at line 274 of file bernoulli.hpp.

template<bool propto, typename T_n , typename T_prob >
return_type<T_prob>::type stan::prob::bernoulli_log ( const T_n &  n,
const T_prob &  theta 
)

Definition at line 25 of file bernoulli.hpp.

template<typename T_y , typename T_prob >
return_type<T_prob>::type stan::prob::bernoulli_log ( const T_y &  n,
const T_prob &  theta 
)
inline

Definition at line 118 of file bernoulli.hpp.

template<bool propto, typename T_n , typename T_prob >
return_type<T_prob>::type stan::prob::bernoulli_logit_log ( const T_n &  n,
const T_prob &  theta 
)

Definition at line 128 of file bernoulli.hpp.

template<typename T_n , typename T_prob >
return_type<T_prob>::type stan::prob::bernoulli_logit_log ( const T_n &  n,
const T_prob &  theta 
)
inline

Definition at line 204 of file bernoulli.hpp.

template<class RNG >
int stan::prob::bernoulli_rng ( const double  theta,
RNG &  rng 
)
inline

Definition at line 394 of file bernoulli.hpp.

template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type<T_size1,T_size2>::type stan::prob::beta_binomial_ccdf_log ( const T_n &  n,
const T_N &  N,
const T_size1 &  alpha,
const T_size2 &  beta 
)

Definition at line 428 of file beta_binomial.hpp.

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

Definition at line 191 of file beta_binomial.hpp.

template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type<T_size1,T_size2>::type stan::prob::beta_binomial_cdf_log ( const T_n &  n,
const T_N &  N,
const T_size1 &  alpha,
const T_size2 &  beta 
)

Definition at line 314 of file beta_binomial.hpp.

template<bool propto, typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type<T_size1,T_size2>::type stan::prob::beta_binomial_log ( const T_n &  n,
const T_N &  N,
const T_size1 &  alpha,
const T_size2 &  beta 
)

Definition at line 28 of file beta_binomial.hpp.

template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >
return_type<T_size1,T_size2>::type stan::prob::beta_binomial_log ( const T_n &  n,
const T_N &  N,
const T_size1 &  alpha,
const T_size2 &  beta 
)

Definition at line 182 of file beta_binomial.hpp.

template<class RNG >
int stan::prob::beta_binomial_rng ( const int  N,
const double  alpha,
const double  beta,
RNG &  rng 
)
inline

Definition at line 541 of file beta_binomial.hpp.

template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type<T_y,T_scale_succ,T_scale_fail>::type stan::prob::beta_ccdf_log ( const T_y &  y,
const T_scale_succ &  alpha,
const T_scale_fail &  beta 
)

Definition at line 476 of file beta.hpp.

template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type<T_y,T_scale_succ,T_scale_fail>::type stan::prob::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 213 of file beta.hpp.

template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type<T_y,T_scale_succ,T_scale_fail>::type stan::prob::beta_cdf_log ( const T_y &  y,
const T_scale_succ &  alpha,
const T_scale_fail &  beta 
)

Definition at line 358 of file beta.hpp.

template<bool propto, typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type<T_y,T_scale_succ,T_scale_fail>::type stan::prob::beta_log ( 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 size(s).

y, alpha, or beta can each either be scalar or std::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.

Parameters
y(Sequence of) scalar(s).
alpha(Sequence of) prior sample size(s).
beta(Sequence of) prior sample size(s).
Returns
The log of the product of densities.
Template Parameters
T_yType of scalar outcome.
T_scale_succType of prior scale for successes.
T_scale_failType of prior scale for failures.
Error Policy:
See Error Handling Policies for details. Conditions:
  • All parameters must not be NaN.
  • alpha must be positive and finite.
  • beta must be positive and finite.

Definition at line 46 of file beta.hpp.

template<typename T_y , typename T_scale_succ , typename T_scale_fail >
return_type<T_y,T_scale_succ,T_scale_fail>::type stan::prob::beta_log ( const T_y &  y,
const T_scale_succ &  alpha,
const T_scale_fail &  beta 
)
inline

Definition at line 194 of file beta.hpp.

template<class RNG >
double stan::prob::beta_rng ( const double  alpha,
const double  beta,
RNG &  rng 
)
inline

Definition at line 593 of file beta.hpp.

template<typename T_n , typename T_N , typename T_prob >
return_type<T_prob>::type stan::prob::binomial_ccdf_log ( const T_n &  n,
const T_N &  N,
const T_prob &  theta 
)

Definition at line 399 of file binomial.hpp.

template<typename T_n , typename T_N , typename T_prob >
return_type<T_prob>::type stan::prob::binomial_cdf ( const T_n &  n,
const T_N &  N,
const T_prob &  theta 
)

Definition at line 249 of file binomial.hpp.

template<typename T_n , typename T_N , typename T_prob >
return_type<T_prob>::type stan::prob::binomial_cdf_log ( const T_n &  n,
const T_N &  N,
const T_prob &  theta 
)

Definition at line 329 of file binomial.hpp.

template<bool propto, typename T_n , typename T_N , typename T_prob >
return_type<T_prob>::type stan::prob::binomial_log ( const T_n &  n,
const T_N &  N,
const T_prob &  theta 
)

Definition at line 31 of file binomial.hpp.

template<typename T_n , typename T_N , typename T_prob >
return_type<T_prob>::type stan::prob::binomial_log ( const T_n &  n,
const T_N &  N,
const T_prob &  theta 
)
inline

Definition at line 129 of file binomial.hpp.

template<bool propto, typename T_n , typename T_N , typename T_prob >
return_type<T_prob>::type stan::prob::binomial_logit_log ( const T_n &  n,
const T_N &  N,
const T_prob &  alpha 
)

Definition at line 142 of file binomial.hpp.

template<typename T_n , typename T_N , typename T_prob >
return_type<T_prob>::type stan::prob::binomial_logit_log ( const T_n &  n,
const T_N &  N,
const T_prob &  alpha 
)
inline

Definition at line 239 of file binomial.hpp.

template<class RNG >
int stan::prob::binomial_rng ( const int  N,
const double  theta,
RNG &  rng 
)
inline

Definition at line 470 of file binomial.hpp.

template<bool propto, typename T_prob >
boost::math::tools::promote_args<T_prob>::type stan::prob::categorical_log ( int  n,
const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &  theta 
)

Definition at line 23 of file categorical.hpp.

template<typename T_prob >
boost::math::tools::promote_args<T_prob>::type stan::prob::categorical_log ( const typename math::index_type< Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > >::type  n,
const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &  theta 
)
inline

Definition at line 59 of file categorical.hpp.

template<bool propto, typename T_prob >
boost::math::tools::promote_args<T_prob>::type stan::prob::categorical_log ( const std::vector< int > &  ns,
const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &  theta 
)

Definition at line 72 of file categorical.hpp.

template<typename T_prob >
boost::math::tools::promote_args<T_prob>::type stan::prob::categorical_log ( const std::vector< int > &  ns,
const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &  theta 
)
inline

Definition at line 124 of file categorical.hpp.

template<bool propto, typename T_prob >
boost::math::tools::promote_args<T_prob>::type stan::prob::categorical_logit_log ( int  n,
const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &  beta 
)

Definition at line 21 of file categorical_logit.hpp.

template<typename T_prob >
boost::math::tools::promote_args<T_prob>::type stan::prob::categorical_logit_log ( int  n,
const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &  beta 
)
inline

Definition at line 46 of file categorical_logit.hpp.

template<bool propto, typename T_prob >
boost::math::tools::promote_args<T_prob>::type stan::prob::categorical_logit_log ( const std::vector< int > &  ns,
const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &  beta 
)

Definition at line 54 of file categorical_logit.hpp.

template<typename T_prob >
boost::math::tools::promote_args<T_prob>::type stan::prob::categorical_logit_log ( const std::vector< int > &  ns,
const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &  beta 
)
inline

Definition at line 91 of file categorical_logit.hpp.

template<class RNG >
int stan::prob::categorical_rng ( const Eigen::Matrix< double, Eigen::Dynamic, 1 > &  theta,
RNG &  rng 
)
inline

Definition at line 131 of file categorical.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::cauchy_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 322 of file cauchy.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::cauchy_cdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

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

$\frac{1}{\pi}\arctan\left(\frac{y-\mu}{\sigma}\right) + \frac{1}{2}$

Errors are configured by policy. All variables must be finite and the scale must be strictly greater than zero.

Parameters
yA scalar variate.
muThe location parameter.
sigmaThe scale parameter.
Returns

Definition at line 158 of file cauchy.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::cauchy_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 255 of file cauchy.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::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 or std::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.

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_yType of scalar outcome.
T_locType of location.
T_scaleType of scale.
Error Policy:
See Error Handling Policies for details. Conditions:
  • All parameters must not be NaN.
  • sigma must be positive.

Definition at line 42 of file cauchy.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::cauchy_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
inline

Definition at line 136 of file cauchy.hpp.

template<class RNG >
double stan::prob::cauchy_rng ( const double  mu,
const double  sigma,
RNG &  rng 
)
inline

Definition at line 388 of file cauchy.hpp.

template<typename T_y , typename T_dof >
return_type<T_y,T_dof>::type stan::prob::chi_square_ccdf_log ( const T_y &  y,
const T_dof &  nu 
)

Definition at line 348 of file chi_square.hpp.

template<typename T_y , typename T_dof >
return_type<T_y,T_dof>::type stan::prob::chi_square_cdf ( const T_y &  y,
const T_dof &  nu 
)

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

y A scalar variate. nu Degrees of freedom.

Returns
The cdf of the chi square distribution

Definition at line 154 of file chi_square.hpp.

template<typename T_y , typename T_dof >
return_type<T_y,T_dof>::type stan::prob::chi_square_cdf_log ( const T_y &  y,
const T_dof &  nu 
)

Definition at line 254 of file chi_square.hpp.

template<bool propto, typename T_y , typename T_dof >
return_type<T_y,T_dof>::type stan::prob::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 prarameter 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*}

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 43 of file chi_square.hpp.

template<typename T_y , typename T_dof >
return_type<T_y,T_dof>::type stan::prob::chi_square_log ( const T_y &  y,
const T_dof &  nu 
)
inline

Definition at line 139 of file chi_square.hpp.

template<class RNG >
double stan::prob::chi_square_rng ( const double  nu,
RNG &  rng 
)
inline

Definition at line 442 of file chi_square.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::cholesky_corr_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  y,
int  K 
)

Definition at line 1512 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::cholesky_corr_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  y,
int  K,
T &  lp 
)

Definition at line 1550 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::cholesky_corr_free ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  x)

Definition at line 1592 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::cholesky_factor_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x,
int  M,
int  N 
)

Return the Cholesky factor of the specified size read from the specified vector.

A total of (N choose 2) + N + (M - N) * N elements are required to read an M by N Cholesky factor.

Template Parameters
TType of scalars in matrix
Parameters
xVector of unconstrained values
MNumber of rows
NNumber of columns
Returns
Cholesky factor

Definition at line 1412 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::cholesky_factor_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x,
int  M,
int  N,
T &  lp 
)

Return the Cholesky factor of the specified size read from the specified vector and increment the specified log probability reference with the log Jacobian adjustment of the transform.

A total of (N choose 2) + N + N * (M - N) free parameters are required to read an M by N Cholesky factor.

Template Parameters
TType of scalars in matrix
Parameters
xVector of unconstrained values
MNumber of rows
NNumber of columns
lpLog probability that is incremented with the log Jacobian
Returns
Cholesky factor

Definition at line 1455 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::cholesky_factor_free ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  y)

Return the unconstrained vector of parameters correspdonding to the specified Cholesky factor.

A Cholesky factor must be lower triangular and have positive diagonal elements.

Parameters
yCholesky factor.
Returns
Unconstrained parameters for Cholesky factor.
Exceptions
std::domain_errorIf the matrix is not a Cholesky factor.

Definition at line 1485 of file transform.hpp.

template<typename T >
T stan::prob::corr_constrain ( const T  x)
inline

Return the result of transforming the specified scalar to have a valid correlation value between -1 and 1 (inclusive).

The transform used is the hyperbolic tangent function,

$f(x) = \tanh x = \frac{\exp(2x) - 1}{\exp(2x) + 1}$.

Parameters
xScalar input.
Returns
Result of transforming the input to fall between -1 and 1.
Template Parameters
TType of scalar.

Definition at line 952 of file transform.hpp.

template<typename T >
T stan::prob::corr_constrain ( const T  x,
T &  lp 
)
inline

Return the result of transforming the specified scalar to have a valid correlation value between -1 and 1 (inclusive).

The transform used is as specified for corr_constrain(T). The log absolute Jacobian determinant is

$\log | \frac{d}{dx} \tanh x | = \log (1 - \tanh^2 x)$.

Template Parameters
TType of scalar.

Definition at line 970 of file transform.hpp.

template<typename T >
T stan::prob::corr_free ( const T  y)
inline

Return the unconstrained scalar that when transformed to a valid correlation produces the specified value.

This function inverts the transform defined for corr_constrain(T), which is the inverse hyperbolic tangent,

$ f^{-1}(y) = \mbox{atanh}\, y = \frac{1}{2} \log \frac{y + 1}{y - 1}$.

Parameters
yCorrelation scalar input.
Returns
Free scalar that transforms to the specified input.
Template Parameters
TType of scalar.

Definition at line 995 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::corr_matrix_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x,
typename math::index_type< Eigen::Matrix< T, Eigen::Dynamic, 1 > >::type  k 
)

Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values.

The input vector must be of length ${k \choose 2} = \frac{k(k-1)}{2}$. The values in the input vector represent unconstrained (partial) correlations among the dimensions.

The transform based on partial correlations is as specified in

  • Lewandowski, Daniel, Dorota Kurowicka, and Harry Joe. 2009. Generating random correlation matrices based on vines and extended onion method. Journal of Multivariate Analysis 100:1989–-2001.

The free vector entries are first constrained to be valid correlation values using corr_constrain(T).

Parameters
xVector of unconstrained partial correlations.
kDimensionality of returned correlation matrix.
Template Parameters
TType of scalar.
Exceptions
std::invalid_argumentif x is not a valid correlation matrix.

Definition at line 1644 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::corr_matrix_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x,
typename math::index_type< Eigen::Matrix< T, Eigen::Dynamic, 1 > >::type  k,
T &  lp 
)

Return the correlation matrix of the specified dimensionality derived from the specified vector of unconstrained values.

The input vector must be of length ${k \choose 2} = \frac{k(k-1)}{2}$. The values in the input vector represent unconstrained (partial) correlations among the dimensions.

The transform is as specified for corr_matrix_constrain(Matrix,size_t); the paper it cites also defines the Jacobians for correlation inputs, which are composed with the correlation constrained Jacobians defined in corr_constrain(T,double) for this function.

Parameters
xVector of unconstrained partial correlations.
kDimensionality of returned correlation matrix.
lpLog probability reference to increment.
Template Parameters
TType of scalar.

Definition at line 1682 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::corr_matrix_free ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  y)

Return the vector of unconstrained partial correlations that define the specified correlation matrix when transformed.

The constraining transform is defined as for corr_matrix_constrain(Matrix,size_t). The inverse transform in this function is simpler in that it only needs to compute the $k \choose 2$ partial correlations and then free those.

Parameters
yThe correlation matrix to free.
Returns
Vector of unconstrained values that produce the specified correlation matrix when transformed.
Template Parameters
TType of scalar.
Exceptions
std::domain_errorif the correlation matrix has no elements or is not a square matrix.
std::runtime_errorif the correlation matrix cannot be factorized by factor_cov_matrix() or if the sds returned by factor_cov_matrix() on log scale are unconstrained.

Definition at line 1722 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::cov_matrix_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x,
typename math::index_type< Eigen::Matrix< T, Eigen::Dynamic, 1 > >::type  K 
)

Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2).

See cov_matrix_free() for the inverse transform.

Parameters
xThe vector to convert to a covariance matrix.
KThe number of rows and columns of the resulting covariance matrix.
Exceptions
std::domain_errorif (x.size() != K + (K choose 2)).

Definition at line 1769 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::cov_matrix_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x,
typename math::index_type< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > >::type  K,
T &  lp 
)

Return the symmetric, positive-definite matrix of dimensions K by K resulting from transforming the specified finite vector of size K plus (K choose 2).

See cov_matrix_free() for the inverse transform.

Parameters
xThe vector to convert to a covariance matrix.
KThe dimensions of the resulting covariance matrix.
lpReference
Exceptions
std::domain_errorif (x.size() != K + (K choose 2)).

Definition at line 1808 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::cov_matrix_constrain_lkj ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x,
size_t  k 
)

Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values.

The input vector must be of length $k \choose 2 + k$. The first $k \choose 2$ values in the input represent unconstrained (partial) correlations and the last $k$ are unconstrained standard deviations of the dimensions.

The transform scales the correlation matrix transform defined in corr_matrix_constrain(Matrix,size_t) with the constrained deviations.

Parameters
xInput vector of unconstrained partial correlations and standard deviations.
kDimensionality of returned covariance matrix.
Returns
Covariance matrix derived from the unconstrained partial correlations and deviations.
Template Parameters
TType of scalar.

Definition at line 1910 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::cov_matrix_constrain_lkj ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x,
size_t  k,
T &  lp 
)

Return the covariance matrix of the specified dimensionality derived from constraining the specified vector of unconstrained values and increment the specified log probability reference with the log absolute Jacobian determinant.

The transform is defined as for cov_matrix_constrain(Matrix,size_t).

The log absolute Jacobian determinant is derived by composing the log absolute Jacobian determinant for the underlying correlation matrix as defined in cov_matrix_constrain(Matrix,size_t,T&) with the Jacobian of the transfrom of the correlation matrix into a covariance matrix by scaling by standard deviations.

Parameters
xInput vector of unconstrained partial correlations and standard deviations.
kDimensionality of returned covariance matrix.
lpLog probability reference to increment.
Returns
Covariance matrix derived from the unconstrained partial correlations and deviations.
Template Parameters
TType of scalar.

Definition at line 1949 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::cov_matrix_free ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  y)

The covariance matrix derived from the symmetric view of the lower-triangular view of the K by K specified matrix is freed to return a vector of size K + (K choose 2).

This is the inverse of the cov_matrix_constrain() function so that for any finite vector x of size K

  • (K choose 2),

x == cov_matrix_free(cov_matrix_constrain(x,K)).

In order for this round-trip to work (and really for this function to work), the symmetric view of its lower-triangular view must be positive definite.

Parameters
yMatrix of dimensions K by K such that he symmetric view of the lower-triangular view is positive definite.
Returns
Vector of size K plus (K choose 2) in (-inf,inf) that produces
Exceptions
std::domain_errorif y is not square, has zero dimensionality, or has a non-positive diagonal element.

Definition at line 1863 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::cov_matrix_free_lkj ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  y)

Return the vector of unconstrained partial correlations and deviations that transform to the specified covariance matrix.

The constraining transform is defined as for cov_matrix_constrain(Matrix,size_t). The inverse first factors out the deviations, then applies the freeing transfrom of corr_matrix_free(Matrix&).

Parameters
yCovariance matrix to free.
Returns
Vector of unconstrained values that transforms to the specified covariance matrix.
Template Parameters
TType of scalar.
Exceptions
std::domain_errorif the correlation matrix has no elements or is not a square matrix.
std::runtime_errorif the correlation matrix cannot be factorized by factor_cov_matrix()

Definition at line 1983 of file transform.hpp.

template<bool propto, typename T_prob , typename T_prior_sample_size >
boost::math::tools::promote_args<T_prob,T_prior_sample_size>::type stan::prob::dirichlet_log ( const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &  theta,
const Eigen::Matrix< T_prior_sample_size, Eigen::Dynamic, 1 > &  alpha 
)

The log of the Dirichlet density for the given theta and a vector of prior sample sizes, alpha.

Each element of alpha must be greater than 0. Each element of theta must be greater than or 0. Theta sums to 1.

\begin{eqnarray*} \theta &\sim& \mbox{\sf{Dirichlet}} (\alpha_1, \ldots, \alpha_k) \\ \log (p (\theta \,|\, \alpha_1, \ldots, \alpha_k) ) &=& \log \left( \frac{\Gamma(\alpha_1 + \cdots + \alpha_k)}{\Gamma(\alpha_1) \cdots \Gamma(\alpha_k)} \theta_1^{\alpha_1 - 1} \cdots \theta_k^{\alpha_k - 1} \right) \\ &=& \log (\Gamma(\alpha_1 + \cdots + \alpha_k)) - \log(\Gamma(\alpha_1)) - \cdots - \log(\Gamma(\alpha_k)) + (\alpha_1 - 1) \log (\theta_1) + \cdots + (\alpha_k - 1) \log (\theta_k) \end{eqnarray*}

Parameters
thetaA scalar vector.
alphaPrior sample sizes.
Returns
The log of the Dirichlet density.
Exceptions
std::domain_errorif any element of alpha is less than or equal to 0.
std::domain_errorif any element of theta is less than 0.
std::domain_errorif the sum of theta is not 1.
Template Parameters
T_probType of scalar.
T_prior_sample_sizeType of prior sample sizes.

Definition at line 46 of file dirichlet.hpp.

template<typename T_prob , typename T_prior_sample_size >
boost::math::tools::promote_args<T_prob,T_prior_sample_size>::type stan::prob::dirichlet_log ( const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &  theta,
const Eigen::Matrix< T_prior_sample_size, Eigen::Dynamic, 1 > &  alpha 
)
inline

Definition at line 77 of file dirichlet.hpp.

template<class RNG >
Eigen::VectorXd stan::prob::dirichlet_rng ( const Eigen::Matrix< double, Eigen::Dynamic, 1 > &  alpha,
RNG &  rng 
)
inline

Definition at line 84 of file dirichlet.hpp.

template<typename T_shape >
T_shape stan::prob::do_lkj_constant ( const T_shape &  eta,
const unsigned int &  K 
)

Definition at line 15 of file lkj_corr.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::double_exponential_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 291 of file double_exponential.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::double_exponential_cdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Calculates the double exponential cumulative density function.

$ f(y|\mu,\sigma) = \begin{cases} \ \frac{1}{2} \exp\left(\frac{y-\mu}{\sigma}\right), \mbox{if } y < \mu \\ 1 - \frac{1}{2} \exp\left(-\frac{y-\mu}{\sigma}\right), \mbox{if } y \ge \mu \ \end{cases}$

Parameters
yA scalar variate.
muThe location parameter.
sigmaThe scale parameter.
Returns
The cumulative density function.

Definition at line 138 of file double_exponential.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::double_exponential_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 215 of file double_exponential.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::double_exponential_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 24 of file double_exponential.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::double_exponential_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 117 of file double_exponential.hpp.

template<class RNG >
double stan::prob::double_exponential_rng ( const double  mu,
const double  sigma,
RNG &  rng 
)
inline

Definition at line 367 of file double_exponential.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type<T_y,T_loc,T_scale,T_inv_scale>::type stan::prob::exp_mod_normal_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_inv_scale &  lambda 
)

Definition at line 356 of file exp_mod_normal.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type<T_y,T_loc,T_scale,T_inv_scale>::type stan::prob::exp_mod_normal_cdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_inv_scale &  lambda 
)

Definition at line 140 of file exp_mod_normal.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type<T_y,T_loc,T_scale,T_inv_scale>::type stan::prob::exp_mod_normal_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_inv_scale &  lambda 
)

Definition at line 252 of file exp_mod_normal.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type<T_y,T_loc,T_scale, T_inv_scale>::type stan::prob::exp_mod_normal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_inv_scale &  lambda 
)

Definition at line 26 of file exp_mod_normal.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >
return_type<T_y,T_loc,T_scale, T_inv_scale>::type stan::prob::exp_mod_normal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_inv_scale &  lambda 
)
inline

Definition at line 132 of file exp_mod_normal.hpp.

template<class RNG >
double stan::prob::exp_mod_normal_rng ( const double  mu,
const double  sigma,
const double  lambda,
RNG &  rng 
)
inline

Definition at line 458 of file exp_mod_normal.hpp.

template<typename T_y , typename T_inv_scale >
return_type<T_y,T_inv_scale>::type stan::prob::exponential_ccdf_log ( const T_y &  y,
const T_inv_scale &  beta 
)

Definition at line 221 of file exponential.hpp.

template<typename T_y , typename T_inv_scale >
return_type<T_y,T_inv_scale>::type stan::prob::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.

Parameters
yA scalar variable.
betaInverse scale parameter.
Template Parameters
T_yType of scalar.
T_inv_scaleType of inverse scale.
PolicyError-handling policy.

Definition at line 122 of file exponential.hpp.

template<typename T_y , typename T_inv_scale >
return_type<T_y,T_inv_scale>::type stan::prob::exponential_cdf_log ( const T_y &  y,
const T_inv_scale &  beta 
)

Definition at line 175 of file exponential.hpp.

template<bool propto, typename T_y , typename T_inv_scale >
return_type<T_y,T_inv_scale>::type stan::prob::exponential_log ( 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*}

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.
Template Parameters
T_yType of scalar.
T_inv_scaleType of inverse scale.

Definition at line 46 of file exponential.hpp.

template<typename T_y , typename T_inv_scale >
return_type<T_y,T_inv_scale>::type stan::prob::exponential_log ( const T_y &  y,
const T_inv_scale &  beta 
)
inline

Definition at line 101 of file exponential.hpp.

template<class RNG >
double stan::prob::exponential_rng ( const double  beta,
RNG &  rng 
)
inline

Definition at line 265 of file exponential.hpp.

template<typename T >
bool stan::prob::factor_cov_matrix ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  Sigma,
Eigen::Array< T, Eigen::Dynamic, 1 > &  CPCs,
Eigen::Array< T, Eigen::Dynamic, 1 > &  sds 
)

This function is intended to make starting values, given a covariance matrix Sigma.

The transformations are hard coded as log for standard deviations and Fisher transformations (atanh()) of CPCs

Parameters
[in]Sigmacovariance matrix
[out]CPCsfill this unbounded (does not resize)
[out]sdsfill this unbounded (does not resize)
Returns
false if any of the diagonals of Sigma are 0

Definition at line 88 of file transform.hpp.

template<typename T >
void stan::prob::factor_U ( const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &  U,
Eigen::Array< T, Eigen::Dynamic, 1 > &  CPCs 
)

This function is intended to make starting values, given a unit upper-triangular matrix U such that U'DU is a correlation matrix.

Parameters
CPCsfill this unbounded
SigmaU matrix

Definition at line 43 of file transform.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::frechet_ccdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)

Definition at line 244 of file frechet.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::frechet_cdf ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)

Definition at line 131 of file frechet.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::frechet_cdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)

Definition at line 193 of file frechet.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::frechet_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)

Definition at line 24 of file frechet.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::frechet_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)
inline

Definition at line 125 of file frechet.hpp.

template<class RNG >
double stan::prob::frechet_rng ( const double  alpha,
const double  sigma,
RNG &  rng 
)
inline

Definition at line 297 of file frechet.hpp.

template<typename T_y , typename T_shape , typename T_inv_scale >
return_type<T_y,T_shape,T_inv_scale>::type stan::prob::gamma_ccdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_inv_scale &  beta 
)

Definition at line 388 of file gamma.hpp.

template<typename T_y , typename T_shape , typename T_inv_scale >
return_type<T_y,T_shape,T_inv_scale>::type stan::prob::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.

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 172 of file gamma.hpp.

template<typename T_y , typename T_shape , typename T_inv_scale >
return_type<T_y,T_shape,T_inv_scale>::type stan::prob::gamma_cdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_inv_scale &  beta 
)

Definition at line 285 of file gamma.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_inv_scale >
return_type<T_y,T_shape,T_inv_scale>::type stan::prob::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*}

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 46 of file gamma.hpp.

template<typename T_y , typename T_shape , typename T_inv_scale >
return_type<T_y,T_shape,T_inv_scale>::type stan::prob::gamma_log ( const T_y &  y,
const T_shape &  alpha,
const T_inv_scale &  beta 
)
inline

Definition at line 151 of file gamma.hpp.

template<class RNG >
double stan::prob::gamma_rng ( const double  alpha,
const double  beta,
RNG &  rng 
)
inline

Definition at line 491 of file gamma.hpp.

template<bool propto, typename T_y , typename T_F , typename T_G , typename T_V , typename T_W , typename T_m0 , typename T_C0 >
return_type< T_y, typename return_type<T_F,T_G,T_V,T_W,T_m0,T_C0>::type >::type stan::prob::gaussian_dlm_obs_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const Eigen::Matrix< T_F, Eigen::Dynamic, Eigen::Dynamic > &  F,
const Eigen::Matrix< T_G, Eigen::Dynamic, Eigen::Dynamic > &  G,
const Eigen::Matrix< T_V, Eigen::Dynamic, Eigen::Dynamic > &  V,
const Eigen::Matrix< T_W, Eigen::Dynamic, Eigen::Dynamic > &  W,
const Eigen::Matrix< T_m0, Eigen::Dynamic, 1 > &  m0,
const Eigen::Matrix< T_C0, Eigen::Dynamic, Eigen::Dynamic > &  C0 
)

The log of a Gaussian dynamic linear model (GDLM).

This distribution is equivalent to, for $t = 1:T$,

\begin{eqnarray*} y_t & \sim N(F' \theta_t, V) \\ \theta_t & \sim N(G \theta_{t-1}, W) \\ \theta_0 & \sim N(m_0, C_0) \end{eqnarray*}

If V is a vector, then the Kalman filter is applied sequentially.

Parameters
yA r x T matrix of observations. Rows are variables, columns are observations.
FA n x r matrix. The design matrix.
GA n x n matrix. The transition matrix.
VA r x r matrix. The observation covariance matrix.
WA n x n matrix. The state covariance matrix.
m0A n x 1 matrix. The mean vector of the distribution of the initial state.
C0A n x n matrix. The covariance matrix of the distribution of the initial state.
Returns
The log of the joint density of the GDLM.
Exceptions
std::domain_errorif a matrix in the Kalman filter is not positive semi-definite.
Template Parameters
T_yType of scalar.
T_FType of design matrix.
T_GType of transition matrix.
T_VType of observation covariance matrix.
T_WType of state covariance matrix.
T_m0Type of initial state mean vector.
T_C0Type of initial state covariance matrix.

Definition at line 80 of file gaussian_dlm_obs.hpp.

template<typename T_y , typename T_F , typename T_G , typename T_V , typename T_W , typename T_m0 , typename T_C0 >
return_type< T_y, typename return_type<T_F,T_G,T_V,T_W,T_m0,T_C0>::type >::type stan::prob::gaussian_dlm_obs_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const Eigen::Matrix< T_F, Eigen::Dynamic, Eigen::Dynamic > &  F,
const Eigen::Matrix< T_G, Eigen::Dynamic, Eigen::Dynamic > &  G,
const Eigen::Matrix< T_V, Eigen::Dynamic, Eigen::Dynamic > &  V,
const Eigen::Matrix< T_W, Eigen::Dynamic, Eigen::Dynamic > &  W,
const Eigen::Matrix< T_m0, Eigen::Dynamic, 1 > &  m0,
const Eigen::Matrix< T_C0, Eigen::Dynamic, Eigen::Dynamic > &  C0 
)
inline

Definition at line 234 of file gaussian_dlm_obs.hpp.

template<bool propto, typename T_y , typename T_F , typename T_G , typename T_V , typename T_W , typename T_m0 , typename T_C0 >
return_type< T_y, typename return_type<T_F,T_G,T_V,T_W,T_m0,T_C0>::type >::type stan::prob::gaussian_dlm_obs_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const Eigen::Matrix< T_F, Eigen::Dynamic, Eigen::Dynamic > &  F,
const Eigen::Matrix< T_G, Eigen::Dynamic, Eigen::Dynamic > &  G,
const Eigen::Matrix< T_V, Eigen::Dynamic, 1 > &  V,
const Eigen::Matrix< T_W, Eigen::Dynamic, Eigen::Dynamic > &  W,
const Eigen::Matrix< T_m0, Eigen::Dynamic, 1 > &  m0,
const Eigen::Matrix< T_C0, Eigen::Dynamic, Eigen::Dynamic > &  C0 
)

The log of a Gaussian dynamic linear model (GDLM) with uncorrelated observation disturbances.

This distribution is equivalent to, for $t = 1:T$,

\begin{eqnarray*} y_t & \sim N(F' \theta_t, diag(V)) \\ \theta_t & \sim N(G \theta_{t-1}, W) \\ \theta_0 & \sim N(m_0, C_0) \end{eqnarray*}

If V is a vector, then the Kalman filter is applied sequentially.

Parameters
yA r x T matrix of observations. Rows are variables, columns are observations.
FA n x r matrix. The design matrix.
GA n x n matrix. The transition matrix.
VA size r vector. The diagonal of the observation covariance matrix.
WA n x n matrix. The state covariance matrix.
m0A n x 1 matrix. The mean vector of the distribution of the initial state.
C0A n x n matrix. The covariance matrix of the distribution of the initial state.
Returns
The log of the joint density of the GDLM.
Exceptions
std::domain_errorif a matrix in the Kalman filter is not semi-positive definite.
Template Parameters
T_yType of scalar.
T_FType of design matrix.
T_GType of transition matrix.
T_VType of observation variances
T_WType of state covariance matrix.
T_m0Type of initial state mean vector.
T_C0Type of initial state covariance matrix.

Definition at line 288 of file gaussian_dlm_obs.hpp.

template<typename T_y , typename T_F , typename T_G , typename T_V , typename T_W , typename T_m0 , typename T_C0 >
return_type< T_y, typename return_type<T_F,T_G,T_V,T_W,T_m0,T_C0>::type >::type stan::prob::gaussian_dlm_obs_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const Eigen::Matrix< T_F, Eigen::Dynamic, Eigen::Dynamic > &  F,
const Eigen::Matrix< T_G, Eigen::Dynamic, Eigen::Dynamic > &  G,
const Eigen::Matrix< T_V, Eigen::Dynamic, 1 > &  V,
const Eigen::Matrix< T_W, Eigen::Dynamic, Eigen::Dynamic > &  W,
const Eigen::Matrix< T_m0, Eigen::Dynamic, 1 > &  m0,
const Eigen::Matrix< T_C0, Eigen::Dynamic, Eigen::Dynamic > &  C0 
)
inline

Definition at line 447 of file gaussian_dlm_obs.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::gumbel_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  beta 
)

Definition at line 234 of file gumbel.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::gumbel_cdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  beta 
)

Definition at line 113 of file gumbel.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::gumbel_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  beta 
)

Definition at line 181 of file gumbel.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::gumbel_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  beta 
)

Definition at line 21 of file gumbel.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::gumbel_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  beta 
)
inline

Definition at line 107 of file gumbel.hpp.

template<class RNG >
double stan::prob::gumbel_rng ( const double  mu,
const double  beta,
RNG &  rng 
)
inline

Definition at line 289 of file gumbel.hpp.

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

Definition at line 25 of file hypergeometric.hpp.

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

Definition at line 83 of file hypergeometric.hpp.

template<class RNG >
int stan::prob::hypergeometric_rng ( const int  N,
const int  a,
const int  b,
RNG &  rng 
)
inline

Definition at line 92 of file hypergeometric.hpp.

template<typename T >
T stan::prob::identity_constrain ( x)
inline

Returns the result of applying the identity constraint transform to the input.

This method is effectively a no-op and is mainly useful as a placeholder in auto-generated code.

Parameters
xFree scalar.
Returns
Transformed input.
Template Parameters
TType of scalar.

Definition at line 391 of file transform.hpp.

template<typename T >
T stan::prob::identity_constrain ( const T  x,
T &   
)
inline

Returns the result of applying the identity constraint transform to the input and increments the log probability reference with the log absolute Jacobian determinant.

This method is effectively a no-op and mainly useful as a placeholder in auto-generated code.

Parameters
xFree scalar. lp Reference to log probability.
Returns
Transformed input.
Template Parameters
TType of scalar.

Definition at line 410 of file transform.hpp.

template<typename T >
T stan::prob::identity_free ( const T  y)
inline

Returns the result of applying the inverse of the identity constraint transform to the input.

This method is effectively a no-op and mainly useful as a placeholder in auto-generated code.

Parameters
yConstrained scalar.
Returns
The input.
Template Parameters
TType of scalar.

Definition at line 427 of file transform.hpp.

template<typename T_y , typename T_dof >
return_type<T_y,T_dof>::type stan::prob::inv_chi_square_ccdf_log ( const T_y &  y,
const T_dof &  nu 
)

Definition at line 332 of file inv_chi_square.hpp.

template<typename T_y , typename T_dof >
return_type<T_y,T_dof>::type stan::prob::inv_chi_square_cdf ( const T_y &  y,
const T_dof &  nu 
)

Definition at line 137 of file inv_chi_square.hpp.

template<typename T_y , typename T_dof >
return_type<T_y,T_dof>::type stan::prob::inv_chi_square_cdf_log ( const T_y &  y,
const T_dof &  nu 
)

Definition at line 239 of file inv_chi_square.hpp.

template<bool propto, typename T_y , typename T_dof >
return_type<T_y,T_dof>::type stan::prob::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 prarameter 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*}

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 43 of file inv_chi_square.hpp.

template<typename T_y , typename T_dof >
return_type<T_y,T_dof>::type stan::prob::inv_chi_square_log ( const T_y &  y,
const T_dof &  nu 
)
inline

Definition at line 131 of file inv_chi_square.hpp.

template<class RNG >
double stan::prob::inv_chi_square_rng ( const double  nu,
RNG &  rng 
)
inline

Definition at line 425 of file inv_chi_square.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::inv_gamma_ccdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  beta 
)

Definition at line 401 of file inv_gamma.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::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.

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 177 of file inv_gamma.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::inv_gamma_cdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  beta 
)

Definition at line 294 of file inv_gamma.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::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.

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 40 of file inv_gamma.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::inv_gamma_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  beta 
)
inline

Definition at line 155 of file inv_gamma.hpp.

template<class RNG >
double stan::prob::inv_gamma_rng ( const double  alpha,
const double  beta,
RNG &  rng 
)
inline

Definition at line 508 of file inv_gamma.hpp.

template<bool propto, typename T_y , typename T_dof , typename T_scale >
boost::math::tools::promote_args<T_y,T_dof,T_scale>::type stan::prob::inv_wishart_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  W,
const T_dof &  nu,
const Eigen::Matrix< T_scale, Eigen::Dynamic, Eigen::Dynamic > &  S 
)

The log of the Inverse-Wishart density for the given W, degrees of freedom, and scale matrix.

The scale matrix, S, must be k x k, symmetric, and semi-positive definite.

\begin{eqnarray*} W &\sim& \mbox{\sf{Inv-Wishart}}_{\nu} (S) \\ \log (p (W \,|\, \nu, S) ) &=& \log \left( \left(2^{\nu k/2} \pi^{k (k-1) /4} \prod_{i=1}^k{\Gamma (\frac{\nu + 1 - i}{2})} \right)^{-1} \times \left| S \right|^{\nu/2} \left| W \right|^{-(\nu + k + 1) / 2} \times \exp (-\frac{1}{2} \mbox{tr} (S W^{-1})) \right) \\ &=& -\frac{\nu k}{2}\log(2) - \frac{k (k-1)}{4} \log(\pi) - \sum_{i=1}^{k}{\log (\Gamma (\frac{\nu+1-i}{2}))} +\frac{\nu}{2} \log(\det(S)) - \frac{\nu+k+1}{2}\log (\det(W)) - \frac{1}{2} \mbox{tr}(S W^{-1}) \end{eqnarray*}

Parameters
WA scalar matrix
nuDegrees of freedom
SThe scale matrix
Returns
The log of the Inverse-Wishart density at W given nu and S.
Exceptions
std::domain_errorif nu is not greater than k-1
std::domain_errorif S is not square, not symmetric, or not semi-positive definite.
Template Parameters
T_yType of scalar.
T_dofType of degrees of freedom.
T_scaleType of scale.

Definition at line 52 of file inv_wishart.hpp.

template<typename T_y , typename T_dof , typename T_scale >
boost::math::tools::promote_args<T_y,T_dof,T_scale>::type stan::prob::inv_wishart_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  W,
const T_dof &  nu,
const Eigen::Matrix< T_scale, Eigen::Dynamic, Eigen::Dynamic > &  S 
)
inline

Definition at line 125 of file inv_wishart.hpp.

template<class RNG >
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> stan::prob::inv_wishart_rng ( const double  nu,
const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &  S,
RNG &  rng 
)
inline

Definition at line 133 of file inv_wishart.hpp.

template<typename T , typename TL >
T stan::prob::lb_constrain ( const T  x,
const TL  lb 
)
inline

Return the lower-bounded value for the specified unconstrained input and specified lower bound.

The transform applied is

$f(x) = \exp(x) + L$

where $L$ is the constant lower bound.

If the lower bound is negative infinity, this function reduces to identity_constrain(x).

Parameters
xUnconstrained scalar input.
lbLower-bound on constrained ouptut.
Returns
Lower-bound constrained value correspdonding to inputs.
Template Parameters
TType of scalar.
TLType of lower bound.

Definition at line 520 of file transform.hpp.

template<typename T , typename TL >
boost::math::tools::promote_args<T,TL>::type stan::prob::lb_constrain ( const T  x,
const TL  lb,
T &  lp 
)
inline

Return the lower-bounded value for the speicifed unconstrained input and specified lower bound, incrementing the specified reference with the log absolute Jacobian determinant of the transform.

If the lower bound is negative infinity, this function reduces to identity_constraint(x,lp).

Parameters
xUnconstrained scalar input.
lbLower-bound on output.
lpReference to log probability to increment.
Returns
Loer-bound constrained value corresponding to inputs.
Template Parameters
TType of scalar.
TLType of lower bound.

Definition at line 545 of file transform.hpp.

template<typename T , typename TL >
boost::math::tools::promote_args<T,TL>::type stan::prob::lb_free ( const T  y,
const TL  lb 
)
inline

Return the unconstrained value that produces the specified lower-bound constrained value.

If the lower bound is negative infinity, it is ignored and the function reduces to identity_free(y).

Parameters
yInput scalar.
lbLower bound.
Returns
Unconstrained value that produces the input when constrained.
Template Parameters
TType of scalar.
TLType of lower bound.
Exceptions
std::domain_errorif y is lower than the lower bound.

Definition at line 570 of file transform.hpp.

template<bool propto, typename T_covar , typename T_shape >
boost::math::tools::promote_args<T_covar, T_shape>::type stan::prob::lkj_corr_cholesky_log ( const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &  L,
const T_shape &  eta 
)

Definition at line 48 of file lkj_corr.hpp.

template<typename T_covar , typename T_shape >
boost::math::tools::promote_args<T_covar, T_shape>::type stan::prob::lkj_corr_cholesky_log ( const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &  L,
const T_shape &  eta 
)
inline

Definition at line 92 of file lkj_corr.hpp.

template<class RNG >
Eigen::MatrixXd stan::prob::lkj_corr_cholesky_rng ( const size_t  K,
const double  eta,
RNG &  rng 
)
inline

Definition at line 153 of file lkj_corr.hpp.

template<bool propto, typename T_y , typename T_shape >
boost::math::tools::promote_args<T_y, T_shape>::type stan::prob::lkj_corr_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const T_shape &  eta 
)

Definition at line 103 of file lkj_corr.hpp.

template<typename T_y , typename T_shape >
boost::math::tools::promote_args<T_y, T_shape>::type stan::prob::lkj_corr_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const T_shape &  eta 
)
inline

Definition at line 146 of file lkj_corr.hpp.

template<class RNG >
Eigen::MatrixXd stan::prob::lkj_corr_rng ( const size_t  K,
const double  eta,
RNG &  rng 
)
inline

Definition at line 178 of file lkj_corr.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >
boost::math::tools::promote_args<T_y,T_loc,T_scale,T_shape>::type stan::prob::lkj_cov_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const Eigen::Matrix< T_loc, Eigen::Dynamic, 1 > &  mu,
const Eigen::Matrix< T_scale, Eigen::Dynamic, 1 > &  sigma,
const T_shape &  eta 
)

Definition at line 23 of file lkj_cov.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
boost::math::tools::promote_args<T_y,T_loc,T_scale,T_shape>::type stan::prob::lkj_cov_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const Eigen::Matrix< T_loc, Eigen::Dynamic, 1 > &  mu,
const Eigen::Matrix< T_scale, Eigen::Dynamic, 1 > &  sigma,
const T_shape &  eta 
)
inline

Definition at line 76 of file lkj_cov.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >
boost::math::tools::promote_args<T_y,T_loc,T_scale,T_shape>::type stan::prob::lkj_cov_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_shape &  eta 
)

Definition at line 88 of file lkj_cov.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
boost::math::tools::promote_args<T_y,T_loc,T_scale,T_shape>::type stan::prob::lkj_cov_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_shape &  eta 
)
inline

Definition at line 124 of file lkj_cov.hpp.

template<typename T >
T stan::prob::log_inv_logit_diff ( const T &  alpha,
const T &  beta 
)
inline

Definition at line 24 of file ordered_logistic.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y, T_loc, T_scale>::type stan::prob::logistic_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 315 of file logistic.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y, T_loc, T_scale>::type stan::prob::logistic_cdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 143 of file logistic.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y, T_loc, T_scale>::type stan::prob::logistic_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 237 of file logistic.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::logistic_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 27 of file logistic.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::logistic_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
inline

Definition at line 136 of file logistic.hpp.

template<class RNG >
double stan::prob::logistic_rng ( const double  mu,
const double  sigma,
RNG &  rng 
)
inline

Definition at line 393 of file logistic.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::lognormal_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 292 of file lognormal.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::lognormal_cdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 150 of file lognormal.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::lognormal_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 225 of file lognormal.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::lognormal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 24 of file lognormal.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::lognormal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
inline

Definition at line 143 of file lognormal.hpp.

template<class RNG >
double stan::prob::lognormal_rng ( const double  mu,
const double  sigma,
RNG &  rng 
)
inline

Definition at line 360 of file lognormal.hpp.

template<typename T , typename TL , typename TU >
boost::math::tools::promote_args<T,TL,TU>::type stan::prob::lub_constrain ( const T  x,
TL  lb,
TU  ub 
)
inline

Return the lower- and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds.

The transform is the transformed and scaled inverse logit,

$f(x) = L + (U - L) \mbox{logit}^{-1}(x)$

If the lower bound is negative infinity and upper bound finite, this function reduces to ub_constrain(x,ub). If the upper bound is positive infinity and the lower bound finite, this function reduces to lb_constrain(x,lb). If the upper bound is positive infinity and the lower bound negative infinity, this function reduces to identity_constrain(x).

Parameters
xFree scalar to transform.
lbLower bound.
ubUpper bound.
Returns
Lower- and upper-bounded scalar derived from transforming the free scalar.
Template Parameters
TType of scalar.
TLType of lower bound.
TUType of upper bound.
Exceptions
std::domain_errorif ub <= lb

Definition at line 710 of file transform.hpp.

template<typename T , typename TL , typename TU >
boost::math::tools::promote_args<T,TL,TU>::type stan::prob::lub_constrain ( const T  x,
const TL  lb,
const TU  ub,
T &  lp 
)

Return the lower- and upper-bounded scalar derived by transforming the specified free scalar given the specified lower and upper bounds and increment the specified log probability with the log absolute Jacobian determinant.

The transform is as defined in lub_constrain(T,double,double). The log absolute Jacobian determinant is given by

$\log \left| \frac{d}{dx} \left( L + (U-L) \mbox{logit}^{-1}(x) \right) \right|$

$ {} = \log | (U-L) \, (\mbox{logit}^{-1}(x)) \, (1 - \mbox{logit}^{-1}(x)) |$

$ {} = \log (U - L) + \log (\mbox{logit}^{-1}(x)) + \log (1 - \mbox{logit}^{-1}(x))$

If the lower bound is negative infinity and upper bound finite, this function reduces to ub_constrain(x,ub,lp). If the upper bound is positive infinity and the lower bound finite, this function reduces to lb_constrain(x,lb,lp). If the upper bound is positive infinity and the lower bound negative infinity, this function reduces to identity_constrain(x,lp).

Parameters
xFree scalar to transform.
lbLower bound.
ubUpper bound.
lpLog probability scalar reference.
Returns
Lower- and upper-bounded scalar derived from transforming the free scalar.
Template Parameters
TType of scalar.
TLType of lower bound.
TUType of upper bound.
Exceptions
std::domain_errorif ub <= lb

Definition at line 780 of file transform.hpp.

template<typename T , typename TL , typename TU >
boost::math::tools::promote_args<T,TL,TU>::type stan::prob::lub_free ( const T  y,
TL  lb,
TU  ub 
)
inline

Return the unconstrained scalar that transforms to the specified lower- and upper-bounded scalar given the specified bounds.

The transfrom in lub_constrain(T,double,double), is reversed by a transformed and scaled logit,

$f^{-1}(y) = \mbox{logit}(\frac{y - L}{U - L})$

where $U$ and $L$ are the lower and upper bounds.

If the lower bound is negative infinity and upper bound finite, this function reduces to ub_free(y,ub). If the upper bound is positive infinity and the lower bound finite, this function reduces to lb_free(x,lb). If the upper bound is positive infinity and the lower bound negative infinity, this function reduces to identity_free(y).

Template Parameters
TType of scalar.
Parameters
yScalar input.
lbLower bound.
ubUpper bound.
Returns
The free scalar that transforms to the input scalar given the bounds.
Exceptions
std::invalid_argumentif the lower bound is greater than the upper bound, y is less than the lower bound, or y is greater than the upper bound

Definition at line 845 of file transform.hpp.

template<typename T >
const Eigen::Array<T,Eigen::Dynamic,1> stan::prob::make_nu ( const T  eta,
const size_t  K 
)

This function calculates the degrees of freedom for the t distribution that corresponds to the shape parameter in the Lewandowski et.

al. distribution

Parameters
etahyperparameter on (0,inf), eta = 1 <-> correlation matrix is uniform
Knumber of variables in covariance matrix

Definition at line 343 of file transform.hpp.

template<bool propto, typename T_y , typename T_Mu , typename T_Sigma , typename T_D >
boost::math::tools::promote_args<T_y,T_Mu,T_Sigma,T_D>::type stan::prob::matrix_normal_prec_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const Eigen::Matrix< T_Mu, Eigen::Dynamic, Eigen::Dynamic > &  Mu,
const Eigen::Matrix< T_Sigma, Eigen::Dynamic, Eigen::Dynamic > &  Sigma,
const Eigen::Matrix< T_D, Eigen::Dynamic, Eigen::Dynamic > &  D 
)

The log of the matrix normal density for the given y, mu, Sigma and D where Sigma and D are given as precision matrices, not covariance matrices.

Parameters
yAn mxn matrix.
MuThe mean matrix.
SigmaThe mxm inverse covariance matrix (i.e., the precision matrix) of the rows of y.
DThe nxn inverse covariance matrix (i.e., the precision matrix) of the columns of y.
Returns
The log of the matrix normal density.
Exceptions
std::domain_errorif Sigma or D are not square, not symmetric, or not semi-positive definite.
Template Parameters
T_yType of scalar.
T_MuType of location.
T_SigmaType of Sigma.
T_DType of D.

Definition at line 41 of file matrix_normal.hpp.

template<typename T_y , typename T_Mu , typename T_Sigma , typename T_D >
boost::math::tools::promote_args<T_y,T_Mu,T_Sigma,T_D>::type stan::prob::matrix_normal_prec_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const Eigen::Matrix< T_Mu, Eigen::Dynamic, Eigen::Dynamic > &  Mu,
const Eigen::Matrix< T_Sigma, Eigen::Dynamic, Eigen::Dynamic > &  Sigma,
const Eigen::Matrix< T_D, Eigen::Dynamic, Eigen::Dynamic > &  D 
)

Definition at line 117 of file matrix_normal.hpp.

template<bool propto, typename T_y , typename T_covar , typename T_w >
boost::math::tools::promote_args<T_y,T_covar,T_w>::type stan::prob::multi_gp_cholesky_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &  L,
const Eigen::Matrix< T_w, Eigen::Dynamic, 1 > &  w 
)

The log of a multivariate Gaussian Process for the given y, w, and a Cholesky factor L of the kernel matrix Sigma.

Sigma = LL', a square, semi-positive definite matrix.. y is a dxN matrix, where each column is a different observation and each row is a different output dimension. The Gaussian Process is assumed to have a scaled kernel matrix with a different scale for each output dimension. This distribution is equivalent to: for (i in 1:d) row(y,i) ~ multi_normal(0,(1/w[i])*LL').

Parameters
yA dxN matrix
LThe Cholesky decomposition of a kernel matrix
wA d-dimensional vector of positve inverse scale parameters for each output.
Returns
The log of the multivariate GP density.
Exceptions
std::domain_errorif Sigma is not square, not symmetric, or not semi-positive definite.
Template Parameters
T_yType of scalar.
T_covarType of kernel.
T_wType of weight.

Definition at line 45 of file multi_gp_cholesky.hpp.

template<typename T_y , typename T_covar , typename T_w >
boost::math::tools::promote_args<T_y,T_covar,T_w>::type stan::prob::multi_gp_cholesky_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &  L,
const Eigen::Matrix< T_w, Eigen::Dynamic, 1 > &  w 
)
inline

Definition at line 106 of file multi_gp_cholesky.hpp.

template<bool propto, typename T_y , typename T_covar , typename T_w >
boost::math::tools::promote_args<T_y,T_covar,T_w>::type stan::prob::multi_gp_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &  Sigma,
const Eigen::Matrix< T_w, Eigen::Dynamic, 1 > &  w 
)

The log of a multivariate Gaussian Process for the given y, Sigma, and w.

y is a dxN matrix, where each column is a different observation and each row is a different output dimension. The Gaussian Process is assumed to have a scaled kernel matrix with a different scale for each output dimension. This distribution is equivalent to: for (i in 1:d) row(y,i) ~ multi_normal(0,(1/w[i])*Sigma).

Parameters
yA dxN matrix
SigmaThe NxN kernel matrix
wA d-dimensional vector of positve inverse scale parameters for each output.
Returns
The log of the multivariate GP density.
Exceptions
std::domain_errorif Sigma is not square, not symmetric, or not semi-positive definite.
Template Parameters
T_yType of scalar.
T_covarType of kernel.
T_wType of weight.

Definition at line 45 of file multi_gp.hpp.

template<typename T_y , typename T_covar , typename T_w >
boost::math::tools::promote_args<T_y,T_covar,T_w>::type stan::prob::multi_gp_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  y,
const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &  Sigma,
const Eigen::Matrix< T_w, Eigen::Dynamic, 1 > &  w 
)
inline

Definition at line 115 of file multi_gp.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_covar >
boost::math::tools::promote_args<typename scalar_type<T_y>::type, typename scalar_type<T_loc>::type, T_covar>::type stan::prob::multi_normal_cholesky_log ( const T_y &  y,
const T_loc &  mu,
const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &  L 
)

The log of the multivariate normal density for the given y, mu, and a Cholesky factor L of the variance matrix.

Sigma = LL', a square, semi-positive definite matrix.

Parameters
yA scalar vector
muThe mean vector of the multivariate normal distribution.
LThe Cholesky decomposition of a variance matrix of the multivariate normal distribution
Returns
The log of the multivariate normal density.
Exceptions
std::domain_errorif LL' is not square, not symmetric, or not semi-positive definite.
Template Parameters
T_yType of scalar.
T_locType of location.
T_covarType of scale.

Definition at line 53 of file multi_normal_cholesky.hpp.

template<typename T_y , typename T_loc , typename T_covar >
boost::math::tools::promote_args<typename scalar_type<T_y>::type, typename scalar_type<T_loc>::type, T_covar>::type stan::prob::multi_normal_cholesky_log ( const T_y &  y,
const T_loc &  mu,
const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &  L 
)
inline

Definition at line 159 of file multi_normal_cholesky.hpp.

template<class RNG >
Eigen::VectorXd stan::prob::multi_normal_cholesky_rng ( const Eigen::Matrix< double, Eigen::Dynamic, 1 > &  mu,
const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &  S,
RNG &  rng 
)
inline

Definition at line 167 of file multi_normal_cholesky.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_covar >
boost::math::tools::promote_args<typename scalar_type<T_y>::type, typename scalar_type<T_loc>::type, T_covar>::type stan::prob::multi_normal_log ( const T_y &  y,
const T_loc &  mu,
const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &  Sigma 
)

Definition at line 27 of file multi_normal.hpp.

template<typename T_y , typename T_loc , typename T_covar >
boost::math::tools::promote_args<typename scalar_type<T_y>::type, typename scalar_type<T_loc>::type, T_covar>::type stan::prob::multi_normal_log ( const T_y &  y,
const T_loc &  mu,
const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &  Sigma 
)
inline

Definition at line 131 of file multi_normal.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_covar >
boost::math::tools::promote_args<typename scalar_type<T_y>::type, typename scalar_type<T_loc>::type, T_covar>::type stan::prob::multi_normal_prec_log ( const T_y &  y,
const T_loc &  mu,
const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &  Sigma 
)

Definition at line 34 of file multi_normal_prec.hpp.

template<typename T_y , typename T_loc , typename T_covar >
boost::math::tools::promote_args<typename scalar_type<T_y>::type, typename scalar_type<T_loc>::type, T_covar>::type stan::prob::multi_normal_prec_log ( const T_y &  y,
const T_loc &  mu,
const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &  Sigma 
)
inline

Definition at line 147 of file multi_normal_prec.hpp.

template<class RNG >
Eigen::VectorXd stan::prob::multi_normal_rng ( const Eigen::Matrix< double, Eigen::Dynamic, 1 > &  mu,
const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &  S,
RNG &  rng 
)
inline

Definition at line 139 of file multi_normal.hpp.

template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale >
boost::math::tools::promote_args<typename scalar_type<T_y>::type,T_dof,typename scalar_type<T_loc>::type,T_scale>::type stan::prob::multi_student_t_log ( const T_y &  y,
const T_dof &  nu,
const T_loc &  mu,
const Eigen::Matrix< T_scale, Eigen::Dynamic, Eigen::Dynamic > &  Sigma 
)

Return the log of the multivariate Student t distribution at the specified arguments.

Template Parameters
proptoCarry out calculations up to a proportion

Definition at line 35 of file multi_student_t.hpp.

template<typename T_y , typename T_dof , typename T_loc , typename T_scale >
boost::math::tools::promote_args<typename scalar_type<T_y>::type,T_dof,typename scalar_type<T_loc>::type,T_scale>::type stan::prob::multi_student_t_log ( const T_y &  y,
const T_dof &  nu,
const T_loc &  mu,
const Eigen::Matrix< T_scale, Eigen::Dynamic, Eigen::Dynamic > &  Sigma 
)
inline

Definition at line 172 of file multi_student_t.hpp.

template<class RNG >
Eigen::VectorXd stan::prob::multi_student_t_rng ( const double  nu,
const Eigen::Matrix< double, Eigen::Dynamic, 1 > &  mu,
const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &  s,
RNG &  rng 
)
inline

Definition at line 184 of file multi_student_t.hpp.

template<bool propto, typename T_prob >
boost::math::tools::promote_args<T_prob>::type stan::prob::multinomial_log ( const std::vector< int > &  ns,
const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &  theta 
)

Definition at line 25 of file multinomial.hpp.

template<typename T_prob >
boost::math::tools::promote_args<T_prob>::type stan::prob::multinomial_log ( const std::vector< int > &  ns,
const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &  theta 
)

Definition at line 61 of file multinomial.hpp.

template<class RNG >
std::vector<int> stan::prob::multinomial_rng ( const Eigen::Matrix< double, Eigen::Dynamic, 1 > &  theta,
const int  N,
RNG &  rng 
)
inline

Definition at line 68 of file multinomial.hpp.

template<bool propto, typename T_n , typename T_location , typename T_inv_scale >
return_type<T_location, T_inv_scale>::type stan::prob::neg_binomial_2_log ( const T_n &  n,
const T_location &  mu,
const T_inv_scale &  phi 
)

Definition at line 31 of file neg_binomial_2.hpp.

template<typename T_n , typename T_location , typename T_inv_scale >
return_type<T_location, T_inv_scale>::type stan::prob::neg_binomial_2_log ( const T_n &  n,
const T_location &  mu,
const T_inv_scale &  phi 
)
inline

Definition at line 138 of file neg_binomial_2.hpp.

template<bool propto, typename T_n , typename T_log_location , typename T_inv_scale >
return_type<T_log_location, T_inv_scale>::type stan::prob::neg_binomial_2_log_log ( const T_n &  n,
const T_log_location &  eta,
const T_inv_scale &  phi 
)

Definition at line 150 of file neg_binomial_2.hpp.

template<typename T_n , typename T_log_location , typename T_inv_scale >
return_type<T_log_location, T_inv_scale>::type stan::prob::neg_binomial_2_log_log ( const T_n &  n,
const T_log_location &  eta,
const T_inv_scale &  phi 
)
inline

Definition at line 258 of file neg_binomial_2.hpp.

template<class RNG >
int stan::prob::neg_binomial_2_log_rng ( const double  eta,
const double  phi,
RNG &  rng 
)
inline

Definition at line 286 of file neg_binomial_2.hpp.

template<class RNG >
int stan::prob::neg_binomial_2_rng ( const double  mu,
const double  phi,
RNG &  rng 
)
inline

Definition at line 266 of file neg_binomial_2.hpp.

template<typename T_n , typename T_shape , typename T_inv_scale >
return_type<T_shape, T_inv_scale>::type stan::prob::neg_binomial_ccdf_log ( const T_n &  n,
const T_shape &  alpha,
const T_inv_scale &  beta 
)

Definition at line 428 of file neg_binomial.hpp.

template<typename T_n , typename T_shape , typename T_inv_scale >
return_type<T_shape, T_inv_scale>::type stan::prob::neg_binomial_cdf ( const T_n &  n,
const T_shape &  alpha,
const T_inv_scale &  beta 
)

Definition at line 181 of file neg_binomial.hpp.

template<typename T_n , typename T_shape , typename T_inv_scale >
return_type<T_shape, T_inv_scale>::type stan::prob::neg_binomial_cdf_log ( const T_n &  n,
const T_shape &  alpha,
const T_inv_scale &  beta 
)

Definition at line 314 of file neg_binomial.hpp.

template<bool propto, typename T_n , typename T_shape , typename T_inv_scale >
return_type<T_shape, T_inv_scale>::type stan::prob::neg_binomial_log ( const T_n &  n,
const T_shape &  alpha,
const T_inv_scale &  beta 
)

Definition at line 30 of file neg_binomial.hpp.

template<typename T_n , typename T_shape , typename T_inv_scale >
return_type<T_shape, T_inv_scale>::type stan::prob::neg_binomial_log ( const T_n &  n,
const T_shape &  alpha,
const T_inv_scale &  beta 
)
inline

Definition at line 171 of file neg_binomial.hpp.

template<class RNG >
int stan::prob::neg_binomial_rng ( const double  alpha,
const double  beta,
RNG &  rng 
)
inline

Definition at line 541 of file neg_binomial.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::normal_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 305 of file normal.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::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.

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

Errors are configured by policy. All variables must be finite and the scale must be strictly greater than zero.

Parameters
yA scalar variate.
muThe location of the normal distribution.
sigmaThe scale of the normal distriubtion
Returns
The unit normal cdf evaluated at the specified arguments.
Template Parameters
T_yType of y.
T_locType of mean parameter.
T_scaleType of standard deviation paramater.
PolicyError-handling policy.

Definition at line 152 of file normal.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::normal_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 233 of file normal.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
boost::enable_if_c<contains_fvar<T_y,T_loc,T_scale>::value, typename return_type<T_y,T_loc,T_scale>::type>::type stan::prob::normal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 22 of file normal.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
boost::enable_if_c<is_var_or_arithmetic<T_y,T_loc,T_scale>::value, typename return_type<T_y,T_loc,T_scale>::type>::type stan::prob::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).

y, mu, or sigma can each be either a scalar or a std::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.

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 41 of file normal.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::normal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma 
)
inline

Definition at line 128 of file normal.hpp.

template<class RNG >
double stan::prob::normal_rng ( const double  mu,
const double  sigma,
RNG &  rng 
)
inline

Definition at line 377 of file normal.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::ordered_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x)

Return an increasing ordered vector derived from the specified free vector.

The returned constrained vector will have the same dimensionality as the specified free vector.

Parameters
xFree vector of scalars.
Returns
Positive, increasing ordered vector.
Template Parameters
TType of scalar.

Definition at line 1224 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::ordered_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x,
T &  lp 
)
inline

Return a positive valued, increasing ordered vector derived from the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.

The returned constrained vector will have the same dimensionality as the specified free vector.

Parameters
xFree vector of scalars.
lpLog probability reference.
Returns
Positive, increasing ordered vector.
Template Parameters
TType of scalar.

Definition at line 1256 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::ordered_free ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  y)

Return the vector of unconstrained scalars that transform to the specified positive ordered vector.

This function inverts the constraining operation defined in ordered_constrain(Matrix),

Parameters
yVector of positive, ordered scalars.
Returns
Free vector that transforms into the input vector.
Template Parameters
TType of scalar.
Exceptions
std::domain_errorif y is not a vector of positive, ordered scalars.

Definition at line 1285 of file transform.hpp.

template<bool propto, typename T_lambda , typename T_cut >
boost::math::tools::promote_args<T_lambda,T_cut>::type stan::prob::ordered_logistic_log ( int  y,
const T_lambda &  lambda,
const Eigen::Matrix< T_cut, Eigen::Dynamic, 1 > &  c 
)

Returns the (natural) log probability of the specified integer outcome given the continuous location and specified cutpoints in an ordered logistic model.

Typically the continous location will be the dot product of a vector of regression coefficients and a vector of predictors for the outcome.

Template Parameters
proptoTrue if calculating up to a proportion.
T_locLocation type.
T_cutCut-point type.
PolicyError policy (only its type matters).
Parameters
yOutcome.
lambdaLocation.
cPositive increasing vector of cutpoints.
Returns
Log probability of outcome given location and cutpoints.
Exceptions
std::domain_errorIf the outcome is not between 1 and the number of cutpoints plus 2; if the cutpoint vector is empty; if the cutpoint vector contains a non-positive, non-finite value; or if the cutpoint vector is not sorted in ascending order.

Definition at line 60 of file ordered_logistic.hpp.

template<typename T_lambda , typename T_cut >
boost::math::tools::promote_args<T_lambda,T_cut>::type stan::prob::ordered_logistic_log ( int  y,
const T_lambda &  lambda,
const Eigen::Matrix< T_cut, Eigen::Dynamic, 1 > &  c 
)

Definition at line 108 of file ordered_logistic.hpp.

template<class RNG >
int stan::prob::ordered_logistic_rng ( const double  eta,
const Eigen::Matrix< double, Eigen::Dynamic, 1 > &  c,
RNG &  rng 
)
inline

Definition at line 115 of file ordered_logistic.hpp.

template<typename T_y , typename T_scale , typename T_shape >
return_type<T_y, T_scale, T_shape>::type stan::prob::pareto_ccdf_log ( const T_y &  y,
const T_scale &  y_min,
const T_shape &  alpha 
)

Definition at line 303 of file pareto.hpp.

template<typename T_y , typename T_scale , typename T_shape >
return_type<T_y, T_scale, T_shape>::type stan::prob::pareto_cdf ( const T_y &  y,
const T_scale &  y_min,
const T_shape &  alpha 
)

Definition at line 128 of file pareto.hpp.

template<typename T_y , typename T_scale , typename T_shape >
return_type<T_y, T_scale, T_shape>::type stan::prob::pareto_cdf_log ( const T_y &  y,
const T_scale &  y_min,
const T_shape &  alpha 
)

Definition at line 223 of file pareto.hpp.

template<bool propto, typename T_y , typename T_scale , typename T_shape >
return_type<T_y,T_scale,T_shape>::type stan::prob::pareto_log ( const T_y &  y,
const T_scale &  y_min,
const T_shape &  alpha 
)

Definition at line 24 of file pareto.hpp.

template<typename T_y , typename T_scale , typename T_shape >
return_type<T_y,T_scale,T_shape>::type stan::prob::pareto_log ( const T_y &  y,
const T_scale &  y_min,
const T_shape &  alpha 
)
inline

Definition at line 122 of file pareto.hpp.

template<class RNG >
double stan::prob::pareto_rng ( const double  y_min,
const double  alpha,
RNG &  rng 
)
inline

Definition at line 379 of file pareto.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type<T_y, T_loc, T_scale, T_shape>::type stan::prob::pareto_type_2_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  lambda,
const T_shape &  alpha 
)

Definition at line 381 of file pareto_type_2.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type<T_y, T_loc, T_scale, T_shape>::type stan::prob::pareto_type_2_cdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  lambda,
const T_shape &  alpha 
)

Definition at line 140 of file pareto_type_2.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type<T_y, T_loc, T_scale, T_shape>::type stan::prob::pareto_type_2_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  lambda,
const T_shape &  alpha 
)

Definition at line 270 of file pareto_type_2.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type<T_y,T_loc,T_scale,T_shape>::type stan::prob::pareto_type_2_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  lambda,
const T_shape &  alpha 
)

Definition at line 24 of file pareto_type_2.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type<T_y,T_loc,T_scale,T_shape>::type stan::prob::pareto_type_2_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  lambda,
const T_shape &  alpha 
)
inline

Definition at line 133 of file pareto_type_2.hpp.

template<class RNG >
double stan::prob::pareto_type_2_rng ( const double  mu,
const double  lambda,
const double  alpha,
RNG &  rng 
)
inline

Definition at line 495 of file pareto_type_2.hpp.

template<typename T_n , typename T_rate >
return_type<T_rate>::type stan::prob::poisson_ccdf_log ( const T_n &  n,
const T_rate &  lambda 
)

Definition at line 322 of file poisson.hpp.

template<typename T_n , typename T_rate >
return_type<T_rate>::type stan::prob::poisson_cdf ( const T_n &  n,
const T_rate &  lambda 
)

Definition at line 194 of file poisson.hpp.

template<typename T_n , typename T_rate >
return_type<T_rate>::type stan::prob::poisson_cdf_log ( const T_n &  n,
const T_rate &  lambda 
)

Definition at line 260 of file poisson.hpp.

template<bool propto, typename T_n , typename T_rate >
return_type<T_rate>::type stan::prob::poisson_log ( const T_n &  n,
const T_rate &  lambda 
)

Definition at line 27 of file poisson.hpp.

template<typename T_n , typename T_rate >
return_type<T_rate>::type stan::prob::poisson_log ( const T_n &  n,
const T_rate &  lambda 
)
inline

Definition at line 101 of file poisson.hpp.

template<bool propto, typename T_n , typename T_log_rate >
return_type<T_log_rate>::type stan::prob::poisson_log_log ( const T_n &  n,
const T_log_rate &  alpha 
)

Definition at line 109 of file poisson.hpp.

template<typename T_n , typename T_log_rate >
return_type<T_log_rate>::type stan::prob::poisson_log_log ( const T_n &  n,
const T_log_rate &  alpha 
)
inline

Definition at line 187 of file poisson.hpp.

template<class RNG >
int stan::prob::poisson_rng ( const double  lambda,
RNG &  rng 
)
inline

Definition at line 384 of file poisson.hpp.

template<typename T >
T stan::prob::positive_constrain ( const T  x)
inline

Return the positive value for the specified unconstrained input.

The transform applied is

$f(x) = \exp(x)$.

Parameters
xArbitrary input scalar.
Returns
Input transformed to be positive.

Definition at line 446 of file transform.hpp.

template<typename T >
T stan::prob::positive_constrain ( const T  x,
T &  lp 
)
inline

Return the positive value for the specified unconstrained input, incrementing the scalar reference with the log absolute Jacobian determinant.

See positive_constrain(T) for details of the transform. The log absolute Jacobian determinant is

$\log | \frac{d}{dx} \mbox{exp}(x) | = \log | \mbox{exp}(x) | = x$.

Parameters
xArbitrary input scalar.
lpLog probability reference.
Returns
Input transformed to be positive.
Template Parameters
TType of scalar.

Definition at line 468 of file transform.hpp.

template<typename T >
T stan::prob::positive_free ( const T  y)
inline

Return the unconstrained value corresponding to the specified positive-constrained value.

The transform is the inverse of the transform $f$ applied by positive_constrain(T), namely

$f^{-1}(x) = \log(x)$.

The input is validated using stan::math::check_positive().

Parameters
yInput scalar.
Returns
Unconstrained value that produces the input when constrained.
Template Parameters
TType of scalar.
Exceptions
std::domain_errorif the variable is negative.

Definition at line 491 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::positive_ordered_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x)

Return an increasing positive ordered vector derived from the specified free vector.

The returned constrained vector will have the same dimensionality as the specified free vector.

Parameters
xFree vector of scalars.
Returns
Positive, increasing ordered vector.
Template Parameters
TType of scalar.

Definition at line 1317 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::positive_ordered_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x,
T &  lp 
)
inline

Return a positive valued, increasing positive ordered vector derived from the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.

The returned constrained vector will have the same dimensionality as the specified free vector.

Parameters
xFree vector of scalars.
lpLog probability reference.
Returns
Positive, increasing ordered vector.
Template Parameters
TType of scalar.

Definition at line 1348 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::positive_ordered_free ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  y)

Return the vector of unconstrained scalars that transform to the specified positive ordered vector.

This function inverts the constraining operation defined in positive_ordered_constrain(Matrix),

Parameters
yVector of positive, ordered scalars.
Returns
Free vector that transforms into the input vector.
Template Parameters
TType of scalar.
Exceptions
std::domain_errorif y is not a vector of positive, ordered scalars.

Definition at line 1376 of file transform.hpp.

template<typename T >
T stan::prob::prob_constrain ( const T  x)
inline

Return a probability value constrained to fall between 0 and 1 (inclusive) for the specified free scalar.

The transform is the inverse logit,

$f(x) = \mbox{logit}^{-1}(x) = \frac{1}{1 + \exp(x)}$.

Parameters
xFree scalar.
Returns
Probability-constrained result of transforming the free scalar.
Template Parameters
TType of scalar.

Definition at line 875 of file transform.hpp.

template<typename T >
T stan::prob::prob_constrain ( const T  x,
T &  lp 
)
inline

Return a probability value constrained to fall between 0 and 1 (inclusive) for the specified free scalar and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.

The transform is as defined for prob_constrain(T). The log absolute Jacobian determinant is

The log absolute Jacobian determinant is

$\log | \frac{d}{dx} \mbox{logit}^{-1}(x) |$

$\log ((\mbox{logit}^{-1}(x)) (1 - \mbox{logit}^{-1}(x))$

$\log (\mbox{logit}^{-1}(x)) + \log (1 - \mbox{logit}^{-1}(x))$.

Parameters
xFree scalar.
lpLog probability reference.
Returns
Probability-constrained result of transforming the free scalar.
Template Parameters
TType of scalar.

Definition at line 903 of file transform.hpp.

template<typename T >
T stan::prob::prob_free ( const T  y)
inline

Return the free scalar that when transformed to a probability produces the specified scalar.

The function that reverses the constraining transform specified in prob_constrain(T) is the logit function,

$f^{-1}(y) = \mbox{logit}(y) = \frac{1 - y}{y}$.

Parameters
yScalar input.
Template Parameters
TType of scalar.
Exceptions
std::domain_errorif y is less than 0 or greater than 1.

Definition at line 927 of file transform.hpp.

template<typename T_y , typename T_scale >
return_type<T_y,T_scale>::type stan::prob::rayleigh_ccdf_log ( const T_y &  y,
const T_scale &  sigma 
)

Definition at line 239 of file rayleigh.hpp.

template<typename T_y , typename T_scale >
return_type<T_y,T_scale>::type stan::prob::rayleigh_cdf ( const T_y &  y,
const T_scale &  sigma 
)

Definition at line 105 of file rayleigh.hpp.

template<typename T_y , typename T_scale >
return_type<T_y,T_scale>::type stan::prob::rayleigh_cdf_log ( const T_y &  y,
const T_scale &  sigma 
)

Definition at line 176 of file rayleigh.hpp.

template<bool propto, typename T_y , typename T_scale >
return_type<T_y,T_scale>::type stan::prob::rayleigh_log ( const T_y &  y,
const T_scale &  sigma 
)

Definition at line 21 of file rayleigh.hpp.

template<typename T_y , typename T_scale >
return_type<T_y,T_scale>::type stan::prob::rayleigh_log ( const T_y &  y,
const T_scale &  sigma 
)
inline

Definition at line 99 of file rayleigh.hpp.

template<class RNG >
double stan::prob::rayleigh_rng ( const double  sigma,
RNG &  rng 
)
inline

Definition at line 299 of file rayleigh.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::read_corr_L ( const Eigen::Array< T, Eigen::Dynamic, 1 > &  CPCs,
const size_t  K 
)

Return the Cholesky factor of the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations.

It is generally better to work with the Cholesky factor rather than the correlation matrix itself when the determinant, inverse, etc. of the correlation matrix is needed for some statistical calculation.

See read_corr_matrix(Array,size_t,T) for more information.

Parameters
CPCsThe (K choose 2) canonical partial correlations in (-1,1).
KDimensionality of correlation matrix.
Returns
Cholesky factor of correlation matrix for specified canonical partial correlations.
Template Parameters
TType of underlying scalar.

Definition at line 139 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::read_corr_L ( const Eigen::Array< T, Eigen::Dynamic, 1 > &  CPCs,
const size_t  K,
T &  log_prob 
)

Return the Cholesky factor of the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations, incrementing the specified scalar reference with the log absolute determinant of the Jacobian of the transformation.

The implementation is Ben Goodrich's Cholesky factor-based approach to the C-vine method of:

  • Daniel Lewandowski, Dorota Kurowicka, and Harry Joe, Generating random correlation matrices based on vines and extended onion method Journal of Multivariate Analysis 100 (2009) 1989–2001
Parameters
CPCsThe (K choose 2) canonical partial correlations in (-1,1).
KDimensionality of correlation matrix.
log_probReference to variable to increment with the log Jacobian determinant.
Returns
Cholesky factor of correlation matrix for specified partial correlations.
Template Parameters
TType of underlying scalar.

Definition at line 215 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::read_corr_matrix ( const Eigen::Array< T, Eigen::Dynamic, 1 > &  CPCs,
const size_t  K 
)

Return the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations.

See read_corr_matrix(Array,size_t,T) for more information.

Parameters
CPCsThe (K choose 2) canonical partial correlations in (-1,1).
KDimensionality of correlation matrix.
Returns
Cholesky factor of correlation matrix for specified canonical partial correlations.
Template Parameters
TType of underlying scalar.

Definition at line 181 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::read_corr_matrix ( const Eigen::Array< T, Eigen::Dynamic, 1 > &  CPCs,
const size_t  K,
T &  log_prob 
)

Return the correlation matrix of the specified dimensionality corresponding to the specified canonical partial correlations, incrementing the specified scalar reference with the log absolute determinant of the Jacobian of the transformation.

It is usually preferable to utilize the version that returns the Cholesky factor of the correlation matrix rather than the correlation matrix itself in statistical calculations.

Parameters
CPCsThe (K choose 2) canonical partial correlations in (-1,1).
KDimensionality of correlation matrix.
log_probReference to variable to increment with the log Jacobian determinant.
Returns
Correlation matrix for specified partial correlations.
Template Parameters
TType of underlying scalar.

Definition at line 258 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::read_cov_L ( const Eigen::Array< T, Eigen::Dynamic, 1 > &  CPCs,
const Eigen::Array< T, Eigen::Dynamic, 1 > &  sds,
T &  log_prob 
)

This is the function that should be called prior to evaluating the density of any elliptical distribution.

Parameters
CPCson (-1,1)
sdson (0,inf)
log_probthe log probability value to increment with the Jacobian
Returns
Cholesky factor of covariance matrix for specified partial correlations.

Definition at line 280 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::read_cov_matrix ( const Eigen::Array< T, Eigen::Dynamic, 1 > &  CPCs,
const Eigen::Array< T, Eigen::Dynamic, 1 > &  sds,
T &  log_prob 
)

A generally worse alternative to call prior to evaluating the density of an elliptical distribution.

Parameters
CPCson (-1,1)
sdson (0,inf)
log_probthe log probability value to increment with the Jacobian
Returns
Covariance matrix for specified partial correlations.

Definition at line 300 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::prob::read_cov_matrix ( const Eigen::Array< T, Eigen::Dynamic, 1 > &  CPCs,
const Eigen::Array< T, Eigen::Dynamic, 1 > &  sds 
)

Builds a covariance matrix from CPCs and standard deviations.

Parameters
CPCsin (-1,1)
sdsin (0,inf)

Definition at line 319 of file transform.hpp.

template<typename T_y , typename T_dof , typename T_scale >
return_type<T_y, T_dof, T_scale>::type stan::prob::scaled_inv_chi_square_ccdf_log ( const T_y &  y,
const T_dof &  nu,
const T_scale &  s 
)

Definition at line 419 of file scaled_inv_chi_square.hpp.

template<typename T_y , typename T_dof , typename T_scale >
return_type<T_y, T_dof, T_scale>::type stan::prob::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.

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 187 of file scaled_inv_chi_square.hpp.

template<typename T_y , typename T_dof , typename T_scale >
return_type<T_y, T_dof, T_scale>::type stan::prob::scaled_inv_chi_square_cdf_log ( const T_y &  y,
const T_dof &  nu,
const T_scale &  s 
)

Definition at line 310 of file scaled_inv_chi_square.hpp.

template<bool propto, typename T_y , typename T_dof , typename T_scale >
return_type<T_y,T_dof,T_scale>::type stan::prob::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*}

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 44 of file scaled_inv_chi_square.hpp.

template<typename T_y , typename T_dof , typename T_scale >
return_type<T_y,T_dof,T_scale>::type stan::prob::scaled_inv_chi_square_log ( const T_y &  y,
const T_dof &  nu,
const T_scale &  s 
)
inline

Definition at line 167 of file scaled_inv_chi_square.hpp.

template<class RNG >
double stan::prob::scaled_inv_chi_square_rng ( const double  nu,
const double  s,
RNG &  rng 
)
inline

Definition at line 528 of file scaled_inv_chi_square.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::simplex_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  y)

Return the simplex corresponding to the specified free vector.

A simplex is a vector containing values greater than or equal to 0 that sum to 1. A vector with (K-1) unconstrained values will produce a simplex of size K.

The transform is based on a centered stick-breaking process.

Parameters
yFree vector input of dimensionality K - 1.
Returns
Simplex of dimensionality K.
Template Parameters
TType of scalar.

Definition at line 1103 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::simplex_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  y,
T &  lp 
)

Return the simplex corresponding to the specified free vector and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.

The simplex transform is defined through a centered stick-breaking process.

Parameters
yFree vector input of dimensionality K - 1.
lpLog probability reference to increment.
Returns
Simplex of dimensionality K.
Template Parameters
TType of scalar.

Definition at line 1142 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::simplex_free ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x)

Return an unconstrained vector that when transformed produces the specified simplex.

It applies to a simplex of dimensionality K and produces an unconstrained vector of dimensionality (K-1).

The simplex transform is defined through a centered stick-breaking process.

Parameters
xSimplex of dimensionality K.
Returns
Free vector of dimensionality (K-1) that transfroms to the simplex.
Template Parameters
TType of scalar.
Exceptions
std::domain_errorif x is not a valid simplex

Definition at line 1188 of file transform.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type<T_y,T_loc,T_scale,T_shape>::type stan::prob::skew_normal_ccdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_shape &  alpha 
)

Definition at line 320 of file skew_normal.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type<T_y,T_loc,T_scale,T_shape>::type stan::prob::skew_normal_cdf ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_shape &  alpha 
)

Definition at line 141 of file skew_normal.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type<T_y,T_loc,T_scale,T_shape>::type stan::prob::skew_normal_cdf_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_shape &  alpha 
)

Definition at line 237 of file skew_normal.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type<T_y,T_loc,T_scale,T_shape>::type stan::prob::skew_normal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_shape &  alpha 
)

Definition at line 23 of file skew_normal.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_shape >
return_type<T_y,T_loc,T_scale, T_shape>::type stan::prob::skew_normal_log ( const T_y &  y,
const T_loc &  mu,
const T_scale &  sigma,
const T_shape &  alpha 
)
inline

Definition at line 134 of file skew_normal.hpp.

template<class RNG >
double stan::prob::skew_normal_rng ( const double  mu,
const double  sigma,
const double  alpha,
RNG &  rng 
)
inline

Definition at line 403 of file skew_normal.hpp.

template<typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type<T_y, T_dof, T_loc, T_scale>::type stan::prob::student_t_ccdf_log ( const T_y &  y,
const T_dof &  nu,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 555 of file student_t.hpp.

template<typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type<T_y, T_dof, T_loc, T_scale>::type stan::prob::student_t_cdf ( const T_y &  y,
const T_dof &  nu,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 219 of file student_t.hpp.

template<typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type<T_y, T_dof, T_loc, T_scale>::type stan::prob::student_t_cdf_log ( const T_y &  y,
const T_dof &  nu,
const T_loc &  mu,
const T_scale &  sigma 
)

Definition at line 393 of file student_t.hpp.

template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type<T_y,T_dof,T_loc,T_scale>::type stan::prob::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*}

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 49 of file student_t.hpp.

template<typename T_y , typename T_dof , typename T_loc , typename T_scale >
return_type<T_y,T_dof,T_loc,T_scale>::type stan::prob::student_t_log ( const T_y &  y,
const T_dof &  nu,
const T_loc &  mu,
const T_scale &  sigma 
)
inline

Definition at line 212 of file student_t.hpp.

template<class RNG >
double stan::prob::student_t_rng ( const double  nu,
const double  mu,
const double  sigma,
RNG &  rng 
)
inline

Definition at line 717 of file student_t.hpp.

template<typename T , typename TU >
boost::math::tools::promote_args<T,TU>::type stan::prob::ub_constrain ( const T  x,
const TU  ub 
)
inline

Return the upper-bounded value for the specified unconstrained scalar and upper bound.

The transform is

$f(x) = U - \exp(x)$

where $U$ is the upper bound.

If the upper bound is positive infinity, this function reduces to identity_constrain(x).

Parameters
xFree scalar.
ubUpper bound.
Returns
Transformed scalar with specified upper bound.
Template Parameters
TType of scalar.
TUType of upper bound.

Definition at line 604 of file transform.hpp.

template<typename T , typename TU >
boost::math::tools::promote_args<T,TU>::type stan::prob::ub_constrain ( const T  x,
const TU  ub,
T &  lp 
)
inline

Return the upper-bounded value for the specified unconstrained scalar and upper bound and increment the specified log probability reference with the log absolute Jacobian determinant of the transform.

The transform is as specified for ub_constrain(T,double). The log absolute Jacobian determinant is

$ \log | \frac{d}{dx} -\mbox{exp}(x) + U | = \log | -\mbox{exp}(x) + 0 | = x$.

If the upper bound is positive infinity, this function reduces to identity_constrain(x,lp).

Parameters
xFree scalar.
ubUpper bound.
lpLog probability reference.
Returns
Transformed scalar with specified upper bound.
Template Parameters
TType of scalar.
TUType of upper bound.

Definition at line 636 of file transform.hpp.

template<typename T , typename TU >
boost::math::tools::promote_args<T,TU>::type stan::prob::ub_free ( const T  y,
const TU  ub 
)
inline

Return the free scalar that corresponds to the specified upper-bounded value with respect to the specified upper bound.

The transform is the reverse of the ub_constrain(T,double) transform,

$f^{-1}(y) = \log -(y - U)$

where $U$ is the upper bound.

If the upper bound is positive infinity, this function reduces to identity_free(y).

Parameters
yUpper-bounded scalar.
ubUpper bound.
Returns
Free scalar corresponding to upper-bounded scalar.
Template Parameters
TType of scalar.
TUType of upper bound.
Exceptions
std::invalid_argumentif y is greater than the upper bound.

Definition at line 668 of file transform.hpp.

template<typename T_y , typename T_low , typename T_high >
return_type<T_y,T_low,T_high>::type stan::prob::uniform_ccdf_log ( const T_y &  y,
const T_low &  alpha,
const T_high &  beta 
)

Definition at line 270 of file uniform.hpp.

template<typename T_y , typename T_low , typename T_high >
return_type<T_y,T_low,T_high>::type stan::prob::uniform_cdf ( const T_y &  y,
const T_low &  alpha,
const T_high &  beta 
)

Definition at line 125 of file uniform.hpp.

template<typename T_y , typename T_low , typename T_high >
return_type<T_y,T_low,T_high>::type stan::prob::uniform_cdf_log ( const T_y &  y,
const T_low &  alpha,
const T_high &  beta 
)

Definition at line 201 of file uniform.hpp.

template<bool propto, typename T_y , typename T_low , typename T_high >
return_type<T_y,T_low,T_high>::type stan::prob::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*}

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 44 of file uniform.hpp.

template<typename T_y , typename T_low , typename T_high >
return_type<T_y,T_low,T_high>::type stan::prob::uniform_log ( const T_y &  y,
const T_low &  alpha,
const T_high &  beta 
)
inline

Definition at line 119 of file uniform.hpp.

template<class RNG >
double stan::prob::uniform_rng ( const double  alpha,
const double  beta,
RNG &  rng 
)
inline

Definition at line 339 of file uniform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::unit_vector_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  y)

Return the unit length vector corresponding to the free vector y.

The free vector contains K-1 spherical coordinates.

Parameters
yof K - 1 spherical coordinates
Returns
Unit length vector of dimension K
Template Parameters
TScalar type.

Definition at line 1015 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::unit_vector_constrain ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  y,
T &  lp 
)

Return the unit length vector corresponding to the free vector y.

The free vector contains K-1 spherical coordinates.

Parameters
yof K - 1 spherical coordinates
Returns
Unit length vector of dimension K
Parameters
lpLog probability reference to increment.
Template Parameters
TScalar type.

Definition at line 1044 of file transform.hpp.

template<typename T >
Eigen::Matrix<T,Eigen::Dynamic,1> stan::prob::unit_vector_free ( const Eigen::Matrix< T, Eigen::Dynamic, 1 > &  x)

Definition at line 1067 of file transform.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::von_mises_log ( T_y const &  y,
T_loc const &  mu,
T_scale const &  kappa 
)

Definition at line 19 of file von_mises.hpp.

template<typename T_y , typename T_loc , typename T_scale >
return_type<T_y,T_loc,T_scale>::type stan::prob::von_mises_log ( T_y const &  y,
T_loc const &  mu,
T_scale const &  kappa 
)
inline

Definition at line 115 of file von_mises.hpp.

template<class RNG >
double stan::prob::von_mises_rng ( const double  mu,
const double  kappa,
RNG &  rng 
)
inline

Definition at line 130 of file von_mises.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::weibull_ccdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)

Definition at line 254 of file weibull.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::weibull_cdf ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)

Definition at line 138 of file weibull.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::weibull_cdf_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)

Definition at line 201 of file weibull.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::weibull_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)

Definition at line 24 of file weibull.hpp.

template<typename T_y , typename T_shape , typename T_scale >
return_type<T_y,T_shape,T_scale>::type stan::prob::weibull_log ( const T_y &  y,
const T_shape &  alpha,
const T_scale &  sigma 
)
inline

Definition at line 132 of file weibull.hpp.

template<class RNG >
double stan::prob::weibull_rng ( const double  alpha,
const double  sigma,
RNG &  rng 
)
inline

Definition at line 304 of file weibull.hpp.

template<bool propto, typename T_y , typename T_dof , typename T_scale >
boost::math::tools::promote_args<T_y,T_dof,T_scale>::type stan::prob::wishart_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  W,
const T_dof &  nu,
const Eigen::Matrix< T_scale, Eigen::Dynamic, Eigen::Dynamic > &  S 
)

The log of the Wishart density for the given W, degrees of freedom, and scale matrix.

The scale matrix, S, must be k x k, symmetric, and semi-positive definite. Dimension, k, is implicit. nu must be greater than k-1

\begin{eqnarray*} W &\sim& \mbox{\sf{Wishart}}_{\nu} (S) \\ \log (p (W \,|\, \nu, S) ) &=& \log \left( \left(2^{\nu k/2} \pi^{k (k-1) /4} \prod_{i=1}^k{\Gamma (\frac{\nu + 1 - i}{2})} \right)^{-1} \times \left| S \right|^{-\nu/2} \left| W \right|^{(\nu - k - 1) / 2} \times \exp (-\frac{1}{2} \mbox{tr} (S^{-1} W)) \right) \\ &=& -\frac{\nu k}{2}\log(2) - \frac{k (k-1)}{4} \log(\pi) - \sum_{i=1}^{k}{\log (\Gamma (\frac{\nu+1-i}{2}))} -\frac{\nu}{2} \log(\det(S)) + \frac{\nu-k-1}{2}\log (\det(W)) - \frac{1}{2} \mbox{tr} (S^{-1}W) \end{eqnarray*}

Parameters
WA scalar matrix
nuDegrees of freedom
SThe scale matrix
Returns
The log of the Wishart density at W given nu and S.
Exceptions
std::domain_errorif nu is not greater than k-1
std::domain_errorif S is not square, not symmetric, or not semi-positive definite.
Template Parameters
T_yType of scalar.
T_dofType of degrees of freedom.
T_scaleType of scale.

Definition at line 62 of file wishart.hpp.

template<typename T_y , typename T_dof , typename T_scale >
boost::math::tools::promote_args<T_y,T_dof,T_scale>::type stan::prob::wishart_log ( const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &  W,
const T_dof &  nu,
const Eigen::Matrix< T_scale, Eigen::Dynamic, Eigen::Dynamic > &  S 
)
inline

Definition at line 135 of file wishart.hpp.

template<class RNG >
Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> stan::prob::wishart_rng ( const double  nu,
const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > &  S,
RNG &  rng 
)
inline

Definition at line 143 of file wishart.hpp.

Variable Documentation

const double stan::prob::CONSTRAINT_TOLERANCE = 1E-8

Definition at line 32 of file transform.hpp.


     [ Stan Home Page ] © 2011–2014, Stan Development Team.