All Classes Namespaces Files Functions Variables Typedefs Enumerator Friends Macros
stan::math Namespace Reference

Matrices and templated mathematical functions. More...

## Namespaces

| detail

## Classes

struct | fvar
class | stack_alloc
| An instance of this class provides a memory pool through which blocks of raw memory may be allocated and then collected simultaneously. More...
struct | coupled_ode_observer
| Observer for the coupled states. More...
struct | coupled_ode_system
| Base template class for a coupled ordinary differential equation system, which adds sensitivities to the base system. More...
struct | coupled_ode_system< F, double, double >
| The coupled ode system for known initial values and known parameters. More...
struct | index_type< std::vector< T > >
| Template metaprogram class to compute the type of index for a standard vector. More...
class | accumulator
| Class to accumulate values and eventually return their sum. More...
struct | array_builder
| Structure for building up arrays in an expression (rather than in statements) using an argumentchaining add() method and a getter method array() to return the result. More...
struct | common_type
struct | common_type< std::vector< T1 >, std::vector< T2 > >
struct | common_type< Eigen::Matrix< T1, R, C >, Eigen::Matrix< T2, R, C > >
class | LDLT_factor
class | LDLT_factor< T, R, C >
| LDLT_factor is a thin wrapper on Eigen::LDLT to allow for reusing factorizations and efficient autodiff of things like log determinants and solutions to linear systems. More...
struct | promote_scalar_struct< T, Eigen::Matrix< S,-1,-1 > >
| Struct to hold static function for promoting underlying scalar types. More...
struct | promote_scalar_struct< T, Eigen::Matrix< S, 1,-1 > >
| Struct to hold static function for promoting underlying scalar types. More...
struct | promote_scalar_struct< T, Eigen::Matrix< S,-1, 1 > >
| Struct to hold static function for promoting underlying scalar types. More...
struct | promote_scalar_type< T, Eigen::Matrix< S, Eigen::Dynamic, Eigen::Dynamic > >
| Template metaprogram to calculate a type for a matrix whose underlying scalar is converted from the second template parameter type to the first. More...
struct | promote_scalar_type< T, Eigen::Matrix< S, Eigen::Dynamic, 1 > >
| Template metaprogram to calculate a type for a vector whose underlying scalar is converted from the second template parameter type to the first. More...
struct | promote_scalar_type< T, Eigen::Matrix< S, 1, Eigen::Dynamic > >
| Template metaprogram to calculate a type for a row vector whose underlying scalar is converted from the second template parameter type to the first. More...
struct | promoter
struct | promoter< T, T >
struct | promoter< std::vector< F >, std::vector< T > >
struct | promoter< std::vector< T >, std::vector< T > >
struct | promoter< Eigen::Matrix< F, R, C >, Eigen::Matrix< T, R, C > >
struct | promoter< Eigen::Matrix< T, R, C >, Eigen::Matrix< T, R, C > >
class | welford_covar_estimator
class | welford_var_estimator
struct | index_type< Eigen::Matrix< T, R, C > >
| Template metaprogram defining typedef for the type of index for an Eigen matrix, vector, or row vector. More...
struct | store_type
struct | store_type< double >
struct | store_type< int >
struct | pass_type
struct | pass_type< double >
struct | pass_type< int >
class | seq_view
class | seq_view< T, Eigen::Matrix< S, Eigen::Dynamic, 1 > >
class | seq_view< T, Eigen::Matrix< S, 1, Eigen::Dynamic > >
class | seq_view< T, Eigen::Matrix< S, Eigen::Dynamic, Eigen::Dynamic > >
class | seq_view< T, std::vector< S > >
class | seq_view< T, std::vector< T > >
class | seq_view< T, std::vector< std::vector< T > > >
class | seq_view< double, std::vector< int > >
struct | value_type< Eigen::Matrix< T, R, C > >
| Template metaprogram defining the type of values stored in an Eigen matrix, vector, or row vector. More...
struct | promote_scalar_struct
| General struct to hold static function for promoting underlying scalar types. More...
struct | promote_scalar_struct< T, T >
| Struct to hold static function for promoting underlying scalar types. More...
struct | promote_scalar_struct< T, std::vector< S > >
| Struct to hold static function for promoting underlying scalar types. More...
struct | promote_scalar_type
| Template metaprogram to calculate a type for converting a convertible type. More...
struct | promote_scalar_type< T, std::vector< S > >
| Template metaprogram to calculate a type for a container whose underlying scalar is converted from the second template parameter type to the first. More...
struct | child_type
| Primary template class for metaprogram to compute child type of T. More...
struct | child_type< T_struct< T_child > >
| Specialization for template classes / structs. More...
struct | include_summand
| Template metaprogram to calculate whether a summand needs to be included in a proportional (log) probability calculation. More...
struct | index_type
| Primary template class for the metaprogram to compute the index type of a container. More...
struct | index_type< const T >
| Template class for metaprogram to compute the type of indexes used in a constant container type. More...
class | partials_vari
struct | OperandsAndPartials
| A variable implementation that stores operands and derivatives with respect to the variable. More...
struct | value_type
| Primary template class for metaprogram to compute the type of values stored in a container. More...
struct | value_type< const T >
| Template class for metaprogram to compute the type of values stored in a constant container. More...
struct | value_type< std::vector< T > >
| Template metaprogram class to compute the type of values stored in a standard vector. More...
class | sum_v_vari
| Class for sums of variables constructed with standard vectors. More...
struct | coupled_ode_system< F, double, stan::math::var >
| The coupled ODE system for known initial values and unknown parameters. More...
struct | coupled_ode_system< F, stan::math::var, double >
| The coupled ODE system for unknown initial values and known parameters. More...
struct | coupled_ode_system< F, stan::math::var, stan::math::var >
| The coupled ode system for unknown intial values and unknown parameters. More...
struct | AutodiffStackStorage
class | chainable
| Abstract base class for variable implementations that handles memory management and applying the chain rule. More...
class | chainable_alloc
| A chainable_alloc is an object which is constructed and destructed normally but the memory lifespan is managed along with the arena allocator for the gradient calculation. More...
class | op_ddv_vari
class | op_dv_vari
class | op_dvd_vari
class | op_dvv_vari
class | gevv_vvv_vari
class | op_matrix_vari
class | precomp_v_vari
class | precomp_vv_vari
class | precomp_vvv_vari
class | precomputed_gradients_vari
| A variable implementation taking a sequence of operands and partial derivatives with respect to the operands. More...
class | stored_gradient_vari
| A var implementation that stores the daughter variable implementation pointers and the partial derivative with respect to the result explicitly in arrays constructed on the auto-diff memory stack. More...
class | op_v_vari
class | var
| Independent (input) and dependent (output) variables for gradients. More...
class | vari
| The variable implementation base class. More...
class | op_vd_vari
class | op_vdd_vari
class | op_vdv_vari
class | op_vector_vari
class | op_vv_vari
class | op_vvd_vari
class | op_vvv_vari
class | LDLT_alloc
| This object stores the actual (double typed) LDLT factorization of an Eigen::Matrix<var> along with pointers to its vari's which allow the *_ldlt functions to save memory. More...
class | LDLT_factor< stan::math::var, R, C >
| A template specialization of src/stan/math/matrix/LDLT_factor.hpp for stan::math::var which can be used with all the *_ldlt functions. More...
class | sum_eigen_v_vari
| Class for representing sums with constructors for Eigen. More...

## Typedefs

typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > ::Index | size_type
| Type for sizes and indexes in an Eigen matrix with double e. More...
typedef Eigen::Matrix< fvar < double >, Eigen::Dynamic, Eigen::Dynamic > | matrix_fd
typedef Eigen::Matrix< fvar < fvar< double > >, Eigen::Dynamic, Eigen::Dynamic > | matrix_ffd
typedef Eigen::Matrix< fvar < double >, Eigen::Dynamic, 1 > | vector_fd
typedef Eigen::Matrix< fvar < fvar< double > >, Eigen::Dynamic, 1 > | vector_ffd
typedef Eigen::Matrix< fvar < double >, 1, Eigen::Dynamic > | row_vector_fd
typedef Eigen::Matrix< fvar < fvar< double > >, 1, Eigen::Dynamic > | row_vector_ffd
typedef Eigen::Matrix< fvar < var >, Eigen::Dynamic, Eigen::Dynamic > | matrix_fv
typedef Eigen::Matrix< fvar < fvar< var > >, Eigen::Dynamic, Eigen::Dynamic > | matrix_ffv
typedef Eigen::Matrix< fvar < var >, Eigen::Dynamic, 1 > | vector_fv
typedef Eigen::Matrix< fvar < fvar< var > >, Eigen::Dynamic, 1 > | vector_ffv
typedef Eigen::Matrix< fvar < var >, 1, Eigen::Dynamic > | row_vector_fv
typedef Eigen::Matrix< fvar < fvar< var > >, 1, Eigen::Dynamic > | row_vector_ffv
typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > | matrix_d
| Type for matrix of double values. More...
typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > | vector_d
| Type for (column) vector of double values. More...
typedef Eigen::Matrix< double, 1, Eigen::Dynamic > | row_vector_d
| Type for (row) vector of double values. More...
typedef AutodiffStackStorage < chainable, chainable_alloc > | ChainableStack
typedef Eigen::Matrix< var, Eigen::Dynamic, Eigen::Dynamic > | matrix_v
| The type of a matrix holding `stan::math::var` values. More...
typedef Eigen::Matrix< var, Eigen::Dynamic, 1 > | vector_v
| The type of a (column) vector holding `stan::math::var` values. More...
typedef Eigen::Matrix< var, 1, Eigen::Dynamic > | row_vector_v
| The type of a row vector holding `stan::math::var` values. More...

## Functions

template<typename T >
fvar< T > | log_sum_exp (const std::vector< fvar< T > > &v)
template<typename T >
fvar< T > | sum (const std::vector< fvar< T > > &m)
| Return the sum of the entries of the specified standard vector. More...
template<typename T >
fvar< T > | operator+ (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | operator+ (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | operator+ (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | operator/ (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | operator/ (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | operator/ (const double x1, const fvar< T > &x2)
template<typename T >
bool | operator== (const fvar< T > &x, const fvar< T > &y)
template<typename T >
bool | operator== (const fvar< T > &x, double y)
template<typename T >
bool | operator== (double x, const fvar< T > &y)
template<typename T >
bool | operator> (const fvar< T > &x, const fvar< T > &y)
template<typename T >
bool | operator> (const fvar< T > &x, double y)
template<typename T >
bool | operator> (double x, const fvar< T > &y)
template<typename T >
bool | operator>= (const fvar< T > &x, const fvar< T > &y)
template<typename T >
bool | operator>= (const fvar< T > &x, double y)
template<typename T >
bool | operator>= (double x, const fvar< T > &y)
template<typename T >
bool | operator< (const fvar< T > &x, double y)
template<typename T >
bool | operator< (double x, const fvar< T > &y)
template<typename T >
bool | operator< (const fvar< T > &x, const fvar< T > &y)
template<typename T >
bool | operator<= (const fvar< T > &x, const fvar< T > &y)
template<typename T >
bool | operator<= (const fvar< T > &x, double y)
template<typename T >
bool | operator<= (double x, const fvar< T > &y)
template<typename T >
fvar< T > | operator* (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | operator* (double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | operator* (const fvar< T > &x1, double x2)
template<typename T >
bool | operator!= (const fvar< T > &x, const fvar< T > &y)
template<typename T >
bool | operator!= (const fvar< T > &x, double y)
template<typename T >
bool | operator!= (double x, const fvar< T > &y)
template<typename T >
fvar< T > | operator- (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | operator- (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | operator- (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | operator- (const fvar< T > &x)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, 1, C1 > | columns_dot_product (const Eigen::Matrix< fvar< T >, R1, C1 > &v1, const Eigen::Matrix< fvar< T >, R2, C2 > &v2)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, 1, C1 > | columns_dot_product (const Eigen::Matrix< fvar< T >, R1, C1 > &v1, const Eigen::Matrix< double, R2, C2 > &v2)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, 1, C1 > | columns_dot_product (const Eigen::Matrix< double, R1, C1 > &v1, const Eigen::Matrix< fvar< T >, R2, C2 > &v2)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, 1, C > | columns_dot_self (const Eigen::Matrix< fvar< T >, R, C > &x)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, C, C > | crossprod (const Eigen::Matrix< fvar< T >, R, C > &m)
template<typename T , int R, int C>
fvar< T > | determinant (const Eigen::Matrix< fvar< T >, R, C > &m)
template<typename T1 , typename T2 >
stan::return_type< T1, T2 >::type | divide (const T1 &v, const T2 &c)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, R, C > | divide (const Eigen::Matrix< fvar< T >, R, C > &v, const fvar< T > &c)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, R, C > | divide (const Eigen::Matrix< fvar< T >, R, C > &v, const double c)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, R, C > | divide (const Eigen::Matrix< double, R, C > &v, const fvar< T > &c)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, R, C > | operator/ (const Eigen::Matrix< fvar< T >, R, C > &v, const fvar< T > &c)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, R, C > | operator/ (const Eigen::Matrix< fvar< T >, R, C > &v, const double c)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, R, C > | operator/ (const Eigen::Matrix< double, R, C > &v, const fvar< T > &c)
template<typename T , int R1, int C1, int R2, int C2>
fvar< T > | dot_product (const Eigen::Matrix< fvar< T >, R1, C1 > &v1, const Eigen::Matrix< fvar< T >, R2, C2 > &v2)
template<typename T , int R1, int C1, int R2, int C2>
fvar< T > | dot_product (const Eigen::Matrix< fvar< T >, R1, C1 > &v1, const Eigen::Matrix< double, R2, C2 > &v2)
template<typename T , int R1, int C1, int R2, int C2>
fvar< T > | dot_product (const Eigen::Matrix< double, R1, C1 > &v1, const Eigen::Matrix< fvar< T >, R2, C2 > &v2)
template<typename T , int R1, int C1, int R2, int C2>
fvar< T > | dot_product (const Eigen::Matrix< fvar< T >, R1, C1 > &v1, const Eigen::Matrix< fvar< T >, R2, C2 > &v2, size_type &length)
template<typename T , int R1, int C1, int R2, int C2>
fvar< T > | dot_product (const Eigen::Matrix< fvar< T >, R1, C1 > &v1, const Eigen::Matrix< double, R2, C2 > &v2, size_type &length)
template<typename T , int R1, int C1, int R2, int C2>
fvar< T > | dot_product (const Eigen::Matrix< double, R1, C1 > &v1, const Eigen::Matrix< fvar< T >, R2, C2 > &v2, size_type &length)
template<typename T >
fvar< T > | dot_product (const std::vector< fvar< T > > &v1, const std::vector< fvar< T > > &v2)
template<typename T >
fvar< T > | dot_product (const std::vector< double > &v1, const std::vector< fvar< T > > &v2)
template<typename T >
fvar< T > | dot_product (const std::vector< fvar< T > > &v1, const std::vector< double > &v2)
template<typename T >
fvar< T > | dot_product (const std::vector< fvar< T > > &v1, const std::vector< fvar< T > > &v2, size_type &length)
template<typename T >
fvar< T > | dot_product (const std::vector< double > &v1, const std::vector< fvar< T > > &v2, size_type &length)
template<typename T >
fvar< T > | dot_product (const std::vector< fvar< T > > &v1, const std::vector< double > &v2, size_type &length)
template<typename T , int R, int C>
fvar< T > | dot_self (const Eigen::Matrix< fvar< T >, R, C > &v)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, R, C > | inverse (const Eigen::Matrix< fvar< T >, R, C > &m)
template<typename T , int R, int C>
fvar< T > | log_determinant (const Eigen::Matrix< fvar< T >, R, C > &m)
template<typename T >
Eigen::Matrix< fvar< T > , Eigen::Dynamic, 1 > | log_softmax (const Eigen::Matrix< fvar< T >, Eigen::Dynamic, 1 > &alpha)
template<typename T , int R, int C>
fvar< T > | log_sum_exp (const Eigen::Matrix< fvar< T >, R, C > &v)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C2 > | mdivide_left (const Eigen::Matrix< fvar< T >, R1, C1 > &A, const Eigen::Matrix< fvar< T >, R2, C2 > &b)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C2 > | mdivide_left (const Eigen::Matrix< double, R1, C1 > &A, const Eigen::Matrix< fvar< T >, R2, C2 > &b)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C2 > | mdivide_left (const Eigen::Matrix< fvar< T >, R1, C1 > &A, const Eigen::Matrix< double, R2, C2 > &b)
template<int R1, int C1, int R2, int C2, typename T2 >
Eigen::Matrix< fvar< T2 >, R1, C2 > | mdivide_left_ldlt (const stan::math::LDLT_factor< double, R1, C1 > &A, const Eigen::Matrix< fvar< T2 >, R2, C2 > &b)
| Returns the solution of the system Ax=b given an LDLT_factor of A. More...
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C1 > | mdivide_left_tri_low (const Eigen::Matrix< fvar< T >, R1, C1 > &A, const Eigen::Matrix< fvar< T >, R2, C2 > &b)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C1 > | mdivide_left_tri_low (const Eigen::Matrix< double, R1, C1 > &A, const Eigen::Matrix< fvar< T >, R2, C2 > &b)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C1 > | mdivide_left_tri_low (const Eigen::Matrix< fvar< T >, R1, C1 > &A, const Eigen::Matrix< double, R2, C2 > &b)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C2 > | mdivide_right (const Eigen::Matrix< fvar< T >, R1, C1 > &A, const Eigen::Matrix< fvar< T >, R2, C2 > &b)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C2 > | mdivide_right (const Eigen::Matrix< fvar< T >, R1, C1 > &A, const Eigen::Matrix< double, R2, C2 > &b)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C2 > | mdivide_right (const Eigen::Matrix< double, R1, C1 > &A, const Eigen::Matrix< fvar< T >, R2, C2 > &b)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C1 > | mdivide_right_tri_low (const Eigen::Matrix< fvar< T >, R1, C1 > &A, const Eigen::Matrix< fvar< T >, R2, C2 > &b)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C2 > | mdivide_right_tri_low (const Eigen::Matrix< fvar< T >, R1, C1 > &A, const Eigen::Matrix< double, R2, C2 > &b)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C2 > | mdivide_right_tri_low (const Eigen::Matrix< double, R1, C1 > &A, const Eigen::Matrix< fvar< T >, R2, C2 > &b)
template<typename T , int R1, int C1>
Eigen::Matrix< fvar< T >, R1, C1 > | multiply (const Eigen::Matrix< fvar< T >, R1, C1 > &m, const fvar< T > &c)
template<typename T , int R2, int C2>
Eigen::Matrix< fvar< T >, R2, C2 > | multiply (const Eigen::Matrix< fvar< T >, R2, C2 > &m, const double c)
template<typename T , int R1, int C1>
Eigen::Matrix< fvar< T >, R1, C1 > | multiply (const Eigen::Matrix< double, R1, C1 > &m, const fvar< T > &c)
template<typename T , int R1, int C1>
Eigen::Matrix< fvar< T >, R1, C1 > | multiply (const fvar< T > &c, const Eigen::Matrix< fvar< T >, R1, C1 > &m)
template<typename T , int R1, int C1>
Eigen::Matrix< fvar< T >, R1, C1 > | multiply (const double c, const Eigen::Matrix< fvar< T >, R1, C1 > &m)
template<typename T , int R1, int C1>
Eigen::Matrix< fvar< T >, R1, C1 > | multiply (const fvar< T > &c, const Eigen::Matrix< double, R1, C1 > &m)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C2 > | multiply (const Eigen::Matrix< fvar< T >, R1, C1 > &m1, const Eigen::Matrix< fvar< T >, R2, C2 > &m2)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C2 > | multiply (const Eigen::Matrix< fvar< T >, R1, C1 > &m1, const Eigen::Matrix< double, R2, C2 > &m2)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, C2 > | multiply (const Eigen::Matrix< double, R1, C1 > &m1, const Eigen::Matrix< fvar< T >, R2, C2 > &m2)
template<typename T , int C1, int R2>
fvar< T > | multiply (const Eigen::Matrix< fvar< T >, 1, C1 > &rv, const Eigen::Matrix< fvar< T >, R2, 1 > &v)
template<typename T , int C1, int R2>
fvar< T > | multiply (const Eigen::Matrix< fvar< T >, 1, C1 > &rv, const Eigen::Matrix< double, R2, 1 > &v)
template<typename T , int C1, int R2>
fvar< T > | multiply (const Eigen::Matrix< double, 1, C1 > &rv, const Eigen::Matrix< fvar< T >, R2, 1 > &v)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, R, R > | multiply_lower_tri_self_transpose (const Eigen::Matrix< fvar< T >, R, C > &m)
template<typename T >
Eigen::Matrix< fvar< T > , Eigen::Dynamic, Eigen::Dynamic > | qr_Q (const Eigen::Matrix< fvar< T >, Eigen::Dynamic, Eigen::Dynamic > &m)
template<typename T >
Eigen::Matrix< fvar< T > , Eigen::Dynamic, Eigen::Dynamic > | qr_R (const Eigen::Matrix< fvar< T >, Eigen::Dynamic, Eigen::Dynamic > &m)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, 1 > | rows_dot_product (const Eigen::Matrix< fvar< T >, R1, C1 > &v1, const Eigen::Matrix< fvar< T >, R2, C2 > &v2)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, 1 > | rows_dot_product (const Eigen::Matrix< double, R1, C1 > &v1, const Eigen::Matrix< fvar< T >, R2, C2 > &v2)
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< fvar< T >, R1, 1 > | rows_dot_product (const Eigen::Matrix< fvar< T >, R1, C1 > &v1, const Eigen::Matrix< double, R2, C2 > &v2)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, R, 1 > | rows_dot_self (const Eigen::Matrix< fvar< T >, R, C > &x)
template<typename T >
Eigen::Matrix< fvar< T > , Eigen::Dynamic, 1 > | softmax (const Eigen::Matrix< fvar< T >, Eigen::Dynamic, 1 > &alpha)
template<typename T >
std::vector< fvar< T > > | sort_asc (std::vector< fvar< T > > xs)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, R, C > | sort_asc (Eigen::Matrix< fvar< T >, R, C > xs)
template<typename T >
std::vector< fvar< T > > | sort_desc (std::vector< fvar< T > > xs)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, R, C > | sort_desc (Eigen::Matrix< fvar< T >, R, C > xs)
template<typename T , int R, int C>
fvar< T > | sum (const Eigen::Matrix< fvar< T >, R, C > &m)
| Return the sum of the entries of the specified matrix. More...
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, R, R > | tcrossprod (const Eigen::Matrix< fvar< T >, R, C > &m)
template<typename T >
fvar< T > | to_fvar (const T &x)
template<typename T >
fvar< T > | to_fvar (const fvar< T > &x)
template<int R, int C, typename T >
Eigen::Matrix< T, R, C > | to_fvar (const Eigen::Matrix< T, R, C > &m)
template<int R, int C>
Eigen::Matrix< fvar< double > , R, C > | to_fvar (const Eigen::Matrix< double, R, C > &m)
template<typename T , int R, int C>
Eigen::Matrix< fvar< T >, R, C > | to_fvar (const Eigen::Matrix< T, R, C > &val, const Eigen::Matrix< T, R, C > &deriv)
template<int RD, int CD, int RA, int CA, int RB, int CB, typename T >
fvar< T > | trace_gen_quad_form (const Eigen::Matrix< fvar< T >, RD, CD > &D, const Eigen::Matrix< fvar< T >, RA, CA > &A, const Eigen::Matrix< fvar< T >, RB, CB > &B)
template<int RA, int CA, int RB, int CB, typename T >
stan::math::fvar< T > | trace_quad_form (const Eigen::Matrix< stan::math::fvar< T >, RA, CA > &A, const Eigen::Matrix< stan::math::fvar< T >, RB, CB > &B)
template<typename T , typename F >
void | gradient (const F &f, const Eigen::Matrix< T, Dynamic, 1 > &x, T &fx, Eigen::Matrix< T, Dynamic, 1 > &grad_fx)
| Calculate the value and the gradient of the specified function at the specified argument. More...
template<typename T , typename F >
void | jacobian (const F &f, const Eigen::Matrix< T, Dynamic, 1 > &x, Eigen::Matrix< T, Dynamic, 1 > &fx, Eigen::Matrix< T, Dynamic, Dynamic > &J)
template<typename T >
fvar< T > | abs (const fvar< T > &x)
template<typename T >
fvar< T > | acos (const fvar< T > &x)
template<typename T >
fvar< T > | acosh (const fvar< T > &x)
template<typename T >
fvar< T > | asin (const fvar< T > &x)
template<typename T >
fvar< T > | asinh (const fvar< T > &x)
template<typename T >
fvar< T > | atan (const fvar< T > &x)
template<typename T >
fvar< T > | atan2 (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | atan2 (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | atan2 (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | atanh (const fvar< T > &x)
template<typename T >
fvar< T > | bessel_first_kind (int v, const fvar< T > &z)
template<typename T >
fvar< T > | bessel_second_kind (int v, const fvar< T > &z)
template<typename T >
fvar< T > | binary_log_loss (const int y, const fvar< T > &y_hat)
template<typename T >
fvar< T > | binomial_coefficient_log (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | binomial_coefficient_log (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | binomial_coefficient_log (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | cbrt (const fvar< T > &x)
template<typename T >
fvar< T > | ceil (const fvar< T > &x)
template<typename T >
fvar< T > | cos (const fvar< T > &x)
template<typename T >
fvar< T > | cosh (const fvar< T > &x)
template<typename T >
fvar< T > | digamma (const fvar< T > &x)
template<typename T >
fvar< T > | erf (const fvar< T > &x)
template<typename T >
fvar< T > | erfc (const fvar< T > &x)
template<typename T >
fvar< T > | exp (const fvar< T > &x)
template<typename T >
fvar< T > | exp2 (const fvar< T > &x)
template<typename T >
fvar< T > | expm1 (const fvar< T > &x)
template<typename T >
fvar< T > | fabs (const fvar< T > &x)
template<typename T >
fvar< T > | falling_factorial (const fvar< T > &x, const fvar< T > &n)
template<typename T >
fvar< T > | falling_factorial (const fvar< T > &x, const double n)
template<typename T >
fvar< T > | falling_factorial (const double x, const fvar< T > &n)
template<typename T >
fvar< T > | fdim (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | fdim (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | fdim (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | floor (const fvar< T > &x)
template<typename T1 , typename T2 , typename T3 >
fvar< typename stan::return_type< T1, T2, T3 > ::type > | fma (const fvar< T1 > &x1, const fvar< T2 > &x2, const fvar< T3 > &x3)
| The fused multiply-add operation (C99). More...
template<typename T1 , typename T2 , typename T3 >
fvar< typename stan::return_type< T1, T2, T3 > ::type > | fma (const T1 &x1, const fvar< T2 > &x2, const fvar< T3 > &x3)
| See all-var input signature for details on the function and derivatives. More...
template<typename T1 , typename T2 , typename T3 >
fvar< typename stan::return_type< T1, T2, T3 > ::type > | fma (const fvar< T1 > &x1, const T2 &x2, const fvar< T3 > &x3)
| See all-var input signature for details on the function and derivatives. More...
template<typename T1 , typename T2 , typename T3 >
fvar< typename stan::return_type< T1, T2, T3 > ::type > | fma (const fvar< T1 > &x1, const fvar< T2 > &x2, const T3 &x3)
| See all-var input signature for details on the function and derivatives. More...
template<typename T1 , typename T2 , typename T3 >
fvar< typename stan::return_type< T1, T2, T3 > ::type > | fma (const T1 &x1, const T2 &x2, const fvar< T3 > &x3)
| See all-var input signature for details on the function and derivatives. More...
template<typename T1 , typename T2 , typename T3 >
fvar< typename stan::return_type< T1, T2, T3 > ::type > | fma (const fvar< T1 > &x1, const T2 &x2, const T3 &x3)
| See all-var input signature for details on the function and derivatives. More...
template<typename T1 , typename T2 , typename T3 >
fvar< typename stan::return_type< T1, T2, T3 > ::type > | fma (const T1 &x1, const fvar< T2 > &x2, const T3 &x3)
| See all-var input signature for details on the function and derivatives. More...
template<typename T >
fvar< T > | fmax (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | fmax (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | fmax (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | fmin (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | fmin (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | fmin (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | fmod (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | fmod (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | fmod (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | gamma_p (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | gamma_p (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | gamma_p (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | gamma_q (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | gamma_q (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | gamma_q (const double x1, const fvar< T > &x2)
template<typename T >
void | grad_inc_beta (stan::math::fvar< T > &g1, stan::math::fvar< T > &g2, stan::math::fvar< T > a, stan::math::fvar< T > b, stan::math::fvar< T > z)
template<typename T >
fvar< T > | hypot (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | hypot (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | hypot (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | inc_beta (const fvar< T > &a, const fvar< T > &b, const fvar< T > &x)
template<typename T >
fvar< T > | inv (const fvar< T > &x)
template<typename T >
fvar< T > | inv_cloglog (const fvar< T > &x)
template<typename T >
fvar< T > | inv_logit (const fvar< T > &x)
template<typename T >
fvar< T > | inv_sqrt (const fvar< T > &x)
template<typename T >
fvar< T > | inv_square (const fvar< T > &x)
template<typename T >
int | is_inf (const fvar< T > &x)
| Returns 1 if the input's value is infinite and 0 otherwise. More...
template<typename T >
int | is_nan (const fvar< T > &x)
| Returns 1 if the input's value is NaN and 0 otherwise. More...
template<typename T >
fvar< T > | lbeta (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | lbeta (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | lbeta (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | lgamma (const fvar< T > &x)
template<typename T >
fvar< typename stan::return_type< T, int > ::type > | lmgamma (int x1, const fvar< T > &x2)
template<typename T >
fvar< T > | log (const fvar< T > &x)
template<typename T >
fvar< T > | log10 (const fvar< T > &x)
template<typename T >
fvar< T > | log1m (const fvar< T > &x)
template<typename T >
fvar< T > | log1m_exp (const fvar< T > &x)
template<typename T >
fvar< T > | log1m_inv_logit (const fvar< T > &x)
template<typename T >
fvar< T > | log1p (const fvar< T > &x)
template<typename T >
fvar< T > | log1p_exp (const fvar< T > &x)
template<typename T >
fvar< T > | log2 (const fvar< T > &x)
template<typename T >
fvar< T > | log_diff_exp (const fvar< T > &x1, const fvar< T > &x2)
template<typename T1 , typename T2 >
fvar< T2 > | log_diff_exp (const T1 &x1, const fvar< T2 > &x2)
template<typename T1 , typename T2 >
fvar< T1 > | log_diff_exp (const fvar< T1 > &x1, const T2 &x2)
template<typename T >
fvar< T > | log_falling_factorial (const fvar< T > &x, const fvar< T > &n)
template<typename T >
fvar< T > | log_falling_factorial (const double x, const fvar< T > &n)
template<typename T >
fvar< T > | log_falling_factorial (const fvar< T > &x, const double n)
template<typename T >
fvar< T > | log_inv_logit (const fvar< T > &x)
template<typename T_theta , typename T_lambda1 , typename T_lambda2 , int N>
void | log_mix_partial_helper (const T_theta &theta, const T_lambda1 &lambda1, const T_lambda2 &lambda2, typename promote_args< T_theta, T_lambda1, T_lambda2 >::type(&partials_array)[N])
template<typename T >
fvar< T > | log_mix (const fvar< T > &theta, const fvar< T > &lambda1, const fvar< T > &lambda2)
| Return the log mixture density with specified mixing proportion and log densities and its derivative at each. More...
template<typename T >
fvar< T > | log_mix (const fvar< T > &theta, const fvar< T > &lambda1, const double lambda2)
template<typename T >
fvar< T > | log_mix (const fvar< T > &theta, const double lambda1, const fvar< T > &lambda2)
template<typename T >
fvar< T > | log_mix (const double theta, const fvar< T > &lambda1, const fvar< T > &lambda2)
template<typename T >
fvar< T > | log_mix (const fvar< T > &theta, const double lambda1, const double lambda2)
template<typename T >
fvar< T > | log_mix (const double theta, const fvar< T > &lambda1, const double lambda2)
template<typename T >
fvar< T > | log_mix (const double theta, const double lambda1, const fvar< T > &lambda2)
template<typename T >
fvar< T > | log_rising_factorial (const fvar< T > &x, const fvar< T > &n)
template<typename T >
fvar< T > | log_rising_factorial (const fvar< T > &x, const double n)
template<typename T >
fvar< T > | log_rising_factorial (const double x, const fvar< T > &n)
template<typename T >
fvar< T > | log_sum_exp (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | log_sum_exp (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | log_sum_exp (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | logit (const fvar< T > &x)
template<typename T >
fvar< T > | modified_bessel_first_kind (int v, const fvar< T > &z)
template<typename T >
fvar< T > | modified_bessel_second_kind (int v, const fvar< T > &z)
template<typename T >
fvar< T > | multiply_log (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | multiply_log (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | multiply_log (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | owens_t (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | owens_t (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | owens_t (const fvar< T > &x1, const double x2)
template<typename T >
fvar< T > | Phi (const fvar< T > &x)
template<typename T >
fvar< T > | pow (const fvar< T > &x1, const fvar< T > &x2)
template<typename T >
fvar< T > | pow (const double x1, const fvar< T > &x2)
template<typename T >
fvar< T > | pow (const fvar< T > &x1, const double x2)
template<typename T >
double | primitive_value (const fvar< T > &v)
| Return the primitive value of the specified forward-mode autodiff variable. More...
template<typename T >
fvar< T > | rising_factorial (const fvar< T > &x, const fvar< T > &n)
template<typename T >
fvar< T > | rising_factorial (const fvar< T > &x, const double n)
template<typename T >
fvar< T > | rising_factorial (const double x, const fvar< T > &n)
template<typename T >
fvar< T > | round (const fvar< T > &x)
template<typename T >
fvar< T > | sin (const fvar< T > &x)
template<typename T >
fvar< T > | sinh (const fvar< T > &x)
template<typename T >
fvar< T > | sqrt (const fvar< T > &x)
template<typename T >
fvar< T > | square (const fvar< T > &x)
template<typename T >
fvar< T > | tan (const fvar< T > &x)
template<typename T >
fvar< T > | tanh (const fvar< T > &x)
template<typename T >
fvar< T > | tgamma (const fvar< T > &x)
template<typename T >
fvar< T > | trunc (const fvar< T > &x)
template<typename T >
T | value_of (const fvar< T > &v)
| Return the value of the specified variable. More...
template<typename T >
double | value_of_rec (const fvar< T > &v)
| Return the value of the specified variable. More...
template<typename T >
bool | is_aligned (T *ptr, unsigned int bytes_aligned)
| Return `true` if the specified pointer is aligned on the number of bytes. More...
template<typename T , typename F >
void | derivative (const F &f, const T &x, T &fx, T &dfx_dx)
| Return the derivative of the specified univariate function at the specified argument. More...
template<typename F >
void | finite_diff_grad_hessian (const F &f, const Eigen::Matrix< double,-1, 1 > &x, double &fx, Eigen::Matrix< double,-1,-1 > &hess, std::vector< Eigen::Matrix< double,-1,-1 > > &grad_hess_fx, const double epsilon=1e-04)
| Calculate the value and the gradient of the hessian of the specified function at the specified argument using second-order autodiff and first-order finite difference. More...
template<typename F >
void | grad_hessian (const F &f, const Eigen::Matrix< double, Dynamic, 1 > &x, double &fx, Eigen::Matrix< double, Dynamic, Dynamic > &H, std::vector< Eigen::Matrix< double, Dynamic, Dynamic > > &grad_H)
| Calculate the value, the Hessian, and the gradient of the Hessian of the specified function at the specified argument. More...
template<typename F >
void | grad_tr_mat_times_hessian (const F &f, const Eigen::Matrix< double, Dynamic, 1 > &x, const Eigen::Matrix< double, Dynamic, Dynamic > &M, Eigen::Matrix< double, Dynamic, 1 > &grad_tr_MH)
template<typename T1 , typename T2 , typename F >
void | gradient_dot_vector (const F &f, const Eigen::Matrix< T1, Dynamic, 1 > &x, const Eigen::Matrix< T2, Dynamic, 1 > &v, T1 &fx, T1 &grad_fx_dot_v)
template<typename F >
void | hessian (const F &f, const Eigen::Matrix< double, Dynamic, 1 > &x, double &fx, Eigen::Matrix< double, Dynamic, 1 > &grad, Eigen::Matrix< double, Dynamic, Dynamic > &H)
| Calculate the value, the gradient, and the Hessian, of the specified function at the specified argument in O(N^2) time and O(N^2) space. More...
template<typename T , typename F >
void | hessian (const F &f, const Eigen::Matrix< T, Dynamic, 1 > &x, T &fx, Eigen::Matrix< T, Dynamic, 1 > &grad, Eigen::Matrix< T, Dynamic, Dynamic > &H)
template<typename F >
void | hessian_times_vector (const F &f, const Eigen::Matrix< double, Dynamic, 1 > &x, const Eigen::Matrix< double, Dynamic, 1 > &v, double &fx, Eigen::Matrix< double, Dynamic, 1 > &Hv)
template<typename T , typename F >
void | hessian_times_vector (const F &f, const Eigen::Matrix< T, Dynamic, 1 > &x, const Eigen::Matrix< T, Dynamic, 1 > &v, T &fx, Eigen::Matrix< T, Dynamic, 1 > &Hv)
template<typename T , typename F >
void | partial_derivative (const F &f, const Eigen::Matrix< T, Dynamic, 1 > &x, int n, T &fx, T &dfx_dxn)
| Return the partial derivative of the specified multiivariate function at the specified argument. More...
double | dist (const std::vector< double > &x, const std::vector< double > &y)
double | dot (const std::vector< double > &x, const std::vector< double > &y)
double | dot_self (const std::vector< double > &x)
double | log_sum_exp (const std::vector< double > &x)
| Return the log of the sum of the exponentiated values of the specified sequence of values. More...
template<typename T >
std::vector< T > | rep_array (const T &x, int n)
template<typename T >
std::vector< std::vector< T > > | rep_array (const T &x, int m, int n)
template<typename T >
std::vector< std::vector < std::vector< T > > > | rep_array (const T &x, int k, int m, int n)
void | scaled_add (std::vector< double > &x, const std::vector< double > &y, const double lambda)
void | sub (std::vector< double > &x, std::vector< double > &y, std::vector< double > &result)
template<typename T >
T | sum (const std::vector< T > &xs)
| Return the sum of the values in the specified standard vector. More...
template<typename F , typename T1 , typename T2 >
std::vector< std::vector < typename stan::return_type < T1, T2 >::type > > | integrate_ode (const F &f, const std::vector< T1 > y0, const double t0, const std::vector< double > &ts, const std::vector< T2 > &theta, const std::vector< double > &x, const std::vector< int > &x_int, std::ostream *msgs)
| Return the solutions for the specified system of ordinary differential equations given the specified initial state, initial times, times of desired solution, and parameters and data, writing error and warning messages to the specified stream. More...
template<typename T_y >
bool | check_cholesky_factor (const char *function, const char *name, const Eigen::Matrix< T_y, Dynamic, Dynamic > &y)
| Return `true` if the specified matrix is a valid Cholesky factor. More...
template<typename T_y >
bool | check_cholesky_factor_corr (const char *function, const char *name, const Eigen::Matrix< T_y, Dynamic, Dynamic > &y)
| Return `true` if the specified matrix is a valid Cholesky factor of a correlation matrix. More...
template<typename T_y , int R, int C>
bool | check_column_index (const char *function, const char *name, const Eigen::Matrix< T_y, R, C > &y, const size_t i)
| Return `true` if the specified index is a valid column of the matrix. More...
template<typename T_y >
bool | check_corr_matrix (const char *function, const char *name, const Eigen::Matrix< T_y, Dynamic, Dynamic > &y)
| Return `true` if the specified matrix is a valid correlation matrix. More...
template<typename T_y >
bool | check_cov_matrix (const char *function, const char *name, const Eigen::Matrix< T_y, Dynamic, Dynamic > &y)
| Return `true` if the specified matrix is a valid covariance matrix. More...
template<typename T , int R, int C>
bool | check_ldlt_factor (const char *function, const char *name, stan::math::LDLT_factor< T, R, C > &A)
| Return `true` if the argument is a valid `stan::math::LDLT_factor`. More...
template<typename T_y >
bool | check_lower_triangular (const char *function, const char *name, const Eigen::Matrix< T_y, Dynamic, Dynamic > &y)
| Return `true` if the specified matrix is lower triangular. More...
template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>
bool | check_matching_dims (const char *function, const char *name1, const Eigen::Matrix< T1, R1, C1 > &y1, const char *name2, const Eigen::Matrix< T2, R2, C2 > &y2)
| Return `true` if the two matrices are of the same size. More...
template<typename T_y1 , typename T_y2 >
bool | check_matching_sizes (const char *function, const char *name1, const T_y1 &y1, const char *name2, const T_y2 &y2)
| Return `true` if two structures at the same size. More...
template<typename T1 , typename T2 >
bool | check_multiplicable (const char *function, const char *name1, const T1 &y1, const char *name2, const T2 &y2)
| Return `true` if the matrices can be multiplied. More...
template<typename T_y >
bool | check_ordered (const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > &y)
| Return `true` if the specified vector is sorted into strictly increasing order. More...
template<typename T_y >
bool | check_ordered (const char *function, const char *name, const std::vector< T_y > &y)
| Return `true` if the specified vector is sorted into strictly increasing order. More...
template<typename T_y >
bool | check_pos_definite (const char *function, const char *name, const Eigen::Matrix< T_y, Dynamic, Dynamic > &y)
| Return `true` if the specified square, symmetric matrix is positive definite. More...
template<typename T_y >
bool | check_pos_semidefinite (const char *function, const char *name, const Eigen::Matrix< T_y, Dynamic, Dynamic > &y)
| Return `true` if the specified matrix is positive definite. More...
template<typename T_y >
bool | check_positive_ordered (const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > &y)
| Return `true` if the specified vector contains non-negative values and is sorted into strictly increasing order. More...
bool | check_range (const char *function, const char *name, const int max, const int index, const int nested_level, const char *error_msg)
| Return `true` if specified index is within range. More...
bool | check_range (const char *function, const char *name, const int max, const int index, const char *error_msg)
| Return `true` if specified index is within range. More...
bool | check_range (const char *function, const char *name, const int max, const int index)
| Return `true` if specified index is within range. More...
template<typename T_y , int R, int C>
bool | check_row_index (const char *function, const char *name, const Eigen::Matrix< T_y, R, C > &y, size_t i)
| Return `true` if the specified index is a valid row of the matrix. More...
template<typename T_prob >
bool | check_simplex (const char *function, const char *name, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta)
| Return `true` if the specified vector is simplex. More...
template<typename T_y >
bool | check_spsd_matrix (const char *function, const char *name, const Eigen::Matrix< T_y, Dynamic, Dynamic > &y)
| Return `true` if the specified matrix is a square, symmetric, and positive semi-definite. More...
template<typename T_y >
bool | check_square (const char *function, const char *name, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y)
| Return `true` if the specified matrix is square. More...
template<typename T >
bool | check_std_vector_index (const char *function, const char *name, const std::vector< T > &y, int i)
| Return `true` if the specified index is valid in std vector. More...
template<typename T_y >
bool | check_symmetric (const char *function, const char *name, const Eigen::Matrix< T_y, Dynamic, Dynamic > &y)
| Return `true` if the specified matrix is symmetric. More...
template<typename T_prob >
bool | check_unit_vector (const char *function, const char *name, const Eigen::Matrix< T_prob, Dynamic, 1 > &theta)
| Return `true` if the specified vector is unit vector. More...
template<typename T , int R, int C>
bool | check_vector (const char *function, const char *name, const Eigen::Matrix< T, R, C > &x)
| Return `true` if the matrix is either a row vector or column vector. More...
void | validate_non_negative_index (const char *var_name, const char *expr, int val)
template<typename T1 , typename T2 , int R, int C>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R, C > | add (const Eigen::Matrix< T1, R, C > &m1, const Eigen::Matrix< T2, R, C > &m2)
| Return the sum of the specified matrices. More...
template<typename T1 , typename T2 , int R, int C>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R, C > | add (const Eigen::Matrix< T1, R, C > &m, const T2 &c)
| Return the sum of the specified matrix and specified scalar. More...
template<typename T1 , typename T2 , int R, int C>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R, C > | add (const T1 &c, const Eigen::Matrix< T2, R, C > &m)
| Return the sum of the specified scalar and specified matrix. More...
template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>
Eigen::Matrix< typename return_type< T1, T2 >::type, Eigen::Dynamic, Eigen::Dynamic > | append_col (const Eigen::Matrix< T1, R1, C1 > &A, const Eigen::Matrix< T2, R2, C2 > &B)
| Return the result of appending the second argument matrix after the first argument matrix, that is, putting them side by side, with the first matrix followed by the second matrix. More...
template<typename T1 , typename T2 , int C1, int C2>
Eigen::Matrix< typename return_type< T1, T2 >::type, 1, Eigen::Dynamic > | append_col (const Eigen::Matrix< T1, 1, C1 > &A, const Eigen::Matrix< T2, 1, C2 > &B)
| Return the result of concatenaing the first row vector followed by the second row vector side by side, with the result being a row vector. More...
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | append_col (const Eigen::Matrix< T, R1, C1 > &A, const Eigen::Matrix< T, R2, C2 > &B)
| Return the result of appending the second argument matrix after the first argument matrix, that is, putting them side by side, with the first matrix followed by the second matrix. More...
template<typename T , int C1, int C2>
Eigen::Matrix< T, 1, Eigen::Dynamic > | append_col (const Eigen::Matrix< T, 1, C1 > &A, const Eigen::Matrix< T, 1, C2 > &B)
| Return the result of concatenaing the first row vector followed by the second row vector side by side, with the result being a row vector. More...
template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>
Eigen::Matrix< typename return_type< T1, T2 >::type, Eigen::Dynamic, Eigen::Dynamic > | append_row (const Eigen::Matrix< T1, R1, C1 > &A, const Eigen::Matrix< T2, R2, C2 > &B)
| Return the result of stacking the rows of the first argument matrix on top of the second argument matrix. More...
template<typename T1 , typename T2 , int R1, int R2>
Eigen::Matrix< typename return_type< T1, T2 >::type, Eigen::Dynamic, 1 > | append_row (const Eigen::Matrix< T1, R1, 1 > &A, const Eigen::Matrix< T2, R2, 1 > &B)
| Return the result of stacking the first vector on top of the second vector, with the result being a vector. More...
template<typename T , int R1, int C1, int R2, int C2>
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | append_row (const Eigen::Matrix< T, R1, C1 > &A, const Eigen::Matrix< T, R2, C2 > &B)
| Return the result of stacking the rows of the first argument matrix on top of the second argument matrix. More...
template<typename T , int R1, int R2>
Eigen::Matrix< T, Eigen::Dynamic, 1 > | append_row (const Eigen::Matrix< T, R1, 1 > &A, const Eigen::Matrix< T, R2, 1 > &B)
| Return the result of stacking the first vector on top of the second vector, with the result being a vector. More...
template<typename LHS , typename RHS >
void | assign (LHS &lhs, const RHS &rhs)
| Copy the right-hand side's value to the left-hand side variable. More...
template<typename LHS , typename RHS , int R1, int C1, int R2, int C2>
void | assign (Eigen::Matrix< LHS, R1, C1 > &x, const Eigen::Matrix< RHS, R2, C2 > &y)
| Copy the right-hand side's value to the left-hand side variable. More...
template<typename LHS , typename RHS , int R, int C>
void | assign (Eigen::Matrix< LHS, R, C > &x, const Eigen::Matrix< RHS, R, C > &y)
| Copy the right-hand side's value to the left-hand side variable. More...
template<typename LHS , typename RHS , int R, int C>
void | assign (Eigen::Block< LHS > x, const Eigen::Matrix< RHS, R, C > &y)
| Copy the right-hand side's value to the left-hand side variable. More...
template<typename LHS , typename RHS >
void | assign (std::vector< LHS > &x, const std::vector< RHS > &y)
| Copy the right-hand side's value to the left-hand side variable. More...
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<typename T >
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | block (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m, size_t i, size_t j, size_t nrows, size_t ncols)
| Return a nrows x ncols submatrix starting at (i-1, j-1). 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 > | cholesky_decompose (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
| Return the lower-triangular Cholesky factor (i.e., matrix square root) of the specified square, symmetric matrix. 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, 1 > | col (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m, size_t j)
| Return the specified column of the specified matrix using start-at-1 indexing. More...
template<typename T , int R, int C>
size_t | cols (const Eigen::Matrix< T, R, C > &m)
template<int R1, int C1, int R2, int C2>
Eigen::Matrix< double, 1, C1 > | columns_dot_product (const Eigen::Matrix< double, R1, C1 > &v1, const Eigen::Matrix< double, R2, C2 > &v2)
| Returns the dot product of the specified vectors. More...
template<typename T , int R, int C>
Eigen::Matrix< T, 1, C > | columns_dot_self (const Eigen::Matrix< T, R, C > &x)
| Returns the dot product of each column of a matrix with itself. 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)
| 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, 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 (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, 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...
matrix_d | crossprod (const matrix_d &M)
| Returns the result of pre-multiplying a matrix by its own transpose. More...
template<typename T >
std::vector< T > | cumulative_sum (const std::vector< T > &x)
| Return the cumulative sum of the specified vector. More...
template<typename T , int R, int C>
Eigen::Matrix< T, R, C > | cumulative_sum (const Eigen::Matrix< T, R, C > &m)
| Return the cumulative sum of the specified matrix. More...
template<typename T , int R, int C>
T | determinant (const Eigen::Matrix< T, R, C > &m)
| Returns the determinant of the specified square matrix. More...
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | diag_matrix (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v)
| Return a square diagonal matrix with the specified vector of coefficients as the diagonal values. More...
template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R1, C1 > | diag_post_multiply (const Eigen::Matrix< T1, R1, C1 > &m1, const Eigen::Matrix< T2, R2, C2 > &m2)
template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R2, C2 > | diag_pre_multiply (const Eigen::Matrix< T1, R1, C1 > &m1, const Eigen::Matrix< T2, R2, C2 > &m2)
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, 1 > | diagonal (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
| Return a column vector of the diagonal elements of the specified matrix. More...
template<typename T >
void | dims (const T &x, std::vector< int > &result)
template<typename T , int R, int C>
void | dims (const Eigen::Matrix< T, R, C > &x, std::vector< int > &result)
template<typename T >
void | dims (const std::vector< T > &x, std::vector< int > &result)
template<typename T >
std::vector< int > | dims (const T &x)
template<typename T1 , int R1, int C1, typename T2 , int R2, int C2>
boost::math::tools::promote_args < T1, T2 >::type | distance (const Eigen::Matrix< T1, R1, C1 > &v1, const Eigen::Matrix< T2, R2, C2 > &v2)
| Returns the distance between the specified vectors. More...
template<int R, int C, typename T >
boost::enable_if_c < boost::is_arithmetic< T > ::value, Eigen::Matrix< double, R, C > >::type | divide (const Eigen::Matrix< double, R, C > &m, T c)
| Return specified matrix divided by specified scalar. More...
template<int R1, int C1, int R2, int C2>
double | dot_product (const Eigen::Matrix< double, R1, C1 > &v1, const Eigen::Matrix< double, R2, C2 > &v2)
| Returns the dot product of the specified vectors. More...
double | dot_product (const double *v1, const double *v2, size_t length)
| Returns the dot product of the specified arrays of doubles. More...
double | dot_product (const std::vector< double > &v1, const std::vector< double > &v2)
| Returns the dot product of the specified arrays of doubles. More...
template<int R, int C>
double | dot_self (const Eigen::Matrix< double, R, C > &v)
| Returns the dot product of the specified vector with itself. More...
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, 1 > | eigenvalues_sym (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
| Return the eigenvalues of the specified symmetric matrix in descending order of magnitude. More...
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | eigenvectors_sym (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
template<typename T1 , typename T2 , int R, int C>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R, C > | elt_divide (const Eigen::Matrix< T1, R, C > &m1, const Eigen::Matrix< T2, R, C > &m2)
| Return the elementwise division of the specified matrices. More...
template<typename T1 , typename T2 , int R, int C>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R, C > | elt_divide (const Eigen::Matrix< T1, R, C > &m, T2 s)
| Return the elementwise division of the specified matrix by the specified scalar. More...
template<typename T1 , typename T2 , int R, int C>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R, C > | elt_divide (T1 s, const Eigen::Matrix< T2, R, C > &m)
| Return the elementwise division of the specified scalar by the specified matrix. More...
template<typename T1 , typename T2 , int R, int C>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R, C > | elt_multiply (const Eigen::Matrix< T1, R, C > &m1, const Eigen::Matrix< T2, R, C > &m2)
| Return the elementwise multiplication of the specified matrices. More...
template<typename T , int Rows, int Cols>
Eigen::Matrix< T, Rows, Cols > | exp (const Eigen::Matrix< T, Rows, Cols > &m)
| Return the element-wise exponentiation of the matrix or vector. More...
template<int Rows, int Cols>
Eigen::Matrix< double, Rows, Cols > | exp (const Eigen::Matrix< double, Rows, Cols > &m)
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 >
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 , typename S >
void | fill (T &x, const S &y)
| Fill the specified container with the specified value. More...
template<typename T , int R, int C, typename S >
void | fill (Eigen::Matrix< T, R, C > &x, const S &y)
| Fill the specified container with the specified value. More...
template<typename T , typename S >
void | fill (std::vector< T > &x, const S &y)
| Fill the specified container with the specified value. More...
template<typename T >
const T & | get_base1 (const std::vector< T > &x, size_t i, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one index. More...
template<typename T >
const T & | get_base1 (const std::vector< std::vector< T > > &x, size_t i1, size_t i2, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
const T & | get_base1 (const std::vector< std::vector< std::vector< T > > > &x, size_t i1, size_t i2, size_t i3, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
const T & | get_base1 (const std::vector< std::vector< std::vector< std::vector< T > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
const T & | get_base1 (const std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
const T & | get_base1 (const std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
const T & | get_base1 (const std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, size_t i7, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
const T & | get_base1 (const std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, size_t i7, size_t i8, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
Eigen::Matrix< T, 1, Eigen::Dynamic > | get_base1 (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &x, size_t m, const char *error_msg, size_t idx)
| Return a copy of the row of the specified vector at the specified base-one row index. More...
template<typename T >
const T & | get_base1 (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &x, size_t m, size_t n, const char *error_msg, size_t idx)
| Return a reference to the value of the specified matrix at the specified base-one row and column indexes. More...
template<typename T >
const T & | get_base1 (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, size_t m, const char *error_msg, size_t idx)
| Return a reference to the value of the specified column vector at the specified base-one index. More...
template<typename T >
const T & | get_base1 (const Eigen::Matrix< T, 1, Eigen::Dynamic > &x, size_t n, const char *error_msg, size_t idx)
| Return a reference to the value of the specified row vector at the specified base-one index. More...
template<typename T >
T & | get_base1_lhs (std::vector< T > &x, size_t i, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one index. More...
template<typename T >
T & | get_base1_lhs (std::vector< std::vector< T > > &x, size_t i1, size_t i2, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
T & | get_base1_lhs (std::vector< std::vector< std::vector< T > > > &x, size_t i1, size_t i2, size_t i3, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
T & | get_base1_lhs (std::vector< std::vector< std::vector< std::vector< T > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
T & | get_base1_lhs (std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
T & | get_base1_lhs (std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
T & | get_base1_lhs (std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, size_t i7, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
T & | get_base1_lhs (std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > > > &x, size_t i1, size_t i2, size_t i3, size_t i4, size_t i5, size_t i6, size_t i7, size_t i8, const char *error_msg, size_t idx)
| Return a reference to the value of the specified vector at the specified base-one indexes. More...
template<typename T >
Eigen::Block< Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > > | get_base1_lhs (Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &x, size_t m, const char *error_msg, size_t idx)
| Return a copy of the row of the specified vector at the specified base-one row index. More...
template<typename T >
T & | get_base1_lhs (Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &x, size_t m, size_t n, const char *error_msg, size_t idx)
| Return a reference to the value of the specified matrix at the specified base-one row and column indexes. More...
template<typename T >
T & | get_base1_lhs (Eigen::Matrix< T, Eigen::Dynamic, 1 > &x, size_t m, const char *error_msg, size_t idx)
| Return a reference to the value of the specified column vector at the specified base-one index. More...
template<typename T >
T & | get_base1_lhs (Eigen::Matrix< T, 1, Eigen::Dynamic > &x, size_t n, const char *error_msg, size_t idx)
| Return a reference to the value of the specified row vector at the specified base-one index. More...
template<typename T_lp , typename T_lp_accum >
boost::math::tools::promote_args < T_lp, T_lp_accum >::type | get_lp (const T_lp &lp, const stan::math::accumulator< T_lp_accum > &lp_accum)
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, 1 > | head (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v, size_t n)
| Return the specified number of elements as a vector from the front of the specified vector. More...
template<typename T >
Eigen::Matrix< T, 1, Eigen::Dynamic > | head (const Eigen::Matrix< T, 1, Eigen::Dynamic > &rv, size_t n)
| Return the specified number of elements as a row vector from the front of the specified row vector. More...
template<typename T >
std::vector< T > | head (const std::vector< T > &sv, size_t n)
| Return the specified number of elements as a standard vector from the front of the specified standard vector. More...
template<typename T >
void | initialize (T &x, const T &v)
template<typename T , typename V >
boost::enable_if_c < boost::is_arithmetic< V > ::value, void >::type | initialize (T &x, V v)
template<typename T , int R, int C, typename V >
void | initialize (Eigen::Matrix< T, R, C > &x, const V &v)
template<typename T , typename V >
void | initialize (std::vector< T > &x, const V &v)
template<typename T , int R, int C>
Eigen::Matrix< T, R, C > | inverse (const Eigen::Matrix< T, R, C > &m)
| Returns the inverse of the specified matrix. More...
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | inverse_spd (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
| Returns the inverse of the specified symmetric, pos/neg-definite matrix. More...
template<typename T , int Rows, int Cols>
Eigen::Matrix< T, Rows, Cols > | log (const Eigen::Matrix< T, Rows, Cols > &m)
| Return the element-wise logarithm of the matrix or vector. More...
template<typename T , int R, int C>
T | log_determinant (const Eigen::Matrix< T, R, C > &m)
| Returns the log absolute determinant of the specified square matrix. More...
template<int R, int C, typename T >
T | log_determinant_ldlt (stan::math::LDLT_factor< T, R, C > &A)
template<typename T , int R, int C>
T | log_determinant_spd (const Eigen::Matrix< T, R, C > &m)
| Returns the log absolute determinant of the specified square matrix. More...
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, 1 > | log_softmax (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v)
| Return the natural logarithm of the softmax of the specified vector. More...
template<int R, int C>
double | log_sum_exp (const Eigen::Matrix< double, R, C > &x)
| Return the log of the sum of the exponentiated values of the specified matrix of values. 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...
int | max (const std::vector< int > &x)
| Returns the maximum coefficient in the specified column vector. More...
template<typename T >
T | max (const std::vector< T > &x)
| Returns the maximum coefficient in the specified column vector. More...
template<typename T , int R, int C>
T | max (const Eigen::Matrix< T, R, C > &m)
| Returns the maximum coefficient in the specified vector, row vector, or matrix. More...
template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R1, C2 > | mdivide_left (const Eigen::Matrix< T1, R1, C1 > &A, const Eigen::Matrix< T2, R2, C2 > &b)
| Returns the solution of the system Ax=b. More...
template<int R1, int C1, int R2, int C2, typename T1 , typename T2 >
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R1, C2 > | mdivide_left_ldlt (const stan::math::LDLT_factor< T1, R1, C1 > &A, const Eigen::Matrix< T2, R2, C2 > &b)
| Returns the solution of the system Ax=b given an LDLT_factor of A. More...
template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R1, C2 > | mdivide_left_spd (const Eigen::Matrix< T1, R1, C1 > &A, const Eigen::Matrix< T2, R2, C2 > &b)
| Returns the solution of the system Ax=b where A is symmetric positive definite. More...
template<int TriView, typename T1 , typename T2 , int R1, int C1, int R2, int C2>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R1, C2 > | mdivide_left_tri (const Eigen::Matrix< T1, R1, C1 > &A, const Eigen::Matrix< T2, R2, C2 > &b)
| Returns the solution of the system Ax=b when A is triangular. More...
template<int TriView, typename T , int R1, int C1>
Eigen::Matrix< T, R1, C1 > | mdivide_left_tri (const Eigen::Matrix< T, R1, C1 > &A)
| Returns the solution of the system Ax=b when A is triangular and b=I. More...
template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R1, C2 > | mdivide_left_tri_low (const Eigen::Matrix< T1, R1, C1 > &A, const Eigen::Matrix< T2, R2, C2 > &b)
template<typename T , int R1, int C1>
Eigen::Matrix< T, R1, C1 > | mdivide_left_tri_low (const Eigen::Matrix< T, R1, C1 > &A)
template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R1, C2 > | mdivide_right (const Eigen::Matrix< T1, R1, C1 > &b, const Eigen::Matrix< T2, R2, C2 > &A)
| Returns the solution of the system Ax=b. More...
template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R1, C2 > | mdivide_right_ldlt (const Eigen::Matrix< T1, R1, C1 > &b, const stan::math::LDLT_factor< T2, R2, C2 > &A)
| Returns the solution of the system xA=b given an LDLT_factor of A. More...
template<int R1, int C1, int R2, int C2>
Eigen::Matrix< double, R1, C2 > | mdivide_right_ldlt (const Eigen::Matrix< double, R1, C1 > &b, const stan::math::LDLT_factor< double, R2, C2 > &A)
template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R1, C2 > | mdivide_right_spd (const Eigen::Matrix< T1, R1, C1 > &b, const Eigen::Matrix< T2, R2, C2 > &A)
| Returns the solution of the system Ax=b where A is symmetric positive definite. More...
template<int TriView, typename T1 , typename T2 , int R1, int C1, int R2, int C2>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R1, C2 > | mdivide_right_tri (const Eigen::Matrix< T1, R1, C1 > &b, const Eigen::Matrix< T2, R2, C2 > &A)
| Returns the solution of the system Ax=b when A is triangular. More...
template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R1, C2 > | mdivide_right_tri_low (const Eigen::Matrix< T1, R1, C1 > &b, const Eigen::Matrix< T2, R2, C2 > &A)
| Returns the solution of the system tri(A)x=b when tri(A) is a lower triangular view of the matrix A. More...
template<typename T >
boost::math::tools::promote_args < T >::type | mean (const std::vector< T > &v)
| Returns the sample mean (i.e., average) of the coefficients in the specified standard vector. More...
template<typename T , int R, int C>
boost::math::tools::promote_args < T >::type | mean (const Eigen::Matrix< T, R, C > &m)
| Returns the sample mean (i.e., average) of the coefficients in the specified vector, row vector, or matrix. More...
int | min (const std::vector< int > &x)
| Returns the minimum coefficient in the specified column vector. More...
template<typename T >
T | min (const std::vector< T > &x)
| Returns the minimum coefficient in the specified column vector. More...
template<typename T , int R, int C>
T | min (const Eigen::Matrix< T, R, C > &m)
| Returns the minimum coefficient in the specified matrix, vector, or row vector. More...
template<typename T >
T | minus (const T &x)
| Returns the negation of the specified scalar or matrix. More...
template<int R, int C, typename T >
boost::enable_if_c < boost::is_arithmetic< T > ::value, Eigen::Matrix< double, R, C > >::type | multiply (const Eigen::Matrix< double, R, C > &m, T c)
| Return specified matrix multiplied by specified scalar. More...
template<int R, int C, typename T >
boost::enable_if_c < boost::is_arithmetic< T > ::value, Eigen::Matrix< double, R, C > >::type | multiply (T c, const Eigen::Matrix< double, R, C > &m)
| Return specified scalar multiplied by specified matrix. More...
template<int R1, int C1, int R2, int C2>
Eigen::Matrix< double, R1, C2 > | multiply (const Eigen::Matrix< double, R1, C1 > &m1, const Eigen::Matrix< double, R2, C2 > &m2)
| Return the product of the specified matrices. More...
template<int C1, int R2>
double | multiply (const Eigen::Matrix< double, 1, C1 > &rv, const Eigen::Matrix< double, R2, 1 > &v)
| Return the scalar product of the specified row vector and specified column vector. More...
matrix_d | multiply_lower_tri_self_transpose (const matrix_d &L)
| Returns the result of multiplying the lower triangular portion of the input matrix by its own transpose. More...
template<typename T >
int | num_elements (const T &x)
| Returns 1, the number of elements in a primitive type. More...
template<typename T , int R, int C>
int | num_elements (const Eigen::Matrix< T, R, C > &m)
| Returns the size of the specified matrix. More...
template<typename T >
int | num_elements (const std::vector< T > &v)
| Returns the number of elements in the specified vector. 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 >
T | prod (const std::vector< T > &v)
| Returns the product of the coefficients of the specified standard vector. More...
template<typename T , int R, int C>
T | prod (const Eigen::Matrix< T, R, C > &v)
| Returns the product of the coefficients of the specified column vector. More...
template<typename T1 , typename T2 , typename F >
common_type< T1, T2 >::type | promote_common (const F &u)
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | qr_Q (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | qr_R (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
template<int RA, int CA, int RB, int CB, typename T >
Eigen::Matrix< T, CB, CB > | quad_form (const Eigen::Matrix< T, RA, CA > &A, const Eigen::Matrix< T, RB, CB > &B)
| Compute B^T A B. More...
template<int RA, int CA, int RB, typename T >
T | quad_form (const Eigen::Matrix< T, RA, CA > &A, const Eigen::Matrix< T, RB, 1 > &B)
template<typename T1 , typename T2 , int R, int C>
Matrix< typename promote_args < T1, T2 >::type, Dynamic, Dynamic > | quad_form_diag (const Matrix< T1, Dynamic, Dynamic > &mat, const Matrix< T2, R, C > &vec)
template<int RA, int CA, int RB, int CB, typename T >
Eigen::Matrix< T, CB, CB > | quad_form_sym (const Eigen::Matrix< T, RA, CA > &A, const Eigen::Matrix< T, RB, CB > &B)
template<int RA, int CA, int RB, typename T >
T | quad_form_sym (const Eigen::Matrix< T, RA, CA > &A, const Eigen::Matrix< T, RB, 1 > &B)
template<typename T >
size_t | rank (const std::vector< T > &v, int s)
| Return the number of components of v less than v[s]. More...
template<typename T , int R, int C>
size_t | rank (const Eigen::Matrix< T, R, C > &v, int s)
| Return the number of components of v less than v[s]. 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_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)
| 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_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 >
Eigen::Matrix< typename boost::math::tools::promote_args < T >::type, Eigen::Dynamic, Eigen::Dynamic > | rep_matrix (const T &x, int m, int n)
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | rep_matrix (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v, int n)
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | rep_matrix (const Eigen::Matrix< T, 1, Eigen::Dynamic > &rv, int m)
template<typename T >
Eigen::Matrix< typename boost::math::tools::promote_args < T >::type, 1, Eigen::Dynamic > | rep_row_vector (const T &x, int m)
template<typename T >
Eigen::Matrix< typename boost::math::tools::promote_args < T >::type, Eigen::Dynamic, 1 > | rep_vector (const T &x, int n)
template<typename T >
void | resize (T &x, std::vector< size_t > dims)
| Recursively resize the specified vector of vectors, which must bottom out at scalar values, Eigen vectors or Eigen matrices. More...
template<typename T >
Eigen::Matrix< T, 1, Eigen::Dynamic > | row (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m, size_t i)
| Return the specified row of the specified matrix, using start-at-1 indexing. More...
template<typename T , int R, int C>
size_t | rows (const Eigen::Matrix< T, R, C > &m)
template<int R1, int C1, int R2, int C2>
Eigen::Matrix< double, R1, 1 > | rows_dot_product (const Eigen::Matrix< double, R1, C1 > &v1, const Eigen::Matrix< double, R2, C2 > &v2)
| Returns the dot product of the specified vectors. More...
template<typename T , int R, int C>
Eigen::Matrix< T, R, 1 > | rows_dot_self (const Eigen::Matrix< T, R, C > &x)
| Returns the dot product of each row of a matrix with itself. More...
template<typename T >
boost::math::tools::promote_args < T >::type | sd (const std::vector< T > &v)
| Returns the unbiased sample standard deviation of the coefficients in the specified column vector. More...
template<typename T , int R, int C>
boost::math::tools::promote_args < T >::type | sd (const Eigen::Matrix< T, R, C > &m)
| Returns the unbiased sample standard deviation of the coefficients in the specified vector, row vector, or matrix. More...
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, 1 > | segment (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v, size_t i, size_t n)
| Return the specified number of elements as a vector starting from the specified element - 1 of the specified vector. More...
template<typename T >
Eigen::Matrix< T, 1, Eigen::Dynamic > | segment (const Eigen::Matrix< T, 1, Eigen::Dynamic > &v, size_t i, size_t n)
template<typename T >
std::vector< T > | segment (const std::vector< T > &sv, size_t i, size_t n)
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 > | singular_values (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
| Return the vector of the singular values of the specified matrix in decreasing order of magnitude. More...
template<typename T >
int | size (const std::vector< T > &x)
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, 1 > | softmax (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v)
| Return the softmax of the specified vector. More...
template<typename T >
std::vector< T > | sort_asc (std::vector< T > xs)
| Return the specified standard vector in ascending order. More...
template<typename T >
std::vector< T > | sort_desc (std::vector< T > xs)
| Return the specified standard vector in descending order. More...
template<typename T , int R, int C>
Eigen::Matrix< T, R, C > | sort_asc (Eigen::Matrix< T, R, C > xs)
| Return the specified eigen vector in ascending order. More...
template<typename T , int R, int C>
Eigen::Matrix< T, R, C > | sort_desc (Eigen::Matrix< T, R, C > xs)
| Return the specified eigen vector in descending order. More...
template<typename C >
std::vector< int > | sort_indices_asc (const C &xs)
| Return a sorted copy of the argument container in ascending order. More...
template<typename C >
std::vector< int > | sort_indices_desc (const C &xs)
| Return a sorted copy of the argument container in ascending order. More...
template<int R1, int C1, int R2, int C2, typename T1 , typename T2 >
boost::math::tools::promote_args < T1, T2 >::type | squared_distance (const Eigen::Matrix< T1, R1, C1 > &v1, const Eigen::Matrix< T2, R2, C2 > &v2)
| Returns the squared distance between the specified vectors. More...
template<typename T >
void | stan_print (std::ostream *o, const T &x)
template<typename T >
void | stan_print (std::ostream *o, const std::vector< T > &x)
template<typename T >
void | stan_print (std::ostream *o, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &x)
template<typename T >
void | stan_print (std::ostream *o, const Eigen::Matrix< T, 1, Eigen::Dynamic > &x)
template<typename T >
void | stan_print (std::ostream *o, const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &x)
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, 1 > | sub_col (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m, size_t i, size_t j, size_t nrows)
| Return a nrows x 1 subcolumn starting at (i-1, j-1). More...
template<typename T >
Eigen::Matrix< T, 1, Eigen::Dynamic > | sub_row (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m, size_t i, size_t j, size_t ncols)
| Return a 1 x nrows subrow starting at (i-1, j-1). More...
template<typename T1 , typename T2 , int R, int C>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R, C > | subtract (const Eigen::Matrix< T1, R, C > &m1, const Eigen::Matrix< T2, R, C > &m2)
| Return the result of subtracting the second specified matrix from the first specified matrix. More...
template<typename T1 , typename T2 , int R, int C>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R, C > | subtract (const T1 &c, const Eigen::Matrix< T2, R, C > &m)
template<typename T1 , typename T2 , int R, int C>
Eigen::Matrix< typename boost::math::tools::promote_args < T1, T2 >::type, R, C > | subtract (const Eigen::Matrix< T1, R, C > &m, const T2 &c)
template<typename T , int R, int C>
double | sum (const Eigen::Matrix< T, R, C > &v)
| Returns the sum of the coefficients of the specified column vector. More...
template<typename T >
Eigen::Matrix< T, Eigen::Dynamic, 1 > | tail (const Eigen::Matrix< T, Eigen::Dynamic, 1 > &v, size_t n)
| Return the specified number of elements as a vector from the back of the specified vector. More...
template<typename T >
Eigen::Matrix< T, 1, Eigen::Dynamic > | tail (const Eigen::Matrix< T, 1, Eigen::Dynamic > &rv, size_t n)
| Return the specified number of elements as a row vector from the back of the specified row vector. More...
template<typename T >
std::vector< T > | tail (const std::vector< T > &sv, size_t n)
matrix_d | tcrossprod (const matrix_d &M)
| Returns the result of post-multiplying a matrix by its own transpose. More...
template<typename T , int R, int C>
vector< T > | to_array_1d (const Matrix< T, R, C > &matrix)
template<typename T >
vector< T > | to_array_1d (const vector< T > &x)
template<typename T >
vector< typename scalar_type < T >::type > | to_array_1d (const vector< vector< T > > &x)
template<typename T >
vector< vector< T > > | to_array_2d (const Matrix< T, Dynamic, Dynamic > &matrix)
template<typename T , int R, int C>
Matrix< T, Dynamic, Dynamic > | to_matrix (Matrix< T, R, C > matrix)
template<typename T >
Matrix< T, Dynamic, Dynamic > | to_matrix (const vector< vector< T > > &vec)
Matrix< double, Dynamic, Dynamic > | to_matrix (const vector< vector< int > > &vec)
template<typename T , int R, int C>
Matrix< T, 1, Dynamic > | to_row_vector (const Matrix< T, R, C > &matrix)
template<typename T >
Matrix< T, 1, Dynamic > | to_row_vector (const vector< T > &vec)
Matrix< double, 1, Dynamic > | to_row_vector (const vector< int > &vec)
template<typename T , int R, int C>
Matrix< T, Dynamic, 1 > | to_vector (const Matrix< T, R, C > &matrix)
template<typename T >
Matrix< T, Dynamic, 1 > | to_vector (const vector< T > &vec)
Matrix< double, Dynamic, 1 > | to_vector (const vector< int > &vec)
template<typename T >
T | trace (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m)
| Returns the trace of the specified matrix. More...
template<typename T >
T | trace (const T &m)
template<typename T1 , typename T2 , typename T3 , int R1, int C1, int R2, int C2, int R3, int C3>
boost::enable_if_c <!stan::is_var< T1 >::value &&!stan::is_var< T2 >::value &&!stan::is_var< T3 >::value, typename boost::math::tools::promote_args < T1, T2, T3 >::type >::type | trace_gen_inv_quad_form_ldlt (const Eigen::Matrix< T1, R1, C1 > &D, const stan::math::LDLT_factor< T2, R2, C2 > &A, const Eigen::Matrix< T3, R3, C3 > &B)
template<int RD, int CD, int RA, int CA, int RB, int CB>
double | trace_gen_quad_form (const Eigen::Matrix< double, RD, CD > &D, const Eigen::Matrix< double, RA, CA > &A, const Eigen::Matrix< double, RB, CB > &B)
| Compute trace(D B^T A B). More...
template<typename T1 , typename T2 , int R2, int C2, int R3, int C3>
boost::enable_if_c <!stan::is_var< T1 >::value &&!stan::is_var< T2 >::value, typename boost::math::tools::promote_args < T1, T2 >::type >::type | trace_inv_quad_form_ldlt (const stan::math::LDLT_factor< T1, R2, C2 > &A, const Eigen::Matrix< T2, R3, C3 > &B)
template<int RA, int CA, int RB, int CB>
double | trace_quad_form (const Eigen::Matrix< double, RA, CA > &A, const Eigen::Matrix< double, RB, CB > &B)
| Compute trace(B^T A B). More...
template<typename T , int R, int C>
Eigen::Matrix< T, C, R > | transpose (const Eigen::Matrix< T, R, C > &m)
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 , int R, int C>
Eigen::Matrix< typename child_type< T >::type, R, C > | value_of (const Eigen::Matrix< T, R, C > &M)
| Convert a matrix of type T to a matrix of doubles. More...
template<typename T , int R, int C>
Eigen::Matrix< double, R, C > | value_of_rec (const Eigen::Matrix< T, R, C > &M)
| Convert a matrix of type T to a matrix of doubles. More...
template<typename T >
boost::math::tools::promote_args < T >::type | variance (const std::vector< T > &v)
| Returns the sample variance (divide by length - 1) of the coefficients in the specified standard vector. More...
template<typename T , int R, int C>
boost::math::tools::promote_args < T >::type | variance (const Eigen::Matrix< T, R, C > &m)
| Returns the sample variance (divide by length - 1) of the coefficients in the specified column vector. More...
template<typename F >
void | finite_diff_gradient (const F &f, const Eigen::Matrix< double,-1, 1 > &x, double &fx, Eigen::Matrix< double,-1, 1 > &grad_fx, const double epsilon=1e-03)
| Calculate the value and the gradient of the specified function at the specified argument using finite difference. More...
template<typename F >
double | finite_diff_hess_helper (const F &f, const Eigen::Matrix< double, Eigen::Dynamic, 1 > &x, const int lambda, const double epsilon=1e-03)
template<typename F >
void | finite_diff_hessian (const F &f, const Eigen::Matrix< double,-1, 1 > &x, double &fx, Eigen::Matrix< double,-1, 1 > &grad_fx, Eigen::Matrix< double,-1,-1 > &hess_fx, const double epsilon=1e-03)
| Calculate the value and the Hessian of the specified function at the specified argument using second-order finite difference. More...
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<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<class RNG >
int | categorical_rng (const Eigen::Matrix< double, Eigen::Dynamic, 1 > &theta, RNG &rng)
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)
| Return a draw from a Dirichlet distribution with specified parameters and pseudo-random number generator. More...
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<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<class RNG >
Eigen::MatrixXd | lkj_corr_cholesky_rng (const size_t K, const double eta, RNG &rng)
template<typename T_shape >
T_shape | do_lkj_constant (const T_shape &eta, const unsigned int &K)
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_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_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_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_loc , typename T_covar >
return_type< T_y, T_loc, T_covar >::type | multi_normal_cholesky_log (const T_y &y, const T_loc &mu, const T_covar &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 >
return_type< T_y, T_loc, T_covar >::type | multi_normal_cholesky_log (const T_y &y, const T_loc &mu, const T_covar &L)
template<class RNG >
Eigen::VectorXd | multi_normal_cholesky_rng (const Eigen::Matrix< double, Dynamic, 1 > &mu, const Eigen::Matrix< double, Dynamic, Dynamic > &S, RNG &rng)
template<bool propto, typename T_y , typename T_loc , typename T_covar >
return_type< T_y, T_loc, T_covar >::type | multi_normal_log (const T_y &y, const T_loc &mu, const T_covar &Sigma)
template<typename T_y , typename T_loc , typename T_covar >
return_type< T_y, T_loc, T_covar >::type | multi_normal_log (const T_y &y, const T_loc &mu, const T_covar &Sigma)
template<bool propto, typename T_y , typename T_loc , typename T_covar >
return_type< T_y, T_loc, T_covar >::type | multi_normal_prec_log (const T_y &y, const T_loc &mu, const T_covar &Sigma)
template<typename T_y , typename T_loc , typename T_covar >
return_type< T_y, T_loc, T_covar >::type | multi_normal_prec_log (const T_y &y, const T_loc &mu, const T_covar &Sigma)
template<class RNG >
Eigen::VectorXd | multi_normal_rng (const Eigen::Matrix< double, Dynamic, 1 > &mu, const Eigen::Matrix< double, Dynamic, Dynamic > &S, 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 | multi_student_t_log (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &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 >
return_type< T_y, T_dof, T_loc, T_scale >::type | multi_student_t_log (const T_y &y, const T_dof &nu, const T_loc &mu, const T_scale &Sigma)
template<class RNG >
Eigen::VectorXd | multi_student_t_rng (const double nu, const Eigen::Matrix< double, Dynamic, 1 > &mu, const Eigen::Matrix< double, Dynamic, Dynamic > &s, RNG &rng)
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<typename T >
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_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<typename T_y , typename T_low , typename T_high >
bool | check_bounded (const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high)
| Return `true` if the value is between the low and high values, inclusively. More...
template<typename T >
bool | check_consistent_size (const char *function, const char *name, const T &x, size_t expected_size)
| Return `true` if the dimension of x is consistent, which is defined to be `expected_size` if x is a vector or 1 if x is not a vector. More...
template<typename T1 , typename T2 >
bool | check_consistent_sizes (const char *function, const char *name1, const T1 &x1, const char *name2, const T2 &x2)
| Return `true` if the dimension of x1 is consistent with x2. More...
template<typename T1 , typename T2 , typename T3 >
bool | check_consistent_sizes (const char *function, const char *name1, const T1 &x1, const char *name2, const T2 &x2, const char *name3, const T3 &x3)
| Return `true` if the dimension of x1, x2, and x3 are consistent. More...
template<typename T1 , typename T2 , typename T3 , typename T4 >
bool | check_consistent_sizes (const char *function, const char *name1, const T1 &x1, const char *name2, const T2 &x2, const char *name3, const T3 &x3, const char *name4, const T4 &x4)
| Return `true` if the dimension of x1, x2, x3, and x4 are consistent. More...
template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >
bool | check_consistent_sizes (const char *function, const char *name1, const T1 &x1, const char *name2, const T2 &x2, const char *name3, const T3 &x3, const char *name4, const T4 &x4, const char *name5, const T5 &x5)
template<typename T_y , typename T_eq >
bool | check_equal (const char *function, const char *name, const T_y &y, const T_eq &eq)
| Return `true` if `y` is equal to `eq`. More...
template<typename T_y >
bool | check_finite (const char *function, const char *name, const T_y &y)
| Return `true` if `y` is finite. More...
template<typename T_y , typename T_low >
bool | check_greater (const char *function, const char *name, const T_y &y, const T_low &low)
| Return `true` if `y` is strictly greater than `low`. More...
template<typename T_y , typename T_low >
bool | check_greater_or_equal (const char *function, const char *name, const T_y &y, const T_low &low)
| Return `true` if `y` is greater or equal than `low`. More...
template<typename T_y , typename T_high >
bool | check_less (const char *function, const char *name, const T_y &y, const T_high &high)
| Return `true` if `y` is strictly less than `high`. More...
template<typename T_y , typename T_high >
bool | check_less_or_equal (const char *function, const char *name, const T_y &y, const T_high &high)
| Return `true` if `y` is less or equal to `high`. More...
template<typename T_y >
bool | check_nonnegative (const char *function, const char *name, const T_y &y)
| Return `true` if `y` is non-negative. More...
template<typename T_y >
bool | check_nonzero_size (const char *function, const char *name, const T_y &y)
| Return `true` if the specified matrix/vector is of non-zero size. More...
template<typename T_y >
bool | check_not_nan (const char *function, const char *name, const T_y &y)
| Return `true` if `y` is not `NaN`. More...
template<typename T_y >
bool | check_positive (const char *function, const char *name, const T_y &y)
| Return `true` if `y` is positive. More...
template<typename T_y >
bool | check_positive_finite (const char *function, const char *name, const T_y &y)
| Return `true` if `y` is positive and finite. More...
bool | check_positive_size (const char *function, const char *name, const char *expr, const int size)
| Return `true` if `size` is positive. More...
template<typename T_size1 , typename T_size2 >
bool | check_size_match (const char *function, const char *name_i, T_size1 i, const char *name_j, T_size2 j)
| Return `true` if the provided sizes match. More...
template<typename T_size1 , typename T_size2 >
bool | check_size_match (const char *function, const char *expr_i, const char *name_i, T_size1 i, const char *expr_j, const char *name_j, T_size2 j)
| Return `true` if the provided sizes match. More...
template<typename T >
void | domain_error (const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
| Throw a domain error with a consistently formatted message. More...
template<typename T >
void | domain_error (const char *function, const char *name, const T &y, const char *msg1)
| Throw a domain error with a consistently formatted message. More...
template<typename T >
void | domain_error_vec (const char *function, const char *name, const T &y, const size_t i, const char *msg1, const char *msg2)
| Throw a domain error with a consistently formatted message. More...
template<typename T >
void | domain_error_vec (const char *function, const char *name, const T &y, const size_t i, const char *msg)
| Throw a domain error with a consistently formatted message. More...
template<typename T >
void | invalid_argument (const char *function, const char *name, const T &y, const char *msg1, const char *msg2)
| Throw an invalid_argument exception with a consistently formatted message. More...
template<typename T >
void | invalid_argument (const char *function, const char *name, const T &y, const char *msg1)
| Throw an invalid_argument exception with a consistently formatted message. More...
template<typename T >
void | invalid_argument_vec (const char *function, const char *name, const T &y, const size_t i, const char *msg1, const char *msg2)
| Throw an invalid argument exception with a consistently formatted message. More...
template<typename T >
void | invalid_argument_vec (const char *function, const char *name, const T &y, const size_t i, const char *msg)
| Throw an invalid argument exception with a consistently formatted message. More...
void | out_of_range (const char *function, const int max, const int index, const char *msg1="", const char *msg2="")
| Throw an out_of_range exception with a consistently formatted message. More...
double | abs (double x)
| Return floating-point absolute value. More...
template<typename T >
bool | as_bool (const T x)
| Return 1 if the argument is unequal to zero and 0 otherwise. More...
template<typename T2 >
T2 | bessel_first_kind (const int v, const T2 z)
| More...
template<typename T2 >
T2 | bessel_second_kind (const int v, const T2 z)
| More...
template<typename T >
boost::math::tools::promote_args < T >::type | binary_log_loss (const int y, const T y_hat)
| Returns the log loss function for binary classification with specified reference and response values. More...
template<typename T_N , typename T_n >
boost::math::tools::promote_args < T_N, T_n >::type | binomial_coefficient_log (const T_N N, const T_n n)
| Return the log of the binomial coefficient for the specified arguments. More...
double | pi ()
| Return the value of pi. More...
double | e ()
| Return the base of the natural logarithm. More...
double | sqrt2 ()
| Return the square root of two. More...
double | log10 ()
| Return natural logarithm of ten. More...
double | positive_infinity ()
| Return positive infinity. More...
double | negative_infinity ()
| Return negative infinity. More...
double | not_a_number ()
| Return (quiet) not-a-number. More...
double | machine_precision ()
| Returns the difference between 1.0 and the next value representable. More...
template<typename T >
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 >
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 >
T | corr_free (const T y)
| Return the unconstrained scalar that when transformed to a valid correlation produces the specified value. More...
double | digamma (double x)
| More...
int | divide (const int x, const int y)
template<typename T >
boost::math::tools::promote_args < T >::type | exp2 (const T y)
| Return the exponent base 2 of the specified argument (C99). More...
template<typename T >
T | F32 (T a, T b, T c, T d, T e, T z, T precision=1e-6)
template<typename T1 , typename T2 >
boost::math::tools::promote_args < T1, T2 >::type | falling_factorial (const T1 x, const T2 n)
| More...
template<typename T1 , typename T2 >
boost::math::tools::promote_args < T1, T2 >::type | fdim (T1 a, T2 b)
| The positive difference function (C99). More...
double | gamma_p (double x, double a)
| More...
double | gamma_q (double x, double a)
| More...
template<typename T >
void | grad_2F1 (T &gradA, T &gradC, T a, T b, T c, T z, T precision=1e-6)
template<typename T >
void | grad_F32 (T *g, T a, T b, T c, T d, T e, T z, T precision=1e-6)
void | grad_inc_beta (double &g1, double &g2, double a, double b, double z)
template<typename T >
void | grad_reg_inc_beta (T &g1, T &g2, T a, T b, T z, T digammaA, T digammaB, T digammaSum, T betaAB)
template<typename T >
T | grad_reg_inc_gamma (T a, T z, T g, T dig, T precision=1e-6)
double | ibeta (const double a, const double b, const double x)
| The normalized incomplete beta function of a, b, and x. More...
template<typename T >
T | identity_constrain (T x)
| Returns the result of applying the identity constraint transform to the input. More...
template<typename T >
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 >
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_true , typename T_false >
boost::math::tools::promote_args < T_true, T_false >::type | if_else (const bool c, const T_true y_true, const T_false y_false)
| Return the second argument if the first argument is true and otherwise return the second argument. More...
double | inc_beta (const double &a, const double &b, const double &x)
template<typename T >
T | inc_beta_ddb (T a, T b, T z, T digamma_b, T digamma_ab)
| Returns the partial derivative of the regularized incomplete beta function, I_{z}(a, b) with respect to b. More...
template<typename T >
T | inc_beta_dda (T a, T b, T z, T digamma_a, T digamma_ab)
| Returns the partial derivative of the regularized incomplete beta function, I_{z}(a, b) with respect to a. More...
template<typename T >
T | inc_beta_ddz (T a, T b, T z)
| Returns the partial derivative of the regularized incomplete beta function, I_{z}(a, b) with respect to z. More...
template<>
double | inc_beta_ddz (double a, double b, double z)
template<typename T >
unsigned int | int_step (const T y)
| The integer step, or Heaviside, function. More...
template<typename T >
boost::math::tools::promote_args < T >::type | inv (const T x)
template<typename T >
boost::math::tools::promote_args < T >::type | inv_cloglog (T x)
| The inverse complementary log-log function. More...
template<typename T >
boost::math::tools::promote_args < T >::type | inv_logit (const T a)
| Returns the inverse logit function applied to the argument. More...
template<typename T >
boost::math::tools::promote_args < T >::type | inv_sqrt (const T x)
template<typename T >
boost::math::tools::promote_args < T >::type | inv_square (const T x)
template<typename Vector >
void | inverse_softmax (const Vector &simplex, Vector &y)
| Writes the inverse softmax of the simplex argument into the second argument. More...
int | is_inf (const double x)
| Returns 1 if the input is infinite and 0 otherwise. More...
bool | is_nan (double x)
| Returns 1 if the input is NaN and 0 otherwise. More...
template<typename T >
bool | is_uninitialized (T x)
| Returns `true` if the specified variable is uninitialized. More...
template<typename T , typename TL >
T | 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 T1 , typename T2 >
boost::math::tools::promote_args < T1, T2 >::type | lbeta (const T1 a, const T2 b)
| Return the log of the beta function applied to the specified arguments. More...
double | lgamma (double x)
| More...
template<typename T >
boost::math::tools::promote_args < T >::type | lmgamma (const int k, T x)
| Return the natural logarithm of the multivariate gamma function with the speciifed dimensions and argument. More...
template<typename T >
boost::math::tools::promote_args < T >::type | log1m (T x)
| Return the natural logarithm of one minus the specified value. More...
template<typename T >
boost::math::tools::promote_args < T >::type | log1m_exp (const T a)
| Calculates the log of 1 minus the exponential of the specified value without overflow log1m_exp(x) = log(1-exp(x)). More...
template<typename T >
boost::math::tools::promote_args < T >::type | log1m_inv_logit (const T u)
| Returns the natural logarithm of 1 minus the inverse logit of the specified argument. More...
template<typename T >
boost::math::tools::promote_args < T >::type | log1p (const T x)
| Return the natural logarithm of one plus the specified value. More...
template<typename T >
boost::math::tools::promote_args < T >::type | log1p_exp (const T a)
| Calculates the log of 1 plus the exponential of the specified value without overflow. More...
template<typename T >
boost::math::tools::promote_args < T >::type | log2 (const T a)
| Returns the base 2 logarithm of the argument (C99). More...
double | log2 ()
| Return natural logarithm of two. More...
template<typename T1 , typename T2 >
boost::math::tools::promote_args < T1, T2 >::type | log_diff_exp (const T1 x, const T2 y)
| The natural logarithm of the difference of the natural exponentiation of x1 and the natural exponentiation of x2. More...
template<typename T1 , typename T2 >
boost::math::tools::promote_args < T1, T2 >::type | log_falling_factorial (const T1 x, const T2 n)
| More...
template<typename T >
boost::math::tools::promote_args < T >::type | log_inv_logit (const T &u)
| Returns the natural logarithm of the inverse logit of the specified argument. More...
double | log_mix (double theta, double lambda1, double lambda2)
| Return the log mixture density with specified mixing proportion and log densities. More...
template<typename T1 , typename T2 >
boost::math::tools::promote_args < T1, T2 >::type | log_rising_factorial (const T1 x, const T2 n)
| More...
template<typename T1 , typename T2 >
boost::math::tools::promote_args < T1, T2 >::type | log_sum_exp (const T2 &a, const T1 &b)
| Calculates the log sum of exponetials without overflow. More...
template<typename T1 , typename T2 >
int | logical_and (const T1 x1, const T2 x2)
| The logical and function which returns 1 if both arguments are unequal to zero and 0 otherwise. More...
template<typename T1 , typename T2 >
int | logical_eq (const T1 x1, const T2 x2)
| Return 1 if the first argument is equal to the second. More...
template<typename T1 , typename T2 >
int | logical_gt (const T1 x1, const T2 x2)
| Return 1 if the first argument is strictly greater than the second. More...
template<typename T1 , typename T2 >
int | logical_gte (const T1 x1, const T2 x2)
| Return 1 if the first argument is greater than or equal to the second. More...
template<typename T1 , typename T2 >
int | logical_lt (T1 x1, T2 x2)
| Return 1 if the first argument is strictly less than the second. More...
template<typename T1 , typename T2 >
int | logical_lte (const T1 x1, const T2 x2)
| Return 1 if the first argument is less than or equal to the second. More...
template<typename T >
int | logical_negation (const T x)
| The logical negation function which returns 1 if the input is equal to zero and 0 otherwise. More...
template<typename T1 , typename T2 >
int | logical_neq (const T1 x1, const T2 x2)
| Return 1 if the first argument is unequal to the second. More...
template<typename T1 , typename T2 >
int | logical_or (T1 x1, T2 x2)
| The logical or function which returns 1 if either argument is unequal to zero and 0 otherwise. More...
template<typename T >
boost::math::tools::promote_args < T >::type | logit (const T a)
| Returns the logit function applied to the argument. 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 T2 >
T2 | modified_bessel_first_kind (const int v, const T2 z)
| More...
template<typename T2 >
T2 | modified_bessel_second_kind (const int v, const T2 z)
| More...
int | modulus (const int x, const int y)
template<typename T_a , typename T_b >
boost::math::tools::promote_args < T_a, T_b >::type | multiply_log (const T_a a, const T_b b)
| Calculated the value of the first argument times log of the second argument while behaving properly with 0 inputs. More...
double | owens_t (const double h, const double a)
| The Owen's T function of h and a. More...
template<typename T >
boost::math::tools::promote_args < T >::type | Phi (const T x)
| The unit normal cumulative distribution function. More...
template<typename T >
boost::math::tools::promote_args < T >::type | Phi_approx (T x)
| Approximation of the unit normal CDF. More...
template<typename T >
T | positive_constrain (const T x)
| Return the positive value for the specified unconstrained input. More...
template<typename T >
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 >
T | positive_free (const T y)
| Return the unconstrained value corresponding to the specified positive-constrained value. More...
template<typename T >
boost::enable_if < boost::is_arithmetic< T >, T > ::type | primitive_value (T x)
| Return the value of the specified arithmetic argument unmodified with its own declared type. More...
template<typename T >
boost::disable_if < boost::is_arithmetic< T > , double >::type | primitive_value (const T &x)
| Return the primitive value of the specified argument. More...
template<typename T >
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 >
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 >
T | prob_free (const T y)
| Return the free scalar that when transformed to a probability produces the specified scalar. More...
template<typename T , typename S >
promote_scalar_type< T, S >::type | promote_scalar (const S &x)
| This is the top-level function to call to promote the scalar types of an input of type S to type T. More...
template<typename T1 , typename T2 >
boost::math::tools::promote_args < T1, T2 >::type | rising_factorial (const T1 x, const T2 n)
| More...
template<typename T >
int | sign (const T &z)
template<typename T >
T | square (const T x)
| Return the square of the specified argument. More...
template<typename T >
int | step (const T y)
| The step, or Heaviside, function. More...
template<typename T >
T | trigamma (T x)
| 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 >
double | value_of (const T x)
| Return the value of the specified scalar argument converted to a double value. More...
template<>
double | value_of< double > (const double x)
| Return the specified argument. More...
template<typename T >
double | value_of_rec (const T x)
| Return the value of the specified scalar argument converted to a double value. More...
template<>
double | value_of_rec< double > (const double x)
| Return the specified argument. More...
template<typename T_n , typename T_prob >
return_type< T_prob >::type | bernoulli_ccdf_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<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<class RNG >
int | bernoulli_rng (const double theta, RNG &rng)
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<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<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<class RNG >
int | beta_binomial_rng (const int N, const double alpha, const double beta, RNG &rng)
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<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<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<class RNG >
double | beta_rng (const double alpha, const double beta, RNG &rng)
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<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<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<class RNG >
int | binomial_rng (const int N, const double theta, RNG &rng)
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<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<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<class RNG >
double | cauchy_rng (const double mu, const double sigma, RNG &rng)
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<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<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<class RNG >
double | chi_square_rng (const double nu, RNG &rng)
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<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<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<class RNG >
double | double_exponential_rng (const double mu, const double sigma, RNG &rng)
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<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<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<class RNG >
double | exp_mod_normal_rng (const double mu, const double sigma, const double lambda, RNG &rng)
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<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<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<class RNG >
double | exponential_rng (const double beta, RNG &rng)
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<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<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<class RNG >
double | frechet_rng (const double alpha, const double sigma, RNG &rng)
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<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<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<class RNG >
double | gamma_rng (const double alpha, const double beta, RNG &rng)
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<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<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<class RNG >
double | gumbel_rng (const double mu, const double beta, 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 (int N, int a, int b, RNG &rng)
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<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<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<class RNG >
double | inv_chi_square_rng (const double nu, RNG &rng)
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<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<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<class RNG >
double | inv_gamma_rng (const double alpha, const double beta, RNG &rng)
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<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<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<class RNG >
double | logistic_rng (const double mu, const double sigma, RNG &rng)
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<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<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<class RNG >
double | lognormal_rng (const double mu, const double sigma, RNG &rng)
template<typename T_n , typename T_location , typename T_precision >
return_type< T_location, T_precision >::type | neg_binomial_2_ccdf_log (const T_n &n, const T_location &mu, const T_precision &phi)
template<typename T_n , typename T_location , typename T_precision >
return_type< T_location, T_precision >::type | neg_binomial_2_cdf (const T_n &n, const T_location &mu, const T_precision &phi)
template<typename T_n , typename T_location , typename T_precision >
return_type< T_location, T_precision >::type | neg_binomial_2_cdf_log (const T_n &n, const T_location &mu, const T_precision &phi)
template<bool propto, typename T_n , typename T_location , typename T_precision >
return_type< T_location, T_precision >::type | neg_binomial_2_log (const T_n &n, const T_location &mu, const T_precision &phi)
template<typename T_n , typename T_location , typename T_precision >
return_type< T_location, T_precision >::type | neg_binomial_2_log (const T_n &n, const T_location &mu, const T_precision &phi)
template<bool propto, typename T_n , typename T_log_location , typename T_precision >
return_type< T_log_location, T_precision >::type | neg_binomial_2_log_log (const T_n &n, const T_log_location &eta, const T_precision &phi)
template<typename T_n , typename T_log_location , typename T_precision >
return_type< T_log_location, T_precision >::type | neg_binomial_2_log_log (const T_n &n, const T_log_location &eta, const T_precision &phi)
template<class RNG >
int | neg_binomial_2_log_rng (const double eta, const double phi, RNG &rng)
template<class RNG >
int | neg_binomial_2_rng (const double mu, const double phi, RNG &rng)
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<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<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<class RNG >
int | neg_binomial_rng (const double alpha, const double beta, RNG &rng)
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<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<bool propto, 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)
| 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<class RNG >
double | normal_rng (const double mu, const double sigma, RNG &rng)
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<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<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<class RNG >
double | pareto_rng (const double y_min, const double alpha, RNG &rng)
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<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<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<class RNG >
double | pareto_type_2_rng (const double mu, const double lambda, const double alpha, RNG &rng)
template<typename T_n , typename T_rate >
return_type< T_rate >::type | poisson_ccdf_log (const T_n &n, const T_rate &lambda)
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<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<class RNG >
int | poisson_log_rng (const double alpha, RNG &rng)
template<class RNG >
int | poisson_rng (const double lambda, RNG &rng)
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<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<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<class RNG >
double | rayleigh_rng (const double sigma, RNG &rng)
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<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<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<class RNG >
double | scaled_inv_chi_square_rng (const double nu, const double s, RNG &rng)
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<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<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<class RNG >
double | skew_normal_rng (const double mu, const double sigma, const double alpha, RNG &rng)
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<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<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<class RNG >
double | student_t_rng (const double nu, const double mu, const double sigma, RNG &rng)
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<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<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<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<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<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<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<class RNG >
double | weibull_rng (const double alpha, const double sigma, RNG &rng)
template<bool propto, typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta >
return_type< T_y, T_alpha, T_tau, T_beta, T_delta >::type | wiener_log (const T_y &y, const T_alpha &alpha, const T_tau &tau, const T_beta &beta, const T_delta &delta)
| The log of the first passage time density function for a (Wiener) drift diffusion model for the given , boundary separation , nondecision time , relative bias , and drift rate . More...
template<typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta >
return_type< T_y, T_alpha, T_tau, T_beta, T_delta >::type | wiener_log (const T_y &y, const T_alpha &alpha, const T_tau &tau, const T_beta &beta, const T_delta &delta)
var | log_sum_exp (const std::vector< var > &x)
| Returns the log sum of exponentials. More...
var | sum (const std::vector< var > &m)
| Returns the sum of the entries of the specified vector. More...
void | add_initial_values (const std::vector< stan::math::var > &y0, std::vector< std::vector< stan::math::var > > &y)
| Increment the state derived from the coupled system in the with the original initial state. More...
static bool | empty_nested ()
| Return true if there is no nested autodiff being executed. More...
static void | grad (chainable *vi)
| Compute the gradient for all variables starting from the specified root variable implementation. More...
static size_t | nested_size ()
var | operator+ (const var &a, const var &b)
| Addition operator for variables (C++). More...
var | operator+ (const var &a, const double b)
| Addition operator for variable and scalar (C++). More...
var | operator+ (const double a, const var &b)
| Addition operator for scalar and variable (C++). More...
var | operator/ (const var &a, const var &b)
| Division operator for two variables (C++). More...
var | operator/ (const var &a, const double b)
| Division operator for dividing a variable by a scalar (C++). More...
var | operator/ (const double a, const var &b)
| Division operator for dividing a scalar by a variable (C++). More...
bool | operator== (const var &a, const var &b)
| Equality operator comparing two variables' values (C++). More...
bool | operator== (const var &a, const double b)
| Equality operator comparing a variable's value and a double (C++). More...
bool | operator== (const double a, const var &b)
| Equality operator comparing a scalar and a variable's value (C++). More...
bool | operator> (const var &a, const var &b)
| Greater than operator comparing variables' values (C++). More...
bool | operator> (const var &a, const double b)
| Greater than operator comparing variable's value and double (C++). More...
bool | operator> (const double a, const var &b)
| Greater than operator comparing a double and a variable's value (C++). More...
bool | operator>= (const var &a, const var &b)
| Greater than or equal operator comparing two variables' values (C++). More...
bool | operator>= (const var &a, const double b)
| Greater than or equal operator comparing variable's value and double (C++). More...
bool | operator>= (const double a, const var &b)
| Greater than or equal operator comparing double and variable's value (C++). More...
bool | operator< (const var &a, const var &b)
| Less than operator comparing variables' values (C++). More...
bool | operator< (const var &a, const double b)
| Less than operator comparing variable's value and a double (C++). More...
bool | operator< (const double a, const var &b)
| Less than operator comparing a double and variable's value (C++). More...
bool | operator<= (const var &a, const var &b)
| Less than or equal operator comparing two variables' values (C++). More...
bool | operator<= (const var &a, const double b)
| Less than or equal operator comparing a variable's value and a scalar (C++). More...
bool | operator<= (const double a, const var &b)
| Less than or equal operator comparing a double and variable's value (C++). More...
var | operator* (const var &a, const var &b)
| Multiplication operator for two variables (C++). More...
var | operator* (const var &a, const double b)
| Multiplication operator for a variable and a scalar (C++). More...
var | operator* (const double a, const var &b)
| Multiplication operator for a scalar and a variable (C++). More...
bool | operator!= (const var &a, const var &b)
| Inequality operator comparing two variables' values (C++). More...
bool | operator!= (const var &a, const double b)
| Inequality operator comparing a variable's value and a double (C++). More...
bool | operator!= (const double a, const var &b)
| Inequality operator comparing a double and a variable's value (C++). More...
var | operator- (const var &a, const var &b)
| Subtraction operator for variables (C++). More...
var | operator- (const var &a, const double b)
| Subtraction operator for variable and scalar (C++). More...
var | operator- (const double a, const var &b)
| Subtraction operator for scalar and variable (C++). More...
var & | operator-- (var &a)
| Prefix decrement operator for variables (C++). More...
var | operator-- (var &a, int)
| Postfix decrement operator for variables (C++). More...
var & | operator++ (var &a)
| Prefix increment operator for variables (C++). More...
var | operator++ (var &a, int)
| Postfix increment operator for variables (C++). More...
var | operator- (const var &a)
| Unary negation operator for variables (C++). More...
bool | operator! (const var &a)
| Prefix logical negation for the value of variables (C++). More...
var | operator+ (const var &a)
| Unary plus operator for variables (C++). More...
var | precomputed_gradients (const double value, const std::vector< var > &operands, const std::vector< double > &gradients)
| This function returns a var for an expression that has the specified value, vector of operands, and vector of partial derivatives of value with respect to the operands. More...
void | print_stack (std::ostream &o)
| Prints the auto-dif variable stack. More...
static void | recover_memory ()
| Recover memory used for all variables for reuse. More...
static void | recover_memory_nested ()
| Recover only the memory used for the top nested call. More...
static void | set_zero_all_adjoints ()
| Reset all adjoint values in the stack to zero. More...
static void | start_nested ()
| Record the current position so that `recover_memory_nested()` can find it. More...
static void | grad (chainable *vi)
template<typename T1 , int R1, int C1, typename T2 , int R2, int C2>
boost::enable_if_c < boost::is_same< T1, var > ::value||boost::is_same< T2, var >::value, Eigen::Matrix < var, 1, C1 > >::type | columns_dot_product (const Eigen::Matrix< T1, R1, C1 > &v1, const Eigen::Matrix< T2, R2, C2 > &v2)
template<int R, int C>
Eigen::Matrix< var, 1, C > | columns_dot_self (const Eigen::Matrix< var, R, C > &x)
| Returns the dot product of each column of a matrix with itself. More...
matrix_v | crossprod (const matrix_v &M)
| Returns the result of pre-multiplying a matrix by its own transpose. More...
template<int R, int C>
var | determinant (const Eigen::Matrix< var, R, C > &m)
double | divide (double x, double y)
| Return the division of the first scalar by the second scalar. More...
template<typename T1 , typename T2 >
var | divide (const T1 &v, const T2 &c)
template<typename T1 , typename T2 , int R, int C>
Eigen::Matrix< var, R, C > | divide (const Eigen::Matrix< T1, R, C > &v, const T2 &c)
| Return the division of the specified column vector by the specified scalar. More...
template<typename T1 , int R1, int C1, typename T2 , int R2, int C2>
boost::enable_if_c < boost::is_same< T1, var > ::value||boost::is_same< T2, var >::value, var >::type | dot_product (const Eigen::Matrix< T1, R1, C1 > &v1, const Eigen::Matrix< T2, R2, C2 > &v2)
| Returns the dot product. More...
template<typename T1 , typename T2 >
boost::enable_if_c < boost::is_same< T1, var > ::value||boost::is_same< T2, var >::value, var >::type | dot_product (const T1 *v1, const T2 *v2, size_t length)
| Returns the dot product. More...
template<typename T1 , typename T2 >
boost::enable_if_c < boost::is_same< T1, var > ::value||boost::is_same< T2, var >::value, var >::type | dot_product (const std::vector< T1 > &v1, const std::vector< T2 > &v2)
| Returns the dot product. More...
template<int R, int C>
var | dot_self (const Eigen::Matrix< var, R, C > &v)
| Returns the dot product of a vector with itself. More...
void | grad (var &v, Eigen::Matrix< var, Eigen::Dynamic, 1 > &x, Eigen::VectorXd &g)
| Propagate chain rule to calculate gradients starting from the specified variable. More...
void | initialize_variable (var &variable, const var &value)
| Initialize variable to value. More...
template<int R, int C>
void | initialize_variable (Eigen::Matrix< var, R, C > &matrix, const var &value)
| Initialize every cell in the matrix to the specified value. More...
template<typename T >
void | initialize_variable (std::vector< T > &variables, const var &value)
| Initialize the variables in the standard vector recursively. More...
template<int R, int C>
var | log_determinant (const Eigen::Matrix< var, R, C > &m)
template<int R, int C>
var | log_determinant_ldlt (stan::math::LDLT_factor< var, R, C > &A)
template<int R, int C>
var | log_determinant_spd (const Eigen::Matrix< var, R, C > &m)
Eigen::Matrix< var, Eigen::Dynamic, 1 > | log_softmax (const Eigen::Matrix< var, Eigen::Dynamic, 1 > &alpha)
| Return the softmax of the specified Eigen vector. More...
template<int R, int C>
var | log_sum_exp (const Eigen::Matrix< var, R, C > &x)
| Returns the log sum of exponentials. More...
template<int R1, int C1, int R2, int C2>
Eigen::Matrix< var, R1, C2 > | mdivide_left (const Eigen::Matrix< var, R1, C1 > &A, const Eigen::Matrix< var, R2, C2 > &b)
template<int R1, int C1, int R2, int C2>
Eigen::Matrix< var, R1, C2 > | mdivide_left (const Eigen::Matrix< var, R1, C1 > &A, const Eigen::Matrix< double, R2, C2 > &b)
template<int R1, int C1, int R2, int C2>
Eigen::Matrix< var, R1, C2 > | mdivide_left (const Eigen::Matrix< double, R1, C1 > &A, const Eigen::Matrix< var, R2, C2 > &b)
template<int R1, int C1, int R2, int C2>
Eigen::Matrix< var, R1, C2 > | mdivide_left_ldlt (const stan::math::LDLT_factor< var, R1, C1 > &A, const Eigen::Matrix< var, R2, C2 > &b)
| Returns the solution of the system Ax=b given an LDLT_factor of A. More...
template<int R1, int C1, int R2, int C2>
Eigen::Matrix< var, R1, C2 > | mdivide_left_ldlt (const stan::math::LDLT_factor< var, R1, C1 > &A, const Eigen::Matrix< double, R2, C2 > &b)
| Returns the solution of the system Ax=b given an LDLT_factor of A. More...
template<int R1, int C1, int R2, int C2>
Eigen::Matrix< var, R1, C2 > | mdivide_left_ldlt (const stan::math::LDLT_factor< double, R1, C1 > &A, const Eigen::Matrix< var, R2, C2 > &b)
| Returns the solution of the system Ax=b given an LDLT_factor of A. More...
template<int R1, int C1, int R2, int C2>
Eigen::Matrix< var, R1, C2 > | mdivide_left_spd (const Eigen::Matrix< var, R1, C1 > &A, const Eigen::Matrix< var, R2, C2 > &b)
template<int R1, int C1, int R2, int C2>
Eigen::Matrix< var, R1, C2 > | mdivide_left_spd (const Eigen::Matrix< var, R1, C1 > &A, const Eigen::Matrix< double, R2, C2 > &b)
template<int R1, int C1, int R2, int C2>
Eigen::Matrix< var, R1, C2 > | mdivide_left_spd (const Eigen::Matrix< double, R1, C1 > &A, const Eigen::Matrix< var, R2, C2 > &b)
template<int TriView, int R1, int C1, int R2, int C2>
Eigen::Matrix< var, R1, C2 > | mdivide_left_tri (const Eigen::Matrix< var, R1, C1 > &A, const Eigen::Matrix< var, R2, C2 > &b)
template<int TriView, int R1, int C1, int R2, int C2>
Eigen::Matrix< var, R1, C2 > | mdivide_left_tri (const Eigen::Matrix< double, R1, C1 > &A, const Eigen::Matrix< var, R2, C2 > &b)
template<int TriView, int R1, int C1, int R2, int C2>
Eigen::Matrix< var, R1, C2 > | mdivide_left_tri (const Eigen::Matrix< var, R1, C1 > &A, const Eigen::Matrix< double, R2, C2 > &b)
template<typename T1 , typename T2 >
boost::enable_if_c < (boost::is_scalar< T1 > ::value||boost::is_same< T1, var >::value)&&(boost::is_scalar < T2 >::value||boost::is_same < T2, var >::value), typename boost::math::tools::promote_args < T1, T2 >::type >::type | multiply (const T1 &v, const T2 &c)
| Return the product of two scalars. More...
template<typename T1 , typename T2 , int R2, int C2>
Eigen::Matrix< var, R2, C2 > | multiply (const T1 &c, const Eigen::Matrix< T2, R2, C2 > &m)
| Return the product of scalar and matrix. More...
template<typename T1 , int R1, int C1, typename T2 >
Eigen::Matrix< var, R1, C1 > | multiply (const Eigen::Matrix< T1, R1, C1 > &m, const T2 &c)
| Return the product of scalar and matrix. More...
template<typename T1 , int R1, int C1, typename T2 , int R2, int C2>
boost::enable_if_c < boost::is_same< T1, var > ::value||boost::is_same< T2, var >::value, Eigen::Matrix < var, R1, C2 > >::type | multiply (const Eigen::Matrix< T1, R1, C1 > &m1, const Eigen::Matrix< T2, R2, C2 > &m2)
| Return the product of the specified matrices. More...
template<typename T1 , int C1, typename T2 , int R2>
boost::enable_if_c < boost::is_same< T1, var > ::value||boost::is_same< T2, var >::value, var >::type | multiply (const Eigen::Matrix< T1, 1, C1 > &rv, const Eigen::Matrix< T2, R2, 1 > &v)
| Return the scalar product of the specified row vector and specified column vector. More...
matrix_v | multiply_lower_tri_self_transpose (const matrix_v &L)
template<typename TA , int RA, int CA, typename TB , int RB, int CB>
boost::enable_if_c < boost::is_same< TA, var > ::value||boost::is_same< TB, var >::value, Eigen::Matrix < var, CB, CB > >::type | quad_form (const Eigen::Matrix< TA, RA, CA > &A, const Eigen::Matrix< TB, RB, CB > &B)
template<typename TA , int RA, int CA, typename TB , int RB>
boost::enable_if_c < boost::is_same< TA, var > ::value||boost::is_same< TB, var >::value, var >::type | quad_form (const Eigen::Matrix< TA, RA, CA > &A, const Eigen::Matrix< TB, RB, 1 > &B)
template<typename TA , int RA, int CA, typename TB , int RB, int CB>
boost::enable_if_c < boost::is_same< TA, var > ::value||boost::is_same< TB, var >::value, Eigen::Matrix < var, CB, CB > >::type | quad_form_sym (const Eigen::Matrix< TA, RA, CA > &A, const Eigen::Matrix< TB, RB, CB > &B)
template<typename TA , int RA, int CA, typename TB , int RB>
boost::enable_if_c < boost::is_same< TA, var > ::value||boost::is_same< TB, var >::value, var >::type | quad_form_sym (const Eigen::Matrix< TA, RA, CA > &A, const Eigen::Matrix< TB, RB, 1 > &B)
template<typename T1 , int R1, int C1, typename T2 , int R2, int C2>
boost::enable_if_c < boost::is_same< T1, var > ::value||boost::is_same< T2, var >::value, Eigen::Matrix < var, R1, 1 > >::type | rows_dot_product (const Eigen::Matrix< T1, R1, C1 > &v1, const Eigen::Matrix< T2, R2, C2 > &v2)
var | sd (const std::vector< var > &v)
| Return the sample standard deviation of the specified standard vector. More...
template<int R, int C>
var | sd (const Eigen::Matrix< var, R, C > &m)
Eigen::Matrix< var, Eigen::Dynamic, 1 > | softmax (const Eigen::Matrix< var, Eigen::Dynamic, 1 > &alpha)
| Return the softmax of the specified Eigen vector. More...
std::vector< var > | sort_asc (std::vector< var > xs)
| Return the specified standard vector in ascending order with gradients kept. More...
template<int R, int C>
Eigen::Matrix< var, R, C > | sort_asc (Eigen::Matrix< var, R, C > xs)
| Return the specified eigen vector in ascending order with gradients kept. More...
std::vector< var > | sort_desc (std::vector< var > xs)
| Return the specified standard vector in descending order with gradients kept. More...
template<int R, int C>
Eigen::Matrix< var, R, C > | sort_desc (Eigen::Matrix< var, R, C > xs)
| Return the specified eigen vector in descending order with gradients kept. More...
template<int R1, int C1, int R2, int C2>
var | squared_distance (const Eigen::Matrix< var, R1, C1 > &v1, const Eigen::Matrix< var, R2, C2 > &v2)
template<int R1, int C1, int R2, int C2>
var | squared_distance (const Eigen::Matrix< var, R1, C1 > &v1, const Eigen::Matrix< double, R2, C2 > &v2)
template<int R1, int C1, int R2, int C2>
var | squared_distance (const Eigen::Matrix< double, R1, C1 > &v1, const Eigen::Matrix< var, R2, C2 > &v2)
void | stan_print (std::ostream *o, const var &x)
template<int R, int C>
var | sum (const Eigen::Matrix< var, R, C > &m)
| Returns the sum of the coefficients of the specified matrix, column vector or row vector. More...
matrix_v | tcrossprod (const matrix_v &M)
| Returns the result of post-multiplying a matrix by its own transpose. More...
var | to_var (const double &x)
| Converts argument to an automatic differentiation variable. More...
var | to_var (const var &x)
| Converts argument to an automatic differentiation variable. More...
matrix_v | to_var (const stan::math::matrix_d &m)
| Converts argument to an automatic differentiation variable. More...
matrix_v | to_var (const matrix_v &m)
| Converts argument to an automatic differentiation variable. More...
vector_v | to_var (const stan::math::vector_d &v)
| Converts argument to an automatic differentiation variable. More...
vector_v | to_var (const vector_v &v)
| Converts argument to an automatic differentiation variable. More...
row_vector_v | to_var (const stan::math::row_vector_d &rv)
| Converts argument to an automatic differentiation variable. More...
row_vector_v | to_var (const row_vector_v &rv)
| Converts argument to an automatic differentiation variable. More...
template<typename T1 , int R1, int C1, typename T2 , int R2, int C2, typename T3 , int R3, int C3>
boost::enable_if_c < stan::is_var< T1 >::value||stan::is_var < T2 >::value||stan::is_var < T3 >::value, var >::type | trace_gen_inv_quad_form_ldlt (const Eigen::Matrix< T1, R1, C1 > &D, const stan::math::LDLT_factor< T2, R2, C2 > &A, const Eigen::Matrix< T3, R3, C3 > &B)
| Compute the trace of an inverse quadratic form. More...
template<typename TD , int RD, int CD, typename TA , int RA, int CA, typename TB , int RB, int CB>
boost::enable_if_c < boost::is_same< TD, var > ::value||boost::is_same< TA, var >::value||boost::is_same < TB, var >::value, var > ::type | trace_gen_quad_form (const Eigen::Matrix< TD, RD, CD > &D, const Eigen::Matrix< TA, RA, CA > &A, const Eigen::Matrix< TB, RB, CB > &B)
template<typename T2 , int R2, int C2, typename T3 , int R3, int C3>
boost::enable_if_c < stan::is_var< T2 >::value||stan::is_var < T3 >::value, var >::type | trace_inv_quad_form_ldlt (const stan::math::LDLT_factor< T2, R2, C2 > &A, const Eigen::Matrix< T3, R3, C3 > &B)
| Compute the trace of an inverse quadratic form. More...
template<typename TA , int RA, int CA, typename TB , int RB, int CB>
boost::enable_if_c < boost::is_same< TA, var > ::value||boost::is_same< TB, var >::value, var >::type | trace_quad_form (const Eigen::Matrix< TA, RA, CA > &A, const Eigen::Matrix< TB, RB, CB > &B)
var | variance (const std::vector< var > &v)
| Return the sample variance of the specified standard vector. More...
template<int R, int C>
var | variance (const Eigen::Matrix< var, R, C > &m)
template<typename F >
void | gradient (const F &f, const Eigen::Matrix< double, Dynamic, 1 > &x, double &fx, Eigen::Matrix< double, Dynamic, 1 > &grad_fx)
| Calculate the value and the gradient of the specified function at the specified argument. More...
template<typename F >
void | jacobian (const F &f, const Eigen::Matrix< double, Dynamic, 1 > &x, Eigen::Matrix< double, Dynamic, 1 > &fx, Eigen::Matrix< double, Dynamic, Dynamic > &J)
var | abs (const var &a)
| Return the absolute value of the variable (std). More...
var | acos (const var &a)
| Return the principal value of the arc cosine of a variable, in radians (cmath). More...
var | acosh (const var &a)
| The inverse hyperbolic cosine function for variables (C99). More...
int | as_bool (const var &v)
| Return 1 if the argument is unequal to zero and 0 otherwise. More...
var | asin (const var &a)
| Return the principal value of the arc sine, in radians, of the specified variable (cmath). More...
var | asinh (const var &a)
| The inverse hyperbolic sine function for variables (C99). More...
var | atan (const var &a)
| Return the principal value of the arc tangent, in radians, of the specified variable (cmath). More...
var | atan2 (const var &a, const var &b)
| Return the principal value of the arc tangent, in radians, of the first variable divided by the second (cmath). More...
var | atan2 (const var &a, const double b)
| Return the principal value of the arc tangent, in radians, of the first variable divided by the second scalar (cmath). More...
var | atan2 (const double a, const var &b)
| Return the principal value of the arc tangent, in radians, of the first scalar divided by the second variable (cmath). More...
var | atanh (const var &a)
| The inverse hyperbolic tangent function for variables (C99). More...
var | bessel_first_kind (const int &v, const var &a)
var | bessel_second_kind (const int &v, const var &a)
var | binary_log_loss (const int y, const stan::math::var &y_hat)
| The log loss function for variables (stan). More...
double | calculate_chain (const double &x, const double &val)
var | cbrt (const var &a)
| Returns the cube root of the specified variable (C99). More...
var | ceil (const var &a)
| Return the ceiling of the specified variable (cmath). More...
var | cos (const var &a)
| Return the cosine of a radian-scaled variable (cmath). More...
var | cosh (const var &a)
| Return the hyperbolic cosine of the specified variable (cmath). More...
var | digamma (const stan::math::var &a)
var | erf (const var &a)
| The error function for variables (C99). More...
var | erfc (const var &a)
| The complementary error function for variables (C99). More...
var | exp (const var &a)
| Return the exponentiation of the specified variable (cmath). More...
var | exp2 (const var &a)
| Exponentiation base 2 function for variables (C99). More...
var | expm1 (const stan::math::var &a)
| The exponentiation of the specified variable minus 1 (C99). More...
var | fabs (const var &a)
| Return the absolute value of the variable (cmath). More...
var | falling_factorial (const var &a, const double &b)
var | falling_factorial (const var &a, const var &b)
var | falling_factorial (const double &a, const var &b)
var | fdim (const stan::math::var &a, const stan::math::var &b)
| Return the positive difference between the first variable's the value and the second's (C99). More...
var | fdim (const double &a, const stan::math::var &b)
| Return the positive difference between the first value and the value of the second variable (C99). More...
var | fdim (const stan::math::var &a, const double &b)
| Return the positive difference between the first variable's value and the second value (C99). More...
var | floor (const var &a)
| Return the floor of the specified variable (cmath). More...
var | fma (const stan::math::var &a, const stan::math::var &b, const stan::math::var &c)
| The fused multiply-add function for three variables (C99). More...
var | fma (const stan::math::var &a, const stan::math::var &b, const double &c)
| The fused multiply-add function for two variables and a value (C99). More...
var | fma (const stan::math::var &a, const double &b, const stan::math::var &c)
| The fused multiply-add function for a variable, value, and variable (C99). More...
var | fma (const stan::math::var &a, const double &b, const double &c)
| The fused multiply-add function for a variable and two values (C99). More...
var | fma (const double &a, const stan::math::var &b, const double &c)
| The fused multiply-add function for a value, variable, and value (C99). More...
var | fma (const double &a, const double &b, const stan::math::var &c)
| The fused multiply-add function for two values and a variable, and value (C99). More...
var | fma (const double &a, const stan::math::var &b, const stan::math::var &c)
| The fused multiply-add function for a value and two variables (C99). More...
var | fmax (const stan::math::var &a, const stan::math::var &b)
| Returns the maximum of the two variable arguments (C99). More...
var | fmax (const stan::math::var &a, const double &b)
| Returns the maximum of the variable and scalar, promoting the scalar to a variable if it is larger (C99). More...
var | fmax (const double &a, const stan::math::var &b)
| Returns the maximum of a scalar and variable, promoting the scalar to a variable if it is larger (C99). More...
var | fmin (const stan::math::var &a, const stan::math::var &b)
| Returns the minimum of the two variable arguments (C99). More...
var | fmin (const stan::math::var &a, double b)
| Returns the minimum of the variable and scalar, promoting the scalar to a variable if it is larger (C99). More...
var | fmin (double a, const stan::math::var &b)
| Returns the minimum of a scalar and variable, promoting the scalar to a variable if it is larger (C99). More...
var | fmod (const var &a, const var &b)
| Return the floating point remainder after dividing the first variable by the second (cmath). More...
var | fmod (const var &a, const double b)
| Return the floating point remainder after dividing the the first variable by the second scalar (cmath). More...
var | fmod (const double a, const var &b)
| Return the floating point remainder after dividing the first scalar by the second variable (cmath). More...
var | gamma_p (const stan::math::var &a, const stan::math::var &b)
var | gamma_p (const stan::math::var &a, const double &b)
var | gamma_p (const double &a, const stan::math::var &b)
var | gamma_q (const stan::math::var &a, const stan::math::var &b)
var | gamma_q (const stan::math::var &a, const double &b)
var | gamma_q (const double &a, const stan::math::var &b)
void | grad_inc_beta (var &g1, var &g2, const var &a, const var &b, const var &z)
var | hypot (const var &a, const var &b)
| Returns the length of the hypoteneuse of a right triangle with sides of the specified lengths (C99). More...
var | hypot (const var &a, double b)
| Returns the length of the hypoteneuse of a right triangle with sides of the specified lengths (C99). More...
var | hypot (double a, const var &b)
| Returns the length of the hypoteneuse of a right triangle with sides of the specified lengths (C99). More...
var | ibeta (const var &a, const var &b, const var &x)
| The normalized incomplete beta function of a, b, and x. More...
var | if_else (bool c, const var &y_true, const var &y_false)
| If the specified condition is true, return the first variable, otherwise return the second variable. More...
var | if_else (bool c, double y_true, const var &y_false)
| If the specified condition is true, return a new variable constructed from the first scalar, otherwise return the second variable. More...
var | if_else (bool c, const var &y_true, const double y_false)
| If the specified condition is true, return the first variable, otherwise return a new variable constructed from the second scalar. More...
var | inc_beta (const stan::math::var &a, const stan::math::var &b, const stan::math::var &c)
var | inv (const var &a)
| More...
var | inv_cloglog (const stan::math::var &a)
| Return the inverse complementary log-log function applied specified variable (stan). More...
var | inv_logit (const stan::math::var &a)
| The inverse logit function for variables (stan). More...
var | inv_sqrt (const var &a)
| More...
var | inv_square (const var &a)
| More...
int | is_inf (const var &v)
| Returns 1 if the input's value is infinite and 0 otherwise. More...
bool | is_nan (const var &v)
| Returns 1 if the input's value is NaN and 0 otherwise. More...
bool | is_uninitialized (var x)
| Returns `true` if the specified variable is uninitialized. More...
var | lgamma (const stan::math::var &a)
| The log gamma function for variables (C99). More...
var | lmgamma (int a, const stan::math::var &b)
var | log (const var &a)
| Return the natural log of the specified variable (cmath). More...
var | log10 (const var &a)
| Return the base 10 log of the specified variable (cmath). More...
var | log1m (const stan::math::var &a)
| The log (1 - x) function for variables. More...
var | log1m_exp (const stan::math::var &a)
| Return the log of 1 minus the exponential of the specified variable. More...
var | log1p (const stan::math::var &a)
| The log (1 + x) function for variables (C99). More...
var | log1p_exp (const stan::math::var &a)
| Return the log of 1 plus the exponential of the specified variable. More...
var | log2 (const stan::math::var &a)
| Returns the base 2 logarithm of the specified variable (C99). More...
var | log_diff_exp (const stan::math::var &a, const stan::math::var &b)
| Returns the log sum of exponentials. More...
var | log_diff_exp (const stan::math::var &a, const double &b)
| Returns the log sum of exponentials. More...
var | log_diff_exp (const double &a, const stan::math::var &b)
| Returns the log sum of exponentials. More...
var | log_falling_factorial (const var &a, const double &b)
var | log_falling_factorial (const var &a, const var &b)
var | log_falling_factorial (const double &a, const var &b)
void | log_mix_partial_helper (const double &theta_val, const double &lambda1_val, const double &lambda2_val, double &one_m_exp_lam2_m_lam1, double &one_m_t_prod_exp_lam2_m_lam1, double &one_d_t_plus_one_m_t_prod_exp_lam2_m_lam1)
template<typename T_theta , typename T_lambda1 , typename T_lambda2 >
return_type< T_theta, T_lambda1, T_lambda2 >::type | log_mix (const T_theta &theta, const T_lambda1 &lambda1, const T_lambda2 &lambda2)
| Return the log mixture density with specified mixing proportion and log densities and its derivative at each. More...
var | log_rising_factorial (const var &a, const double &b)
var | log_rising_factorial (const var &a, const var &b)
var | log_rising_factorial (const double &a, const var &b)
var | log_sum_exp (const stan::math::var &a, const stan::math::var &b)
| Returns the log sum of exponentials. More...
var | log_sum_exp (const stan::math::var &a, const double &b)
| Returns the log sum of exponentials. More...
var | log_sum_exp (const double &a, const stan::math::var &b)
| Returns the log sum of exponentials. More...
var | modified_bessel_first_kind (const int &v, const var &a)
var | modified_bessel_second_kind (const int &v, const var &a)
var | multiply_log (const var &a, const var &b)
| Return the value of a*log(b). More...
var | multiply_log (const var &a, const double b)
| Return the value of a*log(b). More...
var | multiply_log (const double a, const var &b)
| Return the value of a*log(b). More...
var | owens_t (const var &h, const var &a)
| The Owen's T function of h and a. More...
var | owens_t (const var &h, double a)
| The Owen's T function of h and a. More...
var | owens_t (double h, const var &a)
| The Owen's T function of h and a. More...
var | Phi (const stan::math::var &a)
| The unit normal cumulative density function for variables (stan). More...
var | Phi_approx (const stan::math::var &a)
| Approximation of the unit normal CDF for variables (stan). More...
var | pow (const var &base, const var &exponent)
| Return the base raised to the power of the exponent (cmath). More...
var | pow (const var &base, const double exponent)
| Return the base variable raised to the power of the exponent scalar (cmath). More...
var | pow (const double base, const var &exponent)
| Return the base scalar raised to the power of the exponent variable (cmath). More...
double | primitive_value (const var &v)
| Return the primitive double value for the specified auto-diff variable. More...
var | rising_factorial (const var &a, const double &b)
var | rising_factorial (const var &a, const var &b)
var | rising_factorial (const double &a, const var &b)
var | round (const var &a)
| Returns the rounded form of the specified variable (C99). More...
var | sin (const var &a)
| Return the sine of a radian-scaled variable (cmath). More...
var | sinh (const var &a)
| Return the hyperbolic sine of the specified variable (cmath). More...
var | sqrt (const var &a)
| Return the square root of the specified variable (cmath). More...
var | square (const var &x)
| Return the square of the input variable. More...
var | step (const stan::math::var &a)
| Return the step, or heaviside, function applied to the specified variable (stan). More...
var | tan (const var &a)
| Return the tangent of a radian-scaled variable (cmath). More...
var | tanh (const var &a)
| Return the hyperbolic tangent of the specified variable (cmath). More...
var | tgamma (const stan::math::var &a)
| Return the Gamma function applied to the specified variable (C99). More...
var | trunc (const var &a)
| Returns the truncatation of the specified variable (C99). More...
double | value_of (const var &v)
| Return the value of the specified variable. More...
double | value_of_rec (const var &v)
| Return the value of the specified variable. More...

## Variables

const double | CONSTRAINT_TOLERANCE = 1E-8
| The tolerance for checking arithmetic bounds In rank and in simplexes. More...
const double | E = boost::math::constants::e<double>()
| The base of the natural logarithm, . More...
const double | SQRT_2 = std::sqrt(2.0)
| The value of the square root of 2, . More...
const double | INV_SQRT_2 = 1.0 / SQRT_2
| The value of 1 over the square root of 2, . More...
const double | LOG_2 = std::log(2.0)
| The natural logarithm of 2, . More...
const double | LOG_10 = std::log(10.0)
| The natural logarithm of 10, . More...
const double | INFTY = std::numeric_limits<double>::infinity()
| Positive infinity. More...
const double | NEGATIVE_INFTY = - std::numeric_limits<double>::infinity()
| Negative infinity. More...
const double | NOT_A_NUMBER = std::numeric_limits<double>::quiet_NaN()
| (Quiet) not-a-number value. More...
const double | EPSILON = std::numeric_limits<double>::epsilon()
| Smallest positive value. More...
const double | NEGATIVE_EPSILON = - std::numeric_limits<double>::epsilon()
| Largest negative value (i.e., smallest absolute value). More...
const double | POISSON_MAX_RATE = std::pow(2.0, 30)
| Largest rate parameter allowed in Poisson RNG. More...
const double | LOG_PI_OVER_FOUR = std::log(boost::math::constants::pi<double>()) / 4.0
| Log pi divided by 4 . More...
const double | SQRT_PI = std::sqrt(boost::math::constants::pi<double>())
const double | SQRT_2_TIMES_SQRT_PI = SQRT_2 * SQRT_PI
const double | TWO_OVER_SQRT_PI = 2.0 / SQRT_PI
const double | NEG_TWO_OVER_SQRT_PI = -TWO_OVER_SQRT_PI
const double | INV_SQRT_TWO_PI = 1.0 / std::sqrt(2.0 * boost::math::constants::pi<double>())
const double | LOG_PI = std::log(boost::math::constants::pi<double>())
const double | LOG_SQRT_PI = std::log(SQRT_PI)
const double | LOG_ZERO = std::log(0.0)
const double | LOG_TWO = std::log(2.0)
const double | LOG_HALF = std::log(0.5)
const double | NEG_LOG_TWO = - LOG_TWO
const double | NEG_LOG_SQRT_TWO_PI = - std::log(std::sqrt(2.0 * boost::math::constants::pi<double>()))
const double | NEG_LOG_PI = - LOG_PI
const double | NEG_LOG_SQRT_PI = -std::log(std::sqrt(boost::math::constants::pi<double>()))
const double | NEG_LOG_TWO_OVER_TWO = - LOG_TWO / 2.0
const double | LOG_TWO_PI = LOG_TWO + LOG_PI
const double | NEG_LOG_TWO_PI = - LOG_TWO_PI
const std::string | MAJOR_VERSION = STAN_STRING(STAN_MATH_MAJOR)
| Major version number for Stan math library. More...
const std::string | MINOR_VERSION = STAN_STRING(STAN_MATH_MINOR)
| Minor version number for Stan math library. More...
const std::string | PATCH_VERSION = STAN_STRING(STAN_MATH_PATCH)
| Patch version for Stan math library. More...

## Detailed Description

Matrices and templated mathematical functions.

Templated probability distributions. All paramaterizations are based on Bayesian Data Analysis. Function gradients via reverse-mode automatic differentiation.

## Typedef Documentation

typedef AutodiffStackStorage<chainable, chainable_alloc> stan::math::ChainableStack

Definition at line 11 of file chainablestack.hpp.

typedef Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> stan::math::matrix_d

Type for matrix of double values.

Definition at line 23 of file typedefs.hpp.

typedef Eigen::Matrix<fvar<double>, Eigen::Dynamic, Eigen::Dynamic> stan::math::matrix_fd

Definition at line 17 of file typedefs.hpp.

typedef Eigen::Matrix<fvar<fvar<double> >, Eigen::Dynamic, Eigen::Dynamic> stan::math::matrix_ffd

Definition at line 21 of file typedefs.hpp.

typedef Eigen::Matrix<fvar<fvar<var> >, Eigen::Dynamic, Eigen::Dynamic> stan::math::matrix_ffv

Definition at line 18 of file typedefs.hpp.

typedef Eigen::Matrix<fvar<var>, Eigen::Dynamic, Eigen::Dynamic> stan::math::matrix_fv

Definition at line 14 of file typedefs.hpp.

typedef Eigen::Matrix<var, Eigen::Dynamic, Eigen::Dynamic> stan::math::matrix_v

The type of a matrix holding `stan::math::var` values.

Definition at line 21 of file typedefs.hpp.

typedef Eigen::Matrix<double, 1, Eigen::Dynamic> stan::math::row_vector_d

Type for (row) vector of double values.

Definition at line 37 of file typedefs.hpp.

typedef Eigen::Matrix<fvar<double>, 1, Eigen::Dynamic> stan::math::row_vector_fd

Definition at line 33 of file typedefs.hpp.

typedef Eigen::Matrix<fvar<fvar<double> >, 1, Eigen::Dynamic> stan::math::row_vector_ffd

Definition at line 37 of file typedefs.hpp.

typedef Eigen::Matrix<fvar<fvar<var> >, 1, Eigen::Dynamic> stan::math::row_vector_ffv

Definition at line 34 of file typedefs.hpp.

typedef Eigen::Matrix<fvar<var>, 1, Eigen::Dynamic> stan::math::row_vector_fv

Definition at line 30 of file typedefs.hpp.

typedef Eigen::Matrix<var, 1, Eigen::Dynamic> stan::math::row_vector_v

The type of a row vector holding `stan::math::var` values.

Definition at line 37 of file typedefs.hpp.

typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic >::Index stan::math::size_type

Type for sizes and indexes in an Eigen matrix with double e.

Definition at line 13 of file typedefs.hpp.

typedef Eigen::Matrix<double, Eigen::Dynamic, 1> stan::math::vector_d

Type for (column) vector of double values.

Definition at line 30 of file typedefs.hpp.

typedef Eigen::Matrix<fvar<double>, Eigen::Dynamic, 1> stan::math::vector_fd

Definition at line 25 of file typedefs.hpp.

typedef Eigen::Matrix<fvar<fvar<double> >, Eigen::Dynamic, 1> stan::math::vector_ffd

Definition at line 29 of file typedefs.hpp.

typedef Eigen::Matrix<fvar<fvar<var> >, Eigen::Dynamic, 1> stan::math::vector_ffv

Definition at line 26 of file typedefs.hpp.

typedef Eigen::Matrix<fvar<var>, Eigen::Dynamic, 1> stan::math::vector_fv

Definition at line 22 of file typedefs.hpp.

typedef Eigen::Matrix<var, Eigen::Dynamic, 1> stan::math::vector_v

The type of a (column) vector holding `stan::math::var` values.

Definition at line 29 of file typedefs.hpp.

## Function Documentation

template<typename T >

fvar<T> stan::math::abs | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file abs.hpp.

double stan::math::abs | ( | double | x | ) |

Return floating-point absolute value.

Delegates to `fabs(double)` rather than `std::abs(int)`.

Parameters

  x | scalar

Returns
  absolute value of scalar

Definition at line 19 of file abs.hpp.

var stan::math::abs | ( | const var & | a | ) |

inline

Return the absolute value of the variable (std).

Delegates to `fabs()` (see for doc).

Parameters

  a | Variable input.

Returns
  Absolute value of variable.

Definition at line 35 of file abs.hpp.

template<typename T >

fvar<T> stan::math::acos | ( | const fvar< T > & | x | ) |

inline

Definition at line 14 of file acos.hpp.

var stan::math::acos | ( | const var & | a | ) |

inline

Return the principal value of the arc cosine of a variable, in radians (cmath).

The derivative is defined by

.

Parameters

  a | Variable in range [-1, 1].

Returns
  Arc cosine of variable, in radians.

Definition at line 59 of file acos.hpp.

template<typename T >

fvar<T> stan::math::acosh | ( | const fvar< T > & | x | ) |

inline

Definition at line 14 of file acosh.hpp.

var stan::math::acosh | ( | const var & | a | ) |

inline

The inverse hyperbolic cosine function for variables (C99).

For non-variable function, see acosh().

The derivative is defined by

.

Parameters

  a | The variable.

Returns
  Inverse hyperbolic cosine of the variable.

Definition at line 63 of file acosh.hpp.

template<typename T1 , typename T2 , int R, int C>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R, C> stan::math::add | ( | const Eigen::Matrix< T1, R, C > & | m1,
|  | const Eigen::Matrix< T2, R, C > & | m2
| ) |  |

inline

Return the sum of the specified matrices.

The two matrices must have the same dimensions.

Template Parameters

  T1 | Scalar type of first matrix.
  T2 | Scalar type of second matrix.
  R | Row type of matrices.
  C | Column type of matrices.

Parameters

  m1 | First matrix.
  m2 | Second matrix.

Returns
  Sum of the matrices.

Exceptions

  std::invalid_argument | if m1 and m2 do not have the same dimensions.

Definition at line 27 of file add.hpp.

template<typename T1 , typename T2 , int R, int C>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R, C> stan::math::add | ( | const Eigen::Matrix< T1, R, C > & | m,
|  | const T2 & | c
| ) |  |

inline

Return the sum of the specified matrix and specified scalar.

Template Parameters

  T1 | Scalar type of matrix.
  T2 | Type of scalar.

Parameters

  m | Matrix.
  c | Scalar.

Returns
  The matrix plus the scalar.

Definition at line 52 of file add.hpp.

template<typename T1 , typename T2 , int R, int C>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R, C> stan::math::add | ( | const T1 & | c,
|  | const Eigen::Matrix< T2, R, C > & | m
| ) |  |

inline

Return the sum of the specified scalar and specified matrix.

Template Parameters

  T1 | Type of scalar.
  T2 | Scalar type of matrix.

Parameters

  c | Scalar.
  m | Matrix.

Returns
  The scalar plus the matrix.

Definition at line 74 of file add.hpp.

void stan::math::add_initial_values | ( | const std::vector< stan::math::var > & | y0,
|  | std::vector< std::vector< stan::math::var > > & | y
| ) |  |

Increment the state derived from the coupled system in the with the original initial state.

This is necessary because the coupled system subtracts out the initial state in its representation when the initial state is unknown.

Parameters

  [in] | y0 | original initial values to add back into the coupled system.
  [in,out] | y | state of the coupled system on input, incremented with initial values on output.

Definition at line 31 of file coupled_ode_system.hpp.

template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>

Eigen::Matrix<typename return_type<T1, T2>::type, Eigen::Dynamic, Eigen::Dynamic> stan::math::append_col | ( | const Eigen::Matrix< T1, R1, C1 > & | A,
|  | const Eigen::Matrix< T2, R2, C2 > & | B
| ) |  |

inline

Return the result of appending the second argument matrix after the first argument matrix, that is, putting them side by side, with the first matrix followed by the second matrix.

The inputs can be (matrix, matrix), (matrix, vector), (vector, matrix), or (vector, vector) and the output is always a matrix.

Template Parameters

  T1 | Scalar type of first matrix.
  T2 | Scalar type of second matrix.
  R1 | Row specification of first matrix.
  C1 | Column specification of first matrix.
  R2 | Row specification of second matrix.
  C2 | Column specification of second matrix.

Parameters

  A | First matrix.
  B | Second matrix.

Returns
  Result of appending the first matrix followed by the second matrix side by side.

Definition at line 39 of file append_col.hpp.

template<typename T1 , typename T2 , int C1, int C2>

Eigen::Matrix<typename return_type<T1, T2>::type, 1, Eigen::Dynamic> stan::math::append_col | ( | const Eigen::Matrix< T1, 1, C1 > & | A,
|  | const Eigen::Matrix< T2, 1, C2 > & | B
| ) |  |

inline

Return the result of concatenaing the first row vector followed by the second row vector side by side, with the result being a row vector.

This function applies to (row_vector, row_vector) and returns a row_vector.

Template Parameters

  T1 | Scalar type of first row vector.
  T2 | Scalar type of second row vector.
  C1 | Column specification of first row vector.
  C2 | Column specification of second row vector.

Parameters

  A | First vector.
  B | Second vector

Returns
  Result of appending the second row vector to the right of the first row vector.

Definition at line 85 of file append_col.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::append_col | ( | const Eigen::Matrix< T, R1, C1 > & | A,
|  | const Eigen::Matrix< T, R2, C2 > & | B
| ) |  |

inline

Return the result of appending the second argument matrix after the first argument matrix, that is, putting them side by side, with the first matrix followed by the second matrix.

This is an overloaded template function for the case when both matrices have the same type.

The inputs can be (matrix, matrix), (matrix, vector), (vector, matrix), or (vector, vector), and the output is always a matrix.

Template Parameters

  T | Scalar type of both matrices.
  R1 | Row specification of first matrix.
  C1 | Column specification of first matrix.
  R2 | Row specification of second matrix.
  C2 | Column specification of second matrix.

Parameters

  A | First matrix.
  B | Second matrix.

Returns
  Result of appending the first matrix followed by the second matrix side by side.

Definition at line 128 of file append_col.hpp.

template<typename T , int C1, int C2>

Eigen::Matrix<T, 1, Eigen::Dynamic> stan::math::append_col | ( | const Eigen::Matrix< T, 1, C1 > & | A,
|  | const Eigen::Matrix< T, 1, C2 > & | B
| ) |  |

inline

Return the result of concatenaing the first row vector followed by the second row vector side by side, with the result being a row vector.

This function applies to (row_vector, row_vector) and returns a row_vector.

Template Parameters

  T | Scalar type of both vectors.
  C1 | Column specification of first row vector.
  C2 | Column specification of second row vector.

Parameters

  A | First vector.
  B | Second vector

Returns
  Result of appending the second row vector to the right of the first row vector.

Definition at line 160 of file append_col.hpp.

template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>

Eigen::Matrix<typename return_type<T1, T2>::type, Eigen::Dynamic, Eigen::Dynamic> stan::math::append_row | ( | const Eigen::Matrix< T1, R1, C1 > & | A,
|  | const Eigen::Matrix< T2, R2, C2 > & | B
| ) |  |

inline

Return the result of stacking the rows of the first argument matrix on top of the second argument matrix.

The inputs can be (matrix, matrix), (matrix, row_vector), (row_vector, matrix), or (row_vector, row_vector), and the output is always a matrix.

Template Parameters

  T1 | Scalar type of first matrix.
  T2 | Scalar type of second matrix.
  R1 | Row specification of first matrix.
  C1 | Column specification of first matrix.
  R2 | Row specification of second matrix.
  C2 | Column specification of second matrix.

Parameters

  A | First matrix.
  B | Second matrix.

Returns
  Result of stacking first matrix on top of second.

Definition at line 37 of file append_row.hpp.

template<typename T1 , typename T2 , int R1, int R2>

Eigen::Matrix<typename return_type<T1, T2>::type, Eigen::Dynamic, 1> stan::math::append_row | ( | const Eigen::Matrix< T1, R1, 1 > & | A,
|  | const Eigen::Matrix< T2, R2, 1 > & | B
| ) |  |

inline

Return the result of stacking the first vector on top of the second vector, with the result being a vector.

This function applies to (vector, vector) and returns a vector.

Template Parameters

  T1 | Scalar type of first vector.
  T2 | Scalar type of second vector.
  R1 | Row specification of first vector.
  R2 | Row specification of second vector.

Parameters

  A | First vector.
  B | Second vector

Returns
  Result of stacking first vector on top of the second vector.

Definition at line 80 of file append_row.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::append_row | ( | const Eigen::Matrix< T, R1, C1 > & | A,
|  | const Eigen::Matrix< T, R2, C2 > & | B
| ) |  |

inline

Return the result of stacking the rows of the first argument matrix on top of the second argument matrix.

This is an overload for the case when the scalar types of the two input matrix are the same.

The inputs can be (matrix, matrix), (matrix, row_vector), (row_vector, matrix), or (row_vector, row_vector), and the output is always a matrix.

Template Parameters

  T | Scalar type of both matrices.
  R1 | Row specification of first matrix.
  C1 | Column specification of first matrix.
  R2 | Row specification of second matrix.
  C2 | Column specification of second matrix.

Parameters

  A | First matrix.
  B | Second matrix.

Returns
  Result of stacking first matrix on top of second.

Definition at line 121 of file append_row.hpp.

template<typename T , int R1, int R2>

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::append_row | ( | const Eigen::Matrix< T, R1, 1 > & | A,
|  | const Eigen::Matrix< T, R2, 1 > & | B
| ) |  |

inline

Return the result of stacking the first vector on top of the second vector, with the result being a vector.

This is an overloaded template function for the case where both inputs have the same scalar type.

This function applies to (vector, vector) and returns a vector.

Template Parameters

  T | Scalar type of both vectors.
  R1 | Row specification of first vector.
  R2 | Row specification of second vector.

Parameters

  A | First vector.
  B | Second vector

Returns
  Result of stacking first vector on top of the second vector.

Definition at line 155 of file append_row.hpp.

template<typename T >

bool stan::math::as_bool | ( | const T | x | ) |

inline

Return 1 if the argument is unequal to zero and 0 otherwise.

Parameters

  x | Value.

Returns
  1 if argument is equal to zero (or NaN) and 0 otherwise.

Definition at line 14 of file as_bool.hpp.

int stan::math::as_bool | ( | const var & | v | ) |

inline

Return 1 if the argument is unequal to zero and 0 otherwise.

Parameters

  v | Value.

Returns
  1 if argument is equal to zero (or NaN) and 0 otherwise.

Definition at line 15 of file as_bool.hpp.

template<typename T >

fvar<T> stan::math::asin | ( | const fvar< T > & | x | ) |

inline

Definition at line 12 of file asin.hpp.

var stan::math::asin | ( | const var & | a | ) |

inline

Return the principal value of the arc sine, in radians, of the specified variable (cmath).

The derivative is defined by

.

Parameters

  a | Variable in range [-1, 1].

Returns
  Arc sine of variable, in radians.

Definition at line 58 of file asin.hpp.

template<typename T >

fvar<T> stan::math::asinh | ( | const fvar< T > & | x | ) |

inline

Definition at line 13 of file asinh.hpp.

var stan::math::asinh | ( | const var & | a | ) |

inline

The inverse hyperbolic sine function for variables (C99).

For non-variable function, see asinh().

The derivative is defined by

.

Parameters

  a | The variable.

Returns
  Inverse hyperbolic sine of the variable.

Definition at line 62 of file asinh.hpp.

template<typename LHS , typename RHS >

void stan::math::assign | ( | LHS & | lhs,
|  | const RHS & | rhs
| ) |  |

inline

Copy the right-hand side's value to the left-hand side variable.

The `assign()` function is overloaded. This instance will match arguments where the right-hand side is assignable to the left and they are not both `std::vector` or `Eigen::Matrix` types.

Template Parameters

  LHS | Type of left-hand side.
  RHS | Type of right-hand side.

Parameters

  lhs | Left-hand side.
  rhs | Right-hand side.

Definition at line 36 of file assign.hpp.

template<typename LHS , typename RHS , int R1, int C1, int R2, int C2>

void stan::math::assign | ( | Eigen::Matrix< LHS, R1, C1 > & | x,
|  | const Eigen::Matrix< RHS, R2, C2 > & | y
| ) |  |

inline

Copy the right-hand side's value to the left-hand side variable.

The `assign()` function is overloaded. This instance will be called for arguments that are both `Eigen::Matrix` types, but whose shapes are not compatible. The shapes are specified in the row and column template parameters.

Template Parameters

  LHS | Type of left-hand side matrix elements.
  RHS | Type of right-hand side matrix elements.
  R1 | Row shape of left-hand side matrix.
  C1 | Column shape of left-hand side matrix.
  R2 | Row shape of right-hand side matrix.
  C2 | Column shape of right-hand side matrix.

Parameters

  x | Left-hand side matrix.
  y | Right-hand side matrix.

Exceptions

  std::invalid_argument |

Definition at line 62 of file assign.hpp.

template<typename LHS , typename RHS , int R, int C>

void stan::math::assign | ( | Eigen::Matrix< LHS, R, C > & | x,
|  | const Eigen::Matrix< RHS, R, C > & | y
| ) |  |

inline

Copy the right-hand side's value to the left-hand side variable.

The `assign()` function is overloaded. This instance will be called for arguments that are both `Eigen::Matrix` types and whose shapes match. The shapes are specified in the row and column template parameters.

Template Parameters

  LHS | Type of left-hand side matrix elements.
  RHS | Type of right-hand side matrix elements.
  R | Row shape of both matrices.
  C | Column shape of both mtarices.

Parameters

  x | Left-hand side matrix.
  y | Right-hand side matrix.

Exceptions

  std::invalid_argument | if sizes do not match.

Definition at line 94 of file assign.hpp.

template<typename LHS , typename RHS , int R, int C>

void stan::math::assign | ( | Eigen::Block< LHS > | x,
|  | const Eigen::Matrix< RHS, R, C > & | y
| ) |  |

inline

Copy the right-hand side's value to the left-hand side variable.

The `assign()` function is overloaded. This instance will be called for arguments that are both `Eigen::Matrix` types and whose shapes match. The shape of the right-hand side matrix is specified in the row and column shape template parameters.

Template Parameters

  LHS | Type of matrix block elements.
  RHS | Type of right-hand side matrix elements.
  R | Row shape for right-hand side matrix.
  C | Column shape for right-hand side matrix.

Parameters

  x | Left-hand side block view of matrix.
  y | Right-hand side matrix.

Exceptions

  std::invalid_argument | if sizes do not match.

Definition at line 123 of file assign.hpp.

template<typename LHS , typename RHS >

void stan::math::assign | ( | std::vector< LHS > & | x,
|  | const std::vector< RHS > & | y
| ) |  |

inline

Copy the right-hand side's value to the left-hand side variable.

The `assign()` function is overloaded. This instance will be called for arguments that are both `std::vector`, and will call `assign()` element-by element.

For example, a `std::vector<int>` can be assigned to a `std::vector<double>` using this function.

Template Parameters

  LHS | Type of left-hand side vector elements.
  RHS | Type of right-hand side vector elements.

Parameters

  x | Left-hand side vector.
  y | Right-hand side vector.

Exceptions

  std::invalid_argument | if sizes do not match.

Definition at line 155 of file assign.hpp.

template<typename T >

fvar<T> stan::math::atan | ( | const fvar< T > & | x | ) |

inline

Definition at line 12 of file atan.hpp.

var stan::math::atan | ( | const var & | a | ) |

inline

Return the principal value of the arc tangent, in radians, of the specified variable (cmath).

The derivative is defined by

.

Parameters

  a | Variable in range [-1, 1].

Returns
  Arc tangent of variable, in radians.

Definition at line 55 of file atan.hpp.

template<typename T >

fvar<T> stan::math::atan2 | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 12 of file atan2.hpp.

template<typename T >

fvar<T> stan::math::atan2 | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 21 of file atan2.hpp.

template<typename T >

fvar<T> stan::math::atan2 | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 29 of file atan2.hpp.

var stan::math::atan2 | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Return the principal value of the arc tangent, in radians, of the first variable divided by the second (cmath).

The partial derivatives are defined by

, and

.

Parameters

  a | Numerator variable.
  b | Denominator variable.

Returns
  The arc tangent of the fraction, in radians.

Definition at line 62 of file atan2.hpp.

var stan::math::atan2 | ( | const var & | a,
|  | const double | b
| ) |  |

inline

Return the principal value of the arc tangent, in radians, of the first variable divided by the second scalar (cmath).

The derivative with respect to the variable is

.

Parameters

  a | Numerator variable.
  b | Denominator scalar.

Returns
  The arc tangent of the fraction, in radians.

Definition at line 78 of file atan2.hpp.

var stan::math::atan2 | ( | const double | a,
|  | const var & | b
| ) |  |

inline

Return the principal value of the arc tangent, in radians, of the first scalar divided by the second variable (cmath).

The derivative with respect to the variable is

.

Parameters

  a | Numerator scalar.
  b | Denominator variable.

Returns
  The arc tangent of the fraction, in radians.

Definition at line 119 of file atan2.hpp.

template<typename T >

fvar<T> stan::math::atanh | ( | const fvar< T > & | x | ) |

inline

Definition at line 13 of file atanh.hpp.

var stan::math::atanh | ( | const var & | a | ) |

inline

The inverse hyperbolic tangent function for variables (C99).

For non-variable function, see atanh().

The derivative is defined by

.

Parameters

  a | The variable.

Returns
  Inverse hyperbolic tangent of the variable.

Definition at line 65 of file atanh.hpp.

template<typename T >

void stan::math::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

  T | Scalar type.

Parameters

  y | Input sequence.
  ac | Autocorrelations.
  fft | FFT engine instance.

Definition at line 54 of file autocorrelation.hpp.

template<typename T >

void stan::math::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

  T | Scalar type.

Parameters

  y | Input sequence.
  ac | Autocorrelations.

Definition at line 123 of file autocorrelation.hpp.

template<typename T >

void stan::math::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

  T | Scalar type.

Parameters

  y | Input sequence.
  acov | Autocovariance.
  fft | FFT engine instance.

Definition at line 34 of file autocovariance.hpp.

template<typename T >

void stan::math::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

  T | Scalar type.

Parameters

  y | Input sequence.
  acov | Autocovariances.

Definition at line 62 of file autocovariance.hpp.

template<typename T_n , typename T_prob >

return_type<T_prob>::type stan::math::bernoulli_ccdf_log | ( | const T_n & | n,
|  | const T_prob & | theta
| ) |  |

Definition at line 24 of file bernoulli_ccdf_log.hpp.

template<typename T_n , typename T_prob >

return_type<T_prob>::type stan::math::bernoulli_cdf | ( | const T_n & | n,
|  | const T_prob & | theta
| ) |  |

Definition at line 24 of file bernoulli_cdf.hpp.

template<typename T_n , typename T_prob >

return_type<T_prob>::type stan::math::bernoulli_cdf_log | ( | const T_n & | n,
|  | const T_prob & | theta
| ) |  |

Definition at line 24 of file bernoulli_cdf_log.hpp.

template<bool propto, typename T_n , typename T_prob >

return_type<T_prob>::type stan::math::bernoulli_log | ( | const T_n & | n,
|  | const T_prob & | theta
| ) |  |

Definition at line 26 of file bernoulli_log.hpp.

template<typename T_y , typename T_prob >

return_type<T_prob>::type stan::math::bernoulli_log | ( | const T_y & | n,
|  | const T_prob & | theta
| ) |  |

inline

Definition at line 120 of file bernoulli_log.hpp.

template<bool propto, typename T_n , typename T_prob >

return_type<T_prob>::type stan::math::bernoulli_logit_log | ( | const T_n & | n,
|  | const T_prob & | theta
| ) |  |

Definition at line 26 of file bernoulli_logit_log.hpp.

template<typename T_n , typename T_prob >

return_type<T_prob>::type stan::math::bernoulli_logit_log | ( | const T_n & | n,
|  | const T_prob & | theta
| ) |  |

inline

Definition at line 104 of file bernoulli_logit_log.hpp.

template<class RNG >

int stan::math::bernoulli_rng | ( | const double | theta,
|  | RNG & | rng
| ) |  |

inline

Definition at line 23 of file bernoulli_rng.hpp.

template<typename T >

fvar<T> stan::math::bessel_first_kind | ( | int | v,
|  | const fvar< T > & | z
| ) |  |

inline

Definition at line 15 of file bessel_first_kind.hpp.

var stan::math::bessel_first_kind | ( | const int & | v,
|  | const var & | a
| ) |  |

inline

Definition at line 27 of file bessel_first_kind.hpp.

template<typename T2 >

T2 stan::math::bessel_first_kind | ( | const int | v,
|  | const T2 | z
| ) |  |

inline

Definition at line 40 of file bessel_first_kind.hpp.

template<typename T >

fvar<T> stan::math::bessel_second_kind | ( | int | v,
|  | const fvar< T > & | z
| ) |  |

inline

Definition at line 15 of file bessel_second_kind.hpp.

var stan::math::bessel_second_kind | ( | const int & | v,
|  | const var & | a
| ) |  |

inline

Definition at line 27 of file bessel_second_kind.hpp.

template<typename T2 >

T2 stan::math::bessel_second_kind | ( | const int | v,
|  | const T2 | z
| ) |  |

inline

Definition at line 40 of file bessel_second_kind.hpp.

template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >

return_type<T_size1, T_size2>::type stan::math::beta_binomial_ccdf_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_ccdf_log.hpp.

template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >

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

Definition at line 29 of file beta_binomial_cdf.hpp.

template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >

return_type<T_size1, T_size2>::type stan::math::beta_binomial_cdf_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_cdf_log.hpp.

template<bool propto, typename T_n , typename T_N , typename T_size1 , typename T_size2 >

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

Definition at line 30 of file beta_binomial_log.hpp.

template<typename T_n , typename T_N , typename T_size1 , typename T_size2 >

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

Definition at line 175 of file beta_binomial_log.hpp.

template<class RNG >

int stan::math::beta_binomial_rng | ( | const int | N,
|  | const double | alpha,
|  | const double | beta,
|  | RNG & | rng
| ) |  |

inline

Definition at line 26 of file beta_binomial_rng.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::math::beta_ccdf_log | ( | const T_y & | y,
|  | const T_scale_succ & | alpha,
|  | const T_scale_fail & | beta
| ) |  |

Definition at line 34 of file beta_ccdf_log.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::math::beta_cdf | ( | const T_y & | y,
|  | const T_scale_succ & | alpha,
|  | const T_scale_fail & | beta
| ) |  |

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

Parameters

  y | A scalar variate.
  alpha | Prior sample size.
  beta | Prior sample size.

Returns
  The beta cdf evaluated at the specified arguments.

Template Parameters

  T_y | Type of y.
  T_scale_succ | Type of alpha.
  T_scale_fail | Type of beta.

Definition at line 46 of file beta_cdf.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::math::beta_cdf_log | ( | const T_y & | y,
|  | const T_scale_succ & | alpha,
|  | const T_scale_fail & | beta
| ) |  |

Definition at line 33 of file beta_cdf_log.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::math::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 a vector. Any vector inputs must be the same length.

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

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

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_y | Type of scalar outcome.
  T_scale_succ | Type of prior scale for successes.
  T_scale_fail | Type of prior scale for failures.

Definition at line 52 of file beta_log.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::math::beta_log | ( | const T_y & | y,
|  | const T_scale_succ & | alpha,
|  | const T_scale_fail & | beta
| ) |  |

inline

Definition at line 209 of file beta_log.hpp.

template<class RNG >

double stan::math::beta_rng | ( | const double | alpha,
|  | const double | beta,
|  | RNG & | rng
| ) |  |

inline

Definition at line 30 of file beta_rng.hpp.

template<typename T >

fvar<T> stan::math::binary_log_loss | ( | const int | y,
|  | const fvar< T > & | y_hat
| ) |  |

inline

Definition at line 15 of file binary_log_loss.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::binary_log_loss | ( | const int | y,
|  | const T | y_hat
| ) |  |

inline

Returns the log loss function for binary classification with specified reference and response values.

The log loss function for prediction given outcome is

, and

.

Parameters

  y | Reference value in { 0 , 1 }.
  y_hat | Response value in [0, 1].

Returns
  Log loss for response given reference value.

Definition at line 26 of file binary_log_loss.hpp.

var stan::math::binary_log_loss | ( | const int | y,
|  | const stan::math::var & | y_hat
| ) |  |

inline

The log loss function for variables (stan).

See stan::math::binary_log_loss() for the double-based version.

The derivative with respect to the variable is

, and

.

Parameters

  y | Reference value.
  y_hat | Response variable.

Returns
  Log loss of response versus reference value.

Definition at line 68 of file binary_log_loss.hpp.

template<typename T_n , typename T_N , typename T_prob >

return_type<T_prob>::type stan::math::binomial_ccdf_log | ( | const T_n & | n,
|  | const T_N & | N,
|  | const T_prob & | theta
| ) |  |

Definition at line 31 of file binomial_ccdf_log.hpp.

template<typename T_n , typename T_N , typename T_prob >

return_type<T_prob>::type stan::math::binomial_cdf | ( | const T_n & | n,
|  | const T_N & | N,
|  | const T_prob & | theta
| ) |  |

Definition at line 32 of file binomial_cdf.hpp.

template<typename T_n , typename T_N , typename T_prob >

return_type<T_prob>::type stan::math::binomial_cdf_log | ( | const T_n & | n,
|  | const T_N & | N,
|  | const T_prob & | theta
| ) |  |

Definition at line 31 of file binomial_cdf_log.hpp.

template<typename T >

fvar<T> stan::math::binomial_coefficient_log | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 16 of file binomial_coefficient_log.hpp.

template<typename T >

fvar<T> stan::math::binomial_coefficient_log | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 46 of file binomial_coefficient_log.hpp.

template<typename T_N , typename T_n >

boost::math::tools::promote_args<T_N, T_n>::type stan::math::binomial_coefficient_log | ( | const T_N | N,
|  | const T_n | n
| ) |  |

inline

Return the log of the binomial coefficient for the specified arguments.

The binomial coefficient, , read "N choose n", is defined for by

.

This function uses Gamma functions to define the log and generalize the arguments to continuous N and n.

.

Parameters

  N | total number of objects.
  n | number of objects chosen.

Returns
  log (N choose n).

Definition at line 63 of file binomial_coefficient_log.hpp.

template<typename T >

fvar<T> stan::math::binomial_coefficient_log | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 70 of file binomial_coefficient_log.hpp.

template<bool propto, typename T_n , typename T_N , typename T_prob >

return_type<T_prob>::type stan::math::binomial_log | ( | const T_n & | n,
|  | const T_N & | N,
|  | const T_prob & | theta
| ) |  |

Definition at line 36 of file binomial_log.hpp.

template<typename T_n , typename T_N , typename T_prob >

return_type<T_prob>::type stan::math::binomial_log | ( | const T_n & | n,
|  | const T_N & | N,
|  | const T_prob & | theta
| ) |  |

inline

Definition at line 127 of file binomial_log.hpp.

template<bool propto, typename T_n , typename T_N , typename T_prob >

return_type<T_prob>::type stan::math::binomial_logit_log | ( | const T_n & | n,
|  | const T_N & | N,
|  | const T_prob & | alpha
| ) |  |

Definition at line 37 of file binomial_logit_log.hpp.

template<typename T_n , typename T_N , typename T_prob >

return_type<T_prob>::type stan::math::binomial_logit_log | ( | const T_n & | n,
|  | const T_N & | N,
|  | const T_prob & | alpha
| ) |  |

inline

Definition at line 131 of file binomial_logit_log.hpp.

template<class RNG >

int stan::math::binomial_rng | ( | const int | N,
|  | const double | theta,
|  | RNG & | rng
| ) |  |

inline

Definition at line 31 of file binomial_rng.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::block | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m,
|  | size_t | i,
|  | size_t | j,
|  | size_t | nrows,
|  | size_t | ncols
| ) |  |

inline

Return a nrows x ncols submatrix starting at (i-1, j-1).

Parameters

  m | Matrix
  i | Starting row
  j | Starting column
  nrows | Number of rows in block
  ncols | Number of columns in block

Definition at line 23 of file block.hpp.

double stan::math::calculate_chain | ( | const double & | x,
|  | const double & | val
| ) |  |

inline

Definition at line 8 of file calculate_chain.hpp.

template<bool propto, typename T_prob >

boost::math::tools::promote_args<T_prob>::type stan::math::categorical_log | ( | int | n,
|  | const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > & | theta
| ) |  |

Definition at line 25 of file categorical_log.hpp.

template<typename T_prob >

boost::math::tools::promote_args<T_prob>::type stan::math::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 56 of file categorical_log.hpp.

template<bool propto, typename T_prob >

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

Definition at line 68 of file categorical_log.hpp.

template<typename T_prob >

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

inline

Definition at line 116 of file categorical_log.hpp.

template<bool propto, typename T_prob >

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

Definition at line 22 of file categorical_logit_log.hpp.

template<typename T_prob >

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

inline

Definition at line 45 of file categorical_logit_log.hpp.

template<bool propto, typename T_prob >

boost::math::tools::promote_args<T_prob>::type stan::math::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_log.hpp.

template<typename T_prob >

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

inline

Definition at line 89 of file categorical_logit_log.hpp.

template<class RNG >

int stan::math::categorical_rng | ( | const Eigen::Matrix< double, Eigen::Dynamic, 1 > & | theta,
|  | RNG & | rng
| ) |  |

inline

Definition at line 20 of file categorical_rng.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::cauchy_ccdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 24 of file cauchy_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >

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

Parameters

  y | A scalar variate.
  mu | The location parameter.
  sigma | The scale parameter.

Returns

Definition at line 36 of file cauchy_cdf.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::cauchy_cdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 24 of file cauchy_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::cauchy_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

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

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

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

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_y | Type of scalar outcome.
  T_loc | Type of location.
  T_scale | Type of scale.

Definition at line 43 of file cauchy_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::cauchy_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

inline

Definition at line 145 of file cauchy_log.hpp.

template<class RNG >

double stan::math::cauchy_rng | ( | const double | mu,
|  | const double | sigma,
|  | RNG & | rng
| ) |  |

inline

Definition at line 23 of file cauchy_rng.hpp.

template<typename T >

fvar<T> stan::math::cbrt | ( | const fvar< T > & | x | ) |

inline

Definition at line 14 of file cbrt.hpp.

var stan::math::cbrt | ( | const var & | a | ) |

inline

Returns the cube root of the specified variable (C99).

See cbrt() for the double-based version.

The derivative is

.

Parameters

  a | Specified variable.

Returns
  Cube root of the variable.

Definition at line 50 of file cbrt.hpp.

template<typename T >

fvar<T> stan::math::ceil | ( | const fvar< T > & | x | ) |

inline

Definition at line 11 of file ceil.hpp.

var stan::math::ceil | ( | const var & | a | ) |

inline

Return the ceiling of the specified variable (cmath).

The derivative of the ceiling function is defined and zero everywhere but at integers, and we set them to zero for convenience,

.

The ceiling function rounds up. For double values, this is the smallest integral value that is not less than the specified value. Although this function is not differentiable because it is discontinuous at integral values, its gradient is returned as zero everywhere.

Parameters

  a | Input variable.

Returns
  Ceiling of the variable.

Definition at line 60 of file ceil.hpp.

template<typename T_y , typename T_low , typename T_high >

bool stan::math::check_bounded | ( | const char * | function,
|  | const char * | name,
|  | const T_y & | y,
|  | const T_low & | low,
|  | const T_high & | high
| ) |  |

inline

Return `true` if the value is between the low and high values, inclusively.

Template Parameters

  T_y | Type of value
  T_low | Type of low value
  T_high | Type of high value

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Value to check
  low | Low bound
  high | High bound

Returns
  `true` if the value is between low and high, inclusively.

Exceptions

  <code>std::domain_error</code> | otherwise. This also throws if any of the arguments are NaN.

Definition at line 95 of file check_bounded.hpp.

template<typename T_y >

bool stan::math::check_cholesky_factor | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, Dynamic, Dynamic > & | y
| ) |  |

inline

Return `true` if the specified matrix is a valid Cholesky factor.

A Cholesky factor is a lower triangular matrix whose diagonal elements are all positive. Note that Cholesky factors need not be square, but require at least as many rows M as columns N (i.e., M >= N).

Template Parameters

  T_y | Type of elements of Cholesky factor

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Matrix to test

Returns
  `true` if the matrix is a valid Cholesky factor

Exceptions

  <code>std::domain_error</code> | if y is not a valid Choleksy factor, if number of rows is less than the number of columns, if there are 0 columns, or if any element in matrix is NaN

Definition at line 36 of file check_cholesky_factor.hpp.

template<typename T_y >

bool stan::math::check_cholesky_factor_corr | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, Dynamic, Dynamic > & | y
| ) |  |

Return `true` if the specified matrix is a valid Cholesky factor of a correlation matrix.

A Cholesky factor is a lower triangular matrix whose diagonal elements are all positive. Note that Cholesky factors need not be square, but require at least as many rows M as columns N (i.e., M >= N).

Tolerance is specified by `math::CONSTRAINT_TOLERANCE`.

Template Parameters

  T_y | Type of elements of Cholesky factor

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Matrix to test

Returns
  `true` if the matrix is a valid Cholesky factor of a correlation matrix

Exceptions

  <code>std::domain_error</code> | if y is not a valid Choleksy factor, if number of rows is less than the number of columns, if there are 0 columns, or if any element in matrix is NaN

Definition at line 40 of file check_cholesky_factor_corr.hpp.

template<typename T_y , int R, int C>

bool stan::math::check_column_index | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, R, C > & | y,
|  | const size_t | i
| ) |  |

inline

Return `true` if the specified index is a valid column of the matrix.

By default, this is a 1-indexed check (as opposed to 0-indexed). Behavior can be changed by setting `stan::error_index::value`. This function will throw an `std::out_of_range` exception if the index is out of bounds.

Template Parameters

  T_y | Type of scalar.
  R | Number of rows of the matrix
  C | Number of columns of the matrix

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Matrix
  i | Index to check

Returns
  `true` if the index is a valid column index of the matrix.

Exceptions

  std::out_of_range | if index is an invalid column index

Definition at line 37 of file check_column_index.hpp.

template<typename T >

bool stan::math::check_consistent_size | ( | const char * | function,
|  | const char * | name,
|  | const T & | x,
|  | size_t | expected_size
| ) |  |

inline

Return `true` if the dimension of x is consistent, which is defined to be `expected_size` if x is a vector or 1 if x is not a vector.

Template Parameters

  T | Type of value

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  x | Variable to check for consistent size
  expected_size | Expected size if x is a vector

Returns
  `true` if x is scalar or if x is vector-like and has size of `expected_size`

Exceptions

  <code>invalid_argument</code> | if the size is inconsistent

Definition at line 29 of file check_consistent_size.hpp.

template<typename T1 , typename T2 >

bool stan::math::check_consistent_sizes | ( | const char * | function,
|  | const char * | name1,
|  | const T1 & | x1,
|  | const char * | name2,
|  | const T2 & | x2
| ) |  |

inline

Return `true` if the dimension of x1 is consistent with x2.

Consistent size is defined as having the same size if vector-like or being a scalar.

Template Parameters

  T1 | Type of x1
  T2 | Type of x2

Parameters

  function | Function name (for error messages)
  name1 | Variable name (for error messages)
  x1 | Variable to check for consistent size
  name2 | Variable name (for error messages)
  x2 | Variable to check for consistent size

Returns
  `true` if x1 and x2 have consistent sizes

Exceptions

  <code>invalid_argument</code> | if sizes are inconsistent

Definition at line 31 of file check_consistent_sizes.hpp.

template<typename T1 , typename T2 , typename T3 >

bool stan::math::check_consistent_sizes | ( | const char * | function,
|  | const char * | name1,
|  | const T1 & | x1,
|  | const char * | name2,
|  | const T2 & | x2,
|  | const char * | name3,
|  | const T3 & | x3
| ) |  |

inline

Return `true` if the dimension of x1, x2, and x3 are consistent.

Consistent size is defined as having the same size if vector-like or being a scalar.

Template Parameters

  T1 | Type of x1
  T2 | Type of x2
  T3 | Type of x3

Parameters

  function | Function name (for error messages)
  name1 | Variable name (for error messages)
  x1 | Variable to check for consistent size
  name2 | Variable name (for error messages)
  x2 | Variable to check for consistent size
  name3 | Variable name (for error messages)
  x3 | Variable to check for consistent size

Returns
  `true` if x1, x2, and x3 have consistent sizes

Exceptions

  <code>invalid_argument</code> | if sizes are inconsistent

Definition at line 66 of file check_consistent_sizes.hpp.

template<typename T1 , typename T2 , typename T3 , typename T4 >

bool stan::math::check_consistent_sizes | ( | const char * | function,
|  | const char * | name1,
|  | const T1 & | x1,
|  | const char * | name2,
|  | const T2 & | x2,
|  | const char * | name3,
|  | const T3 & | x3,
|  | const char * | name4,
|  | const T4 & | x4
| ) |  |

inline

Return `true` if the dimension of x1, x2, x3, and x4 are consistent.

Consistent size is defined as having the same size if vector-like or being a scalar.

Template Parameters

  T1 | Type of x1
  T2 | Type of x2
  T3 | Type of x3
  T4 | Type of x4

Parameters

  function | Function name (for error messages)
  name1 | Variable name (for error messages)
  x1 | Variable to check for consistent size
  name2 | Variable name (for error messages)
  x2 | Variable to check for consistent size
  name3 | Variable name (for error messages)
  x3 | Variable to check for consistent size
  name4 | Variable name (for error messages)
  x4 | Variable to check for consistent size

Returns
  `true` if x1, x2, x3, and x4 have consistent sizes

Exceptions

  <code>invalid_argument</code> | if sizes are inconsistent

Definition at line 107 of file check_consistent_sizes.hpp.

template<typename T1 , typename T2 , typename T3 , typename T4 , typename T5 >

bool stan::math::check_consistent_sizes | ( | const char * | function,
|  | const char * | name1,
|  | const T1 & | x1,
|  | const char * | name2,
|  | const T2 & | x2,
|  | const char * | name3,
|  | const T3 & | x3,
|  | const char * | name4,
|  | const T4 & | x4,
|  | const char * | name5,
|  | const T5 & | x5
| ) |  |

inline

Definition at line 128 of file check_consistent_sizes.hpp.

template<typename T_y >

bool stan::math::check_corr_matrix | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, Dynamic, Dynamic > & | y
| ) |  |

inline

Return `true` if the specified matrix is a valid correlation matrix.

A valid correlation matrix is symmetric, has a unit diagonal (all 1 values), and has all values between -1 and 1 (inclusive).

This function throws exceptions if the variable is not a valid correlation matrix.

Template Parameters

  T_y | Type of scalar

Parameters

  function | Name of the function this was called from
  name | Name of the variable
  y | Matrix to test

Returns
  `true` if the specified matrix is a valid correlation matrix

Exceptions

  <code>std::invalid_argument</code> | if the matrix is not square or if the matrix is 0x0
  <code>std::domain_error</code> | if the matrix is non-symmetric, diagonals not near 1, not positive definite, or any of the elements nan.

Definition at line 46 of file check_corr_matrix.hpp.

template<typename T_y >

bool stan::math::check_cov_matrix | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, Dynamic, Dynamic > & | y
| ) |  |

inline

Return `true` if the specified matrix is a valid covariance matrix.

A valid covariance matrix is a square, symmetric matrix that is positive definite.

Template Parameters

  T | Type of scalar.

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Matrix to test

Returns
  `true` if the matrix is a valid covariance matrix

Exceptions

  <code>std::invalid_argument</code> | if the matrix is not square or if the matrix is 0x0
  <code>std::domain_error</code> | if the matrix is not symmetric, if the matrix is not positive definite, or if any element of the matrix is nan

Definition at line 32 of file check_cov_matrix.hpp.

template<typename T_y , typename T_eq >

bool stan::math::check_equal | ( | const char * | function,
|  | const char * | name,
|  | const T_y & | y,
|  | const T_eq & | eq
| ) |  |

inline

Return `true` if `y` is equal to `eq`.

This function is vectorized over both `y` and `eq`. If both `y` and `eq` are scalar or vector-like, then each element is compared in order. If one of `y` or `eq` are vector and the other is scalar, then the scalar is broadcast to the size of the vector.

Template Parameters

  T_y | Type of variable
  T_eq | Type of comparison

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Variable to check equality
  eq | Expected value for y

Returns
  `true` if y is equal to eq

Exceptions

  <code>std::domain_error</code> | if y is unequal to eq or if any element of y or eq is NaN.

Definition at line 90 of file check_equal.hpp.

template<typename T_y >

bool stan::math::check_finite | ( | const char * | function,
|  | const char * | name,
|  | const T_y & | y
| ) |  |

inline

Return `true` if `y` is finite.

This function is vectorized and will check each element of `y`.

Template Parameters

  T_y | Type of y

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Variable to check

Returns
  `true` if y is finite.

Exceptions

  <code>domain_error</code> | if y is infinity, -infinity, or NaN.

Definition at line 62 of file check_finite.hpp.

template<typename T_y , typename T_low >

bool stan::math::check_greater | ( | const char * | function,
|  | const char * | name,
|  | const T_y & | y,
|  | const T_low & | low
| ) |  |

inline

Return `true` if `y` is strictly greater than `low`.

This function is vectorized and will check each element of `y` against each element of `low`.

Template Parameters

  T_y | Type of y
  T_low | Type of lower bound

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Variable to check
  low | Lower bound

Returns
  `true` if y is strictly greater than low.

Exceptions

  <code>domain_error</code> | if y is not greater than low or if any element of y or low is NaN.

Definition at line 84 of file check_greater.hpp.

template<typename T_y , typename T_low >

bool stan::math::check_greater_or_equal | ( | const char * | function,
|  | const char * | name,
|  | const T_y & | y,
|  | const T_low & | low
| ) |  |

inline

Return `true` if `y` is greater or equal than `low`.

This function is vectorized and will check each element of `y` against each element of `low`.

Template Parameters

  T_y | Type of y
  T_low | Type of lower bound

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Variable to check
  low | Lower bound

Returns
  `true` if y is greater or equal than low.

Exceptions

  <code>domain_error</code> | if y is not greater or equal to low or if any element of y or low is NaN.

Definition at line 84 of file check_greater_or_equal.hpp.

template<typename T , int R, int C>

bool stan::math::check_ldlt_factor | ( | const char * | function,
|  | const char * | name,
|  | stan::math::LDLT_factor< T, R, C > & | A
| ) |  |

inline

Return `true` if the argument is a valid `stan::math::LDLT_factor`.

`LDLT_factor` can be constructed in an invalid state, so it must be checked. A invalid `LDLT_factor` is constructed from a non positive definite matrix.

Template Parameters

  T | Type of scalar
  R | Rows of the matrix
  C | Columns of the matrix

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  A | `stan::math::LDLT_factor` to check for validity.

Returns
  `true` if the matrix is positive definite.
  throws `std::domain_error` the LDLT_factor was created improperly (A.success() == false)

Definition at line 34 of file check_ldlt_factor.hpp.

template<typename T_y , typename T_high >

bool stan::math::check_less | ( | const char * | function,
|  | const char * | name,
|  | const T_y & | y,
|  | const T_high & | high
| ) |  |

inline

Return `true` if `y` is strictly less than `high`.

This function is vectorized and will check each element of `y` against each element of `high`.

Template Parameters

  T_y | Type of y
  T_high | Type of upper bound

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Variable to check
  high | Upper bound

Returns
  `true` if y is strictly less than low.

Exceptions

  <code>domain_error</code> | if y is not less than low or if any element of y or high is NaN.

Definition at line 81 of file check_less.hpp.

template<typename T_y , typename T_high >

bool stan::math::check_less_or_equal | ( | const char * | function,
|  | const char * | name,
|  | const T_y & | y,
|  | const T_high & | high
| ) |  |

inline

Return `true` if `y` is less or equal to `high`.

This function is vectorized and will check each element of `y` against each element of `high`.

Template Parameters

  T_y | Type of y
  T_high | Type of upper bound

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Variable to check
  high | Upper bound

Returns
  `true` if y is less than or equal to low.

Exceptions

  <code>std::domain_error</code> | if y is not less than or equal to low or if any element of y or high is NaN.

Definition at line 81 of file check_less_or_equal.hpp.

template<typename T_y >

bool stan::math::check_lower_triangular | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, Dynamic, Dynamic > & | y
| ) |  |

inline

Return `true` if the specified matrix is lower triangular.

A matrix x is not lower triangular if there is a non-zero entry x[m, n] with m < n. This function only inspects the upper triangular portion of the matrix, not including the diagonal.

Template Parameters

  T | Type of scalar of the matrix

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Matrix to test

Returns
  `true` if the matrix is lower triangular.

Exceptions

  <code>std::domain_error</code> | if the matrix is not lower triangular or if any element in the upper triangular portion is NaN

Definition at line 35 of file check_lower_triangular.hpp.

template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>

bool stan::math::check_matching_dims | ( | const char * | function,
|  | const char * | name1,
|  | const Eigen::Matrix< T1, R1, C1 > & | y1,
|  | const char * | name2,
|  | const Eigen::Matrix< T2, R2, C2 > & | y2
| ) |  |

inline

Return `true` if the two matrices are of the same size.

This function checks not only the runtime sizes, but the static sizes as well. For example, a 4x1 matrix is not the same as a vector with 4 elements.

Template Parameters

  T1 | Scalar type of the first matrix
  T2 | Scalar type of the second matrix
  R1 | Rows specified at compile time of the first matrix
  C1 | Columns specified at compile time of the first matrix
  R2 | Rows specified at compile time of the second matrix
  C2 | Columns specified at compile time of the second matrix

Parameters

  function | Function name (for error messages)
  name1 | Variable name for the first matrix (for error messages)
  y1 | First matrix
  name2 | Variable name for the second matrix (for error messages)
  y2 | Second matrix

Returns
  `true` if the dimensions of the two matrices match

Exceptions

  <code>std::invalid_argument</code> | if the dimensions of the matrices do not match

Definition at line 37 of file check_matching_dims.hpp.

template<typename T_y1 , typename T_y2 >

bool stan::math::check_matching_sizes | ( | const char * | function,
|  | const char * | name1,
|  | const T_y1 & | y1,
|  | const char * | name2,
|  | const T_y2 & | y2
| ) |  |

inline

Return `true` if two structures at the same size.

This function only checks the runtime sizes for variables that implement a `size()` method.

Template Parameters

  T_y1 | Type of the first variable
  T_y2 | Type of the second variable

Parameters

  function | Function name (for error messages)
  name1 | First variable name (for error messages)
  y1 | First variable
  name2 | Second variable name (for error messages)
  y2 | Second variable

Returns
  `true` if the sizes match

Exceptions

  <code>std::invalid_argument</code> | if the sizes do not match

Definition at line 29 of file check_matching_sizes.hpp.

template<typename T1 , typename T2 >

bool stan::math::check_multiplicable | ( | const char * | function,
|  | const char * | name1,
|  | const T1 & | y1,
|  | const char * | name2,
|  | const T2 & | y2
| ) |  |

inline

Return `true` if the matrices can be multiplied.

This checks the runtime sizes to determine whether the two matrices are multiplicable. This allows Eigen matrices, vectors, and row vectors to be checked.

Template Parameters

  T1 | Type of first matrix
  T2 | Type of second matrix

Parameters

  function | Function name (for error messages)
  name1 | Variable name for the first matrix (for error messages)
  y1 | First matrix
  name2 | Variable name for the second matrix (for error messages)
  y2 | Second matrix

Returns
  `true` if the two matrices are multiplicable

Exceptions

  <code>std::invalid_argument</code> | if the matrices are not multiplicable or if either matrix is size 0 for either rows or columns

Definition at line 33 of file check_multiplicable.hpp.

template<typename T_y >

bool stan::math::check_nonnegative | ( | const char * | function,
|  | const char * | name,
|  | const T_y & | y
| ) |  |

inline

Return `true` if `y` is non-negative.

This function is vectorized and will check each element of `y`.

Template Parameters

  T_y | Type of y

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Variable to check

Returns
  `true` if y is greater than or equal to 0.

Exceptions

  <code>domain_error</code> | if y is negative or if any element of y is NaN.

Definition at line 66 of file check_nonnegative.hpp.

template<typename T_y >

bool stan::math::check_nonzero_size | ( | const char * | function,
|  | const char * | name,
|  | const T_y & | y
| ) |  |

inline

Return `true` if the specified matrix/vector is of non-zero size.

Throws a std:invalid_argument otherwise. The message will indicate that the variable name "has size 0".

Template Parameters

  T_y | Type of container

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Container to test. This will accept matrices and vectors

Returns
  `true` if the the specified matrix/vector is of non-zero size

Exceptions

  <code>std::invalid_argument</code> | if the specified matrix/vector has zero size

Definition at line 31 of file check_nonzero_size.hpp.

template<typename T_y >

bool stan::math::check_not_nan | ( | const char * | function,
|  | const char * | name,
|  | const T_y & | y
| ) |  |

inline

Return `true` if `y` is not `NaN`.

This function is vectorized and will check each element of `y`. If any element is `NaN`, this function will throw an exception.

Template Parameters

  T_y | Type of y

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Variable to check

Returns
  `true` if y is not NaN.

Exceptions

  <code>domain_error</code> | if any element of y is NaN.

Definition at line 63 of file check_not_nan.hpp.

template<typename T_y >

bool stan::math::check_ordered | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > & | y
| ) |  |

Return `true` if the specified vector is sorted into strictly increasing order.

Template Parameters

  T_y | Type of scalar

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Vector to test

Returns
  `true` if the vector is ordered

Exceptions

  <code>std::domain_error</code> | if the vector elements are not ordered, if there are duplicated values, or if any element is `NaN`.

Definition at line 31 of file check_ordered.hpp.

template<typename T_y >

bool stan::math::check_ordered | ( | const char * | function,
|  | const char * | name,
|  | const std::vector< T_y > & | y
| ) |  |

Return `true` if the specified vector is sorted into strictly increasing order.

Template Parameters

  T_y | Type of scalar

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | `std::vector` to test

Returns
  `true` if the vector is ordered

Exceptions

  <code>std::domain_error</code> | if the vector elements are not ordered, if there are duplicated values, or if any element is `NaN`.

Definition at line 78 of file check_ordered.hpp.

template<typename T_y >

bool stan::math::check_pos_definite | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, Dynamic, Dynamic > & | y
| ) |  |

inline

Return `true` if the specified square, symmetric matrix is positive definite.

Template Parameters

  T_y | Type of scalar of the matrix

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Matrix to test

Returns
  `true` if the matrix is positive definite

Exceptions

  <code>std::invalid_argument</code> | if the matrix is not square or if the matrix has 0 size.
  <code>std::domain_error</code> | if the matrix is not symmetric, if it is not positive definite, or if any element is `NaN`.

Definition at line 38 of file check_pos_definite.hpp.

template<typename T_y >

bool stan::math::check_pos_semidefinite | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, Dynamic, Dynamic > & | y
| ) |  |

inline

Return `true` if the specified matrix is positive definite.

Template Parameters

  T_y | scalar type of the matrix

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Matrix to test

Returns
  `true` if the matrix is positive semi-definite.

Exceptions

  <code>std::invalid_argument</code> | if the matrix is not square or if the matrix has 0 size.
  <code>std::domain_error</code> | if the matrix is not symmetric, or if it is not positive semi-definite, or if any element of the matrix is `NaN`.

Definition at line 36 of file check_pos_semidefinite.hpp.

template<typename T_y >

bool stan::math::check_positive | ( | const char * | function,
|  | const char * | name,
|  | const T_y & | y
| ) |  |

inline

Return `true` if `y` is positive.

This function is vectorized and will check each element of `y`.

Template Parameters

  T_y | Type of y

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Variable to check

Returns
  `true` if y is greater than 0.

Exceptions

  <code>domain_error</code> | if y is negative or zero or if any element of y is NaN.

Definition at line 68 of file check_positive.hpp.

template<typename T_y >

bool stan::math::check_positive_finite | ( | const char * | function,
|  | const char * | name,
|  | const T_y & | y
| ) |  |

inline

Return `true` if `y` is positive and finite.

This function is vectorized and will check each element of `y`.

Template Parameters

  T_y | Type of y

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Variable to check

Returns
  `true` if every element of y is greater than 0 and y is not infinite.

Exceptions

  <code>domain_error</code> | if any element of y is not positive or if any element of y is NaN.

Definition at line 28 of file check_positive_finite.hpp.

template<typename T_y >

bool stan::math::check_positive_ordered | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > & | y
| ) |  |

Return `true` if the specified vector contains non-negative values and is sorted into strictly increasing order.

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Vector to test

Returns
  `true` if the vector is positive, ordered

Exceptions

  <code>std::domain_error</code> | if the vector contains non-positive values, if the values are not ordered, if there are duplicated values, or if any element is `NaN`.

Definition at line 32 of file check_positive_ordered.hpp.

bool stan::math::check_positive_size | ( | const char * | function,
|  | const char * | name,
|  | const char * | expr,
|  | const int | size
| ) |  |

inline

Return `true` if `size` is positive.

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  expr | Expression for the dimension size (for error messages)
  size | Size value to check

Returns
  `true` if `size` is greater than 0.

Exceptions

  <code>std::invalid_argument</code> | if `size` is zero or negative.

Definition at line 23 of file check_positive_size.hpp.

bool stan::math::check_range | ( | const char * | function,
|  | const char * | name,
|  | const int | max,
|  | const int | index,
|  | const int | nested_level,
|  | const char * | error_msg
| ) |  |

inline

Return `true` if specified index is within range.

This check is 1-indexed by default. This behavior can be changed by setting `stan::error_index::value`.

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  max | Maximum size of the variable
  index | Index to check
  nested_level | Nested level (for error messages)
  error_msg | Additional error message (for error messages)

Returns
  `true` if the index is within range

Exceptions

  <code>std::out_of_range</code> | if the index is not in range

Definition at line 29 of file check_range.hpp.

bool stan::math::check_range | ( | const char * | function,
|  | const char * | name,
|  | const int | max,
|  | const int | index,
|  | const char * | error_msg
| ) |  |

inline

Return `true` if specified index is within range.

This check is 1-indexed by default. This behavior can be changed by setting `stan::error_index::value`.

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  max | Maximum size of the variable
  index | Index to check
  error_msg | Additional error message (for error messages)

Returns
  `true` if the index is within range

Exceptions

  <code>std::out_of_range</code> | if the index is not in range

Definition at line 62 of file check_range.hpp.

bool stan::math::check_range | ( | const char * | function,
|  | const char * | name,
|  | const int | max,
|  | const int | index
| ) |  |

inline

Return `true` if specified index is within range.

This check is 1-indexed by default. This behavior can be changed by setting `stan::error_index::value`.

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  max | Maximum size of the variable
  index | Index to check

Returns
  `true` if the index is within range

Exceptions

  <code>std::out_of_range</code> | if the index is not in range

Definition at line 89 of file check_range.hpp.

template<typename T_y , int R, int C>

bool stan::math::check_row_index | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, R, C > & | y,
|  | size_t | i
| ) |  |

inline

Return `true` if the specified index is a valid row of the matrix.

This check is 1-indexed by default. This behavior can be changed by setting `stan::error_index::value`.

Template Parameters

  T | Scalar type
  R | Compile time rows
  C | Compile time columns

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Matrix to test
  i | is index

Returns
  `true` if the index is a valid row index in the matrix

Exceptions

  <code>std::out_of_range</code> | if the index is out of range.

Definition at line 32 of file check_row_index.hpp.

template<typename T_prob >

bool stan::math::check_simplex | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > & | theta
| ) |  |

Return `true` if the specified vector is simplex.

To be a simplex, all values must be greater than or equal to 0 and the values must sum to 1.

A valid simplex is one where the sum of hte elements is equal to 1. This function tests that the sum is within the tolerance specified by `CONSTRAINT_TOLERANCE`. This function only accepts Eigen vectors, statically typed vectors, not general matrices with 1 column.

Template Parameters

  T_prob | Scalar type of the vector

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  theta | Vector to test.

Returns
  `true` if the vector is a simplex

Exceptions

  <code>std::invalid_argument</code> | if `theta` is a 0-vector.
  <code>std::domain_error</code> | if the vector is not a simplex or if any element is `NaN`.

Definition at line 41 of file check_simplex.hpp.

template<typename T_size1 , typename T_size2 >

bool stan::math::check_size_match | ( | const char * | function,
|  | const char * | name_i,
|  | T_size1 | i,
|  | const char * | name_j,
|  | T_size2 | j
| ) |  |

inline

Return `true` if the provided sizes match.

Template Parameters

  T_size1 | Type of size 1
  T_size2 | Type of size 2

Parameters

  function | Function name (for error messages)
  name_i | Variable name 1 (for error messages)
  i | Size 1
  name_j | Variable name 2 (for error messages)
  j | Size 2

Returns
  `true` if the sizes match

Exceptions

  <code>std::invalid_argument</code> | if the sizes do not match

Definition at line 30 of file check_size_match.hpp.

template<typename T_size1 , typename T_size2 >

bool stan::math::check_size_match | ( | const char * | function,
|  | const char * | expr_i,
|  | const char * | name_i,
|  | T_size1 | i,
|  | const char * | expr_j,
|  | const char * | name_j,
|  | T_size2 | j
| ) |  |

inline

Return `true` if the provided sizes match.

Template Parameters

  T_size1 | Type of size 1
  T_size2 | Type of size 2

Parameters

  function | Function name (for error messages)
  expr_i | Expression for variable name 1 (for error messages)
  name_i | Variable name 1 (for error messages)
  i | Size 1
  expr_j | Expression for variable name 2 (for error messages)
  name_j | Variable name 2 (for error messages)
  j | Size 2

Returns
  `true` if the sizes match

Exceptions

  <code>std::invalid_argument</code> | if the sizes do not match

Definition at line 67 of file check_size_match.hpp.

template<typename T_y >

bool stan::math::check_spsd_matrix | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, Dynamic, Dynamic > & | y
| ) |  |

inline

Return `true` if the specified matrix is a square, symmetric, and positive semi-definite.

Template Parameters

  T | Scalar type of the matrix

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Matrix to test

Returns
  `true` if the matrix is a square, symmetric, and positive semi-definite.

Exceptions

  <code>std::invalid_argument</code> | if the matrix is not square or if the matrix is 0x0
  <code>std::domain_error</code> | if the matrix is not symmetric or if the matrix is not positive semi-definite

Definition at line 32 of file check_spsd_matrix.hpp.

template<typename T_y >

bool stan::math::check_square | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > & | y
| ) |  |

inline

Return `true` if the specified matrix is square.

This check allows 0x0 matrices.

Template Parameters

  T | Type of scalar.

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Matrix to test

Returns
  `true` if the matrix is a square matrix.

Exceptions

  <code>std::invalid_argument</code> | if the matrix is not square

Definition at line 28 of file check_square.hpp.

template<typename T >

bool stan::math::check_std_vector_index | ( | const char * | function,
|  | const char * | name,
|  | const std::vector< T > & | y,
|  | int | i
| ) |  |

inline

Return `true` if the specified index is valid in std vector.

This check is 1-indexed by default. This behavior can be changed by setting `stan::error_index::value`.

Template Parameters

  T | Scalar type

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | `std::vector` to test
  i | Index

Returns
  `true` if the index is a valid in std vector.

Exceptions

  <code>std::out_of_range</code> | if the index is out of range.

Definition at line 30 of file check_std_vector_index.hpp.

template<typename T_y >

bool stan::math::check_symmetric | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_y, Dynamic, Dynamic > & | y
| ) |  |

inline

Return `true` if the specified matrix is symmetric.

The error message is either 0 or 1 indexed, specified by `stan::error_index::value`.

Template Parameters

  T_y | Type of scalar.

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  y | Matrix to test

Returns
  `true` if the matrix is symmetric

Exceptions

  <code>std::invalid_argument</code> | if the matrix is not square.
  <code>std::domain_error</code> | if any element not on the main diagonal is `NaN`

Definition at line 38 of file check_symmetric.hpp.

template<typename T_prob >

bool stan::math::check_unit_vector | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T_prob, Dynamic, 1 > & | theta
| ) |  |

Return `true` if the specified vector is unit vector.

A valid unit vector is one where the square of the elements summed is equal to 1. This function tests that the sum is within the tolerance specified by `CONSTRAINT_TOLERANCE`. This function only accepts Eigen vectors, statically typed vectors, not general matrices with 1 column.

Template Parameters

  T_prob | Scalar type of the vector

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  theta | Vector to test.

Returns
  `true` if the vector is a unit vector.

Exceptions

  <code>std::invalid_argument</code> | if `theta` is a 0-vector.
  <code>std::domain_error</code> | if the vector is not a unit vector or if any element is `NaN`.

Definition at line 38 of file check_unit_vector.hpp.

template<typename T , int R, int C>

bool stan::math::check_vector | ( | const char * | function,
|  | const char * | name,
|  | const Eigen::Matrix< T, R, C > & | x
| ) |  |

inline

Return `true` if the matrix is either a row vector or column vector.

This function checks the runtime size of the matrix to check whether it is a row or column vector.

Template Parameters

  T | Scalar type of the matrix
  R | Compile time rows of the matrix
  C | Compile time columns of the matrix

Parameters

  function | Function name (for error messages)
  name | Variable name (for error messages)
  x | Matrix

Returns
  `true` if x either has 1 columns or 1 rows

Exceptions

  <code>std::invalid_argument</code> | if x is not a row or column vector.

Definition at line 34 of file check_vector.hpp.

template<typename T_y , typename T_dof >

return_type<T_y, T_dof>::type stan::math::chi_square_ccdf_log | ( | const T_y & | y,
|  | const T_dof & | nu
| ) |  |

Definition at line 28 of file chi_square_ccdf_log.hpp.

template<typename T_y , typename T_dof >

return_type<T_y, T_dof>::type stan::math::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 37 of file chi_square_cdf.hpp.

template<typename T_y , typename T_dof >

return_type<T_y, T_dof>::type stan::math::chi_square_cdf_log | ( | const T_y & | y,
|  | const T_dof & | nu
| ) |  |

Definition at line 28 of file chi_square_cdf_log.hpp.

template<bool propto, typename T_y , typename T_dof >

return_type<T_y, T_dof>::type stan::math::chi_square_log | ( | const T_y & | y,
|  | const T_dof & | nu
| ) |  |

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

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

Parameters

  y | A scalar variable.
  nu | Degrees of freedom.

Exceptions

  std::domain_error | if nu is not greater than or equal to 0
  std::domain_error | if y is not greater than or equal to 0.

Template Parameters

  T_y | Type of scalar.
  T_dof | Type of degrees of freedom.

Definition at line 47 of file chi_square_log.hpp.

template<typename T_y , typename T_dof >

return_type<T_y, T_dof>::type stan::math::chi_square_log | ( | const T_y & | y,
|  | const T_dof & | nu
| ) |  |

inline

Definition at line 144 of file chi_square_log.hpp.

template<class RNG >

double stan::math::chi_square_rng | ( | const double | nu,
|  | RNG & | rng
| ) |  |

inline

Definition at line 25 of file chi_square_rng.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::cholesky_corr_constrain | ( | const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | y,
|  | int | K
| ) |  |

Definition at line 20 of file cholesky_corr_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::cholesky_corr_constrain | ( | const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | y,
|  | int | K,
|  | T & | lp
| ) |  |

Definition at line 58 of file cholesky_corr_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::cholesky_corr_free | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | x | ) |

Definition at line 18 of file cholesky_corr_free.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::cholesky_decompose | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m | ) |

Return the lower-triangular Cholesky factor (i.e., matrix square root) of the specified square, symmetric matrix.

The return value will be a lower-traingular matrix such that the original matrix is given by

.

Parameters

  m | Symmetrix matrix.

Returns
  Square root of matrix.

Exceptions

  std::domain_error | if m is not a symmetric matrix.

Definition at line 23 of file cholesky_decompose.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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

  T | Type of scalars in matrix

Parameters

  x | Vector of unconstrained values
  M | Number of rows
  N | Number of columns

Returns
  Cholesky factor

Definition at line 29 of file cholesky_factor_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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

  T | Type of scalars in matrix

Parameters

  x | Vector of unconstrained values
  M | Number of rows
  N | Number of columns
  lp | Log probability that is incremented with the log Jacobian

Returns
  Cholesky factor

Definition at line 73 of file cholesky_factor_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  y | Cholesky factor.

Returns
  Unconstrained parameters for Cholesky factor.

Exceptions

  std::domain_error | If the matrix is not a Cholesky factor.

Definition at line 24 of file cholesky_factor_free.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::col | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m,
|  | size_t | j
| ) |  |

inline

Return the specified column of the specified matrix using start-at-1 indexing.

This is equivalent to calling `m.col(i - 1)` and assigning the resulting template expression to a column vector.

Parameters

  m | Matrix.
  j | Column index (count from 1).

Returns
  Specified column of the matrix.

Definition at line 24 of file col.hpp.

template<typename T , int R, int C>

size_t stan::math::cols | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Definition at line 12 of file cols.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, 1, C1> stan::math::columns_dot_product | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | v1,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | v2
| ) |  |

inline

Definition at line 18 of file columns_dot_product.hpp.

template<int R1, int C1, int R2, int C2>

Eigen::Matrix<double, 1, C1> stan::math::columns_dot_product | ( | const Eigen::Matrix< double, R1, C1 > & | v1,
|  | const Eigen::Matrix< double, R2, C2 > & | v2
| ) |  |

inline

Returns the dot product of the specified vectors.

Parameters

  v1 | First vector.
  v2 | Second vector.

Returns
  Dot product of the vectors.

Exceptions

  std::domain_error | If the vectors are not the same size or if they are both not vector dimensioned.

Definition at line 22 of file columns_dot_product.hpp.

template<typename T1 , int R1, int C1, typename T2 , int R2, int C2>

boost::enable_if_c<boost::is_same<T1, var>::value || boost::is_same<T2, var>::value, Eigen::Matrix<var, 1, C1> >::type stan::math::columns_dot_product | ( | const Eigen::Matrix< T1, R1, C1 > & | v1,
|  | const Eigen::Matrix< T2, R2, C2 > & | v2
| ) |  |

inline

Definition at line 25 of file columns_dot_product.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, 1, C1> stan::math::columns_dot_product | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | v1,
|  | const Eigen::Matrix< double, R2, C2 > & | v2
| ) |  |

inline

Definition at line 35 of file columns_dot_product.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, 1, C1> stan::math::columns_dot_product | ( | const Eigen::Matrix< double, R1, C1 > & | v1,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | v2
| ) |  |

inline

Definition at line 52 of file columns_dot_product.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, 1, C> stan::math::columns_dot_self | ( | const Eigen::Matrix< fvar< T >, R, C > & | x | ) |

inline

Definition at line 15 of file columns_dot_self.hpp.

template<typename T , int R, int C>

Eigen::Matrix<T, 1, C> stan::math::columns_dot_self | ( | const Eigen::Matrix< T, R, C > & | x | ) |

inline

Returns the dot product of each column of a matrix with itself.

Parameters

  x | Matrix.

Template Parameters

  T | scalar type

Definition at line 16 of file columns_dot_self.hpp.

template<int R, int C>

Eigen::Matrix<var, 1, C> stan::math::columns_dot_self | ( | const Eigen::Matrix< var, R, C > & | x | ) |

inline

Returns the dot product of each column of a matrix with itself.

Parameters

  x | Matrix.

Template Parameters

  T | scalar type

Definition at line 22 of file columns_dot_self.hpp.

template<typename T >

T stan::math::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,

.

Parameters

  x | Scalar input.

Returns
  Result of transforming the input to fall between -1 and 1.

Template Parameters

  T | Type of scalar.

Definition at line 25 of file corr_constrain.hpp.

template<typename T >

T stan::math::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

.

Template Parameters

  T | Type of scalar.

Definition at line 43 of file corr_constrain.hpp.

template<typename T >

T stan::math::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,

.

Parameters

  y | Correlation scalar input.

Returns
  Free scalar that transforms to the specified input.

Template Parameters

  T | Type of scalar.

Definition at line 29 of file corr_free.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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 . 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

  x | Vector of unconstrained partial correlations.
  k | Dimensionality of returned correlation matrix.

Template Parameters

  T | Type of scalar.

Exceptions

  std::invalid_argument | if x is not a valid correlation matrix.

Definition at line 40 of file corr_matrix_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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 . 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

  x | Vector of unconstrained partial correlations.
  k | Dimensionality of returned correlation matrix.
  lp | Log probability reference to increment.

Template Parameters

  T | Type of scalar.

Definition at line 78 of file corr_matrix_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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 partial correlations and then free those.

Parameters

  y | The correlation matrix to free.

Returns
  Vector of unconstrained values that produce the specified correlation matrix when transformed.

Template Parameters

  T | Type of scalar.

Exceptions

  std::domain_error | if the correlation matrix has no elements or is not a square matrix.
  std::runtime_error | if 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 38 of file corr_matrix_free.hpp.

template<typename T >

fvar<T> stan::math::cos | ( | const fvar< T > & | x | ) |

inline

Definition at line 13 of file cos.hpp.

var stan::math::cos | ( | const var & | a | ) |

inline

Return the cosine of a radian-scaled variable (cmath).

The derivative is defined by

.

Parameters

  a | Variable for radians of angle.

Returns
  Cosine of variable.

Definition at line 49 of file cos.hpp.

template<typename T >

fvar<T> stan::math::cosh | ( | const fvar< T > & | x | ) |

inline

Definition at line 13 of file cosh.hpp.

var stan::math::cosh | ( | const var & | a | ) |

inline

Return the hyperbolic cosine of the specified variable (cmath).

The derivative is defined by

.

Parameters

  a | Variable.

Returns
  Hyperbolic cosine of variable.

Definition at line 50 of file cosh.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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

  x | The vector to convert to a covariance matrix.
  K | The number of rows and columns of the resulting covariance matrix.

Exceptions

  std::domain_error | if (x.size() != K + (K choose 2)).

Definition at line 30 of file cov_matrix_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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

  x | The vector to convert to a covariance matrix.
  K | The dimensions of the resulting covariance matrix.
  lp | Reference

Exceptions

  std::domain_error | if (x.size() != K + (K choose 2)).

Definition at line 70 of file cov_matrix_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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 . The first values in the input represent unconstrained (partial) correlations and the last 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

  x | Input vector of unconstrained partial correlations and standard deviations.
  k | Dimensionality of returned covariance matrix.

Returns
  Covariance matrix derived from the unconstrained partial correlations and deviations.

Template Parameters

  T | Type of scalar.

Definition at line 34 of file cov_matrix_constrain_lkj.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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

  x | Input vector of unconstrained partial correlations and standard deviations.
  k | Dimensionality of returned covariance matrix.
  lp | Log probability reference to increment.

Returns
  Covariance matrix derived from the unconstrained partial correlations and deviations.

Template Parameters

  T | Type of scalar.

Definition at line 73 of file cov_matrix_constrain_lkj.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  y | Matrix 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_error | if `y` is not square, has zero dimensionality, or has a non-positive diagonal element.

Definition at line 37 of file cov_matrix_free.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  y | Covariance matrix to free.

Returns
  Vector of unconstrained values that transforms to the specified covariance matrix.

Template Parameters

  T | Type of scalar.

Exceptions

  std::domain_error | if the correlation matrix has no elements or is not a square matrix.
  std::runtime_error | if the correlation matrix cannot be factorized by factor_cov_matrix()

Definition at line 32 of file cov_matrix_free_lkj.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, C, C> stan::math::crossprod | ( | const Eigen::Matrix< fvar< T >, R, C > & | m | ) |

inline

Definition at line 17 of file crossprod.hpp.

matrix_d stan::math::crossprod | ( | const matrix_d & | M | ) |

inline

Returns the result of pre-multiplying a matrix by its own transpose.

Parameters

  M | Matrix to multiply.

Returns
  Transpose of M times M

Definition at line 17 of file crossprod.hpp.

matrix_v stan::math::crossprod | ( | const matrix_v & | M | ) |

inline

Returns the result of pre-multiplying a matrix by its own transpose.

Parameters

  M | Matrix to multiply.

Returns
  Transpose of M times M

Definition at line 17 of file crossprod.hpp.

template<typename T >

std::vector<T> stan::math::cumulative_sum | ( | const std::vector< T > & | x | ) |

inline

Return the cumulative sum of the specified vector.

The cumulative sum of a vector of values

is the
@code x[0], x[1] + x[2], ..., x[1] + , ..., + x[x.size()-1]

Template Parameters

  T | Scalar type of vector.

Parameters

  x | Vector of values.

Returns
  Cumulative sum of values.

Definition at line 23 of file cumulative_sum.hpp.

template<typename T , int R, int C>

Eigen::Matrix<T, R, C> stan::math::cumulative_sum | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Return the cumulative sum of the specified matrix.

The cumulative sum is of the same type as the input and has values defined by

x(0), x(1) + x(2), ..., x(1) + , ..., + x(x.size()-1)

Template Parameters

  T | Scalar type of matrix.
  R | Row type of matrix.
  C | Column type of matrix.

Parameters

  m | Matrix of values.

Returns
  Cumulative sum of values.

Definition at line 49 of file cumulative_sum.hpp.

template<typename T , typename F >

void stan::math::derivative | ( | const F & | f,
|  | const T & | x,
|  | T & | fx,
|  | T & | dfx_dx
| ) |  |

Return the derivative of the specified univariate function at the specified argument.

Template Parameters

  T | Argument type
  F | Function type

Parameters

  [in] | f | Function
  [in] | x | Argument
  [out] | fx | Value of function applied to argument
  [out] | dfx_dx | Value of derivative

Definition at line 28 of file derivative.hpp.

template<typename T , int R, int C>

T stan::math::determinant | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Returns the determinant of the specified square matrix.

Parameters

  m | Specified matrix.

Returns
  Determinant of the matrix.

Exceptions

  std::domain_error | if matrix is not square.

Definition at line 18 of file determinant.hpp.

template<typename T , int R, int C>

fvar<T> stan::math::determinant | ( | const Eigen::Matrix< fvar< T >, R, C > & | m | ) |

inline

Definition at line 21 of file determinant.hpp.

template<int R, int C>

var stan::math::determinant | ( | const Eigen::Matrix< var, R, C > & | m | ) |

inline

Definition at line 66 of file determinant.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::diag_matrix | ( | const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | v | ) |

inline

Return a square diagonal matrix with the specified vector of coefficients as the diagonal values.

Parameters

  [in] | v | Specified vector.

Returns
  Diagonal matrix with vector as diagonal values.

Definition at line 18 of file diag_matrix.hpp.

template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R1, C1> stan::math::diag_post_multiply | ( | const Eigen::Matrix< T1, R1, C1 > & | m1,
|  | const Eigen::Matrix< T2, R2, C2 > & | m2
| ) |  |

Definition at line 14 of file diag_post_multiply.hpp.

template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R2, C2> stan::math::diag_pre_multiply | ( | const Eigen::Matrix< T1, R1, C1 > & | m1,
|  | const Eigen::Matrix< T2, R2, C2 > & | m2
| ) |  |

Definition at line 14 of file diag_pre_multiply.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::diagonal | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m | ) |

inline

Return a column vector of the diagonal elements of the specified matrix.

The matrix is not required to be square.

Parameters

  m | Specified matrix.

Returns
  Diagonal of the matrix.

Definition at line 18 of file diagonal.hpp.

template<typename T >

fvar<T> stan::math::digamma | ( | const fvar< T > & | x | ) |

inline

Definition at line 16 of file digamma.hpp.

var stan::math::digamma | ( | const stan::math::var & | a | ) |

inline

Definition at line 24 of file digamma.hpp.

double stan::math::digamma | ( | double | x | ) |

Definition at line 39 of file digamma.hpp.

template<typename T >

void stan::math::dims | ( | const T & | x,
|  | std::vector< int > & | result
| ) |  |

inline

Definition at line 13 of file dims.hpp.

template<typename T , int R, int C>

void stan::math::dims | ( | const Eigen::Matrix< T, R, C > & | x,
|  | std::vector< int > & | result
| ) |  |

inline

Definition at line 18 of file dims.hpp.

template<typename T >

void stan::math::dims | ( | const std::vector< T > & | x,
|  | std::vector< int > & | result
| ) |  |

inline

Definition at line 25 of file dims.hpp.

template<typename T >

std::vector<int> stan::math::dims | ( | const T & | x | ) |

inline

Definition at line 34 of file dims.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::math::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.

Parameters

  theta | A scalar vector.
  alpha | Prior sample sizes.

Returns
  The log of the Dirichlet density.

Exceptions

  std::domain_error | if any element of alpha is less than or equal to 0.
  std::domain_error | if any element of theta is less than 0.
  std::domain_error | if the sum of theta is not 1.

Template Parameters

  T_prob | Type of scalar.
  T_prior_sample_size | Type of prior sample sizes.

Definition at line 46 of file dirichlet_log.hpp.

template<typename T_prob , typename T_prior_sample_size >

boost::math::tools::promote_args<T_prob, T_prior_sample_size>::type stan::math::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 79 of file dirichlet_log.hpp.

template<class RNG >

Eigen::VectorXd stan::math::dirichlet_rng | ( | const Eigen::Matrix< double, Eigen::Dynamic, 1 > & | alpha,
|  | RNG & | rng
| ) |  |

inline

Return a draw from a Dirichlet distribution with specified parameters and pseudo-random number generator.

For prior counts greater than zero, the usual algorithm that draws gamma variates and normalizes is used.

For prior counts less than zero (i.e., parameters with value less than one), a log-scale version of the following algorithm is used to deal with underflow:

> G. Marsaglia and W. Tsang. A simple method for generating gamma variables. ACM Transactions on Mathematical Software. 26(3):363–372, 2000.

Template Parameters

  RNG | Type of pseudo-random number generator.

Parameters

  alpha | Prior count (plus 1) parameter for Dirichlet.
  rng | Pseudo-random number generator.

Definition at line 46 of file dirichlet_rng.hpp.

double stan::math::dist | ( | const std::vector< double > & | x,
|  | const std::vector< double > & | y
| ) |  |

inline

Definition at line 11 of file dist.hpp.

template<typename T1 , int R1, int C1, typename T2 , int R2, int C2>

boost::math::tools::promote_args<T1, T2>::type stan::math::distance | ( | const Eigen::Matrix< T1, R1, C1 > & | v1,
|  | const Eigen::Matrix< T2, R2, C2 > & | v2
| ) |  |

inline

Returns the distance between the specified vectors.

Parameters

  v1 | First vector.
  v2 | Second vector.

Returns
  Dot product of the vectors.

Exceptions

  std::domain_error | If the vectors are not the same size or if they are both not vector dimensioned.

Definition at line 25 of file distance.hpp.

int stan::math::divide | ( | const int | x,
|  | const int | y
| ) |  |

inline

Definition at line 10 of file divide.hpp.

template<typename T1 , typename T2 >

stan::return_type<T1, T2>::type stan::math::divide | ( | const T1 & | v,
|  | const T2 & | c
| ) |  |

inline

Definition at line 17 of file divide.hpp.

double stan::math::divide | ( | double | x,
|  | double | y
| ) |  |

inline

Return the division of the first scalar by the second scalar.

Parameters

  [in] | x | Specified vector.
  [in] | y | Specified scalar.

Returns
  Vector divided by the scalar.

Definition at line 22 of file divide.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, R, C> stan::math::divide | ( | const Eigen::Matrix< fvar< T >, R, C > & | v,
|  | const fvar< T > & | c
| ) |  |

inline

Definition at line 23 of file divide.hpp.

template<int R, int C, typename T >

boost::enable_if_c<boost::is_arithmetic<T>::value, Eigen::Matrix<double, R, C> >::type stan::math::divide | ( | const Eigen::Matrix< double, R, C > & | m,
|  | T | c
| ) |  |

inline

Return specified matrix divided by specified scalar.

Template Parameters

  R | Row type for matrix.
  C | Column type for matrix.

Parameters

  m | Matrix.
  c | Scalar.

Returns
  Matrix divided by scalar.

Definition at line 23 of file divide.hpp.

template<typename T1 , typename T2 >

var stan::math::divide | ( | const T1 & | v,
|  | const T2 & | c
| ) |  |

inline

Definition at line 27 of file divide.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, R, C> stan::math::divide | ( | const Eigen::Matrix< fvar< T >, R, C > & | v,
|  | const double | c
| ) |  |

inline

Definition at line 34 of file divide.hpp.

template<typename T1 , typename T2 , int R, int C>

Eigen::Matrix<var, R, C> stan::math::divide | ( | const Eigen::Matrix< T1, R, C > & | v,
|  | const T2 & | c
| ) |  |

inline

Return the division of the specified column vector by the specified scalar.

Parameters

  [in] | v | Specified vector.
  [in] | c | Specified scalar.

Returns
  Vector divided by the scalar.

Definition at line 39 of file divide.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, R, C> stan::math::divide | ( | const Eigen::Matrix< double, R, C > & | v,
|  | const fvar< T > & | c
| ) |  |

inline

Definition at line 46 of file divide.hpp.

template<typename T_shape >

T_shape stan::math::do_lkj_constant | ( | const T_shape & | eta,
|  | const unsigned int & | K
| ) |  |

Definition at line 55 of file lkj_corr_log.hpp.

template<typename T >

void stan::math::domain_error | ( | const char * | function,
|  | const char * | name,
|  | const T & | y,
|  | const char * | msg1,
|  | const char * | msg2
| ) |  |

inline

Throw a domain error with a consistently formatted message.

This is an abstraction for all Stan functions to use when throwing domain errors. This will allow us to change the behavior for all functions at once. (We've already changed behavior mulitple times up to Stan v2.5.0.)

The message is: "<function>: <name> <msg1><y><msg2>"

Template Parameters

  T | Type of variable

Parameters

  function | Name of the function
  name | Name of the variable
  y | Variable
  msg1 | Message to print before the variable
  msg2 | Message to print after the variable

Exceptions

  std::domain_error |

Definition at line 32 of file domain_error.hpp.

template<typename T >

void stan::math::domain_error | ( | const char * | function,
|  | const char * | name,
|  | const T & | y,
|  | const char * | msg1
| ) |  |

inline

Throw a domain error with a consistently formatted message.

This is an abstraction for all Stan functions to use when throwing domain errors. This will allow us to change the behavior for all functions at once. (We've already changed behavior mulitple times up to Stan v2.5.0.)

The message is: "<function>: <name> <msg1><y>"

Template Parameters

  T | Type of variable

Parameters

  function | Name of the function
  name | Name of the variable
  y | Variable
  msg1 | Message to print before the variable

Exceptions

  std::domain_error |

Definition at line 67 of file domain_error.hpp.

template<typename T >

void stan::math::domain_error_vec | ( | const char * | function,
|  | const char * | name,
|  | const T & | y,
|  | const size_t | i,
|  | const char * | msg1,
|  | const char * | msg2
| ) |  |

inline

Throw a domain error with a consistently formatted message.

This is an abstraction for all Stan functions to use when throwing domain errors. This will allow us to change the behavior for all functions at once. (We've already changed behavior mulitple times up to Stan v2.5.0.)

The message is: "<function>: <name>[<i+error_index>] <msg1><y>" where error_index is the value of stan::error_index::value which indicates whether the message should be 0 or 1 indexed.

Template Parameters

  T | Type of variable

Parameters

  function | Name of the function
  name | Name of the variable
  y | Variable
  i | Index
  msg1 | Message to print before the variable
  msg2 | Message to print after the variable

Exceptions

  std::domain_error |

Definition at line 38 of file domain_error_vec.hpp.

template<typename T >

void stan::math::domain_error_vec | ( | const char * | function,
|  | const char * | name,
|  | const T & | y,
|  | const size_t | i,
|  | const char * | msg
| ) |  |

inline

Throw a domain error with a consistently formatted message.

This is an abstraction for all Stan functions to use when throwing domain errors. This will allow us to change the behavior for all functions at once. (We've already changed behavior mulitple times up to Stan v2.5.0.)

The message is: "<function>: <name>[<i+error_index>] <msg1><y>" where error_index is the value of stan::error_index::value which indicates whether the message should be 0 or 1 indexed.

Template Parameters

  T | Type of variable

Parameters

  function | Name of the function
  name | Name of the variable
  y | Variable
  i | Index
  msg | Message to print before the variable

Exceptions

  std::domain_error |

Definition at line 73 of file domain_error_vec.hpp.

double stan::math::dot | ( | const std::vector< double > & | x,
|  | const std::vector< double > & | y
| ) |  |

inline

Definition at line 11 of file dot.hpp.

template<typename T , int R1, int C1, int R2, int C2>

fvar<T> stan::math::dot_product | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | v1,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | v2
| ) |  |

inline

Definition at line 20 of file dot_product.hpp.

template<int R1, int C1, int R2, int C2>

double stan::math::dot_product | ( | const Eigen::Matrix< double, R1, C1 > & | v1,
|  | const Eigen::Matrix< double, R2, C2 > & | v2
| ) |  |

inline

Returns the dot product of the specified vectors.

Parameters

  v1 | First vector.
  v2 | Second vector.

Returns
  Dot product of the vectors.

Exceptions

  std::domain_error | If the vectors are not the same size or if they are both not vector dimensioned.

Definition at line 22 of file dot_product.hpp.

double stan::math::dot_product | ( | const double * | v1,
|  | const double * | v2,
|  | size_t | length
| ) |  |

inline

Returns the dot product of the specified arrays of doubles.

Parameters

  v1 | First array.
  v2 | Second array.
  length | Length of both arrays.

Definition at line 37 of file dot_product.hpp.

template<typename T , int R1, int C1, int R2, int C2>

fvar<T> stan::math::dot_product | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | v1,
|  | const Eigen::Matrix< double, R2, C2 > & | v2
| ) |  |

inline

Definition at line 37 of file dot_product.hpp.

double stan::math::dot_product | ( | const std::vector< double > & | v1,
|  | const std::vector< double > & | v2
| ) |  |

inline

Returns the dot product of the specified arrays of doubles.

Parameters

  v1 | First array.
  v2 | Second array.

Exceptions

  std::domain_error | if the vectors are not the same size.

Definition at line 50 of file dot_product.hpp.

template<typename T , int R1, int C1, int R2, int C2>

fvar<T> stan::math::dot_product | ( | const Eigen::Matrix< double, R1, C1 > & | v1,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | v2
| ) |  |

inline

Definition at line 54 of file dot_product.hpp.

template<typename T , int R1, int C1, int R2, int C2>

fvar<T> stan::math::dot_product | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | v1,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | v2,
|  | size_type & | length
| ) |  |

inline

Definition at line 71 of file dot_product.hpp.

template<typename T , int R1, int C1, int R2, int C2>

fvar<T> stan::math::dot_product | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | v1,
|  | const Eigen::Matrix< double, R2, C2 > & | v2,
|  | size_type & | length
| ) |  |

inline

Definition at line 86 of file dot_product.hpp.

template<typename T , int R1, int C1, int R2, int C2>

fvar<T> stan::math::dot_product | ( | const Eigen::Matrix< double, R1, C1 > & | v1,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | v2,
|  | size_type & | length
| ) |  |

inline

Definition at line 101 of file dot_product.hpp.

template<typename T >

fvar<T> stan::math::dot_product | ( | const std::vector< fvar< T > > & | v1,
|  | const std::vector< fvar< T > > & | v2
| ) |  |

inline

Definition at line 116 of file dot_product.hpp.

template<typename T >

fvar<T> stan::math::dot_product | ( | const std::vector< double > & | v1,
|  | const std::vector< fvar< T > > & | v2
| ) |  |

inline

Definition at line 130 of file dot_product.hpp.

template<typename T >

fvar<T> stan::math::dot_product | ( | const std::vector< fvar< T > > & | v1,
|  | const std::vector< double > & | v2
| ) |  |

inline

Definition at line 144 of file dot_product.hpp.

template<typename T >

fvar<T> stan::math::dot_product | ( | const std::vector< fvar< T > > & | v1,
|  | const std::vector< fvar< T > > & | v2,
|  | size_type & | length
| ) |  |

inline

Definition at line 158 of file dot_product.hpp.

template<typename T >

fvar<T> stan::math::dot_product | ( | const std::vector< double > & | v1,
|  | const std::vector< fvar< T > > & | v2,
|  | size_type & | length
| ) |  |

inline

Definition at line 170 of file dot_product.hpp.

template<typename T >

fvar<T> stan::math::dot_product | ( | const std::vector< fvar< T > > & | v1,
|  | const std::vector< double > & | v2,
|  | size_type & | length
| ) |  |

inline

Definition at line 182 of file dot_product.hpp.

template<typename T1 , int R1, int C1, typename T2 , int R2, int C2>

boost::enable_if_c<boost::is_same<T1, var>::value || boost::is_same<T2, var>::value, var>::type stan::math::dot_product | ( | const Eigen::Matrix< T1, R1, C1 > & | v1,
|  | const Eigen::Matrix< T2, R2, C2 > & | v2
| ) |  |

inline

Returns the dot product.

Parameters

  [in] | v1 | First column vector.
  [in] | v2 | Second column vector.

Returns
  Dot product of the vectors.

Exceptions

  std::domain_error | if length of v1 is not equal to length of v2.

Definition at line 212 of file dot_product.hpp.

template<typename T1 , typename T2 >

boost::enable_if_c<boost::is_same<T1, var>::value || boost::is_same<T2, var>::value, var>::type stan::math::dot_product | ( | const T1 * | v1,
|  | const T2 * | v2,
|  | size_t | length
| ) |  |

inline

Returns the dot product.

Parameters

  [in] | v1 | First array.
  [in] | v2 | Second array.
  [in] | length | Length of both arrays.

Returns
  Dot product of the arrays.

Definition at line 233 of file dot_product.hpp.

template<typename T1 , typename T2 >

boost::enable_if_c<boost::is_same<T1, var>::value || boost::is_same<T2, var>::value, var>::type stan::math::dot_product | ( | const std::vector< T1 > & | v1,
|  | const std::vector< T2 > & | v2
| ) |  |

inline

Returns the dot product.

Parameters

  [in] | v1 | First vector.
  [in] | v2 | Second vector.

Returns
  Dot product of the vectors.

Exceptions

  std::domain_error | if sizes of v1 and v2 do not match.

Definition at line 249 of file dot_product.hpp.

double stan::math::dot_self | ( | const std::vector< double > & | x | ) |

inline

Definition at line 11 of file dot_self.hpp.

template<typename T , int R, int C>

fvar<T> stan::math::dot_self | ( | const Eigen::Matrix< fvar< T >, R, C > & | v | ) |

inline

Definition at line 16 of file dot_self.hpp.

template<int R, int C>

double stan::math::dot_self | ( | const Eigen::Matrix< double, R, C > & | v | ) |

inline

Returns the dot product of the specified vector with itself.

Parameters

  v | Vector.

Template Parameters

  R | number of rows or `Eigen::Dynamic` for dynamic
  C | number of rows or `Eigen::Dyanmic` for dynamic

Exceptions

  std::domain_error | If v is not vector dimensioned.

Definition at line 18 of file dot_self.hpp.

template<int R, int C>

var stan::math::dot_self | ( | const Eigen::Matrix< var, R, C > & | v | ) |

inline

Returns the dot product of a vector with itself.

Parameters

  [in] | v | Vector.

Returns
  Dot product of the vector with itself.

Template Parameters

  R | number of rows or `Eigen::Dynamic` for dynamic; one of R or C must be 1
  C | number of rows or `Eigen::Dyanmic` for dynamic; one of R or C must be 1

Definition at line 80 of file dot_self.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::double_exponential_ccdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 24 of file double_exponential_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::double_exponential_cdf | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Calculates the double exponential cumulative density function.

Parameters

  y | A scalar variate.
  mu | The location parameter.
  sigma | The scale parameter.

Returns
  The cumulative density function.

Definition at line 38 of file double_exponential_cdf.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::double_exponential_cdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 24 of file double_exponential_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::double_exponential_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 29 of file double_exponential_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::double_exponential_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 128 of file double_exponential_log.hpp.

template<class RNG >

double stan::math::double_exponential_rng | ( | const double | mu,
|  | const double | sigma,
|  | RNG & | rng
| ) |  |

inline

Definition at line 24 of file double_exponential_rng.hpp.

double stan::math::e | ( |  | ) |

inline

Return the base of the natural logarithm.

Returns
  Base of natural logarithm.

Definition at line 95 of file constants.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::eigenvalues_sym | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m | ) |

Return the eigenvalues of the specified symmetric matrix in descending order of magnitude.

This function is more efficient than the general eigenvalues function for symmetric matrices.

See `eigen_decompose()` for more information.

Parameters

  m | Specified matrix.

Returns
  Eigenvalues of matrix.

Definition at line 22 of file eigenvalues_sym.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::eigenvectors_sym | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m | ) |

Definition at line 13 of file eigenvectors_sym.hpp.

template<typename T1 , typename T2 , int R, int C>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R, C> stan::math::elt_divide | ( | const Eigen::Matrix< T1, R, C > & | m1,
|  | const Eigen::Matrix< T2, R, C > & | m2
| ) |  |

Return the elementwise division of the specified matrices.

Template Parameters

  T1 | Type of scalars in first matrix.
  T2 | Type of scalars in second matrix.
  R | Row type of both matrices.
  C | Column type of both matrices.

Parameters

  m1 | First matrix
  m2 | Second matrix

Returns
  Elementwise division of matrices.

Definition at line 24 of file elt_divide.hpp.

template<typename T1 , typename T2 , int R, int C>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R, C> stan::math::elt_divide | ( | const Eigen::Matrix< T1, R, C > & | m,
|  | T2 | s
| ) |  |

Return the elementwise division of the specified matrix by the specified scalar.

Template Parameters

  T1 | Type of scalars in the matrix.
  T2 | Type of the scalar.
  R | Row type of the matrix.
  C | Column type of the matrix.

Parameters

  m | matrix
  s | scalar

Returns
  Elementwise division of a scalar by matrix.

Definition at line 50 of file elt_divide.hpp.

template<typename T1 , typename T2 , int R, int C>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R, C> stan::math::elt_divide | ( | T1 | s,
|  | const Eigen::Matrix< T2, R, C > & | m
| ) |  |

Return the elementwise division of the specified scalar by the specified matrix.

Template Parameters

  T1 | Type of the scalar.
  T2 | Type of scalars in the matrix.
  R | Row type of the matrix.
  C | Column type of the matrix.

Parameters

  s | scalar
  m | matrix

Returns
  Elementwise division of a scalar by matrix.

Definition at line 68 of file elt_divide.hpp.

template<typename T1 , typename T2 , int R, int C>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R, C> stan::math::elt_multiply | ( | const Eigen::Matrix< T1, R, C > & | m1,
|  | const Eigen::Matrix< T2, R, C > & | m2
| ) |  |

Return the elementwise multiplication of the specified matrices.

Template Parameters

  T1 | Type of scalars in first matrix.
  T2 | Type of scalars in second matrix.
  R | Row type of both matrices.
  C | Column type of both matrices.

Parameters

  m1 | First matrix
  m2 | Second matrix

Returns
  Elementwise product of matrices.

Definition at line 25 of file elt_multiply.hpp.

static bool stan::math::empty_nested | ( |  | ) |

inlinestatic

Return true if there is no nested autodiff being executed.

Definition at line 14 of file empty_nested.hpp.

template<typename T >

fvar<T> stan::math::erf | ( | const fvar< T > & | x | ) |

inline

Definition at line 14 of file erf.hpp.

var stan::math::erf | ( | const var & | a | ) |

inline

The error function for variables (C99).

For non-variable function, see erf() from cmath.

The derivative is

.

Parameters

  a | The variable.

Returns
  Error function applied to the variable.

Definition at line 63 of file erf.hpp.

template<typename T >

fvar<T> stan::math::erfc | ( | const fvar< T > & | x | ) |

inline

Definition at line 14 of file erfc.hpp.

var stan::math::erfc | ( | const var & | a | ) |

inline

The complementary error function for variables (C99).

For non-variable function, see erfc() from <cmath>.

The derivative is

.

Parameters

  a | The variable.

Returns
  Complementary error function applied to the variable.

Definition at line 63 of file erfc.hpp.

template<typename T >

fvar<T> stan::math::exp | ( | const fvar< T > & | x | ) |

inline

Definition at line 10 of file exp.hpp.

template<typename T , int Rows, int Cols>

Eigen::Matrix<T, Rows, Cols> stan::math::exp | ( | const Eigen::Matrix< T, Rows, Cols > & | m | ) |

inline

Return the element-wise exponentiation of the matrix or vector.

Parameters

  m | The matrix or vector.

Returns
  ret(i, j) = exp(m(i, j))

Definition at line 19 of file exp.hpp.

template<int Rows, int Cols>

Eigen::Matrix<double, Rows, Cols> stan::math::exp | ( | const Eigen::Matrix< double, Rows, Cols > & | m | ) |

inline

Definition at line 28 of file exp.hpp.

var stan::math::exp | ( | const var & | a | ) |

inline

Return the exponentiation of the specified variable (cmath).

Parameters

  a | Variable to exponentiate.

Returns
  Exponentiated variable.

Definition at line 44 of file exp.hpp.

template<typename T >

fvar<T> stan::math::exp2 | ( | const fvar< T > & | x | ) |

inline

Definition at line 14 of file exp2.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::exp2 | ( | const T | y | ) |

inline

Return the exponent base 2 of the specified argument (C99).

The exponent base 2 function is defined by

`exp2(y) = pow(2.0, y)`.

Parameters

  y | Value.

Template Parameters

  T | Type of scalar.

Returns
  Exponent base 2 of value.

Definition at line 23 of file exp2.hpp.

var stan::math::exp2 | ( | const var & | a | ) |

inline

Exponentiation base 2 function for variables (C99).

For non-variable function, see boost::math::exp2().

The derivatie is

.

Parameters

  a | The variable.

Returns
  Two to the power of the specified variable.

Definition at line 52 of file exp2.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::math::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 24 of file exp_mod_normal_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >

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

Definition at line 24 of file exp_mod_normal_cdf.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::math::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 24 of file exp_mod_normal_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_inv_scale >

return_type<T_y, T_loc, T_scale, T_inv_scale>::type stan::math::exp_mod_normal_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma,
|  | const T_inv_scale & | lambda
| ) |  |

Definition at line 25 of file exp_mod_normal_log.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::math::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 139 of file exp_mod_normal_log.hpp.

template<class RNG >

double stan::math::exp_mod_normal_rng | ( | const double | mu,
|  | const double | sigma,
|  | const double | lambda,
|  | RNG & | rng
| ) |  |

inline

Definition at line 29 of file exp_mod_normal_rng.hpp.

template<typename T >

fvar<T> stan::math::expm1 | ( | const fvar< T > & | x | ) |

inline

Definition at line 12 of file expm1.hpp.

var stan::math::expm1 | ( | const stan::math::var & | a | ) |

inline

The exponentiation of the specified variable minus 1 (C99).

The derivative is given by

.

Parameters

  a | The variable.

Returns
  Two to the power of the specified variable.

Definition at line 52 of file expm1.hpp.

template<typename T_y , typename T_inv_scale >

return_type<T_y, T_inv_scale>::type stan::math::exponential_ccdf_log | ( | const T_y & | y,
|  | const T_inv_scale & | beta
| ) |  |

Definition at line 27 of file exponential_ccdf_log.hpp.

template<typename T_y , typename T_inv_scale >

return_type<T_y, T_inv_scale>::type stan::math::exponential_cdf | ( | const T_y & | y,
|  | const T_inv_scale & | beta
| ) |  |

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

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

Parameters

  y | A scalar variable.
  beta | Inverse scale parameter.

Template Parameters

  T_y | Type of scalar.
  T_inv_scale | Type of inverse scale.

Definition at line 40 of file exponential_cdf.hpp.

template<typename T_y , typename T_inv_scale >

return_type<T_y, T_inv_scale>::type stan::math::exponential_cdf_log | ( | const T_y & | y,
|  | const T_inv_scale & | beta
| ) |  |

Definition at line 28 of file exponential_cdf_log.hpp.

template<bool propto, typename T_y , typename T_inv_scale >

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

Parameters

  y | A scalar variable.
  beta | Inverse scale parameter.

Exceptions

  std::domain_error | if beta is not greater than 0.
  std::domain_error | if y is not greater than or equal to 0.

Template Parameters

  T_y | Type of scalar.
  T_inv_scale | Type of inverse scale.

Definition at line 54 of file exponential_log.hpp.

template<typename T_y , typename T_inv_scale >

return_type<T_y, T_inv_scale>::type stan::math::exponential_log | ( | const T_y & | y,
|  | const T_inv_scale & | beta
| ) |  |

inline

Definition at line 111 of file exponential_log.hpp.

template<class RNG >

double stan::math::exponential_rng | ( | const double | beta,
|  | RNG & | rng
| ) |  |

inline

Definition at line 27 of file exponential_rng.hpp.

template<typename T >

T stan::math::F32 | ( | T | a,
|  | T | b,
|  | T | c,
|  | T | d,
|  | T | e,
|  | T | z,
|  | T | precision = `1e-6`
| ) |  |

Definition at line 11 of file F32.hpp.

template<typename T >

fvar<T> stan::math::fabs | ( | const fvar< T > & | x | ) |

inline

Definition at line 14 of file fabs.hpp.

var stan::math::fabs | ( | const var & | a | ) |

inline

Return the absolute value of the variable (cmath).

Choosing an arbitrary value at the non-differentiable point 0,

.

where is the signum function, taking values -1 if , 0 if , and 1 if .

The function `abs()` provides the same behavior, with `abs()` defined in stdlib.h and `fabs()` defined in `cmath`. The derivative is 0 if the input is 0.

Returns std::numeric_limits<double>::quiet_NaN() for NaN inputs.

Parameters

  a | Input variable.

Returns
  Absolute value of variable.

Definition at line 50 of file fabs.hpp.

template<typename T >

bool stan::math::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] | Sigma | covariance matrix
  [out] | CPCs | fill this unbounded (does not resize)
  [out] | sds | fill this unbounded (does not resize)

Returns
  false if any of the diagonals of Sigma are 0

Definition at line 27 of file factor_cov_matrix.hpp.

template<typename T >

void stan::math::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

  U | Sigma matrix
  CPCs | fill this unbounded

Definition at line 29 of file factor_U.hpp.

template<typename T >

fvar<T> stan::math::falling_factorial | ( | const fvar< T > & | x,
|  | const fvar< T > & | n
| ) |  |

inline

Definition at line 15 of file falling_factorial.hpp.

template<typename T >

fvar<T> stan::math::falling_factorial | ( | const fvar< T > & | x,
|  | const double | n
| ) |  |

inline

Definition at line 26 of file falling_factorial.hpp.

template<typename T >

fvar<T> stan::math::falling_factorial | ( | const double | x,
|  | const fvar< T > & | n
| ) |  |

inline

Definition at line 37 of file falling_factorial.hpp.

var stan::math::falling_factorial | ( | const var & | a,
|  | const double & | b
| ) |  |

inline

Definition at line 52 of file falling_factorial.hpp.

template<typename T1 , typename T2 >

boost::math::tools::promote_args<T1, T2>::type stan::math::falling_factorial | ( | const T1 | x,
|  | const T2 | n
| ) |  |

inline

Definition at line 54 of file falling_factorial.hpp.

var stan::math::falling_factorial | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Definition at line 57 of file falling_factorial.hpp.

var stan::math::falling_factorial | ( | const double & | a,
|  | const var & | b
| ) |  |

inline

Definition at line 62 of file falling_factorial.hpp.

template<typename T >

fvar<T> stan::math::fdim | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 11 of file fdim.hpp.

template<typename T >

fvar<T> stan::math::fdim | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 22 of file fdim.hpp.

template<typename T1 , typename T2 >

boost::math::tools::promote_args<T1, T2>::type stan::math::fdim | ( | T1 | a,
|  | T2 | b
| ) |  |

inline

The positive difference function (C99).

The function is defined by

`fdim(a, b) = (a > b) ? (a - b) : 0.0`.

Parameters

  a | First value.
  b | Second value.

Returns
  Returns min(a - b, 0.0).

Definition at line 26 of file fdim.hpp.

template<typename T >

fvar<T> stan::math::fdim | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 32 of file fdim.hpp.

var stan::math::fdim | ( | const stan::math::var & | a,
|  | const stan::math::var & | b
| ) |  |

inline

Return the positive difference between the first variable's the value and the second's (C99).

See stan::math::fdim() for the double-based version.

The partial derivative with respect to the first argument is

if , and

if .

With respect to the second argument, the partial is

if , and

if .

Parameters

  a | First variable.
  b | Second variable.

Returns
  The positive difference between the first and second variable.

Definition at line 110 of file fdim.hpp.

var stan::math::fdim | ( | const double & | a,
|  | const stan::math::var & | b
| ) |  |

inline

Return the positive difference between the first value and the value of the second variable (C99).

See fdim(var, var) for definitions of values and derivatives.

The derivative with respect to the variable is

if , and

if .

Parameters

  a | First value.
  b | Second variable.

Returns
  The positive difference between the first and second arguments.

Definition at line 135 of file fdim.hpp.

var stan::math::fdim | ( | const stan::math::var & | a,
|  | const double & | b
| ) |  |

inline

Return the positive difference between the first variable's value and the second value (C99).

See fdim(var, var) for definitions of values and derivatives.

The derivative with respect to the variable is

if , and

if .

Parameters

  a | First value.
  b | Second variable.

Returns
  The positive difference between the first and second arguments.

Definition at line 158 of file fdim.hpp.

template<typename T , typename S >

void stan::math::fill | ( | T & | x,
|  | const S & | y
| ) |  |

Fill the specified container with the specified value.

This base case simply assigns the value to the container.

Template Parameters

  T | Type of reference container.
  S | Type of value.

Parameters

  x | Container.
  y | Value.

Definition at line 22 of file fill.hpp.

template<typename T , int R, int C, typename S >

void stan::math::fill | ( | Eigen::Matrix< T, R, C > & | x,
|  | const S & | y
| ) |  |

Fill the specified container with the specified value.

The specified matrix is filled by element.

Template Parameters

  T | Type of scalar for matrix container.
  R | Row type of matrix.
  C | Column type of matrix.
  S | Type of value.

Parameters

  x | Container.
  y | Value.

Definition at line 39 of file fill.hpp.

template<typename T , typename S >

void stan::math::fill | ( | std::vector< T > & | x,
|  | const S & | y
| ) |  |

Fill the specified container with the specified value.

Each container in the specified standard vector is filled recursively by calling `fill`.

Template Parameters

  T | Type of container in vector.
  S | Type of value.

Parameters

  x | Container.
  y | Value.

Definition at line 55 of file fill.hpp.

template<typename F >

void stan::math::finite_diff_grad_hessian | ( | const F & | f,
|  | const Eigen::Matrix< double,-1, 1 > & | x,
|  | double & | fx,
|  | Eigen::Matrix< double,-1,-1 > & | hess,
|  | std::vector< Eigen::Matrix< double,-1,-1 > > & | grad_hess_fx,
|  | const double | epsilon = `1e-04`
| ) |  |

Calculate the value and the gradient of the hessian of the specified function at the specified argument using second-order autodiff and first-order finite difference.

The functor must implement

`double operator()(const Eigen::Matrix<double, Eigen::Dynamic, 1>&)`

Reference:

De Levie: An improved numerical approximation for the first derivative, page 3

4 calls to the function, f.

Template Parameters

  F | Type of function

Parameters

  [in] | f | Function
  [in] | x | Argument to function
  [out] | fx | Function applied to argument
  [out] | hess | Hessian matrix
  [out] | grad_hess_fx | gradient of Hessian of function at argument
  [in] | epsilon | perturbation size

Definition at line 43 of file finite_diff_grad_hessian.hpp.

template<typename F >

void stan::math::finite_diff_gradient | ( | const F & | f,
|  | const Eigen::Matrix< double,-1, 1 > & | x,
|  | double & | fx,
|  | Eigen::Matrix< double,-1, 1 > & | grad_fx,
|  | const double | epsilon = `1e-03`
| ) |  |

Calculate the value and the gradient of the specified function at the specified argument using finite difference.

The functor must implement

`double operator()(const Eigen::Matrix<double, Eigen::Dynamic, 1>&)`

Error should be on order of epsilon ^ 6. The reference for this algorithm is:

De Levie: An improved numerical approximation for the first derivative, page 3

This function involves 6 calls to f.

Template Parameters

  F | Type of function

Parameters

  [in] | f | Function
  [in] | x | Argument to function
  [out] | fx | Function applied to argument
  [out] | grad_fx | Gradient of function at argument
  [in] | epsilon | perturbation size

Definition at line 39 of file finite_diff_gradient.hpp.

template<typename F >

double stan::math::finite_diff_hess_helper | ( | const F & | f,
|  | const Eigen::Matrix< double, Eigen::Dynamic, 1 > & | x,
|  | const int | lambda,
|  | const double | epsilon = `1e-03`
| ) |  |

Definition at line 13 of file finite_diff_hessian.hpp.

template<typename F >

void stan::math::finite_diff_hessian | ( | const F & | f,
|  | const Eigen::Matrix< double,-1, 1 > & | x,
|  | double & | fx,
|  | Eigen::Matrix< double,-1, 1 > & | grad_fx,
|  | Eigen::Matrix< double,-1,-1 > & | hess_fx,
|  | const double | epsilon = `1e-03`
| ) |  |

Calculate the value and the Hessian of the specified function at the specified argument using second-order finite difference.

The functor must implement

`double operator()(const Eigen::Matrix<double, Eigen::Dynamic, 1>&)`

Error should be on order of epsilon ^ 4, with 4 calls to the function f.

Reference: Eberly: Derivative Approximation by Finite Differences Page 6

Template Parameters

  F | Type of function

Parameters

  [in] | f | Function
  [in] | x | Argument to function
  [out] | fx | Function applied to argument
  [out] | grad_fx | Gradient of function at argument
  [out] | hess_fx | Hessian of function at argument
  [in] | epsilon | perturbation size

Definition at line 67 of file finite_diff_hessian.hpp.

template<typename T >

fvar<T> stan::math::floor | ( | const fvar< T > & | x | ) |

inline

Definition at line 11 of file floor.hpp.

var stan::math::floor | ( | const var & | a | ) |

inline

Return the floor of the specified variable (cmath).

The derivative of the floor function is defined and zero everywhere but at integers, so we set these derivatives to zero for convenience,

.

The floor function rounds down. For double values, this is the largest integral value that is not greater than the specified value. Although this function is not differentiable because it is discontinuous at integral values, its gradient is returned as zero everywhere.

Parameters

  a | Input variable.

Returns
  Floor of the variable.

Definition at line 60 of file floor.hpp.

template<typename T1 , typename T2 , typename T3 >

fvar<typename stan::return_type<T1, T2, T3>::type> stan::math::fma | ( | const fvar< T1 > & | x1,
|  | const fvar< T2 > & | x2,
|  | const fvar< T3 > & | x3
| ) |  |

inline

The fused multiply-add operation (C99).

This double-based operation delegates to `fma`.

The function is defined by

`fma(a, b, c) = (a * b) + c`.

Parameters

  x1 | First value.
  x2 | Second value.
  x3 | Third value.

Returns
  Product of the first two values plus the third.

Definition at line 61 of file fma.hpp.

template<typename T1 , typename T2 , typename T3 >

fvar<typename stan::return_type<T1, T2, T3>::type> stan::math::fma | ( | const T1 & | x1,
|  | const fvar< T2 > & | x2,
|  | const fvar< T3 > & | x3
| ) |  |

inline

See all-var input signature for details on the function and derivatives.

Definition at line 74 of file fma.hpp.

template<typename T1 , typename T2 , typename T3 >

fvar<typename stan::return_type<T1, T2, T3>::type> stan::math::fma | ( | const fvar< T1 > & | x1,
|  | const T2 & | x2,
|  | const fvar< T3 > & | x3
| ) |  |

inline

See all-var input signature for details on the function and derivatives.

Definition at line 86 of file fma.hpp.

template<typename T1 , typename T2 , typename T3 >

fvar<typename stan::return_type<T1, T2, T3>::type> stan::math::fma | ( | const fvar< T1 > & | x1,
|  | const fvar< T2 > & | x2,
|  | const T3 & | x3
| ) |  |

inline

See all-var input signature for details on the function and derivatives.

Definition at line 98 of file fma.hpp.

template<typename T1 , typename T2 , typename T3 >

fvar<typename stan::return_type<T1, T2, T3>::type> stan::math::fma | ( | const T1 & | x1,
|  | const T2 & | x2,
|  | const fvar< T3 > & | x3
| ) |  |

inline

See all-var input signature for details on the function and derivatives.

Definition at line 110 of file fma.hpp.

template<typename T1 , typename T2 , typename T3 >

fvar<typename stan::return_type<T1, T2, T3>::type> stan::math::fma | ( | const fvar< T1 > & | x1,
|  | const T2 & | x2,
|  | const T3 & | x3
| ) |  |

inline

See all-var input signature for details on the function and derivatives.

Definition at line 122 of file fma.hpp.

var stan::math::fma | ( | const stan::math::var & | a,
|  | const stan::math::var & | b,
|  | const stan::math::var & | c
| ) |  |

inline

The fused multiply-add function for three variables (C99).

This function returns the product of the first two arguments plus the third argument.

The double-based version `::fma(double, double, double)` is defined in `<cmath>`.

The partial derivatives are

, and

, and

.

Parameters

  a | First multiplicand.
  b | Second multiplicand.
  c | Summand.

Returns
  Product of the multiplicands plus the summand, ($a * $b) + $c.

Definition at line 129 of file fma.hpp.

template<typename T1 , typename T2 , typename T3 >

fvar<typename stan::return_type<T1, T2, T3>::type> stan::math::fma | ( | const T1 & | x1,
|  | const fvar< T2 > & | x2,
|  | const T3 & | x3
| ) |  |

inline

See all-var input signature for details on the function and derivatives.

Definition at line 134 of file fma.hpp.

var stan::math::fma | ( | const stan::math::var & | a,
|  | const stan::math::var & | b,
|  | const double & | c
| ) |  |

inline

The fused multiply-add function for two variables and a value (C99).

This function returns the product of the first two arguments plus the third argument.

The double-based version `::fma(double, double, double)` is defined in `<cmath>`.

The partial derivatives are

, and

.

Parameters

  a | First multiplicand.
  b | Second multiplicand.
  c | Summand.

Returns
  Product of the multiplicands plus the summand, ($a * $b) + $c.

Definition at line 154 of file fma.hpp.

var stan::math::fma | ( | const stan::math::var & | a,
|  | const double & | b,
|  | const stan::math::var & | c
| ) |  |

inline

The fused multiply-add function for a variable, value, and variable (C99).

This function returns the product of the first two arguments plus the third argument.

The double-based version `::fma(double, double, double)` is defined in `<cmath>`.

The partial derivatives are

, and

.

Parameters

  a | First multiplicand.
  b | Second multiplicand.
  c | Summand.

Returns
  Product of the multiplicands plus the summand, ($a * $b) + $c.

Definition at line 179 of file fma.hpp.

var stan::math::fma | ( | const stan::math::var & | a,
|  | const double & | b,
|  | const double & | c
| ) |  |

inline

The fused multiply-add function for a variable and two values (C99).

This function returns the product of the first two arguments plus the third argument.

The double-based version `::fma(double, double, double)` is defined in `<cmath>`.

The derivative is

.

Parameters

  a | First multiplicand.
  b | Second multiplicand.
  c | Summand.

Returns
  Product of the multiplicands plus the summand, ($a * $b) + $c.

Definition at line 202 of file fma.hpp.

var stan::math::fma | ( | const double & | a,
|  | const stan::math::var & | b,
|  | const double & | c
| ) |  |

inline

The fused multiply-add function for a value, variable, and value (C99).

This function returns the product of the first two arguments plus the third argument.

The double-based version `::fma(double, double, double)` is defined in `<cmath>`.

The derivative is

, and

Parameters

  a | First multiplicand.
  b | Second multiplicand.
  c | Summand.

Returns
  Product of the multiplicands plus the summand, ($a * $b) + $c.

Definition at line 225 of file fma.hpp.

var stan::math::fma | ( | const double & | a,
|  | const double & | b,
|  | const stan::math::var & | c
| ) |  |

inline

The fused multiply-add function for two values and a variable, and value (C99).

This function returns the product of the first two arguments plus the third argument.

The double-based version `::fma(double, double, double)` is defined in `<cmath>`.

The derivative is

.

Parameters

  a | First multiplicand.
  b | Second multiplicand.
  c | Summand.

Returns
  Product of the multiplicands plus the summand, ($a * $b) + $c.

Definition at line 248 of file fma.hpp.

var stan::math::fma | ( | const double & | a,
|  | const stan::math::var & | b,
|  | const stan::math::var & | c
| ) |  |

inline

The fused multiply-add function for a value and two variables (C99).

This function returns the product of the first two arguments plus the third argument.

The double-based version `::fma(double, double, double)` is defined in `<cmath>`.

The partial derivaties are

, and

.

Parameters

  a | First multiplicand.
  b | Second multiplicand.
  c | Summand.

Returns
  Product of the multiplicands plus the summand, ($a * $b) + $c.

Definition at line 273 of file fma.hpp.

template<typename T >

fvar<T> stan::math::fmax | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 13 of file fmax.hpp.

template<typename T >

fvar<T> stan::math::fmax | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 33 of file fmax.hpp.

template<typename T >

fvar<T> stan::math::fmax | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 53 of file fmax.hpp.

var stan::math::fmax | ( | const stan::math::var & | a,
|  | const stan::math::var & | b
| ) |  |

inline

Returns the maximum of the two variable arguments (C99).

No new variable implementations are created, with this function defined as if by

`fmax(a, b) = a` if a's value is greater than b's, and .

`fmax(a, b) = b` if b's value is greater than or equal to a's.

Parameters

  a | First variable.
  b | Second variable.

Returns
  If the first variable's value is larger than the second's, the first variable, otherwise the second variable.

Definition at line 63 of file fmax.hpp.

var stan::math::fmax | ( | const stan::math::var & | a,
|  | const double & | b
| ) |  |

inline

Returns the maximum of the variable and scalar, promoting the scalar to a variable if it is larger (C99).

For `fmax(a, b)`, if a's value is greater than b, then a is returned, otherwise a fesh variable implementation wrapping the value b is returned.

Parameters

  a | First variable.
  b | Second value

Returns
  If the first variable's value is larger than or equal to the second value, the first variable, otherwise the second value promoted to a fresh variable.

Definition at line 95 of file fmax.hpp.

var stan::math::fmax | ( | const double & | a,
|  | const stan::math::var & | b
| ) |  |

inline

Returns the maximum of a scalar and variable, promoting the scalar to a variable if it is larger (C99).

For `fmax(a, b)`, if a is greater than b's value, then a fresh variable implementation wrapping a is returned, otherwise b is returned.

Parameters

  a | First value.
  b | Second variable.

Returns
  If the first value is larger than the second variable's value, return the first value promoted to a variable, otherwise return the second variable.

Definition at line 127 of file fmax.hpp.

template<typename T >

fvar<T> stan::math::fmin | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 13 of file fmin.hpp.

template<typename T >

fvar<T> stan::math::fmin | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 33 of file fmin.hpp.

template<typename T >

fvar<T> stan::math::fmin | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 53 of file fmin.hpp.

var stan::math::fmin | ( | const stan::math::var & | a,
|  | const stan::math::var & | b
| ) |  |

inline

Returns the minimum of the two variable arguments (C99).

For `fmin(a, b)`, if a's value is less than b's, then a is returned, otherwise b is returned.

Parameters

  a | First variable.
  b | Second variable.

Returns
  If the first variable's value is smaller than the second's, the first variable, otherwise the second variable.

Definition at line 59 of file fmin.hpp.

var stan::math::fmin | ( | const stan::math::var & | a,
|  | double | b
| ) |  |

inline

Returns the minimum of the variable and scalar, promoting the scalar to a variable if it is larger (C99).

For `fmin(a, b)`, if a's value is less than or equal to b, then a is returned, otherwise a fresh variable wrapping b is returned.

Parameters

  a | First variable.
  b | Second value

Returns
  If the first variable's value is less than or equal to the second value, the first variable, otherwise the second value promoted to a fresh variable.

Definition at line 89 of file fmin.hpp.

var stan::math::fmin | ( | double | a,
|  | const stan::math::var & | b
| ) |  |

inline

Returns the minimum of a scalar and variable, promoting the scalar to a variable if it is larger (C99).

For `fmin(a, b)`, if a is less than b's value, then a fresh variable implementation wrapping a is returned, otherwise b is returned.

Parameters

  a | First value.
  b | Second variable.

Returns
  If the first value is smaller than the second variable's value, return the first value promoted to a variable, otherwise return the second variable.

Definition at line 120 of file fmin.hpp.

template<typename T >

fvar<T> stan::math::fmod | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 16 of file fmod.hpp.

template<typename T >

fvar<T> stan::math::fmod | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 26 of file fmod.hpp.

template<typename T >

fvar<T> stan::math::fmod | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 39 of file fmod.hpp.

var stan::math::fmod | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Return the floating point remainder after dividing the first variable by the second (cmath).

The partial derivatives with respect to the variables are defined everywhere but where , but we set these to match other values, with

, and

.

Parameters

  a | First variable.
  b | Second variable.

Returns
  Floating pointer remainder of dividing the first variable by the second.

Definition at line 103 of file fmod.hpp.

var stan::math::fmod | ( | const var & | a,
|  | const double | b
| ) |  |

inline

Return the floating point remainder after dividing the the first variable by the second scalar (cmath).

The derivative with respect to the variable is

.

Parameters

  a | First variable.
  b | Second scalar.

Returns
  Floating pointer remainder of dividing the first variable by the second scalar.

Definition at line 120 of file fmod.hpp.

var stan::math::fmod | ( | const double | a,
|  | const var & | b
| ) |  |

inline

Return the floating point remainder after dividing the first scalar by the second variable (cmath).

The derivative with respect to the variable is

.

Parameters

  a | First scalar.
  b | Second variable.

Returns
  Floating pointer remainder of dividing first scalar by the second variable.

Definition at line 137 of file fmod.hpp.

template<typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::frechet_ccdf_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | sigma
| ) |  |

Definition at line 31 of file frechet_ccdf_log.hpp.

template<typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::frechet_cdf | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | sigma
| ) |  |

Definition at line 31 of file frechet_cdf.hpp.

template<typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::frechet_cdf_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | sigma
| ) |  |

Definition at line 31 of file frechet_cdf_log.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::frechet_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | sigma
| ) |  |

Definition at line 34 of file frechet_log.hpp.

template<typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::frechet_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | sigma
| ) |  |

inline

Definition at line 140 of file frechet_log.hpp.

template<class RNG >

double stan::math::frechet_rng | ( | const double | alpha,
|  | const double | sigma,
|  | RNG & | rng
| ) |  |

inline

Definition at line 30 of file frechet_rng.hpp.

template<typename T_y , typename T_shape , typename T_inv_scale >

return_type<T_y, T_shape, T_inv_scale>::type stan::math::gamma_ccdf_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_inv_scale & | beta
| ) |  |

Definition at line 35 of file gamma_ccdf_log.hpp.

template<typename T_y , typename T_shape , typename T_inv_scale >

return_type<T_y, T_shape, T_inv_scale>::type stan::math::gamma_cdf | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_inv_scale & | beta
| ) |  |

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

Parameters

  y | A scalar variable.
  alpha | Shape parameter.
  beta | Inverse scale parameter.

Exceptions

  std::domain_error | if alpha is not greater than 0.
  std::domain_error | if beta is not greater than 0.
  std::domain_error | if y is not greater than or equal to 0.

Template Parameters

  T_y | Type of scalar.
  T_shape | Type of shape.
  T_inv_scale | Type of inverse scale.

Definition at line 49 of file gamma_cdf.hpp.

template<typename T_y , typename T_shape , typename T_inv_scale >

return_type<T_y, T_shape, T_inv_scale>::type stan::math::gamma_cdf_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_inv_scale & | beta
| ) |  |

Definition at line 35 of file gamma_cdf_log.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::math::gamma_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_inv_scale & | beta
| ) |  |

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

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

Parameters

  y | A scalar variable.
  alpha | Shape parameter.
  beta | Inverse scale parameter.

Exceptions

  std::domain_error | if alpha is not greater than 0.
  std::domain_error | if beta is not greater than 0.
  std::domain_error | if y is not greater than or equal to 0.

Template Parameters

  T_y | Type of scalar.
  T_shape | Type of shape.
  T_inv_scale | Type of inverse scale.

Definition at line 52 of file gamma_log.hpp.

template<typename T_y , typename T_shape , typename T_inv_scale >

return_type<T_y, T_shape, T_inv_scale>::type stan::math::gamma_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_inv_scale & | beta
| ) |  |

inline

Definition at line 164 of file gamma_log.hpp.

template<typename T >

fvar<T> stan::math::gamma_p | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 15 of file gamma_p.hpp.

template<typename T >

fvar<T> stan::math::gamma_p | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 51 of file gamma_p.hpp.

double stan::math::gamma_p | ( | double | x,
|  | double | a
| ) |  |

Definition at line 53 of file gamma_p.hpp.

template<typename T >

fvar<T> stan::math::gamma_p | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 86 of file gamma_p.hpp.

var stan::math::gamma_p | ( | const stan::math::var & | a,
|  | const stan::math::var & | b
| ) |  |

inline

Definition at line 104 of file gamma_p.hpp.

var stan::math::gamma_p | ( | const stan::math::var & | a,
|  | const double & | b
| ) |  |

inline

Definition at line 109 of file gamma_p.hpp.

var stan::math::gamma_p | ( | const double & | a,
|  | const stan::math::var & | b
| ) |  |

inline

Definition at line 114 of file gamma_p.hpp.

template<typename T >

fvar<T> stan::math::gamma_q | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 15 of file gamma_q.hpp.

template<typename T >

fvar<T> stan::math::gamma_q | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 51 of file gamma_q.hpp.

double stan::math::gamma_q | ( | double | x,
|  | double | a
| ) |  |

Definition at line 53 of file gamma_q.hpp.

var stan::math::gamma_q | ( | const stan::math::var & | a,
|  | const stan::math::var & | b
| ) |  |

inline

Definition at line 58 of file gamma_q.hpp.

var stan::math::gamma_q | ( | const stan::math::var & | a,
|  | const double & | b
| ) |  |

inline

Definition at line 63 of file gamma_q.hpp.

var stan::math::gamma_q | ( | const double & | a,
|  | const stan::math::var & | b
| ) |  |

inline

Definition at line 68 of file gamma_q.hpp.

template<typename T >

fvar<T> stan::math::gamma_q | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 86 of file gamma_q.hpp.

template<class RNG >

double stan::math::gamma_rng | ( | const double | alpha,
|  | const double | beta,
|  | RNG & | rng
| ) |  |

inline

Definition at line 33 of file gamma_rng.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::math::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 ,

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

Parameters

  y | A r x T matrix of observations. Rows are variables, columns are observations.
  F | A n x r matrix. The design matrix.
  G | A n x n matrix. The transition matrix.
  V | A r x r matrix. The observation covariance matrix.
  W | A n x n matrix. The state covariance matrix.
  m0 | A n x 1 matrix. The mean vector of the distribution of the initial state.
  C0 | A 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_error | if a matrix in the Kalman filter is not positive semi-definite.

Template Parameters

  T_y | Type of scalar.
  T_F | Type of design matrix.
  T_G | Type of transition matrix.
  T_V | Type of observation covariance matrix.
  T_W | Type of state covariance matrix.
  T_m0 | Type of initial state mean vector.
  T_C0 | Type of initial state covariance matrix.

Definition at line 79 of file gaussian_dlm_obs_log.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::math::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 225 of file gaussian_dlm_obs_log.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::math::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 ,

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

Parameters

  y | A r x T matrix of observations. Rows are variables, columns are observations.
  F | A n x r matrix. The design matrix.
  G | A n x n matrix. The transition matrix.
  V | A size r vector. The diagonal of the observation covariance matrix.
  W | A n x n matrix. The state covariance matrix.
  m0 | A n x 1 matrix. The mean vector of the distribution of the initial state.
  C0 | A 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_error | if a matrix in the Kalman filter is not semi-positive definite.

Template Parameters

  T_y | Type of scalar.
  T_F | Type of design matrix.
  T_G | Type of transition matrix.
  T_V | Type of observation variances
  T_W | Type of state covariance matrix.
  T_m0 | Type of initial state mean vector.
  T_C0 | Type of initial state covariance matrix.

Definition at line 285 of file gaussian_dlm_obs_log.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::math::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 442 of file gaussian_dlm_obs_log.hpp.

template<typename T >

const T& stan::math::get_base1 | ( | const std::vector< T > & | x,
|  | size_t | i,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one index.

If the index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i | Index into vector plus 1.
  error_msg | Error message if the index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at `i - 1`

Template Parameters

  T | type of value.

Definition at line 27 of file get_base1.hpp.

template<typename T >

const T& stan::math::get_base1 | ( | const std::vector< std::vector< T > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 53 of file get_base1.hpp.

template<typename T >

const T& stan::math::get_base1 | ( | const std::vector< std::vector< std::vector< T > > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | size_t | i3,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  i3 | Third index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 81 of file get_base1.hpp.

template<typename T >

const T& stan::math::get_base1 | ( | const std::vector< std::vector< std::vector< std::vector< T > > > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | size_t | i3,
|  | size_t | i4,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  i3 | Third index plus 1.
  i4 | Fourth index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 111 of file get_base1.hpp.

template<typename T >

const T& stan::math::get_base1 | ( | const std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | size_t | i3,
|  | size_t | i4,
|  | size_t | i5,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  i3 | Third index plus 1.
  i4 | Fourth index plus 1.
  i5 | Fifth index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 143 of file get_base1.hpp.

template<typename T >

const T& stan::math::get_base1 | ( | const std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | size_t | i3,
|  | size_t | i4,
|  | size_t | i5,
|  | size_t | i6,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  i3 | Third index plus 1.
  i4 | Fourth index plus 1.
  i5 | Fifth index plus 1.
  i6 | Sixth index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 178 of file get_base1.hpp.

template<typename T >

const T& stan::math::get_base1 | ( | const std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | size_t | i3,
|  | size_t | i4,
|  | size_t | i5,
|  | size_t | i6,
|  | size_t | i7,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  i3 | Third index plus 1.
  i4 | Fourth index plus 1.
  i5 | Fifth index plus 1.
  i6 | Sixth index plus 1.
  i7 | Seventh index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 216 of file get_base1.hpp.

template<typename T >

const T& stan::math::get_base1 | ( | const std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | size_t | i3,
|  | size_t | i4,
|  | size_t | i5,
|  | size_t | i6,
|  | size_t | i7,
|  | size_t | i8,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  i3 | Third index plus 1.
  i4 | Fourth index plus 1.
  i5 | Fifth index plus 1.
  i6 | Sixth index plus 1.
  i7 | Seventh index plus 1.
  i8 | Eigth index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 256 of file get_base1.hpp.

template<typename T >

Eigen::Matrix<T, 1, Eigen::Dynamic> stan::math::get_base1 | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | x,
|  | size_t | m,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a copy of the row of the specified vector at the specified base-one row index.

If the index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Warning: Because a copy is involved, it is inefficient to access element of matrices by first using this method to get a row then using a second call to get the value at a specified column.

Parameters

  x | Matrix from which to get a row
  m | Index into matrix plus 1.
  error_msg | Error message if the index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Row of matrix at `i - 1`.

Template Parameters

  T | type of value.

Definition at line 297 of file get_base1.hpp.

template<typename T >

const T& stan::math::get_base1 | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | x,
|  | size_t | m,
|  | size_t | n,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified matrix at the specified base-one row and column indexes.

If either index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Matrix from which to get a row
  m | Row index plus 1.
  n | Column index plus 1.
  error_msg | Error message if either index is out of range.
  idx | Nested index level to report in error message if either index is out of range.

Returns
  Value of matrix at row `m - 1` and column `n - 1`.

Template Parameters

  T | type of value.

Definition at line 324 of file get_base1.hpp.

template<typename T >

const T& stan::math::get_base1 | ( | const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | x,
|  | size_t | m,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified column vector at the specified base-one index.

If the index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Column vector from which to get a value.
  m | Row index plus 1.
  error_msg | Error message if the index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of column vector at row `m - 1`.

Template Parameters

  T | type of value.

Definition at line 351 of file get_base1.hpp.

template<typename T >

const T& stan::math::get_base1 | ( | const Eigen::Matrix< T, 1, Eigen::Dynamic > & | x,
|  | size_t | n,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified row vector at the specified base-one index.

If the index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Row vector from which to get a value.
  n | Column index plus 1.
  error_msg | Error message if the index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of row vector at column `n - 1`.

Template Parameters

  T | type of value.

Definition at line 376 of file get_base1.hpp.

template<typename T >

T& stan::math::get_base1_lhs | ( | std::vector< T > & | x,
|  | size_t | i,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one index.

If the index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i | Index into vector plus 1.
  error_msg | Error message if the index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at `i - 1`

Template Parameters

  T | type of value.

Definition at line 27 of file get_base1_lhs.hpp.

template<typename T >

T& stan::math::get_base1_lhs | ( | std::vector< std::vector< T > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 53 of file get_base1_lhs.hpp.

template<typename T >

T& stan::math::get_base1_lhs | ( | std::vector< std::vector< std::vector< T > > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | size_t | i3,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  i3 | Third index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 81 of file get_base1_lhs.hpp.

template<typename T >

T& stan::math::get_base1_lhs | ( | std::vector< std::vector< std::vector< std::vector< T > > > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | size_t | i3,
|  | size_t | i4,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  i3 | Third index plus 1.
  i4 | Fourth index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 111 of file get_base1_lhs.hpp.

template<typename T >

T& stan::math::get_base1_lhs | ( | std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | size_t | i3,
|  | size_t | i4,
|  | size_t | i5,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  i3 | Third index plus 1.
  i4 | Fourth index plus 1.
  i5 | Fifth index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 144 of file get_base1_lhs.hpp.

template<typename T >

T& stan::math::get_base1_lhs | ( | std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | size_t | i3,
|  | size_t | i4,
|  | size_t | i5,
|  | size_t | i6,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  i3 | Third index plus 1.
  i4 | Fourth index plus 1.
  i5 | Fifth index plus 1.
  i6 | Sixth index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 179 of file get_base1_lhs.hpp.

template<typename T >

T& stan::math::get_base1_lhs | ( | std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | size_t | i3,
|  | size_t | i4,
|  | size_t | i5,
|  | size_t | i6,
|  | size_t | i7,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  i3 | Third index plus 1.
  i4 | Fourth index plus 1.
  i5 | Fifth index plus 1.
  i6 | Sixth index plus 1.
  i7 | Seventh index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 217 of file get_base1_lhs.hpp.

template<typename T >

T& stan::math::get_base1_lhs | ( | std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< std::vector< T > > > > > > > > & | x,
|  | size_t | i1,
|  | size_t | i2,
|  | size_t | i3,
|  | size_t | i4,
|  | size_t | i5,
|  | size_t | i6,
|  | size_t | i7,
|  | size_t | i8,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified vector at the specified base-one indexes.

If an index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Vector from which to get a value.
  i1 | First index plus 1.
  i2 | Second index plus 1.
  i3 | Third index plus 1.
  i4 | Fourth index plus 1.
  i5 | Fifth index plus 1.
  i6 | Sixth index plus 1.
  i7 | Seventh index plus 1.
  i8 | Eigth index plus 1.
  error_msg | Error message if an index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of vector at indexes.

Template Parameters

  T | type of value.

Definition at line 258 of file get_base1_lhs.hpp.

template<typename T >

Eigen::Block<Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> > stan::math::get_base1_lhs | ( | Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | x,
|  | size_t | m,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a copy of the row of the specified vector at the specified base-one row index.

If the index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Warning: Because a copy is involved, it is inefficient to access element of matrices by first using this method to get a row then using a second call to get the value at a specified column.

Parameters

  x | Matrix from which to get a row
  m | Index into matrix plus 1.
  error_msg | Error message if the index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Row of matrix at `i - 1`.

Template Parameters

  T | type of value.

Definition at line 301 of file get_base1_lhs.hpp.

template<typename T >

T& stan::math::get_base1_lhs | ( | Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | x,
|  | size_t | m,
|  | size_t | n,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified matrix at the specified base-one row and column indexes.

If either index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Matrix from which to get a row
  m | Row index plus 1.
  n | Column index plus 1.
  error_msg | Error message if either index is out of range.
  idx | Nested index level to report in error message if either index is out of range.

Returns
  Value of matrix at row `m - 1` and column `n - 1`.

Template Parameters

  T | type of value.

Definition at line 328 of file get_base1_lhs.hpp.

template<typename T >

T& stan::math::get_base1_lhs | ( | Eigen::Matrix< T, Eigen::Dynamic, 1 > & | x,
|  | size_t | m,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified column vector at the specified base-one index.

If the index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Column vector from which to get a value.
  m | Row index plus 1.
  error_msg | Error message if the index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of column vector at row `m - 1`.

Template Parameters

  T | type of value.

Definition at line 355 of file get_base1_lhs.hpp.

template<typename T >

T& stan::math::get_base1_lhs | ( | Eigen::Matrix< T, 1, Eigen::Dynamic > & | x,
|  | size_t | n,
|  | const char * | error_msg,
|  | size_t | idx
| ) |  |

inline

Return a reference to the value of the specified row vector at the specified base-one index.

If the index is out of range, throw a `std::out_of_range` exception with the specified error message and index indicated.

Parameters

  x | Row vector from which to get a value.
  n | Column index plus 1.
  error_msg | Error message if the index is out of range.
  idx | Nested index level to report in error message if the index is out of range.

Returns
  Value of row vector at column `n - 1`.

Template Parameters

  T | type of value.

Definition at line 380 of file get_base1_lhs.hpp.

template<typename T_lp , typename T_lp_accum >

boost::math::tools::promote_args<T_lp, T_lp_accum>::type stan::math::get_lp | ( | const T_lp & | lp,
|  | const stan::math::accumulator< T_lp_accum > & | lp_accum
| ) |  |

inline

Definition at line 14 of file get_lp.hpp.

static void stan::math::grad | ( | chainable * | vi | ) |

static

void stan::math::grad | ( | var & | v,
|  | Eigen::Matrix< var, Eigen::Dynamic, 1 > & | x,
|  | Eigen::VectorXd & | g
| ) |  |

Propagate chain rule to calculate gradients starting from the specified variable.

Resizes the input vector to be the correct size.

The grad() function does not itself recover any memory. use `recover_memory()` or `recover_memory_nested()` to recover memory.

Parameters

  [in] | v | Value of function being differentiated
  [in] | x | Variables being differentiated with respect to
  [out] | g | Gradient, d/dx v, evaluated at x.

Definition at line 26 of file grad.hpp.

static void stan::math::grad | ( | chainable * | vi | ) |

static

Compute the gradient for all variables starting from the specified root variable implementation.

Does not recover memory. This chainable variable's adjoint is initialized using the method `init_dependent()` and then the chain rule is applied working down the stack from this chainable and calling each chainable's `chain()` method in turn.

This function computes a nested gradient only going back as far as the last nesting.

This function does not recover any memory from the computation.

Parameters

  vi | Variable implementation for root of partial derivative propagation.

Definition at line 30 of file grad.hpp.

template<typename T >

void stan::math::grad_2F1 | ( | T & | gradA,
|  | T & | gradC,
|  | T | a,
|  | T | b,
|  | T | c,
|  | T | z,
|  | T | precision = `1e-6`
| ) |  |

Definition at line 13 of file grad_2F1.hpp.

template<typename T >

void stan::math::grad_F32 | ( | T * | g,
|  | T | a,
|  | T | b,
|  | T | c,
|  | T | d,
|  | T | e,
|  | T | z,
|  | T | precision = `1e-6`
| ) |  |

Definition at line 11 of file grad_F32.hpp.

template<typename F >

void stan::math::grad_hessian | ( | const F & | f,
|  | const Eigen::Matrix< double, Dynamic, 1 > & | x,
|  | double & | fx,
|  | Eigen::Matrix< double, Dynamic, Dynamic > & | H,
|  | std::vector< Eigen::Matrix< double, Dynamic, Dynamic > > & | grad_H
| ) |  |

Calculate the value, the Hessian, and the gradient of the Hessian of the specified function at the specified argument.

The functor must implement

`stan::math::fvar<stan::math::fvar<stan::math::var> > operator()(const Eigen::Matrix<stan::math::fvar<stan::math::fvar<stan::math::var> >, Eigen::Dynamic, 1>&)`

using only operations that are defined for `stan::math::fvar` and `stan::math::var`.

This latter constraint usually requires the functions to be defined in terms of the libraries defined in Stan or in terms of functions with appropriately general namespace imports that eventually depend on functions defined in Stan.

Template Parameters

  F | Type of function

Parameters

  [in] | f | Function
  [in] | x | Argument to function
  [out] | fx | Function applied to argument
  [out] | H | Hessian of function at argument
  [out] | grad_H | Gradient of the Hessian of function at argument

Definition at line 46 of file grad_hessian.hpp.

void stan::math::grad_inc_beta | ( | double & | g1,
|  | double & | g2,
|  | double | a,
|  | double | b,
|  | double | z
| ) |  |

Definition at line 17 of file grad_inc_beta.hpp.

void stan::math::grad_inc_beta | ( | var & | g1,
|  | var & | g2,
|  | const var & | a,
|  | const var & | b,
|  | const var & | z
| ) |  |

Definition at line 24 of file grad_inc_beta.hpp.

template<typename T >

void stan::math::grad_inc_beta | ( | stan::math::fvar< T > & | g1,
|  | stan::math::fvar< T > & | g2,
|  | stan::math::fvar< T > | a,
|  | stan::math::fvar< T > | b,
|  | stan::math::fvar< T > | z
| ) |  |

Definition at line 24 of file grad_inc_beta.hpp.

template<typename T >

void stan::math::grad_reg_inc_beta | ( | T & | g1,
|  | T & | g2,
|  | T | a,
|  | T | b,
|  | T | z,
|  | T | digammaA,
|  | T | digammaB,
|  | T | digammaSum,
|  | T | betaAB
| ) |  |

Definition at line 14 of file grad_reg_inc_beta.hpp.

template<typename T >

T stan::math::grad_reg_inc_gamma | ( | T | a,
|  | T | z,
|  | T | g,
|  | T | dig,
|  | T | precision = `1e-6`
| ) |  |

Definition at line 15 of file grad_reg_inc_gamma.hpp.

template<typename F >

void stan::math::grad_tr_mat_times_hessian | ( | const F & | f,
|  | const Eigen::Matrix< double, Dynamic, 1 > & | x,
|  | const Eigen::Matrix< double, Dynamic, Dynamic > & | M,
|  | Eigen::Matrix< double, Dynamic, 1 > & | grad_tr_MH
| ) |  |

Definition at line 20 of file grad_tr_mat_times_hessian.hpp.

template<typename F >

void stan::math::gradient | ( | const F & | f,
|  | const Eigen::Matrix< double, Dynamic, 1 > & | x,
|  | double & | fx,
|  | Eigen::Matrix< double, Dynamic, 1 > & | grad_fx
| ) |  |

Calculate the value and the gradient of the specified function at the specified argument.

The functor must implement

`stan::math::var operator()(const Eigen::Matrix<stan::math::var, Eigen::Dynamic, 1>&)`

using only operations that are defined for `stan::math::var`. This latter constraint usually requires the functions to be defined in terms of the libraries defined in Stan or in terms of functions with appropriately general namespace imports that eventually depend on functions defined in Stan.

Time and memory usage is on the order of the size of the fully unfolded expression for the function applied to the argument, independently of dimension.

Template Parameters

  F | Type of function

Parameters

  [in] | f | Function
  [in] | x | Argument to function
  [out] | fx | Function applied to argument
  [out] | grad_fx | Gradient of function at argument

Definition at line 44 of file gradient.hpp.

template<typename T , typename F >

void stan::math::gradient | ( | const F & | f,
|  | const Eigen::Matrix< T, Dynamic, 1 > & | x,
|  | T & | fx,
|  | Eigen::Matrix< T, Dynamic, 1 > & | grad_fx
| ) |  |

Calculate the value and the gradient of the specified function at the specified argument.

The functor must implement

`stan::math::fvar operator()(const Eigen::Matrix<stan::math::var, Eigen::Dynamic, 1>&)`

using only operations that are defined for `stan::math::fvar`. This latter constraint usually requires the functions to be defined in terms of the libraries defined in Stan or in terms of functions with appropriately general namespace imports that eventually depend on functions defined in Stan.

Time and memory usage is on the order of the size of the fully unfolded expression for the function applied to the argument, independently of dimension.

Template Parameters

  F | Type of function

Parameters

  [in] | f | Function
  [in] | x | Argument to function
  [out] | fx | Function applied to argument
  [out] | grad_fx | Gradient of function at argument

Definition at line 44 of file gradient.hpp.

template<typename T1 , typename T2 , typename F >

void stan::math::gradient_dot_vector | ( | const F & | f,
|  | const Eigen::Matrix< T1, Dynamic, 1 > & | x,
|  | const Eigen::Matrix< T2, Dynamic, 1 > & | v,
|  | T1 & | fx,
|  | T1 & | grad_fx_dot_v
| ) |  |

Definition at line 19 of file gradient_dot_vector.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::gumbel_ccdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | beta
| ) |  |

Definition at line 28 of file gumbel_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::gumbel_cdf | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | beta
| ) |  |

Definition at line 28 of file gumbel_cdf.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::gumbel_cdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | beta
| ) |  |

Definition at line 28 of file gumbel_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::gumbel_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | beta
| ) |  |

Definition at line 28 of file gumbel_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::gumbel_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | beta
| ) |  |

inline

Definition at line 118 of file gumbel_log.hpp.

template<class RNG >

double stan::math::gumbel_rng | ( | const double | mu,
|  | const double | beta,
|  | RNG & | rng
| ) |  |

inline

Definition at line 27 of file gumbel_rng.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::head | ( | const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | v,
|  | size_t | n
| ) |  |

inline

Return the specified number of elements as a vector from the front of the specified vector.

Template Parameters

  T | Type of value in vector

Parameters

  v | Vector input
  n | Size of return

Returns
  The first n elements of v

Definition at line 24 of file head.hpp.

template<typename T >

Eigen::Matrix<T, 1, Eigen::Dynamic> stan::math::head | ( | const Eigen::Matrix< T, 1, Eigen::Dynamic > & | rv,
|  | size_t | n
| ) |  |

inline

Return the specified number of elements as a row vector from the front of the specified row vector.

Template Parameters

  T | Type of value in vector

Parameters

  rv | Row vector
  n | Size of return row vector

Returns
  The first n elements of rv

Definition at line 42 of file head.hpp.

template<typename T >

std::vector<T> stan::math::head | ( | const std::vector< T > & | sv,
|  | size_t | n
| ) |  |

Return the specified number of elements as a standard vector from the front of the specified standard vector.

Template Parameters

  T | Type of value in vector

Parameters

  sv | Standard vector
  n | Size of return

Returns
  The first n elements of sv

Definition at line 58 of file head.hpp.

template<typename F >

void stan::math::hessian | ( | const F & | f,
|  | const Eigen::Matrix< double, Dynamic, 1 > & | x,
|  | double & | fx,
|  | Eigen::Matrix< double, Dynamic, 1 > & | grad,
|  | Eigen::Matrix< double, Dynamic, Dynamic > & | H
| ) |  |

Calculate the value, the gradient, and the Hessian, of the specified function at the specified argument in O(N^2) time and O(N^2) space.

The functor must implement

`stan::math::fvar<stan::math::var> operator()(const Eigen::Matrix<stan::math::fvar<stan::math::var>, Eigen::Dynamic, 1>&)`

using only operations that are defined for `stan::math::fvar` and `stan::math::var`.

This latter constraint usually requires the functions to be defined in terms of the libraries defined in Stan or in terms of functions with appropriately general namespace imports that eventually depend on functions defined in Stan.

Template Parameters

  F | Type of function

Parameters

  [in] | f | Function
  [in] | x | Argument to function
  [out] | fx | Function applied to argument
  [out] | grad | gradient of function at argument
  [out] | H | Hessian of function at argument

Definition at line 46 of file hessian.hpp.

template<typename T , typename F >

void stan::math::hessian | ( | const F & | f,
|  | const Eigen::Matrix< T, Dynamic, 1 > & | x,
|  | T & | fx,
|  | Eigen::Matrix< T, Dynamic, 1 > & | grad,
|  | Eigen::Matrix< T, Dynamic, Dynamic > & | H
| ) |  |

Definition at line 75 of file hessian.hpp.

template<typename F >

void stan::math::hessian_times_vector | ( | const F & | f,
|  | const Eigen::Matrix< double, Dynamic, 1 > & | x,
|  | const Eigen::Matrix< double, Dynamic, 1 > & | v,
|  | double & | fx,
|  | Eigen::Matrix< double, Dynamic, 1 > & | Hv
| ) |  |

Definition at line 17 of file hessian_times_vector.hpp.

template<typename T , typename F >

void stan::math::hessian_times_vector | ( | const F & | f,
|  | const Eigen::Matrix< T, Dynamic, 1 > & | x,
|  | const Eigen::Matrix< T, Dynamic, 1 > & | v,
|  | T & | fx,
|  | Eigen::Matrix< T, Dynamic, 1 > & | Hv
| ) |  |

Definition at line 46 of file hessian_times_vector.hpp.

template<bool propto, typename T_n , typename T_N , typename T_a , typename T_b >

double stan::math::hypergeometric_log | ( | const T_n & | n,
|  | const T_N & | N,
|  | const T_a & | a,
|  | const T_b & | b
| ) |  |

Definition at line 31 of file hypergeometric_log.hpp.

template<typename T_n , typename T_N , typename T_a , typename T_b >

double stan::math::hypergeometric_log | ( | const T_n & | n,
|  | const T_N & | N,
|  | const T_a & | a,
|  | const T_b & | b
| ) |  |

inline

Definition at line 88 of file hypergeometric_log.hpp.

template<class RNG >

int stan::math::hypergeometric_rng | ( | int | N,
|  | int | a,
|  | int | b,
|  | RNG & | rng
| ) |  |

inline

Definition at line 16 of file hypergeometric_rng.hpp.

template<typename T >

fvar<T> stan::math::hypot | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 13 of file hypot.hpp.

template<typename T >

fvar<T> stan::math::hypot | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 22 of file hypot.hpp.

template<typename T >

fvar<T> stan::math::hypot | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 31 of file hypot.hpp.

var stan::math::hypot | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Returns the length of the hypoteneuse of a right triangle with sides of the specified lengths (C99).

See hypot() for double-based function.

The partial derivatives are given by

, and

.

Parameters

  a | Length of first side.
  b | Length of second side.

Returns
  Length of hypoteneuse.

Definition at line 53 of file hypot.hpp.

var stan::math::hypot | ( | const var & | a,
|  | double | b
| ) |  |

inline

Returns the length of the hypoteneuse of a right triangle with sides of the specified lengths (C99).

See hypot() for double-based function.

The derivative is

.

Parameters

  a | Length of first side.
  b | Length of second side.

Returns
  Length of hypoteneuse.

Definition at line 71 of file hypot.hpp.

var stan::math::hypot | ( | double | a,
|  | const var & | b
| ) |  |

inline

Returns the length of the hypoteneuse of a right triangle with sides of the specified lengths (C99).

See hypot() for double-based function.

The derivative is

.

Parameters

  a | Length of first side.
  b | Length of second side.

Returns
  Length of hypoteneuse.

Definition at line 116 of file hypot.hpp.

double stan::math::ibeta | ( | const double | a,
|  | const double | b,
|  | const double | x
| ) |  |

inline

The normalized incomplete beta function of a, b, and x.

Used to compute the cumulative density function for the beta distribution.

Parameters

  a | Shape parameter a <= 0; a and b can't both be 0
  b | Shape parameter b <= 0
  x | Random variate. 0 <= x <= 1

Exceptions

  if | constraints are violated or if any argument is NaN

Returns
  The normalized incomplete beta function.

Definition at line 23 of file ibeta.hpp.

var stan::math::ibeta | ( | const var & | a,
|  | const var & | b,
|  | const var & | x
| ) |  |

inline

The normalized incomplete beta function of a, b, and x.

Used to compute the cumulative density function for the beta distribution.

Partial derivatives are those specified by wolfram alpha. The values were checked using both finite differences and by independent code for calculating the derivatives found in JSS (paper by Boik and Robison-Cox).

Parameters

  a | Shape parameter.
  b | Shape parameter.
  x | Random variate.

Returns
  The normalized incomplete beta function.

Exceptions

  if | any argument is NaN.

Definition at line 238 of file ibeta.hpp.

template<typename T >

T stan::math::identity_constrain | ( | T | 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

  x | Free scalar.

Returns
  Transformed input.

Template Parameters

  T | Type of scalar.

Definition at line 22 of file identity_constrain.hpp.

template<typename T >

T stan::math::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

  x | Free scalar. lp Reference to log probability.

Returns
  Transformed input.

Template Parameters

  T | Type of scalar.

Definition at line 41 of file identity_constrain.hpp.

template<typename T >

T stan::math::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

  y | Constrained scalar.

Returns
  The input.

Template Parameters

  T | Type of scalar.

Definition at line 21 of file identity_free.hpp.

var stan::math::if_else | ( | bool | c,
|  | const var & | y_true,
|  | const var & | y_false
| ) |  |

inline

If the specified condition is true, return the first variable, otherwise return the second variable.

Parameters

  c | Boolean condition.
  y_true | Variable to return if condition is true.
  y_false | Variable to return if condition is false.

Definition at line 17 of file if_else.hpp.

template<typename T_true , typename T_false >

boost::math::tools::promote_args<T_true, T_false>::type stan::math::if_else | ( | const bool | c,
|  | const T_true | y_true,
|  | const T_false | y_false
| ) |  |

inline

Return the second argument if the first argument is true and otherwise return the second argument.

This is just a convenience method to provide a function with the same behavior as the built-in ternary operator. In general, this function behaves as if defined by

`if_else(c, y1, y0) = c ? y1 : y0`.

Parameters

  c | Boolean condition value.
  y_true | Value to return if condition is true.
  y_false | Value to return if condition is false.

Definition at line 25 of file if_else.hpp.

var stan::math::if_else | ( | bool | c,
|  | double | y_true,
|  | const var & | y_false
| ) |  |

inline

If the specified condition is true, return a new variable constructed from the first scalar, otherwise return the second variable.

Parameters

  c | Boolean condition.
  y_true | Value to promote to variable and return if condition is true.
  y_false | Variable to return if condition is false.

Definition at line 29 of file if_else.hpp.

var stan::math::if_else | ( | bool | c,
|  | const var & | y_true,
|  | const double | y_false
| ) |  |

inline

If the specified condition is true, return the first variable, otherwise return a new variable constructed from the second scalar.

Parameters

  c | Boolean condition.
  y_true | Variable to return if condition is true.
  y_false | Value to promote to variable and return if condition is false.

Definition at line 44 of file if_else.hpp.

double stan::math::inc_beta | ( | const double & | a,
|  | const double & | b,
|  | const double & | x
| ) |  |

inline

Definition at line 10 of file inc_beta.hpp.

template<typename T >

fvar<T> stan::math::inc_beta | ( | const fvar< T > & | a,
|  | const fvar< T > & | b,
|  | const fvar< T > & | x
| ) |  |

inline

Definition at line 20 of file inc_beta.hpp.

var stan::math::inc_beta | ( | const stan::math::var & | a,
|  | const stan::math::var & | b,
|  | const stan::math::var & | c
| ) |  |

inline

Definition at line 45 of file inc_beta.hpp.

template<typename T >

T stan::math::inc_beta_dda | ( | T | a,
|  | T | b,
|  | T | z,
|  | T | digamma_a,
|  | T | digamma_ab
| ) |  |

Returns the partial derivative of the regularized incomplete beta function, I_{z}(a, b) with respect to a.

The power series used to compute the deriative tends to converge slowly when a and b are large, especially if z approaches 1. The implementation will throw an exception if the series have not converged within 100,000 iterations. The current implementation has been tested for values of a and b up to 12500 and z = 0.999.

Template Parameters

  T | scalar types of arguments

Parameters

  a | a
  b | b
  z | upper bound of the integral
  digamma_a | value of digamma(a)
  digamma_ab | value of digamma(b)

Returns
  partial derivative of the incomplete beta with respect to a

Precondition
  a >= 0
  b >= 0
  0 <= z <= 1

Definition at line 38 of file inc_beta_dda.hpp.

template<typename T >

T stan::math::inc_beta_ddb | ( | T | a,
|  | T | b,
|  | T | z,
|  | T | digamma_b,
|  | T | digamma_ab
| ) |  |

Returns the partial derivative of the regularized incomplete beta function, I_{z}(a, b) with respect to b.

The power series used to compute the deriative tends to converge slowly when a and b are large, especailly if z approaches 1. The implementation will throw an exception if the series have not converged within 100,000 iterations. The current implementation has been tested for values of a and b up to 12500 and z = 0.999.

Template Parameters

  T | scalar types of arguments

Parameters

  a | a
  b | b
  z | upper bound of the integral
  digamma_b | value of digamma(b)
  digamma_ab | value of digamma(b)

Returns
  partial derivative of the incomplete beta with respect to b

Precondition
  a >= 0
  b >= 0
  0 <= z <= 1

Definition at line 38 of file inc_beta_ddb.hpp.

template<typename T >

T stan::math::inc_beta_ddz | ( | T | a,
|  | T | b,
|  | T | z
| ) |  |

Returns the partial derivative of the regularized incomplete beta function, I_{z}(a, b) with respect to z.

Template Parameters

  T | scalar types of arguments

Parameters

  a | a
  b | b
  z | upper bound of the integral

Returns
  partial derivative of the incomplete beta with respect to z

Precondition
  a > 0
  b > 0
  0 < z <= 1

Definition at line 27 of file inc_beta_ddz.hpp.

template<>

double stan::math::inc_beta_ddz | ( | double | a,
|  | double | b,
|  | double | z
| ) |  |

Definition at line 35 of file inc_beta_ddz.hpp.

template<typename T >

void stan::math::initialize | ( | T & | x,
|  | const T & | v
| ) |  |

inline

Definition at line 17 of file initialize.hpp.

template<typename T , typename V >

boost::enable_if_c<boost::is_arithmetic<V>::value, void>::type stan::math::initialize | ( | T & | x,
|  | V | v
| ) |  |

inline

Definition at line 23 of file initialize.hpp.

template<typename T , int R, int C, typename V >

void stan::math::initialize | ( | Eigen::Matrix< T, R, C > & | x,
|  | const V & | v
| ) |  |

inline

Definition at line 27 of file initialize.hpp.

template<typename T , typename V >

void stan::math::initialize | ( | std::vector< T > & | x,
|  | const V & | v
| ) |  |

inline

Definition at line 32 of file initialize.hpp.

void stan::math::initialize_variable | ( | var & | variable,
|  | const var & | value
| ) |  |

inline

Initialize variable to value.

(Function may look pointless, but its needed to bottom out recursion.)

Definition at line 15 of file initialize_variable.hpp.

template<int R, int C>

void stan::math::initialize_variable | ( | Eigen::Matrix< var, R, C > & | matrix,
|  | const var & | value
| ) |  |

inline

Initialize every cell in the matrix to the specified value.

Definition at line 24 of file initialize_variable.hpp.

template<typename T >

void stan::math::initialize_variable | ( | std::vector< T > & | variables,
|  | const var & | value
| ) |  |

inline

Initialize the variables in the standard vector recursively.

Definition at line 34 of file initialize_variable.hpp.

template<typename T >

unsigned int stan::math::int_step | ( | const T | y | ) |

The integer step, or Heaviside, function.

For double NaN input, int_step(NaN) returns 0.

Parameters

  y | Value to test.

Returns
  1 if value is greater than 0 and 0 otherwise

Template Parameters

  T | Scalar argument type.

Definition at line 25 of file int_step.hpp.

template<typename F , typename T1 , typename T2 >

std::vector<std::vector<typename stan::return_type<T1, T2>::type> > stan::math::integrate_ode | ( | const F & | f,
|  | const std::vector< T1 > | y0,
|  | const double | t0,
|  | const std::vector< double > & | ts,
|  | const std::vector< T2 > & | theta,
|  | const std::vector< double > & | x,
|  | const std::vector< int > & | x_int,
|  | std::ostream * | msgs
| ) |  |

Return the solutions for the specified system of ordinary differential equations given the specified initial state, initial times, times of desired solution, and parameters and data, writing error and warning messages to the specified stream.

Warning: If the system of equations is stiff, roughly defined by having varying time scales across dimensions, then this solver is likely to be slow.

This function is templated to allow the initial times to be either data or autodiff variables and the parameters to be data or autodiff variables. The autodiff-based implementation for reverse-mode are defined in namespace `stan::math` and may be invoked via argument-dependent lookup by including their headers.

This function uses the Dormand-Prince method as implemented in Boost's `boost::numeric::odeint::runge_kutta_dopri5` integrator.

Template Parameters

  F | type of ODE system function.
  T1 | type of scalars for initial values.
  T2 | type of scalars for parameters.

Parameters

  [in] | f | functor for the base ordinary differential equation.
  [in] | y0 | initial state.
  [in] | t0 | initial time.
  [in] | ts | times of the desired solutions, in strictly increasing order, all greater than the initial time.
  [in] | theta | parameter vector for the ODE.
  [in] | x | continuous data vector for the ODE.
  [in] | x_int | integer data vector for the ODE.
  [in,out] | msgs | the print stream for warning messages.

Returns
  a vector of states, each state being a vector of the same size as the state variable, corresponding to a time in ts.

Definition at line 60 of file integrate_ode.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::inv | ( | const T | x | ) |

inline

Definition at line 12 of file inv.hpp.

template<typename T >

fvar<T> stan::math::inv | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file inv.hpp.

var stan::math::inv | ( | const var & | a | ) |

inline

Definition at line 42 of file inv.hpp.

template<typename T_y , typename T_dof >

return_type<T_y, T_dof>::type stan::math::inv_chi_square_ccdf_log | ( | const T_y & | y,
|  | const T_dof & | nu
| ) |  |

Definition at line 33 of file inv_chi_square_ccdf_log.hpp.

template<typename T_y , typename T_dof >

return_type<T_y, T_dof>::type stan::math::inv_chi_square_cdf | ( | const T_y & | y,
|  | const T_dof & | nu
| ) |  |

Definition at line 33 of file inv_chi_square_cdf.hpp.

template<typename T_y , typename T_dof >

return_type<T_y, T_dof>::type stan::math::inv_chi_square_cdf_log | ( | const T_y & | y,
|  | const T_dof & | nu
| ) |  |

Definition at line 33 of file inv_chi_square_cdf_log.hpp.

template<bool propto, typename T_y , typename T_dof >

return_type<T_y, T_dof>::type stan::math::inv_chi_square_log | ( | const T_y & | y,
|  | const T_dof & | nu
| ) |  |

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

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

Parameters

  y | A scalar variable.
  nu | Degrees of freedom.

Exceptions

  std::domain_error | if nu is not greater than or equal to 0
  std::domain_error | if y is not greater than or equal to 0.

Template Parameters

  T_y | Type of scalar.
  T_dof | Type of degrees of freedom.

Definition at line 52 of file inv_chi_square_log.hpp.

template<typename T_y , typename T_dof >

return_type<T_y, T_dof>::type stan::math::inv_chi_square_log | ( | const T_y & | y,
|  | const T_dof & | nu
| ) |  |

inline

Definition at line 142 of file inv_chi_square_log.hpp.

template<class RNG >

double stan::math::inv_chi_square_rng | ( | const double | nu,
|  | RNG & | rng
| ) |  |

inline

Definition at line 31 of file inv_chi_square_rng.hpp.

template<typename T >

fvar<T> stan::math::inv_cloglog | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file inv_cloglog.hpp.

var stan::math::inv_cloglog | ( | const stan::math::var & | a | ) |

inline

Return the inverse complementary log-log function applied specified variable (stan).

See stan::math::inv_cloglog() for the double-based version.

The derivative is given by

.

Parameters

  a | Variable argument.

Returns
  The inverse complementary log-log of the specified argument.

Definition at line 36 of file inv_cloglog.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::inv_cloglog | ( | T | x | ) |

inline

The inverse complementary log-log function.

The function is defined by

`inv_cloglog(x) = 1 - exp(-exp(x))`.

This function can be used to implement the inverse link function for complementary-log-log regression.

Parameters

  x | Argument.

Returns
  Inverse complementary log-log of the argument.

Definition at line 49 of file inv_cloglog.hpp.

template<typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::inv_gamma_ccdf_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | beta
| ) |  |

Definition at line 35 of file inv_gamma_ccdf_log.hpp.

template<typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::inv_gamma_cdf | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | beta
| ) |  |

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

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

Parameters

  y | A scalar variable.
  alpha | Shape parameter.
  beta | Scale parameter.

Exceptions

  std::domain_error | if alpha is not greater than 0.
  std::domain_error | if beta is not greater than 0.
  std::domain_error | if y is not greater than 0.

Template Parameters

  T_y | Type of scalar.
  T_shape | Type of shape.
  T_scale | Type of scale.

Definition at line 51 of file inv_gamma_cdf.hpp.

template<typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::inv_gamma_cdf_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | beta
| ) |  |

Definition at line 35 of file inv_gamma_cdf_log.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::inv_gamma_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | beta
| ) |  |

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

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

Parameters

  y | A scalar variable.
  alpha | Shape parameter.
  beta | Scale parameter.

Exceptions

  std::domain_error | if alpha is not greater than 0.
  std::domain_error | if beta is not greater than 0.
  std::domain_error | if y is not greater than 0.

Template Parameters

  T_y | Type of scalar.
  T_shape | Type of shape.
  T_scale | Type of scale.

Definition at line 51 of file inv_gamma_log.hpp.

template<typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::inv_gamma_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | beta
| ) |  |

inline

Definition at line 163 of file inv_gamma_log.hpp.

template<class RNG >

double stan::math::inv_gamma_rng | ( | const double | alpha,
|  | const double | beta,
|  | RNG & | rng
| ) |  |

inline

Definition at line 33 of file inv_gamma_rng.hpp.

template<typename T >

fvar<T> stan::math::inv_logit | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file inv_logit.hpp.

var stan::math::inv_logit | ( | const stan::math::var & | a | ) |

inline

The inverse logit function for variables (stan).

See stan::math::inv_logit() for the double-based version.

The derivative of inverse logit is

.

Parameters

  a | Argument variable.

Returns
  Inverse logit of argument.

Definition at line 34 of file inv_logit.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::inv_logit | ( | const T | a | ) |

inline

Returns the inverse logit function applied to the argument.

The inverse logit function is defined by

.

This function can be used to implement the inverse link function for logistic regression.

The inverse to this function is `stan::math::logit`.

Parameters

  a | Argument.

Returns
  Inverse logit of argument.

Definition at line 52 of file inv_logit.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::inv_sqrt | ( | const T | x | ) |

inline

Definition at line 12 of file inv_sqrt.hpp.

template<typename T >

fvar<T> stan::math::inv_sqrt | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file inv_sqrt.hpp.

var stan::math::inv_sqrt | ( | const var & | a | ) |

inline

Definition at line 42 of file inv_sqrt.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::inv_square | ( | const T | x | ) |

inline

Definition at line 12 of file inv_square.hpp.

template<typename T >

fvar<T> stan::math::inv_square | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file inv_square.hpp.

var stan::math::inv_square | ( | const var & | a | ) |

inline

Definition at line 42 of file inv_square.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::math::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.

Parameters

  W | A scalar matrix
  nu | Degrees of freedom
  S | The scale matrix

Returns
  The log of the Inverse-Wishart density at W given nu and S.

Exceptions

  std::domain_error | if nu is not greater than k-1
  std::domain_error | if S is not square, not symmetric, or not semi-positive definite.

Template Parameters

  T_y | Type of scalar.
  T_dof | Type of degrees of freedom.
  T_scale | Type of scale.

Definition at line 52 of file inv_wishart_log.hpp.

template<typename T_y , typename T_dof , typename T_scale >

boost::math::tools::promote_args<T_y, T_dof, T_scale>::type stan::math::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_log.hpp.

template<class RNG >

Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> stan::math::inv_wishart_rng | ( | const double | nu,
|  | const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > & | S,
|  | RNG & | rng
| ) |  |

inline

Definition at line 21 of file inv_wishart_rng.hpp.

template<typename T >

void stan::math::invalid_argument | ( | const char * | function,
|  | const char * | name,
|  | const T & | y,
|  | const char * | msg1,
|  | const char * | msg2
| ) |  |

inline

Throw an invalid_argument exception with a consistently formatted message.

This is an abstraction for all Stan functions to use when throwing invalid argument. This will allow us to change the behavior for all functions at once.

The message is: "<function>: <name> <msg1><y><msg2>"

Template Parameters

  T | Type of variable

Parameters

  function | Name of the function
  name | Name of the variable
  y | Variable
  msg1 | Message to print before the variable
  msg2 | Message to print after the variable

Exceptions

  std::invalid_argument |

Definition at line 31 of file invalid_argument.hpp.

template<typename T >

void stan::math::invalid_argument | ( | const char * | function,
|  | const char * | name,
|  | const T & | y,
|  | const char * | msg1
| ) |  |

inline

Throw an invalid_argument exception with a consistently formatted message.

This is an abstraction for all Stan functions to use when throwing invalid argument. This will allow us to change the behavior for all functions at once. (We've already changed behavior mulitple times up to Stan v2.5.0.)

The message is: "<function>: <name> <msg1><y>"

Template Parameters

  T | Type of variable

Parameters

  function | Name of the function
  name | Name of the variable
  y | Variable
  msg1 | Message to print before the variable

Exceptions

  std::invalid_argument |

Definition at line 66 of file invalid_argument.hpp.

template<typename T >

void stan::math::invalid_argument_vec | ( | const char * | function,
|  | const char * | name,
|  | const T & | y,
|  | const size_t | i,
|  | const char * | msg1,
|  | const char * | msg2
| ) |  |

inline

Throw an invalid argument exception with a consistently formatted message.

This is an abstraction for all Stan functions to use when throwing invalid arguments. This will allow us to change the behavior for all functions at once. (We've already changed behavior mulitple times up to Stan v2.5.0.)

The message is: "<function>: <name>[<i+error_index>] <msg1><y>" where error_index is the value of stan::error_index::value which indicates whether the message should be 0 or 1 indexed.

Template Parameters

  T | Type of variable

Parameters

  function | Name of the function
  name | Name of the variable
  y | Variable
  i | Index
  msg1 | Message to print before the variable
  msg2 | Message to print after the variable

Exceptions

  std::invalid_argument |

Definition at line 38 of file invalid_argument_vec.hpp.

template<typename T >

void stan::math::invalid_argument_vec | ( | const char * | function,
|  | const char * | name,
|  | const T & | y,
|  | const size_t | i,
|  | const char * | msg
| ) |  |

inline

Throw an invalid argument exception with a consistently formatted message.

This is an abstraction for all Stan functions to use when throwing invalid arguments. This will allow us to change the behavior for all functions at once. (We've already changed behavior mulitple times up to Stan v2.5.0.)

The message is: "<function>: <name>[<i+error_index>] <msg1><y>" where error_index is the value of stan::error_index::value which indicates whether the message should be 0 or 1 indexed.

Template Parameters

  T | Type of variable

Parameters

  function | Name of the function
  name | Name of the variable
  y | Variable
  i | Index
  msg | Message to print before the variable

Exceptions

  std::invalid_argument |

Definition at line 74 of file invalid_argument_vec.hpp.

template<typename T , int R, int C>

Eigen::Matrix<T, R, C> stan::math::inverse | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Returns the inverse of the specified matrix.

Parameters

  m | Specified matrix.

Returns
  Inverse of the matrix.

Definition at line 18 of file inverse.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, R, C> stan::math::inverse | ( | const Eigen::Matrix< fvar< T >, R, C > & | m | ) |

inline

Definition at line 20 of file inverse.hpp.

template<typename Vector >

void stan::math::inverse_softmax | ( | const Vector & | simplex,
|  | Vector & | y
| ) |  |

Writes the inverse softmax of the simplex argument into the second argument.

See `stan::math::softmax` for the inverse function and a definition of the relation.

The inverse softmax function is defined by

.

This function defines the inverse of `stan::math::softmax` up to a scaling factor.

Because of the definition, values of 0.0 in the simplex are converted to negative infinity, and values of 1.0 are converted to 0.0.

There is no check that the input vector is a valid simplex vector.

Parameters

  simplex | Simplex vector input.
  y | Vector into which the inverse softmax is written.

Exceptions

  std::invalid_argument | if size of the input and output vectors differ.

Definition at line 34 of file inverse_softmax.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::inverse_spd | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m | ) |

inline

Returns the inverse of the specified symmetric, pos/neg-definite matrix.

Parameters

  m | Specified matrix.

Returns
  Inverse of the matrix.

Definition at line 19 of file inverse_spd.hpp.

template<typename T >

bool stan::math::is_aligned | ( | T * | ptr,
|  | unsigned int | bytes_aligned
| ) |  |

Return `true` if the specified pointer is aligned on the number of bytes.

This doesn't really make sense other than for powers of 2.

Parameters

  ptr | Pointer to test.
  bytes_aligned | Number of bytes of alignment required.

Returns
  `true` if pointer is aligned.

Template Parameters

  Type | of object to which pointer points.

Definition at line 34 of file stack_alloc.hpp.

int stan::math::is_inf | ( | const double | x | ) |

inline

Returns 1 if the input is infinite and 0 otherwise.

Delegates to `boost::math::isinf`.

Parameters

  x | Value to test.

Returns
  `1` if the value is infinite.

Definition at line 19 of file is_inf.hpp.

template<typename T >

int stan::math::is_inf | ( | const fvar< T > & | x | ) |

inline

Returns 1 if the input's value is infinite and 0 otherwise.

Delegates to `stan::math::is_inf`.

Parameters

  x | Value to test.

Returns
  `1` if the value is infinite and `0` otherwise.

Definition at line 22 of file is_inf.hpp.

int stan::math::is_inf | ( | const var & | v | ) |

inline

Returns 1 if the input's value is infinite and 0 otherwise.

Delegates to `stan::math::is_inf`.

Parameters

  v | Value to test.

Returns
  `1` if the value is infinite and `0` otherwise.

Definition at line 23 of file is_inf.hpp.

bool stan::math::is_nan | ( | double | x | ) |

inline

Returns 1 if the input is NaN and 0 otherwise.

Delegates to `boost::math::isnan`.

Parameters

  x | Value to test.

Returns
  `1` if the value is NaN.

Definition at line 18 of file is_nan.hpp.

bool stan::math::is_nan | ( | const var & | v | ) |

inline

Returns 1 if the input's value is NaN and 0 otherwise.

Delegates to `stan::math::is_nan(double)`.

Parameters

  v | Value to test.

Returns
  `1` if the value is NaN and `0` otherwise.

Definition at line 21 of file is_nan.hpp.

template<typename T >

int stan::math::is_nan | ( | const fvar< T > & | x | ) |

inline

Returns 1 if the input's value is NaN and 0 otherwise.

Delegates to `stan::math::is_nan`.

Parameters

  x | Value to test.

Returns
  `1` if the value is NaN and `0` otherwise.

Definition at line 22 of file is_nan.hpp.

template<typename T >

bool stan::math::is_uninitialized | ( | T | x | ) |

inline

Returns `true` if the specified variable is uninitialized.

Arithmetic types are always initialized by definition (the value is not specified).

Template Parameters

  T | Type of object to test.

Parameters

  x | Object to test.

Returns
  `true` if the specified object is uninitialized.
  false if input is NaN.

Definition at line 19 of file is_uninitialized.hpp.

bool stan::math::is_uninitialized | ( | var | x | ) |

inline

Returns `true` if the specified variable is uninitialized.

This overload of the `stan::math::is_uninitialized()` function delegates the return to the `is_uninitialized()` method on the specified variable.

Parameters

  x | Object to test.

Returns
  `true` if the specified object is uninitialized.

Definition at line 23 of file is_uninitialized.hpp.

template<typename F >

void stan::math::jacobian | ( | const F & | f,
|  | const Eigen::Matrix< double, Dynamic, 1 > & | x,
|  | Eigen::Matrix< double, Dynamic, 1 > & | fx,
|  | Eigen::Matrix< double, Dynamic, Dynamic > & | J
| ) |  |

Definition at line 15 of file jacobian.hpp.

template<typename T , typename F >

void stan::math::jacobian | ( | const F & | f,
|  | const Eigen::Matrix< T, Dynamic, 1 > & | x,
|  | Eigen::Matrix< T, Dynamic, 1 > & | fx,
|  | Eigen::Matrix< T, Dynamic, Dynamic > & | J
| ) |  |

Definition at line 16 of file jacobian.hpp.

template<typename T , typename TL >

T stan::math::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

where is the constant lower bound.

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

Parameters

  x | Unconstrained scalar input.
  lb | Lower-bound on constrained ouptut.

Returns
  Lower-bound constrained value correspdonding to inputs.

Template Parameters

  T | Type of scalar.
  TL | Type of lower bound.

Definition at line 35 of file lb_constrain.hpp.

template<typename T , typename TL >

boost::math::tools::promote_args<T, TL>::type stan::math::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

  x | Unconstrained scalar input.
  lb | Lower-bound on output.
  lp | Reference to log probability to increment.

Returns
  Loer-bound constrained value corresponding to inputs.

Template Parameters

  T | Type of scalar.
  TL | Type of lower bound.

Definition at line 61 of file lb_constrain.hpp.

template<typename T , typename TL >

boost::math::tools::promote_args<T, TL>::type stan::math::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

  y | Input scalar.
  lb | Lower bound.

Returns
  Unconstrained value that produces the input when constrained.

Template Parameters

  T | Type of scalar.
  TL | Type of lower bound.

Exceptions

  std::domain_error | if y is lower than the lower bound.

Definition at line 32 of file lb_free.hpp.

template<typename T >

fvar<T> stan::math::lbeta | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 16 of file lbeta.hpp.

template<typename T >

fvar<T> stan::math::lbeta | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 28 of file lbeta.hpp.

template<typename T >

fvar<T> stan::math::lbeta | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 38 of file lbeta.hpp.

template<typename T1 , typename T2 >

boost::math::tools::promote_args<T1, T2>::type stan::math::lbeta | ( | const T1 | a,
|  | const T2 | b
| ) |  |

inline

Return the log of the beta function applied to the specified arguments.

The beta function is defined for and by

.

This function returns its log,

.

See boost::math::lgamma() for the double-based and stan::math for the variable-based log Gamma function.

Parameters

  a | First value
  b | Second value

Returns
  Log of the beta function applied to the two values.

Template Parameters

  T1 | Type of first value.
  T2 | Type of second value.

Definition at line 59 of file lbeta.hpp.

template<typename T >

fvar<T> stan::math::lgamma | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file lgamma.hpp.

double stan::math::lgamma | ( | double | x | ) |

Definition at line 31 of file lgamma.hpp.

var stan::math::lgamma | ( | const stan::math::var & | a | ) |

inline

The log gamma function for variables (C99).

The derivatie is the digamma function,

.

Parameters

  a | The variable.

Returns
  Log gamma of the variable.

Definition at line 35 of file lgamma.hpp.

template<bool propto, typename T_covar , typename T_shape >

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

Definition at line 57 of file lkj_corr_cholesky_log.hpp.

template<typename T_covar , typename T_shape >

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

inline

Definition at line 99 of file lkj_corr_cholesky_log.hpp.

template<class RNG >

Eigen::MatrixXd stan::math::lkj_corr_cholesky_rng | ( | const size_t | K,
|  | const double | eta,
|  | RNG & | rng
| ) |  |

inline

Definition at line 54 of file lkj_corr_cholesky_rng.hpp.

template<bool propto, typename T_y , typename T_shape >

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

Definition at line 88 of file lkj_corr_log.hpp.

template<typename T_y , typename T_shape >

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

inline

Definition at line 124 of file lkj_corr_log.hpp.

template<class RNG >

Eigen::MatrixXd stan::math::lkj_corr_rng | ( | const size_t | K,
|  | const double | eta,
|  | RNG & | rng
| ) |  |

inline

Definition at line 54 of file lkj_corr_rng.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::math::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 24 of file lkj_cov_log.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::math::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 74 of file lkj_cov_log.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::math::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 87 of file lkj_cov_log.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::math::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_log.hpp.

template<typename T >

fvar<typename stan::return_type<T, int>::type> stan::math::lmgamma | ( | int | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 16 of file lmgamma.hpp.

var stan::math::lmgamma | ( | int | a,
|  | const stan::math::var & | b
| ) |  |

inline

Definition at line 28 of file lmgamma.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::lmgamma | ( | const int | k,
|  | T | x
| ) |  |

inline

Return the natural logarithm of the multivariate gamma function with the speciifed dimensions and argument.

The multivariate gamma function for dimensionality and argument is defined by

,

where is the gamma function.

Parameters

  k | Number of dimensions.
  x | Function argument.

Returns
  Natural log of the multivariate gamma function.

Template Parameters

  T | Type of scalar.

Definition at line 57 of file lmgamma.hpp.

template<typename T >

fvar<T> stan::math::log | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file log.hpp.

template<typename T , int Rows, int Cols>

Eigen::Matrix<T, Rows, Cols> stan::math::log | ( | const Eigen::Matrix< T, Rows, Cols > & | m | ) |

inline

Return the element-wise logarithm of the matrix or vector.

Parameters

  m | The matrix or vector.

Returns
  ret(i, j) = log(m(i, j))

Definition at line 17 of file log.hpp.

var stan::math::log | ( | const var & | a | ) |

inline

Return the natural log of the specified variable (cmath).

The derivative is defined by

.

Parameters

  a | Variable whose log is taken.

Returns
  Natural log of variable.

Definition at line 50 of file log.hpp.

template<typename T >

fvar<T> stan::math::log10 | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file log10.hpp.

var stan::math::log10 | ( | const var & | a | ) |

inline

Return the base 10 log of the specified variable (cmath).

The derivative is defined by

.

Parameters

  a | Variable whose log is taken.

Returns
  Base 10 log of variable.

Definition at line 54 of file log10.hpp.

double stan::math::log10 | ( |  | ) |

inline

Return natural logarithm of ten.

Returns
  Natural logarithm of ten.

Definition at line 114 of file constants.hpp.

template<typename T >

fvar<T> stan::math::log1m | ( | const fvar< T > & | x | ) |

inline

Definition at line 16 of file log1m.hpp.

var stan::math::log1m | ( | const stan::math::var & | a | ) |

inline

The log (1 - x) function for variables.

The derivative is given by

.

Parameters

  a | The variable.

Returns
  The variable representing log of 1 minus the variable.

Definition at line 32 of file log1m.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::log1m | ( | T | x | ) |

inline

Return the natural logarithm of one minus the specified value.

The main use of this function is to cut down on intermediate values during algorithmic differentiation.

Parameters

  x | Specified value.

Returns
  Natural log of one minus `x`.

Definition at line 40 of file log1m.hpp.

template<typename T >

fvar<T> stan::math::log1m_exp | ( | const fvar< T > & | x | ) |

inline

Definition at line 16 of file log1m_exp.hpp.

var stan::math::log1m_exp | ( | const stan::math::var & | a | ) |

inline

Return the log of 1 minus the exponential of the specified variable.

Definition at line 33 of file log1m_exp.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::log1m_exp | ( | const T | a | ) |

inline

Calculates the log of 1 minus the exponential of the specified value without overflow log1m_exp(x) = log(1-exp(x)).

This function is only defined for x<0

Definition at line 41 of file log1m_exp.hpp.

template<typename T >

fvar<T> stan::math::log1m_inv_logit | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file log1m_inv_logit.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::log1m_inv_logit | ( | const T | u | ) |

inline

Returns the natural logarithm of 1 minus the inverse logit of the specified argument.

Template Parameters

  T | Scalar type

Parameters

  u | Input.

Returns
  log of 1 minus the inverse logit of the input.

Definition at line 36 of file log1m_inv_logit.hpp.

template<typename T >

fvar<T> stan::math::log1p | ( | const fvar< T > & | x | ) |

inline

Definition at line 16 of file log1p.hpp.

var stan::math::log1p | ( | const stan::math::var & | a | ) |

inline

The log (1 + x) function for variables (C99).

The derivative is given by

.

Parameters

  a | The variable.

Returns
  The log of 1 plus the variable.

Definition at line 34 of file log1p.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::log1p | ( | const T | x | ) |

inline

Return the natural logarithm of one plus the specified value.

The main use of this function is to cut down on intermediate values during algorithmic differentiation.

Parameters

  x | Specified value.

Returns
  Natural log of one plus `x`.

Definition at line 39 of file log1p.hpp.

template<typename T >

fvar<T> stan::math::log1p_exp | ( | const fvar< T > & | x | ) |

inline

Definition at line 13 of file log1p_exp.hpp.

var stan::math::log1p_exp | ( | const stan::math::var & | a | ) |

inline

Return the log of 1 plus the exponential of the specified variable.

Definition at line 28 of file log1p_exp.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::log1p_exp | ( | const T | a | ) |

inline

Calculates the log of 1 plus the exponential of the specified value without overflow.

This function is related to other special functions by:

`log1p_exp(x)`

`= log1p(exp(a))`

`= log(1 + exp(x))`

`= log_sum_exp(0, x)`.

Definition at line 44 of file log1p_exp.hpp.

template<typename T >

fvar<T> stan::math::log2 | ( | const fvar< T > & | x | ) |

inline

Definition at line 17 of file log2.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::log2 | ( | const T | a | ) |

inline

Returns the base 2 logarithm of the argument (C99).

The function is defined by:

`log2(a) = log(a) / std::log(2.0)`.

Template Parameters

  T | type of scalar

Parameters

  a | Value.

Returns
  Base 2 logarithm of the value.

Definition at line 25 of file log2.hpp.

double stan::math::log2 | ( |  | ) |

inline

Return natural logarithm of two.

Returns
  Natural logarithm of two.

Definition at line 35 of file log2.hpp.

var stan::math::log2 | ( | const stan::math::var & | a | ) |

inline

Returns the base 2 logarithm of the specified variable (C99).

See stan::math::log2() for the double-based version.

The derivative is

.

Parameters

  a | Specified variable.

Returns
  Base 2 logarithm of the variable.

Definition at line 53 of file log2.hpp.

template<int R, int C>

var stan::math::log_determinant | ( | const Eigen::Matrix< var, R, C > & | m | ) |

inline

Definition at line 13 of file log_determinant.hpp.

template<typename T , int R, int C>

T stan::math::log_determinant | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Returns the log absolute determinant of the specified square matrix.

Parameters

  m | Specified matrix.

Returns
  log absolute determinant of the matrix.

Exceptions

  std::domain_error | if matrix is not square.

Definition at line 18 of file log_determinant.hpp.

template<typename T , int R, int C>

fvar<T> stan::math::log_determinant | ( | const Eigen::Matrix< fvar< T >, R, C > & | m | ) |

inline

Definition at line 20 of file log_determinant.hpp.

template<int R, int C, typename T >

T stan::math::log_determinant_ldlt | ( | stan::math::LDLT_factor< T, R, C > & | A | ) |

inline

Definition at line 12 of file log_determinant_ldlt.hpp.

template<int R, int C>

var stan::math::log_determinant_ldlt | ( | stan::math::LDLT_factor< var, R, C > & | A | ) |

Definition at line 48 of file log_determinant_ldlt.hpp.

template<int R, int C>

var stan::math::log_determinant_spd | ( | const Eigen::Matrix< var, R, C > & | m | ) |

inline

Definition at line 15 of file log_determinant_spd.hpp.

template<typename T , int R, int C>

T stan::math::log_determinant_spd | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Returns the log absolute determinant of the specified square matrix.

Parameters

  m | Specified matrix.

Returns
  log absolute determinant of the matrix.

Exceptions

  std::domain_error | if matrix is not square.

Definition at line 19 of file log_determinant_spd.hpp.

template<typename T >

fvar<T> stan::math::log_diff_exp | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 14 of file log_diff_exp.hpp.

template<typename T1 , typename T2 >

fvar<T2> stan::math::log_diff_exp | ( | const T1 & | x1,
|  | const fvar< T2 > & | x2
| ) |  |

inline

Definition at line 26 of file log_diff_exp.hpp.

template<typename T1 , typename T2 >

fvar<T1> stan::math::log_diff_exp | ( | const fvar< T1 > & | x1,
|  | const T2 & | x2
| ) |  |

inline

Definition at line 37 of file log_diff_exp.hpp.

var stan::math::log_diff_exp | ( | const stan::math::var & | a,
|  | const stan::math::var & | b
| ) |  |

inline

Returns the log sum of exponentials.

Definition at line 49 of file log_diff_exp.hpp.

template<typename T1 , typename T2 >

boost::math::tools::promote_args<T1, T2>::type stan::math::log_diff_exp | ( | const T1 | x,
|  | const T2 | y
| ) |  |

inline

The natural logarithm of the difference of the natural exponentiation of x1 and the natural exponentiation of x2.

This function is only defined for x<0

Definition at line 50 of file log_diff_exp.hpp.

var stan::math::log_diff_exp | ( | const stan::math::var & | a,
|  | const double & | b
| ) |  |

inline

Returns the log sum of exponentials.

Definition at line 56 of file log_diff_exp.hpp.

var stan::math::log_diff_exp | ( | const double & | a,
|  | const stan::math::var & | b
| ) |  |

inline

Returns the log sum of exponentials.

Definition at line 63 of file log_diff_exp.hpp.

template<typename T >

fvar<T> stan::math::log_falling_factorial | ( | const fvar< T > & | x,
|  | const fvar< T > & | n
| ) |  |

inline

Definition at line 15 of file log_falling_factorial.hpp.

template<typename T >

fvar<T> stan::math::log_falling_factorial | ( | const double | x,
|  | const fvar< T > & | n
| ) |  |

inline

Definition at line 25 of file log_falling_factorial.hpp.

template<typename T >

fvar<T> stan::math::log_falling_factorial | ( | const fvar< T > & | x,
|  | const double | n
| ) |  |

inline

Definition at line 35 of file log_falling_factorial.hpp.

template<typename T1 , typename T2 >

boost::math::tools::promote_args<T1, T2>::type stan::math::log_falling_factorial | ( | const T1 | x,
|  | const T2 | n
| ) |  |

inline

Definition at line 41 of file log_falling_factorial.hpp.

var stan::math::log_falling_factorial | ( | const var & | a,
|  | const double & | b
| ) |  |

inline

Definition at line 62 of file log_falling_factorial.hpp.

var stan::math::log_falling_factorial | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Definition at line 67 of file log_falling_factorial.hpp.

var stan::math::log_falling_factorial | ( | const double & | a,
|  | const var & | b
| ) |  |

inline

Definition at line 72 of file log_falling_factorial.hpp.

template<typename T >

fvar<T> stan::math::log_inv_logit | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file log_inv_logit.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::log_inv_logit | ( | const T & | u | ) |

inline

Returns the natural logarithm of the inverse logit of the specified argument.

Template Parameters

  T | Scalar type

Parameters

  u | Input.

Returns
  log of the inverse logit of the input.

Definition at line 36 of file log_inv_logit.hpp.

template<typename T >

T stan::math::log_inv_logit_diff | ( | const T & | alpha,
|  | const T & | beta
| ) |  |

inline

Definition at line 26 of file ordered_logistic_log.hpp.

double stan::math::log_mix | ( | double | theta,
|  | double | lambda1,
|  | double | lambda2
| ) |  |

Return the log mixture density with specified mixing proportion and log densities.

Parameters

  [in] | theta | mixing proportion in [0, 1].
  | lambda1 | first log density.
  | lambda2 | second log density.

Returns
  log mixture of densities in specified proportion

Definition at line 46 of file log_mix.hpp.

template<typename T_theta , typename T_lambda1 , typename T_lambda2 >

return_type<T_theta, T_lambda1, T_lambda2>::type stan::math::log_mix | ( | const T_theta & | theta,
|  | const T_lambda1 & | lambda1,
|  | const T_lambda2 & | lambda2
| ) |  |

inline

Return the log mixture density with specified mixing proportion and log densities and its derivative at each.

Template Parameters

  T_theta | theta scalar type.
  T_lambda1 | lambda1 scalar type.
  T_lambda2 | lambda2 scalar type.

Parameters

  [in] | theta | mixing proportion in [0, 1].
  [in] | lambda1 | first log density.
  [in] | lambda2 | second log density.

Returns
  log mixture of densities in specified proportion

Definition at line 88 of file log_mix.hpp.

template<typename T >

fvar<T> stan::math::log_mix | ( | const fvar< T > & | theta,
|  | const fvar< T > & | lambda1,
|  | const fvar< T > & | lambda2
| ) |  |

inline

Return the log mixture density with specified mixing proportion and log densities and its derivative at each.

Template Parameters

  T | scalar type.

Parameters

  [in] | theta | mixing proportion in [0, 1].
  [in] | lambda1 | first log density.
  [in] | lambda2 | second log density.

Returns
  log mixture of densities in specified proportion

Definition at line 116 of file log_mix.hpp.

template<typename T >

fvar<T> stan::math::log_mix | ( | const fvar< T > & | theta,
|  | const fvar< T > & | lambda1,
|  | const double | lambda2
| ) |  |

inline

Definition at line 142 of file log_mix.hpp.

template<typename T >

fvar<T> stan::math::log_mix | ( | const fvar< T > & | theta,
|  | const double | lambda1,
|  | const fvar< T > & | lambda2
| ) |  |

inline

Definition at line 167 of file log_mix.hpp.

template<typename T >

fvar<T> stan::math::log_mix | ( | const double | theta,
|  | const fvar< T > & | lambda1,
|  | const fvar< T > & | lambda2
| ) |  |

inline

Definition at line 192 of file log_mix.hpp.

template<typename T >

fvar<T> stan::math::log_mix | ( | const fvar< T > & | theta,
|  | const double | lambda1,
|  | const double | lambda2
| ) |  |

inline

Definition at line 216 of file log_mix.hpp.

template<typename T >

fvar<T> stan::math::log_mix | ( | const double | theta,
|  | const fvar< T > & | lambda1,
|  | const double | lambda2
| ) |  |

inline

Definition at line 237 of file log_mix.hpp.

template<typename T >

fvar<T> stan::math::log_mix | ( | const double | theta,
|  | const double | lambda1,
|  | const fvar< T > & | lambda2
| ) |  |

inline

Definition at line 258 of file log_mix.hpp.

void stan::math::log_mix_partial_helper | ( | const double & | theta_val,
|  | const double & | lambda1_val,
|  | const double & | lambda2_val,
|  | double & | one_m_exp_lam2_m_lam1,
|  | double & | one_m_t_prod_exp_lam2_m_lam1,
|  | double & | one_d_t_plus_one_m_t_prod_exp_lam2_m_lam1
| ) |  |

inline

Definition at line 28 of file log_mix.hpp.

template<typename T_theta , typename T_lambda1 , typename T_lambda2 , int N>

void stan::math::log_mix_partial_helper | ( | const T_theta & | theta,
|  | const T_lambda1 & | lambda1,
|  | const T_lambda2 & | lambda2,
|  | typename promote_args< T_theta, T_lambda1, T_lambda2 >::type(&) | partials_array[N]
| ) |  |

inline

Definition at line 31 of file log_mix.hpp.

template<typename T >

fvar<T> stan::math::log_rising_factorial | ( | const fvar< T > & | x,
|  | const fvar< T > & | n
| ) |  |

inline

Definition at line 16 of file log_rising_factorial.hpp.

template<typename T >

fvar<T> stan::math::log_rising_factorial | ( | const fvar< T > & | x,
|  | const double | n
| ) |  |

inline

Definition at line 28 of file log_rising_factorial.hpp.

template<typename T >

fvar<T> stan::math::log_rising_factorial | ( | const double | x,
|  | const fvar< T > & | n
| ) |  |

inline

Definition at line 39 of file log_rising_factorial.hpp.

template<typename T1 , typename T2 >

boost::math::tools::promote_args<T1, T2>::type stan::math::log_rising_factorial | ( | const T1 | x,
|  | const T2 | n
| ) |  |

inline

Definition at line 41 of file log_rising_factorial.hpp.

var stan::math::log_rising_factorial | ( | const var & | a,
|  | const double & | b
| ) |  |

inline

Definition at line 49 of file log_rising_factorial.hpp.

var stan::math::log_rising_factorial | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Definition at line 54 of file log_rising_factorial.hpp.

var stan::math::log_rising_factorial | ( | const double & | a,
|  | const var & | b
| ) |  |

inline

Definition at line 59 of file log_rising_factorial.hpp.

template<typename T >

Eigen::Matrix<fvar<T>, Eigen::Dynamic, 1> stan::math::log_softmax | ( | const Eigen::Matrix< fvar< T >, Eigen::Dynamic, 1 > & | alpha | ) |

inline

Definition at line 16 of file log_softmax.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::log_softmax | ( | const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | v | ) |

inline

Return the natural logarithm of the softmax of the specified vector.

For the log softmax function, the entries in the Jacobian are

Template Parameters

  T | Scalar type of values in vector.

Parameters

  [in] | v | Vector to transform.

Returns
  Unit simplex result of the softmax transform of the vector.

Definition at line 44 of file log_softmax.hpp.

Eigen::Matrix<var, Eigen::Dynamic, 1> stan::math::log_softmax | ( | const Eigen::Matrix< var, Eigen::Dynamic, 1 > & | alpha | ) |

inline

Return the softmax of the specified Eigen vector.

Softmax is guaranteed to return a simplex.

The gradient calculations are unfolded.

Parameters

  alpha | Unconstrained input vector.

Returns
  Softmax of the input.

Exceptions

  std::domain_error | If the input vector is size 0.

Definition at line 61 of file log_softmax.hpp.

template<typename T >

fvar<T> stan::math::log_sum_exp | ( | const std::vector< fvar< T > > & | v | ) |

Definition at line 14 of file log_sum_exp.hpp.

template<typename T >

fvar<T> stan::math::log_sum_exp | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 15 of file log_sum_exp.hpp.

template<typename T , int R, int C>

fvar<T> stan::math::log_sum_exp | ( | const Eigen::Matrix< fvar< T >, R, C > & | v | ) |

Definition at line 19 of file log_sum_exp.hpp.

double stan::math::log_sum_exp | ( | const std::vector< double > & | x | ) |

Return the log of the sum of the exponentiated values of the specified sequence of values.

The function is defined as follows to prevent overflow in exponential calculations.

.

Parameters

  [in] | x | array of specified values

Returns
  The log of the sum of the exponentiated vector values.

Definition at line 24 of file log_sum_exp.hpp.

template<typename T >

fvar<T> stan::math::log_sum_exp | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 26 of file log_sum_exp.hpp.

template<int R, int C>

double stan::math::log_sum_exp | ( | const Eigen::Matrix< double, R, C > & | x | ) |

Return the log of the sum of the exponentiated values of the specified matrix of values.

The matrix may be a full matrix, a vector, or a row vector.

The function is defined as follows to prevent overflow in exponential calculations.

.

Parameters

  [in] | x | Matrix of specified values

Returns
  The log of the sum of the exponentiated vector values.

Definition at line 28 of file log_sum_exp.hpp.

template<typename T >

fvar<T> stan::math::log_sum_exp | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 36 of file log_sum_exp.hpp.

var stan::math::log_sum_exp | ( | const std::vector< var > & | x | ) |

inline

Returns the log sum of exponentials.

Definition at line 45 of file log_sum_exp.hpp.

template<typename T1 , typename T2 >

boost::math::tools::promote_args<T1, T2>::type stan::math::log_sum_exp | ( | const T2 & | a,
|  | const T1 & | b
| ) |  |

inline

Calculates the log sum of exponetials without overflow.

,

where .

Parameters

  a | the first variable
  b | the second variable

Definition at line 48 of file log_sum_exp.hpp.

var stan::math::log_sum_exp | ( | const stan::math::var & | a,
|  | const stan::math::var & | b
| ) |  |

inline

Returns the log sum of exponentials.

Definition at line 50 of file log_sum_exp.hpp.

template<int R, int C>

var stan::math::log_sum_exp | ( | const Eigen::Matrix< var, R, C > & | x | ) |

inline

Returns the log sum of exponentials.

Parameters

  x | matrix

Definition at line 54 of file log_sum_exp.hpp.

var stan::math::log_sum_exp | ( | const stan::math::var & | a,
|  | const double & | b
| ) |  |

inline

Returns the log sum of exponentials.

Definition at line 57 of file log_sum_exp.hpp.

var stan::math::log_sum_exp | ( | const double & | a,
|  | const stan::math::var & | b
| ) |  |

inline

Returns the log sum of exponentials.

Definition at line 64 of file log_sum_exp.hpp.

template<typename T1 , typename T2 >

int stan::math::logical_and | ( | const T1 | x1,
|  | const T2 | x2
| ) |  |

inline

The logical and function which returns 1 if both arguments are unequal to zero and 0 otherwise.

Equivalent to `x1 != 0 && x2 != 0`.

Template Parameters

  T1 | Type of first argument.
  T2 | Type of second argument.

Parameters

  x1 | First argument
  x2 | Second argument

Returns
  `true` if both x1 and x2 are not equal to 0.

Definition at line 30 of file logical_and.hpp.

template<typename T1 , typename T2 >

int stan::math::logical_eq | ( | const T1 | x1,
|  | const T2 | x2
| ) |  |

inline

Return 1 if the first argument is equal to the second.

Equivalent to `x1 == x2`.

Template Parameters

  T1 | Type of first argument.
  T2 | Type of second argument.

Parameters

  x1 | First argument
  x2 | Second argument

Returns
  `true` iff `x1 == x2`

Definition at line 19 of file logical_eq.hpp.

template<typename T1 , typename T2 >

int stan::math::logical_gt | ( | const T1 | x1,
|  | const T2 | x2
| ) |  |

inline

Return 1 if the first argument is strictly greater than the second.

Equivalent to `x1 < x2`.

Template Parameters

  T1 | Type of first argument.
  T2 | Type of second argument.

Parameters

  x1 | First argument
  x2 | Second argument

Returns
  `true` iff `x1 > x2`

Definition at line 19 of file logical_gt.hpp.

template<typename T1 , typename T2 >

int stan::math::logical_gte | ( | const T1 | x1,
|  | const T2 | x2
| ) |  |

inline

Return 1 if the first argument is greater than or equal to the second.

Equivalent to `x1 >= x2`.

Template Parameters

  T1 | Type of first argument.
  T2 | Type of second argument.

Parameters

  x1 | First argument
  x2 | Second argument

Returns
  `true` iff `x1 >= x2`

Definition at line 19 of file logical_gte.hpp.

template<typename T1 , typename T2 >

int stan::math::logical_lt | ( | T1 | x1,
|  | T2 | x2
| ) |  |

inline

Return 1 if the first argument is strictly less than the second.

Equivalent to `x1 < x2`.

Template Parameters

  T1 | Type of first argument.
  T2 | Type of second argument.

Parameters

  x1 | First argument
  x2 | Second argument

Returns
  `true` iff `x1 < x2`

Definition at line 20 of file logical_lt.hpp.

template<typename T1 , typename T2 >

int stan::math::logical_lte | ( | const T1 | x1,
|  | const T2 | x2
| ) |  |

inline

Return 1 if the first argument is less than or equal to the second.

Equivalent to `x1 <= x2`.

Template Parameters

  T1 | Type of first argument.
  T2 | Type of second argument.

Parameters

  x1 | First argument
  x2 | Second argument

Returns
  `true` iff `x1 <= x2`

Definition at line 19 of file logical_lte.hpp.

template<typename T >

int stan::math::logical_negation | ( | const T | x | ) |

inline

The logical negation function which returns 1 if the input is equal to zero and 0 otherwise.

Template Parameters

  T | Type to compare to zero.

Parameters

  x | Value to compare to zero.

Returns
  1 if input is equal to zero.

Definition at line 17 of file logical_negation.hpp.

template<typename T1 , typename T2 >

int stan::math::logical_neq | ( | const T1 | x1,
|  | const T2 | x2
| ) |  |

inline

Return 1 if the first argument is unequal to the second.

Equivalent to `x1 != x2`.

Template Parameters

  T1 | Type of first argument.
  T2 | Type of second argument.

Parameters

  x1 | First argument
  x2 | Second argument

Returns
  `true` iff `x1 != x2`

Definition at line 19 of file logical_neq.hpp.

template<typename T1 , typename T2 >

int stan::math::logical_or | ( | T1 | x1,
|  | T2 | x2
| ) |  |

inline

The logical or function which returns 1 if either argument is unequal to zero and 0 otherwise.

Equivalent to `x1 != 0 || x2 != 0`.

Template Parameters

  T1 | Type of first argument.
  T2 | Type of second argument.

Parameters

  x1 | First argument
  x2 | Second argument

Returns
  `true` if either x1 or x2 is not equal to 0.

Definition at line 29 of file logical_or.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::logistic_ccdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 31 of file logistic_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::logistic_cdf | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 31 of file logistic_cdf.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::logistic_cdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 30 of file logistic_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::logistic_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 32 of file logistic_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::logistic_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

inline

Definition at line 142 of file logistic_log.hpp.

template<class RNG >

double stan::math::logistic_rng | ( | const double | mu,
|  | const double | sigma,
|  | RNG & | rng
| ) |  |

inline

Definition at line 27 of file logistic_rng.hpp.

template<typename T >

fvar<T> stan::math::logit | ( | const fvar< T > & | x | ) |

inline

Definition at line 17 of file logit.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::logit | ( | const T | a | ) |

inline

Returns the logit function applied to the argument.

The logit function is defined as for by returning the log odds of treated as a probability,

.

The inverse to this function is `stan::math::inv_logit`.

Parameters

  a | Argument.

Returns
  Logit of the argument.

Definition at line 44 of file logit.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::lognormal_ccdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 23 of file lognormal_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::lognormal_cdf | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 23 of file lognormal_cdf.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::lognormal_cdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 23 of file lognormal_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::lognormal_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 33 of file lognormal_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::lognormal_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

inline

Definition at line 158 of file lognormal_log.hpp.

template<class RNG >

double stan::math::lognormal_rng | ( | const double | mu,
|  | const double | sigma,
|  | RNG & | rng
| ) |  |

inline

Definition at line 22 of file lognormal_rng.hpp.

template<typename T , typename TL , typename TU >

boost::math::tools::promote_args<T, TL, TU>::type stan::math::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,

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

  x | Free scalar to transform.
  lb | Lower bound.
  ub | Upper bound.

Returns
  Lower- and upper-bounded scalar derived from transforming the free scalar.

Template Parameters

  T | Type of scalar.
  TL | Type of lower bound.
  TU | Type of upper bound.

Exceptions

  std::domain_error | if ub <= lb

Definition at line 44 of file lub_constrain.hpp.

template<typename T , typename TL , typename TU >

boost::math::tools::promote_args<T, TL, TU>::type stan::math::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

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

  x | Free scalar to transform.
  lb | Lower bound.
  ub | Upper bound.
  lp | Log probability scalar reference.

Returns
  Lower- and upper-bounded scalar derived from transforming the free scalar.

Template Parameters

  T | Type of scalar.
  TL | Type of lower bound.
  TU | Type of upper bound.

Exceptions

  std::domain_error | if ub <= lb

Definition at line 114 of file lub_constrain.hpp.

template<typename T , typename TL , typename TU >

boost::math::tools::promote_args<T, TL, TU>::type stan::math::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,

where and 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

  T | Type of scalar.

Parameters

  y | Scalar input.
  lb | Lower bound.
  ub | Upper bound.

Returns
  The free scalar that transforms to the input scalar given the bounds.

Exceptions

  std::invalid_argument | if 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 47 of file lub_free.hpp.

double stan::math::machine_precision | ( |  | ) |

inline

Returns the difference between 1.0 and the next value representable.

Returns
  Minimum positive number.

Definition at line 151 of file constants.hpp.

template<typename T >

const Eigen::Array<T, Eigen::Dynamic, 1> stan::math::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

  eta | hyperparameter on (0, inf), eta = 1 <-> correlation matrix is uniform
  K | number of variables in covariance matrix

Definition at line 22 of file make_nu.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::math::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

  y | An mxn matrix.
  Mu | The mean matrix.
  Sigma | The mxm inverse covariance matrix (i.e., the precision matrix) of the rows of y.
  D | The 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_error | if Sigma or D are not square, not symmetric, or not semi-positive definite.

Template Parameters

  T_y | Type of scalar.
  T_Mu | Type of location.
  T_Sigma | Type of Sigma.
  T_D | Type of D.

Definition at line 43 of file matrix_normal_prec_log.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::math::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 112 of file matrix_normal_prec_log.hpp.

int stan::math::max | ( | const std::vector< int > & | x | ) |

inline

Returns the maximum coefficient in the specified column vector.

Parameters

  x | Specified vector.

Returns
  Maximum coefficient value in the vector.

Template Parameters

  Type | of values being compared and returned

Exceptions

  std::domain_error | If the size of the vector is zero.

Definition at line 21 of file max.hpp.

template<typename T >

T stan::math::max | ( | const std::vector< T > & | x | ) |

inline

Returns the maximum coefficient in the specified column vector.

Parameters

  x | Specified vector.

Returns
  Maximum coefficient value in the vector.

Template Parameters

  T | Type of values being compared and returned

Definition at line 39 of file max.hpp.

template<typename T , int R, int C>

T stan::math::max | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Returns the maximum coefficient in the specified vector, row vector, or matrix.

Parameters

  m | Specified vector, row vector, or matrix.

Returns
  Maximum coefficient value in the vector.

Definition at line 56 of file max.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C2> stan::math::mdivide_left | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | A,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | b
| ) |  |

inline

Definition at line 24 of file mdivide_left.hpp.

template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R1, C2> stan::math::mdivide_left | ( | const Eigen::Matrix< T1, R1, C1 > & | A,
|  | const Eigen::Matrix< T2, R2, C2 > & | b
| ) |  |

inline

Returns the solution of the system Ax=b.

Parameters

  A | Matrix.
  b | Right hand side matrix or vector.

Returns
  x = A^-1 b, solution of the linear system.

Exceptions

  std::domain_error | if A is not square or the rows of b don't match the size of A.

Definition at line 25 of file mdivide_left.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C2> stan::math::mdivide_left | ( | const Eigen::Matrix< double, R1, C1 > & | A,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | b
| ) |  |

inline

Definition at line 68 of file mdivide_left.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C2> stan::math::mdivide_left | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | A,
|  | const Eigen::Matrix< double, R2, C2 > & | b
| ) |  |

inline

Definition at line 94 of file mdivide_left.hpp.

template<int R1, int C1, int R2, int C2>

Eigen::Matrix<var, R1, C2> stan::math::mdivide_left | ( | const Eigen::Matrix< var, R1, C1 > & | A,
|  | const Eigen::Matrix< var, R2, C2 > & | b
| ) |  |

inline

Definition at line 274 of file mdivide_left.hpp.

template<int R1, int C1, int R2, int C2>

Eigen::Matrix<var, R1, C2> stan::math::mdivide_left | ( | const Eigen::Matrix< var, R1, C1 > & | A,
|  | const Eigen::Matrix< double, R2, C2 > & | b
| ) |  |

inline

Definition at line 301 of file mdivide_left.hpp.

template<int R1, int C1, int R2, int C2>

Eigen::Matrix<var, R1, C2> stan::math::mdivide_left | ( | const Eigen::Matrix< double, R1, C1 > & | A,
|  | const Eigen::Matrix< var, R2, C2 > & | b
| ) |  |

inline

Definition at line 328 of file mdivide_left.hpp.

template<int R1, int C1, int R2, int C2, typename T2 >

Eigen::Matrix<fvar<T2>, R1, C2> stan::math::mdivide_left_ldlt | ( | const stan::math::LDLT_factor< double, R1, C1 > & | A,
|  | const Eigen::Matrix< fvar< T2 >, R2, C2 > & | b
| ) |  |

inline

Returns the solution of the system Ax=b given an LDLT_factor of A.

Parameters

  A | LDLT_factor
  b | Right hand side matrix or vector.

Returns
  x = b A^-1, solution of the linear system.

Exceptions

  std::domain_error | if rows of b don't match the size of A.

Definition at line 25 of file mdivide_left_ldlt.hpp.

template<int R1, int C1, int R2, int C2, typename T1 , typename T2 >

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R1, C2> stan::math::mdivide_left_ldlt | ( | const stan::math::LDLT_factor< T1, R1, C1 > & | A,
|  | const Eigen::Matrix< T2, R2, C2 > & | b
| ) |  |

inline

Returns the solution of the system Ax=b given an LDLT_factor of A.

Parameters

  A | LDLT_factor
  b | Right hand side matrix or vector.

Returns
  x = b A^-1, solution of the linear system.

Exceptions

  std::domain_error | if rows of b don't match the size of A.

Definition at line 26 of file mdivide_left_ldlt.hpp.

template<int R1, int C1, int R2, int C2>

Eigen::Matrix<var, R1, C2> stan::math::mdivide_left_ldlt | ( | const stan::math::LDLT_factor< var, R1, C1 > & | A,
|  | const Eigen::Matrix< var, R2, C2 > & | b
| ) |  |

inline

Returns the solution of the system Ax=b given an LDLT_factor of A.

Parameters

  A | LDLT_factor
  b | Right hand side matrix or vector.

Returns
  x = b A^-1, solution of the linear system.

Exceptions

  std::domain_error | if rows of b don't match the size of A.

Definition at line 246 of file mdivide_left_ldlt.hpp.

template<int R1, int C1, int R2, int C2>

Eigen::Matrix<var, R1, C2> stan::math::mdivide_left_ldlt | ( | const stan::math::LDLT_factor< var, R1, C1 > & | A,
|  | const Eigen::Matrix< double, R2, C2 > & | b
| ) |  |

inline

Returns the solution of the system Ax=b given an LDLT_factor of A.

Parameters

  A | LDLT_factor
  b | Right hand side matrix or vector.

Returns
  x = b A^-1, solution of the linear system.

Exceptions

  std::domain_error | if rows of b don't match the size of A.

Definition at line 274 of file mdivide_left_ldlt.hpp.

template<int R1, int C1, int R2, int C2>

Eigen::Matrix<var, R1, C2> stan::math::mdivide_left_ldlt | ( | const stan::math::LDLT_factor< double, R1, C1 > & | A,
|  | const Eigen::Matrix< var, R2, C2 > & | b
| ) |  |

inline

Returns the solution of the system Ax=b given an LDLT_factor of A.

Parameters

  A | LDLT_factor
  b | Right hand side matrix or vector.

Returns
  x = b A^-1, solution of the linear system.

Exceptions

  std::domain_error | if rows of b don't match the size of A.

Definition at line 302 of file mdivide_left_ldlt.hpp.

template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R1, C2> stan::math::mdivide_left_spd | ( | const Eigen::Matrix< T1, R1, C1 > & | A,
|  | const Eigen::Matrix< T2, R2, C2 > & | b
| ) |  |

inline

Returns the solution of the system Ax=b where A is symmetric positive definite.

Parameters

  A | Matrix.
  b | Right hand side matrix or vector.

Returns
  x = A^-1 b, solution of the linear system.

Exceptions

  std::domain_error | if A is not square or the rows of b don't match the size of A.

Definition at line 28 of file mdivide_left_spd.hpp.

template<int R1, int C1, int R2, int C2>

Eigen::Matrix<var, R1, C2> stan::math::mdivide_left_spd | ( | const Eigen::Matrix< var, R1, C1 > & | A,
|  | const Eigen::Matrix< var, R2, C2 > & | b
| ) |  |

inline

Definition at line 248 of file mdivide_left_spd.hpp.

template<int R1, int C1, int R2, int C2>

Eigen::Matrix<var, R1, C2> stan::math::mdivide_left_spd | ( | const Eigen::Matrix< var, R1, C1 > & | A,
|  | const Eigen::Matrix< double, R2, C2 > & | b
| ) |  |

inline

Definition at line 275 of file mdivide_left_spd.hpp.

template<int R1, int C1, int R2, int C2>

Eigen::Matrix<var, R1, C2> stan::math::mdivide_left_spd | ( | const Eigen::Matrix< double, R1, C1 > & | A,
|  | const Eigen::Matrix< var, R2, C2 > & | b
| ) |  |

inline

Definition at line 302 of file mdivide_left_spd.hpp.

template<int TriView, typename T1 , typename T2 , int R1, int C1, int R2, int C2>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R1, C2> stan::math::mdivide_left_tri | ( | const Eigen::Matrix< T1, R1, C1 > & | A,
|  | const Eigen::Matrix< T2, R2, C2 > & | b
| ) |  |

inline

Returns the solution of the system Ax=b when A is triangular.

Parameters

  A | Triangular matrix. Specify upper or lower with TriView being Eigen::Upper or Eigen::Lower.
  b | Right hand side matrix or vector.

Returns
  x = A^-1 b, solution of the linear system.

Exceptions

  std::domain_error | if A is not square or the rows of b don't match the size of A.

Definition at line 27 of file mdivide_left_tri.hpp.

template<int TriView, typename T , int R1, int C1>

Eigen::Matrix<T, R1, C1> stan::math::mdivide_left_tri | ( | const Eigen::Matrix< T, R1, C1 > & | A | ) |

inline

Returns the solution of the system Ax=b when A is triangular and b=I.

Parameters

  A | Triangular matrix. Specify upper or lower with TriView being Eigen::Upper or Eigen::Lower.

Returns
  x = A^-1 .

Exceptions

  std::domain_error | if A is not square

Definition at line 50 of file mdivide_left_tri.hpp.

template<int TriView, int R1, int C1, int R2, int C2>

Eigen::Matrix<var, R1, C2> stan::math::mdivide_left_tri | ( | const Eigen::Matrix< var, R1, C1 > & | A,
|  | const Eigen::Matrix< var, R2, C2 > & | b
| ) |  |

inline

Definition at line 304 of file mdivide_left_tri.hpp.

template<int TriView, int R1, int C1, int R2, int C2>

Eigen::Matrix<var, R1, C2> stan::math::mdivide_left_tri | ( | const Eigen::Matrix< double, R1, C1 > & | A,
|  | const Eigen::Matrix< var, R2, C2 > & | b
| ) |  |

inline

Definition at line 330 of file mdivide_left_tri.hpp.

template<int TriView, int R1, int C1, int R2, int C2>

Eigen::Matrix<var, R1, C2> stan::math::mdivide_left_tri | ( | const Eigen::Matrix< var, R1, C1 > & | A,
|  | const Eigen::Matrix< double, R2, C2 > & | b
| ) |  |

inline

Definition at line 356 of file mdivide_left_tri.hpp.

template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R1, C2> stan::math::mdivide_left_tri_low | ( | const Eigen::Matrix< T1, R1, C1 > & | A,
|  | const Eigen::Matrix< T2, R2, C2 > & | b
| ) |  |

inline

Definition at line 16 of file mdivide_left_tri_low.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C1> stan::math::mdivide_left_tri_low | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | A,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | b
| ) |  |

inline

Definition at line 22 of file mdivide_left_tri_low.hpp.

template<typename T , int R1, int C1>

Eigen::Matrix<T, R1, C1> stan::math::mdivide_left_tri_low | ( | const Eigen::Matrix< T, R1, C1 > & | A | ) |

inline

Definition at line 32 of file mdivide_left_tri_low.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C1> stan::math::mdivide_left_tri_low | ( | const Eigen::Matrix< double, R1, C1 > & | A,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | b
| ) |  |

inline

Definition at line 68 of file mdivide_left_tri_low.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C1> stan::math::mdivide_left_tri_low | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | A,
|  | const Eigen::Matrix< double, R2, C2 > & | b
| ) |  |

inline

Definition at line 109 of file mdivide_left_tri_low.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C2> stan::math::mdivide_right | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | A,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | b
| ) |  |

inline

Definition at line 24 of file mdivide_right.hpp.

template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R1, C2> stan::math::mdivide_right | ( | const Eigen::Matrix< T1, R1, C1 > & | b,
|  | const Eigen::Matrix< T2, R2, C2 > & | A
| ) |  |

inline

Returns the solution of the system Ax=b.

Parameters

  A | Matrix.
  b | Right hand side matrix or vector.

Returns
  x = b A^-1, solution of the linear system.

Exceptions

  std::domain_error | if A is not square or the rows of b don't match the size of A.

Definition at line 26 of file mdivide_right.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C2> stan::math::mdivide_right | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | A,
|  | const Eigen::Matrix< double, R2, C2 > & | b
| ) |  |

inline

Definition at line 68 of file mdivide_right.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C2> stan::math::mdivide_right | ( | const Eigen::Matrix< double, R1, C1 > & | A,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | b
| ) |  |

inline

Definition at line 95 of file mdivide_right.hpp.

template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R1, C2> stan::math::mdivide_right_ldlt | ( | const Eigen::Matrix< T1, R1, C1 > & | b,
|  | const stan::math::LDLT_factor< T2, R2, C2 > & | A
| ) |  |

inline

Returns the solution of the system xA=b given an LDLT_factor of A.

Parameters

  A | LDLT_factor
  b | Right hand side matrix or vector.

Returns
  x = A^-1 b, solution of the linear system.

Exceptions

  std::domain_error | if rows of b don't match the size of A.

Definition at line 26 of file mdivide_right_ldlt.hpp.

template<int R1, int C1, int R2, int C2>

Eigen::Matrix<double, R1, C2> stan::math::mdivide_right_ldlt | ( | const Eigen::Matrix< double, R1, C1 > & | b,
|  | const stan::math::LDLT_factor< double, R2, C2 > & | A
| ) |  |

inline

Definition at line 38 of file mdivide_right_ldlt.hpp.

template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R1, C2> stan::math::mdivide_right_spd | ( | const Eigen::Matrix< T1, R1, C1 > & | b,
|  | const Eigen::Matrix< T2, R2, C2 > & | A
| ) |  |

inline

Returns the solution of the system Ax=b where A is symmetric positive definite.

Parameters

  A | Matrix.
  b | Right hand side matrix or vector.

Returns
  x = b A^-1, solution of the linear system.

Exceptions

  std::domain_error | if A is not square or the rows of b don't match the size of A.

Definition at line 29 of file mdivide_right_spd.hpp.

template<int TriView, typename T1 , typename T2 , int R1, int C1, int R2, int C2>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R1, C2> stan::math::mdivide_right_tri | ( | const Eigen::Matrix< T1, R1, C1 > & | b,
|  | const Eigen::Matrix< T2, R2, C2 > & | A
| ) |  |

inline

Returns the solution of the system Ax=b when A is triangular.

Parameters

  A | Triangular matrix. Specify upper or lower with TriView being Eigen::Upper or Eigen::Lower.
  b | Right hand side matrix or vector.

Returns
  x = b A^-1, solution of the linear system.

Exceptions

  std::domain_error | if A is not square or the rows of b don't match the size of A.

Definition at line 29 of file mdivide_right_tri.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C1> stan::math::mdivide_right_tri_low | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | A,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | b
| ) |  |

inline

Definition at line 22 of file mdivide_right_tri_low.hpp.

template<typename T1 , typename T2 , int R1, int C1, int R2, int C2>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R1, C2> stan::math::mdivide_right_tri_low | ( | const Eigen::Matrix< T1, R1, C1 > & | b,
|  | const Eigen::Matrix< T2, R2, C2 > & | A
| ) |  |

inline

Returns the solution of the system tri(A)x=b when tri(A) is a lower triangular view of the matrix A.

Parameters

  A | Matrix.
  b | Right hand side matrix or vector.

Returns
  x = b * tri(A)^-1, solution of the linear system.

Exceptions

  std::domain_error | if A is not square or the rows of b don't match the size of A.

Definition at line 25 of file mdivide_right_tri_low.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C2> stan::math::mdivide_right_tri_low | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | A,
|  | const Eigen::Matrix< double, R2, C2 > & | b
| ) |  |

inline

Definition at line 68 of file mdivide_right_tri_low.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C2> stan::math::mdivide_right_tri_low | ( | const Eigen::Matrix< double, R1, C1 > & | A,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | b
| ) |  |

inline

Definition at line 103 of file mdivide_right_tri_low.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::mean | ( | const std::vector< T > & | v | ) |

inline

Returns the sample mean (i.e., average) of the coefficients in the specified standard vector.

Parameters

  v | Specified vector.

Returns
  Sample mean of vector coefficients.

Exceptions

  std::domain_error | if the size of the vector is less than 1.

Definition at line 23 of file mean.hpp.

template<typename T , int R, int C>

boost::math::tools::promote_args<T>::type stan::math::mean | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Returns the sample mean (i.e., average) of the coefficients in the specified vector, row vector, or matrix.

Parameters

  m | Specified vector, row vector, or matrix.

Returns
  Sample mean of vector coefficients.

Definition at line 40 of file mean.hpp.

int stan::math::min | ( | const std::vector< int > & | x | ) |

inline

Returns the minimum coefficient in the specified column vector.

Parameters

  x | Specified vector.

Returns
  Minimum coefficient value in the vector.

Template Parameters

  Type | of values being compared and returned

Definition at line 20 of file min.hpp.

template<typename T >

T stan::math::min | ( | const std::vector< T > & | x | ) |

inline

Returns the minimum coefficient in the specified column vector.

Parameters

  x | Specified vector.

Returns
  Minimum coefficient value in the vector.

Template Parameters

  Type | of values being compared and returned

Definition at line 38 of file min.hpp.

template<typename T , int R, int C>

T stan::math::min | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Returns the minimum coefficient in the specified matrix, vector, or row vector.

Parameters

  m | Specified matrix, vector, or row vector.

Returns
  Minimum coefficient value in the vector.

Definition at line 55 of file min.hpp.

template<typename T >

T stan::math::minus | ( | const T & | x | ) |

inline

Returns the negation of the specified scalar or matrix.

Template Parameters

  T | Type of subtrahend.

Parameters

  x | Subtrahend.

Returns
  Negation of subtrahend.

Definition at line 16 of file minus.hpp.

template<typename T >

fvar<T> stan::math::modified_bessel_first_kind | ( | int | v,
|  | const fvar< T > & | z
| ) |  |

inline

Definition at line 15 of file modified_bessel_first_kind.hpp.

var stan::math::modified_bessel_first_kind | ( | const int & | v,
|  | const var & | a
| ) |  |

inline

Definition at line 27 of file modified_bessel_first_kind.hpp.

template<typename T2 >

T2 stan::math::modified_bessel_first_kind | ( | const int | v,
|  | const T2 | z
| ) |  |

inline

Definition at line 39 of file modified_bessel_first_kind.hpp.

template<typename T >

fvar<T> stan::math::modified_bessel_second_kind | ( | int | v,
|  | const fvar< T > & | z
| ) |  |

inline

Definition at line 15 of file modified_bessel_second_kind.hpp.

var stan::math::modified_bessel_second_kind | ( | const int & | v,
|  | const var & | a
| ) |  |

inline

Definition at line 27 of file modified_bessel_second_kind.hpp.

template<typename T2 >

T2 stan::math::modified_bessel_second_kind | ( | const int | v,
|  | const T2 | z
| ) |  |

inline

Definition at line 42 of file modified_bessel_second_kind.hpp.

int stan::math::modulus | ( | const int | x,
|  | const int | y
| ) |  |

inline

Definition at line 10 of file modulus.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::math::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

  y | A dxN matrix
  L | The Cholesky decomposition of a kernel matrix
  w | A d-dimensional vector of positve inverse scale parameters for each output.

Returns
  The log of the multivariate GP density.

Exceptions

  std::domain_error | if Sigma is not square, not symmetric, or not semi-positive definite.

Template Parameters

  T_y | Type of scalar.
  T_covar | Type of kernel.
  T_w | Type of weight.

Definition at line 43 of file multi_gp_cholesky_log.hpp.

template<typename T_y , typename T_covar , typename T_w >

boost::math::tools::promote_args<T_y, T_covar, T_w>::type stan::math::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_log.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::math::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

  y | A dxN matrix
  Sigma | The NxN kernel matrix
  w | A d-dimensional vector of positve inverse scale parameters for each output.

Returns
  The log of the multivariate GP density.

Exceptions

  std::domain_error | if Sigma is not square, not symmetric, or not semi-positive definite.

Template Parameters

  T_y | Type of scalar.
  T_covar | Type of kernel.
  T_w | Type of weight.

Definition at line 45 of file multi_gp_log.hpp.

template<typename T_y , typename T_covar , typename T_w >

boost::math::tools::promote_args<T_y, T_covar, T_w>::type stan::math::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 112 of file multi_gp_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_covar >

return_type<T_y, T_loc, T_covar>::type stan::math::multi_normal_cholesky_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_covar & | 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

  y | A scalar vector
  mu | The mean vector of the multivariate normal distribution.
  L | The Cholesky decomposition of a variance matrix of the multivariate normal distribution

Returns
  The log of the multivariate normal density.

Exceptions

  std::domain_error | if LL' is not square, not symmetric, or not semi-positive definite.

Template Parameters

  T_y | Type of scalar.
  T_loc | Type of location.
  T_covar | Type of scale.

Definition at line 50 of file multi_normal_cholesky_log.hpp.

template<typename T_y , typename T_loc , typename T_covar >

return_type<T_y, T_loc, T_covar>::type stan::math::multi_normal_cholesky_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_covar & | L
| ) |  |

inline

Definition at line 156 of file multi_normal_cholesky_log.hpp.

template<class RNG >

Eigen::VectorXd stan::math::multi_normal_cholesky_rng | ( | const Eigen::Matrix< double, Dynamic, 1 > & | mu,
|  | const Eigen::Matrix< double, Dynamic, Dynamic > & | S,
|  | RNG & | rng
| ) |  |

inline

Definition at line 31 of file multi_normal_cholesky_rng.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_covar >

return_type<T_y, T_loc, T_covar>::type stan::math::multi_normal_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_covar & | Sigma
| ) |  |

Definition at line 28 of file multi_normal_log.hpp.

template<typename T_y , typename T_loc , typename T_covar >

return_type<T_y, T_loc, T_covar>::type stan::math::multi_normal_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_covar & | Sigma
| ) |  |

inline

Definition at line 128 of file multi_normal_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_covar >

return_type<T_y, T_loc, T_covar>::type stan::math::multi_normal_prec_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_covar & | Sigma
| ) |  |

Definition at line 36 of file multi_normal_prec_log.hpp.

template<typename T_y , typename T_loc , typename T_covar >

return_type<T_y, T_loc, T_covar>::type stan::math::multi_normal_prec_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_covar & | Sigma
| ) |  |

inline

Definition at line 143 of file multi_normal_prec_log.hpp.

template<class RNG >

Eigen::VectorXd stan::math::multi_normal_rng | ( | const Eigen::Matrix< double, Dynamic, 1 > & | mu,
|  | const Eigen::Matrix< double, Dynamic, Dynamic > & | S,
|  | RNG & | rng
| ) |  |

inline

Definition at line 25 of file multi_normal_rng.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::math::multi_student_t_log | ( | const T_y & | y,
|  | const T_dof & | nu,
|  | const T_loc & | mu,
|  | const T_scale & | Sigma
| ) |  |

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

Template Parameters

  propto | Carry out calculations up to a proportion

Definition at line 37 of file multi_student_t_log.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::math::multi_student_t_log | ( | const T_y & | y,
|  | const T_dof & | nu,
|  | const T_loc & | mu,
|  | const T_scale & | Sigma
| ) |  |

inline

Definition at line 171 of file multi_student_t_log.hpp.

template<class RNG >

Eigen::VectorXd stan::math::multi_student_t_rng | ( | const double | nu,
|  | const Eigen::Matrix< double, Dynamic, 1 > & | mu,
|  | const Eigen::Matrix< double, Dynamic, Dynamic > & | s,
|  | RNG & | rng
| ) |  |

inline

Definition at line 30 of file multi_student_t_rng.hpp.

template<bool propto, typename T_prob >

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

Definition at line 24 of file multinomial_log.hpp.

template<typename T_prob >

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

Definition at line 59 of file multinomial_log.hpp.

template<class RNG >

std::vector<int> stan::math::multinomial_rng | ( | const Eigen::Matrix< double, Eigen::Dynamic, 1 > & | theta,
|  | const int | N,
|  | RNG & | rng
| ) |  |

inline

Definition at line 23 of file multinomial_rng.hpp.

template<typename T , int R1, int C1>

Eigen::Matrix<fvar<T>, R1, C1> stan::math::multiply | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | m,
|  | const fvar< T > & | c
| ) |  |

inline

Definition at line 20 of file multiply.hpp.

template<int R, int C, typename T >

boost::enable_if_c<boost::is_arithmetic<T>::value, Eigen::Matrix<double, R, C> >::type stan::math::multiply | ( | const Eigen::Matrix< double, R, C > & | m,
|  | T | c
| ) |  |

inline

Return specified matrix multiplied by specified scalar.

Template Parameters

  R | Row type for matrix.
  C | Column type for matrix.

Parameters

  m | Matrix.
  c | Scalar.

Returns
  Product of matrix and scalar.

Definition at line 25 of file multiply.hpp.

template<typename T1 , typename T2 >

boost::enable_if_c< (boost::is_scalar<T1>::value || boost::is_same<T1, var>::value) && (boost::is_scalar<T2>::value || boost::is_same<T2, var>::value), typename boost::math::tools::promote_args<T1, T2>::type>::type stan::math::multiply | ( | const T1 & | v,
|  | const T2 & | c
| ) |  |

inline

Return the product of two scalars.

Parameters

  [in] | v | First scalar.
  [in] | c | Specified scalar.

Returns
  Product of scalars.

Definition at line 31 of file multiply.hpp.

template<typename T , int R2, int C2>

Eigen::Matrix<fvar<T>, R2, C2> stan::math::multiply | ( | const Eigen::Matrix< fvar< T >, R2, C2 > & | m,
|  | const double | c
| ) |  |

inline

Definition at line 32 of file multiply.hpp.

template<typename T1 , typename T2 , int R2, int C2>

Eigen::Matrix<var, R2, C2> stan::math::multiply | ( | const T1 & | c,
|  | const Eigen::Matrix< T2, R2, C2 > & | m
| ) |  |

inline

Return the product of scalar and matrix.

Parameters

  [in] | c | Specified scalar.
  [in] | m | Matrix.

Returns
  Product of scalar and matrix.

Definition at line 43 of file multiply.hpp.

template<typename T , int R1, int C1>

Eigen::Matrix<fvar<T>, R1, C1> stan::math::multiply | ( | const Eigen::Matrix< double, R1, C1 > & | m,
|  | const fvar< T > & | c
| ) |  |

inline

Definition at line 44 of file multiply.hpp.

template<int R, int C, typename T >

boost::enable_if_c<boost::is_arithmetic<T>::value, Eigen::Matrix<double, R, C> >::type stan::math::multiply | ( | T | c,
|  | const Eigen::Matrix< double, R, C > & | m
| ) |  |

inline

Return specified scalar multiplied by specified matrix.

Template Parameters

  R | Row type for matrix.
  C | Column type for matrix.

Parameters

  c | Scalar.
  m | Matrix.

Returns
  Product of scalar and matrix.

Definition at line 45 of file multiply.hpp.

template<typename T , int R1, int C1>

Eigen::Matrix<fvar<T>, R1, C1> stan::math::multiply | ( | const fvar< T > & | c,
|  | const Eigen::Matrix< fvar< T >, R1, C1 > & | m
| ) |  |

inline

Definition at line 56 of file multiply.hpp.

template<typename T1 , int R1, int C1, typename T2 >

Eigen::Matrix<var, R1, C1> stan::math::multiply | ( | const Eigen::Matrix< T1, R1, C1 > & | m,
|  | const T2 & | c
| ) |  |

inline

Return the product of scalar and matrix.

Parameters

  [in] | m | Matrix.
  [in] | c | Specified scalar.

Returns
  Product of scalar and matrix.

Definition at line 57 of file multiply.hpp.

template<int R1, int C1, int R2, int C2>

Eigen::Matrix<double, R1, C2> stan::math::multiply | ( | const Eigen::Matrix< double, R1, C1 > & | m1,
|  | const Eigen::Matrix< double, R2, C2 > & | m2
| ) |  |

inline

Return the product of the specified matrices.

The number of columns in the first matrix must be the same as the number of rows in the second matrix.

Parameters

  m1 | First matrix.
  m2 | Second matrix.

Returns
  The product of the first and second matrices.

Exceptions

  std::domain_error | if the number of columns of m1 does not match the number of rows of m2.

Definition at line 62 of file multiply.hpp.

template<typename T , int R1, int C1>

Eigen::Matrix<fvar<T>, R1, C1> stan::math::multiply | ( | const double | c,
|  | const Eigen::Matrix< fvar< T >, R1, C1 > & | m
| ) |  |

inline

Definition at line 63 of file multiply.hpp.

template<typename T , int R1, int C1>

Eigen::Matrix<fvar<T>, R1, C1> stan::math::multiply | ( | const fvar< T > & | c,
|  | const Eigen::Matrix< double, R1, C1 > & | m
| ) |  |

inline

Definition at line 70 of file multiply.hpp.

template<typename T1 , int R1, int C1, typename T2 , int R2, int C2>

boost::enable_if_c< boost::is_same<T1, var>::value || boost::is_same<T2, var>::value, Eigen::Matrix<var, R1, C2> >::type stan::math::multiply | ( | const Eigen::Matrix< T1, R1, C1 > & | m1,
|  | const Eigen::Matrix< T2, R2, C2 > & | m2
| ) |  |

inline

Return the product of the specified matrices.

The number of columns in the first matrix must be the same as the number of rows in the second matrix.

Parameters

  [in] | m1 | First matrix.
  [in] | m2 | Second matrix.

Returns
  The product of the first and second matrices.

Exceptions

  std::domain_error | if the number of columns of m1 does not match the number of rows of m2.

Definition at line 76 of file multiply.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C2> stan::math::multiply | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | m1,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | m2
| ) |  |

inline

Definition at line 77 of file multiply.hpp.

template<int C1, int R2>

double stan::math::multiply | ( | const Eigen::Matrix< double, 1, C1 > & | rv,
|  | const Eigen::Matrix< double, R2, 1 > & | v
| ) |  |

inline

Return the scalar product of the specified row vector and specified column vector.

The return is the same as the dot product. The two vectors must be the same size.

Parameters

  rv | Row vector.
  v | Column vector.

Returns
  Scalar result of multiplying row vector by column vector.

Exceptions

  std::domain_error | if rv and v are not the same size.

Definition at line 80 of file multiply.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C2> stan::math::multiply | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | m1,
|  | const Eigen::Matrix< double, R2, C2 > & | m2
| ) |  |

inline

Definition at line 96 of file multiply.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, C2> stan::math::multiply | ( | const Eigen::Matrix< double, R1, C1 > & | m1,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | m2
| ) |  |

inline

Definition at line 115 of file multiply.hpp.

template<typename T1 , int C1, typename T2 , int R2>

boost::enable_if_c< boost::is_same<T1, var>::value || boost::is_same<T2, var>::value, var >::type stan::math::multiply | ( | const Eigen::Matrix< T1, 1, C1 > & | rv,
|  | const Eigen::Matrix< T2, R2, 1 > & | v
| ) |  |

inline

Return the scalar product of the specified row vector and specified column vector.

The return is the same as the dot product. The two vectors must be the same size.

Parameters

  [in] | rv | Row vector.
  [in] | v | Column vector.

Returns
  Scalar result of multiplying row vector by column vector.

Exceptions

  std::domain_error | if rv and v are not the same size

Definition at line 128 of file multiply.hpp.

template<typename T , int C1, int R2>

fvar<T> stan::math::multiply | ( | const Eigen::Matrix< fvar< T >, 1, C1 > & | rv,
|  | const Eigen::Matrix< fvar< T >, R2, 1 > & | v
| ) |  |

inline

Definition at line 134 of file multiply.hpp.

template<typename T , int C1, int R2>

fvar<T> stan::math::multiply | ( | const Eigen::Matrix< fvar< T >, 1, C1 > & | rv,
|  | const Eigen::Matrix< double, R2, 1 > & | v
| ) |  |

inline

Definition at line 145 of file multiply.hpp.

template<typename T , int C1, int R2>

fvar<T> stan::math::multiply | ( | const Eigen::Matrix< double, 1, C1 > & | rv,
|  | const Eigen::Matrix< fvar< T >, R2, 1 > & | v
| ) |  |

inline

Definition at line 156 of file multiply.hpp.

template<typename T >

fvar<T> stan::math::multiply_log | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 15 of file multiply_log.hpp.

template<typename T >

fvar<T> stan::math::multiply_log | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 25 of file multiply_log.hpp.

template<typename T >

fvar<T> stan::math::multiply_log | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 35 of file multiply_log.hpp.

template<typename T_a , typename T_b >

boost::math::tools::promote_args<T_a, T_b>::type stan::math::multiply_log | ( | const T_a | a,
|  | const T_b | b
| ) |  |

inline

Calculated the value of the first argument times log of the second argument while behaving properly with 0 inputs.

.

Parameters

  a | the first variable
  b | the second variable

Returns
  a * log(b)

Definition at line 51 of file multiply_log.hpp.

var stan::math::multiply_log | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Return the value of a*log(b).

When both a and b are 0, the value returned is 0. The partial deriviative with respect to a is log(b). The partial deriviative with respect to b is a/b. When a and b are both 0, this is set to Inf.

Parameters

  a | First variable.
  b | Second variable.

Returns
  Value of a*log(b)

Definition at line 74 of file multiply_log.hpp.

var stan::math::multiply_log | ( | const var & | a,
|  | const double | b
| ) |  |

inline

Return the value of a*log(b).

When both a and b are 0, the value returned is 0. The partial deriviative with respect to a is log(b).

Parameters

  a | First variable.
  b | Second scalar.

Returns
  Value of a*log(b)

Definition at line 87 of file multiply_log.hpp.

var stan::math::multiply_log | ( | const double | a,
|  | const var & | b
| ) |  |

inline

Return the value of a*log(b).

When both a and b are 0, the value returned is 0. The partial deriviative with respect to b is a/b. When a and b are both 0, this is set to Inf.

Parameters

  a | First scalar.
  b | Second variable.

Returns
  Value of a*log(b)

Definition at line 101 of file multiply_log.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, R, R> stan::math::multiply_lower_tri_self_transpose | ( | const Eigen::Matrix< fvar< T >, R, C > & | m | ) |

inline

Definition at line 17 of file multiply_lower_tri_self_transpose.hpp.

matrix_d stan::math::multiply_lower_tri_self_transpose | ( | const matrix_d & | L | ) |

inline

Returns the result of multiplying the lower triangular portion of the input matrix by its own transpose.

Parameters

  L | Matrix to multiply.

Returns
  The lower triangular values in L times their own transpose.

Exceptions

  std::domain_error | If the input matrix is not square.

Definition at line 18 of file multiply_lower_tri_self_transpose.hpp.

matrix_v stan::math::multiply_lower_tri_self_transpose | ( | const matrix_v & | L | ) |

inline

Definition at line 19 of file multiply_lower_tri_self_transpose.hpp.

template<typename T_n , typename T_location , typename T_precision >

return_type<T_location, T_precision>::type stan::math::neg_binomial_2_ccdf_log | ( | const T_n & | n,
|  | const T_location & | mu,
|  | const T_precision & | phi
| ) |  |

Definition at line 33 of file neg_binomial_2_ccdf_log.hpp.

template<typename T_n , typename T_location , typename T_precision >

return_type<T_location, T_precision>::type stan::math::neg_binomial_2_cdf | ( | const T_n & | n,
|  | const T_location & | mu,
|  | const T_precision & | phi
| ) |  |

Definition at line 37 of file neg_binomial_2_cdf.hpp.

template<typename T_n , typename T_location , typename T_precision >

return_type<T_location, T_precision>::type stan::math::neg_binomial_2_cdf_log | ( | const T_n & | n,
|  | const T_location & | mu,
|  | const T_precision & | phi
| ) |  |

Definition at line 31 of file neg_binomial_2_cdf_log.hpp.

template<bool propto, typename T_n , typename T_location , typename T_precision >

return_type<T_location, T_precision>::type stan::math::neg_binomial_2_log | ( | const T_n & | n,
|  | const T_location & | mu,
|  | const T_precision & | phi
| ) |  |

Definition at line 37 of file neg_binomial_2_log.hpp.

template<typename T_n , typename T_location , typename T_precision >

return_type<T_location, T_precision>::type stan::math::neg_binomial_2_log | ( | const T_n & | n,
|  | const T_location & | mu,
|  | const T_precision & | phi
| ) |  |

inline

Definition at line 141 of file neg_binomial_2_log.hpp.

template<bool propto, typename T_n , typename T_log_location , typename T_precision >

return_type<T_log_location, T_precision>::type stan::math::neg_binomial_2_log_log | ( | const T_n & | n,
|  | const T_log_location & | eta,
|  | const T_precision & | phi
| ) |  |

Definition at line 33 of file neg_binomial_2_log_log.hpp.

template<typename T_n , typename T_log_location , typename T_precision >

return_type<T_log_location, T_precision>::type stan::math::neg_binomial_2_log_log | ( | const T_n & | n,
|  | const T_log_location & | eta,
|  | const T_precision & | phi
| ) |  |

inline

Definition at line 140 of file neg_binomial_2_log_log.hpp.

template<class RNG >

int stan::math::neg_binomial_2_log_rng | ( | const double | eta,
|  | const double | phi,
|  | RNG & | rng
| ) |  |

inline

Definition at line 29 of file neg_binomial_2_log_rng.hpp.

template<class RNG >

int stan::math::neg_binomial_2_rng | ( | const double | mu,
|  | const double | phi,
|  | RNG & | rng
| ) |  |

inline

Definition at line 29 of file neg_binomial_2_rng.hpp.

template<typename T_n , typename T_shape , typename T_inv_scale >

return_type<T_shape, T_inv_scale>::type stan::math::neg_binomial_ccdf_log | ( | const T_n & | n,
|  | const T_shape & | alpha,
|  | const T_inv_scale & | beta
| ) |  |

Definition at line 32 of file neg_binomial_ccdf_log.hpp.

template<typename T_n , typename T_shape , typename T_inv_scale >

return_type<T_shape, T_inv_scale>::type stan::math::neg_binomial_cdf | ( | const T_n & | n,
|  | const T_shape & | alpha,
|  | const T_inv_scale & | beta
| ) |  |

Definition at line 29 of file neg_binomial_cdf.hpp.

template<typename T_n , typename T_shape , typename T_inv_scale >

return_type<T_shape, T_inv_scale>::type stan::math::neg_binomial_cdf_log | ( | const T_n & | n,
|  | const T_shape & | alpha,
|  | const T_inv_scale & | beta
| ) |  |

Definition at line 32 of file neg_binomial_cdf_log.hpp.

template<bool propto, typename T_n , typename T_shape , typename T_inv_scale >

return_type<T_shape, T_inv_scale>::type stan::math::neg_binomial_log | ( | const T_n & | n,
|  | const T_shape & | alpha,
|  | const T_inv_scale & | beta
| ) |  |

Definition at line 39 of file neg_binomial_log.hpp.

template<typename T_n , typename T_shape , typename T_inv_scale >

return_type<T_shape, T_inv_scale>::type stan::math::neg_binomial_log | ( | const T_n & | n,
|  | const T_shape & | alpha,
|  | const T_inv_scale & | beta
| ) |  |

inline

Definition at line 183 of file neg_binomial_log.hpp.

template<class RNG >

int stan::math::neg_binomial_rng | ( | const double | alpha,
|  | const double | beta,
|  | RNG & | rng
| ) |  |

inline

Definition at line 30 of file neg_binomial_rng.hpp.

double stan::math::negative_infinity | ( |  | ) |

inline

Return negative infinity.

Returns
  Negative infinity.

Definition at line 132 of file constants.hpp.

static size_t stan::math::nested_size | ( |  | ) |

inlinestatic

Definition at line 12 of file nested_size.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::normal_ccdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 24 of file normal_ccdf_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::normal_cdf | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

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

.

Parameters

  y | A scalar variate.
  mu | The location of the normal distribution.
  sigma | The scale of the normal distriubtion

Returns
  The unit normal cdf evaluated at the specified arguments.

Template Parameters

  T_y | Type of y.
  T_loc | Type of mean parameter.
  T_scale | Type of standard deviation paramater.

Definition at line 38 of file normal_cdf.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::normal_cdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 24 of file normal_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::normal_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

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

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

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

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_error | if the scale is not positive.

Template Parameters

  T_y | Underlying type of scalar in sequence.
  T_loc | Type of location parameter.

Definition at line 43 of file normal_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::normal_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

inline

Definition at line 136 of file normal_log.hpp.

template<class RNG >

double stan::math::normal_rng | ( | const double | mu,
|  | const double | sigma,
|  | RNG & | rng
| ) |  |

inline

Definition at line 20 of file normal_rng.hpp.

double stan::math::not_a_number | ( |  | ) |

inline

Return (quiet) not-a-number.

Returns
  Quiet not-a-number.

Definition at line 141 of file constants.hpp.

template<typename T >

int stan::math::num_elements | ( | const T & | x | ) |

inline

Returns 1, the number of elements in a primitive type.

Parameters

  x | Argument of primitive type.

Returns
  1

Definition at line 19 of file num_elements.hpp.

template<typename T , int R, int C>

int stan::math::num_elements | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Returns the size of the specified matrix.

Parameters

  m | argument matrix

Returns
  size of matrix

Definition at line 31 of file num_elements.hpp.

template<typename T >

int stan::math::num_elements | ( | const std::vector< T > & | v | ) |

inline

Returns the number of elements in the specified vector.

This assumes it is not ragged and that each of its contained elements has the same number of elements.

Parameters

  v | argument vector

Returns
  number of contained arguments

Definition at line 45 of file num_elements.hpp.

bool stan::math::operator! | ( | const var & | a | ) |

inline

Prefix logical negation for the value of variables (C++).

The expression (!a) is equivalent to negating the scalar value of the variable a.

Note that this is the only logical operator defined for variables. Overridden logical conjunction (&&) and disjunction (||) operators do not apply the same "short circuit" rules as the built-in logical operators.

Parameters

  a | Variable to negate.

Returns
  True if variable is non-zero.

Definition at line 31 of file operator_unary_not.hpp.

template<typename T >

bool stan::math::operator!= | ( | const fvar< T > & | x,
|  | const fvar< T > & | y
| ) |  |

inline

Definition at line 14 of file operator_not_equal.hpp.

template<typename T >

bool stan::math::operator!= | ( | const fvar< T > & | x,
|  | double | y
| ) |  |

inline

Definition at line 21 of file operator_not_equal.hpp.

bool stan::math::operator!= | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Inequality operator comparing two variables' values (C++).

Parameters

  a | First variable.
  b | Second variable.

Returns
  True if the first variable's value is not the same as the second's.

Definition at line 26 of file operator_not_equal.hpp.

template<typename T >

bool stan::math::operator!= | ( | double | x,
|  | const fvar< T > & | y
| ) |  |

inline

Definition at line 28 of file operator_not_equal.hpp.

bool stan::math::operator!= | ( | const var & | a,
|  | const double | b
| ) |  |

inline

Inequality operator comparing a variable's value and a double (C++).

Parameters

  a | First variable.
  b | Second value.

Returns
  True if the first variable's value is not the same as the second value.

Definition at line 39 of file operator_not_equal.hpp.

bool stan::math::operator!= | ( | const double | a,
|  | const var & | b
| ) |  |

inline

Inequality operator comparing a double and a variable's value (C++).

Parameters

  a | First value.
  b | Second variable.

Returns
  True if the first value is not the same as the second variable's value.

Definition at line 52 of file operator_not_equal.hpp.

template<typename T >

fvar<T> stan::math::operator* | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 14 of file operator_multiplication.hpp.

template<typename T >

fvar<T> stan::math::operator* | ( | double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 22 of file operator_multiplication.hpp.

template<typename T >

fvar<T> stan::math::operator* | ( | const fvar< T > & | x1,
|  | double | x2
| ) |  |

inline

Definition at line 29 of file operator_multiplication.hpp.

var stan::math::operator* | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Multiplication operator for two variables (C++).

The partial derivatives are

, and

.

Parameters

  a | First variable operand.
  b | Second variable operand.

Returns
  Variable result of multiplying operands.

Definition at line 83 of file operator_multiplication.hpp.

var stan::math::operator* | ( | const var & | a,
|  | const double | b
| ) |  |

inline

Multiplication operator for a variable and a scalar (C++).

The partial derivative for the variable is

, and

Parameters

  a | Variable operand.
  b | Scalar operand.

Returns
  Variable result of multiplying operands.

Definition at line 98 of file operator_multiplication.hpp.

var stan::math::operator* | ( | const double | a,
|  | const var & | b
| ) |  |

inline

Multiplication operator for a scalar and a variable (C++).

The partial derivative for the variable is

.

Parameters

  a | Scalar operand.
  b | Variable operand.

Returns
  Variable result of multiplying the operands.

Definition at line 115 of file operator_multiplication.hpp.

template<typename T >

fvar<T> stan::math::operator+ | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 13 of file operator_addition.hpp.

template<typename T >

fvar<T> stan::math::operator+ | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 20 of file operator_addition.hpp.

template<typename T >

fvar<T> stan::math::operator+ | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 27 of file operator_addition.hpp.

var stan::math::operator+ | ( | const var & | a | ) |

inline

Unary plus operator for variables (C++).

The function simply returns its input, because

.

The effect of unary plus on a built-in C++ scalar type is integer promotion. Because variables are all double-precision floating point already, promotion is not necessary.

Parameters

  a | Argument variable.

Returns
  The input reference.

Definition at line 43 of file operator_unary_plus.hpp.

var stan::math::operator+ | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Addition operator for variables (C++).

The partial derivatives are defined by

, and

.

Parameters

  a | First variable operand.
  b | Second variable operand.

Returns
  Variable result of adding two variables.

Definition at line 84 of file operator_addition.hpp.

var stan::math::operator+ | ( | const var & | a,
|  | const double | b
| ) |  |

inline

Addition operator for variable and scalar (C++).

The derivative with respect to the variable is

.

Parameters

  a | First variable operand.
  b | Second scalar operand.

Returns
  Result of adding variable and scalar.

Definition at line 99 of file operator_addition.hpp.

var stan::math::operator+ | ( | const double | a,
|  | const var & | b
| ) |  |

inline

Addition operator for scalar and variable (C++).

The derivative with respect to the variable is

.

Parameters

  a | First scalar operand.
  b | Second variable operand.

Returns
  Result of adding variable and scalar.

Definition at line 116 of file operator_addition.hpp.

var& stan::math::operator++ | ( | var & | a | ) |

inline

Prefix increment operator for variables (C++).

Following C++, (++a) is defined to behave exactly as (a = a + 1.0) does, but is faster and uses less memory. In particular, the result is an assignable lvalue.

Parameters

  a | Variable to increment.

Returns
  Reference the result of incrementing this input variable.

Definition at line 36 of file operator_unary_increment.hpp.

var stan::math::operator++ | ( | var & | a,
|  | int |
| ) |  |

inline

Postfix increment operator for variables (C++).

Following C++, the expression `(a++)` is defined to behave like the sequence of operations

`var temp = a; a = a + 1.0; return temp;`

Parameters

  a | Variable to increment.

Returns
  Input variable.

Definition at line 52 of file operator_unary_increment.hpp.

template<typename T >

fvar<T> stan::math::operator- | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 14 of file operator_subtraction.hpp.

template<typename T >

fvar<T> stan::math::operator- | ( | const fvar< T > & | x | ) |

inline

Definition at line 14 of file operator_unary_minus.hpp.

template<typename T >

fvar<T> stan::math::operator- | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 21 of file operator_subtraction.hpp.

template<typename T >

fvar<T> stan::math::operator- | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 28 of file operator_subtraction.hpp.

var stan::math::operator- | ( | const var & | a | ) |

inline

Unary negation operator for variables (C++).

.

Parameters

  a | Argument variable.

Returns
  Negation of variable.

Definition at line 51 of file operator_unary_negative.hpp.

var stan::math::operator- | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Subtraction operator for variables (C++).

The partial derivatives are defined by

, and

.

Parameters

  a | First variable operand.
  b | Second variable operand.

Returns
  Variable result of subtracting the second variable from the first.

Definition at line 99 of file operator_subtraction.hpp.

var stan::math::operator- | ( | const var & | a,
|  | const double | b
| ) |  |

inline

Subtraction operator for variable and scalar (C++).

The derivative for the variable is

, and

Parameters

  a | First variable operand.
  b | Second scalar operand.

Returns
  Result of subtracting the scalar from the variable.

Definition at line 114 of file operator_subtraction.hpp.

var stan::math::operator- | ( | const double | a,
|  | const var & | b
| ) |  |

inline

Subtraction operator for scalar and variable (C++).

The derivative for the variable is

, and

Parameters

  a | First scalar operand.
  b | Second variable operand.

Returns
  Result of sutracting a variable from a scalar.

Definition at line 131 of file operator_subtraction.hpp.

var& stan::math::operator-- | ( | var & | a | ) |

inline

Prefix decrement operator for variables (C++).

Following C++, `(–a)` is defined to behave exactly as

`a = a - 1.0)`

does, but is faster and uses less memory. In particular, the result is an assignable lvalue.

Parameters

  a | Variable to decrement.

Returns
  Reference the result of decrementing this input variable.

Definition at line 40 of file operator_unary_decrement.hpp.

var stan::math::operator-- | ( | var & | a,
|  | int |
| ) |  |

inline

Postfix decrement operator for variables (C++).

Following C++, the expression `(a–)` is defined to behave like the sequence of operations

`var temp = a; a = a - 1.0; return temp;`

Parameters

  a | Variable to decrement.

Returns
  Input variable.

Definition at line 56 of file operator_unary_decrement.hpp.

template<typename T >

fvar<T> stan::math::operator/ | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 14 of file operator_division.hpp.

template<typename T >

fvar<T> stan::math::operator/ | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 22 of file operator_division.hpp.

template<typename T >

fvar<T> stan::math::operator/ | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 30 of file operator_division.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, R, C> stan::math::operator/ | ( | const Eigen::Matrix< fvar< T >, R, C > & | v,
|  | const fvar< T > & | c
| ) |  |

inline

Definition at line 58 of file divide.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, R, C> stan::math::operator/ | ( | const Eigen::Matrix< fvar< T >, R, C > & | v,
|  | const double | c
| ) |  |

inline

Definition at line 64 of file divide.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, R, C> stan::math::operator/ | ( | const Eigen::Matrix< double, R, C > & | v,
|  | const fvar< T > & | c
| ) |  |

inline

Definition at line 70 of file divide.hpp.

var stan::math::operator/ | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Division operator for two variables (C++).

The partial derivatives for the variables are

, and

.

Parameters

  a | First variable operand.
  b | Second variable operand.

Returns
  Variable result of dividing the first variable by the second.

Definition at line 96 of file operator_division.hpp.

var stan::math::operator/ | ( | const var & | a,
|  | const double | b
| ) |  |

inline

Division operator for dividing a variable by a scalar (C++).

The derivative with respect to the variable is

.

Parameters

  a | Variable operand.
  b | Scalar operand.

Returns
  Variable result of dividing the variable by the scalar.

Definition at line 111 of file operator_division.hpp.

var stan::math::operator/ | ( | const double | a,
|  | const var & | b
| ) |  |

inline

Division operator for dividing a scalar by a variable (C++).

The derivative with respect to the variable is

.

Parameters

  a | Scalar operand.
  b | Variable operand.

Returns
  Variable result of dividing the scalar by the variable.

Definition at line 128 of file operator_division.hpp.

template<typename T >

bool stan::math::operator< | ( | const fvar< T > & | x,
|  | double | y
| ) |  |

inline

Definition at line 12 of file operator_less_than.hpp.

template<typename T >

bool stan::math::operator< | ( | double | x,
|  | const fvar< T > & | y
| ) |  |

inline

Definition at line 18 of file operator_less_than.hpp.

template<typename T >

bool stan::math::operator< | ( | const fvar< T > & | x,
|  | const fvar< T > & | y
| ) |  |

inline

Definition at line 24 of file operator_less_than.hpp.

bool stan::math::operator< | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Less than operator comparing variables' values (C++).

Parameters

  a | First variable.
  b | Second variable.

Returns
  True if first variable's value is less than second's.

Definition at line 24 of file operator_less_than.hpp.

bool stan::math::operator< | ( | const var & | a,
|  | const double | b
| ) |  |

inline

Less than operator comparing variable's value and a double (C++).

Parameters

  a | First variable.
  b | Second value.

Returns
  True if first variable's value is less than second value.

Definition at line 36 of file operator_less_than.hpp.

bool stan::math::operator< | ( | const double | a,
|  | const var & | b
| ) |  |

inline

Less than operator comparing a double and variable's value (C++).

Parameters

  a | First value.
  b | Second variable.

Returns
  True if first value is less than second variable's value.

Definition at line 48 of file operator_less_than.hpp.

template<typename T >

bool stan::math::operator<= | ( | const fvar< T > & | x,
|  | const fvar< T > & | y
| ) |  |

inline

Definition at line 14 of file operator_less_than_or_equal.hpp.

template<typename T >

bool stan::math::operator<= | ( | const fvar< T > & | x,
|  | double | y
| ) |  |

inline

Definition at line 21 of file operator_less_than_or_equal.hpp.

bool stan::math::operator<= | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Less than or equal operator comparing two variables' values (C++).

Parameters

  a | First variable.
  b | Second variable.

Returns
  True if first variable's value is less than or equal to the second's.

Definition at line 26 of file operator_less_than_or_equal.hpp.

template<typename T >

bool stan::math::operator<= | ( | double | x,
|  | const fvar< T > & | y
| ) |  |

inline

Definition at line 28 of file operator_less_than_or_equal.hpp.

bool stan::math::operator<= | ( | const var & | a,
|  | const double | b
| ) |  |

inline

Less than or equal operator comparing a variable's value and a scalar (C++).

Parameters

  a | First variable.
  b | Second value.

Returns
  True if first variable's value is less than or equal to the second value.

Definition at line 39 of file operator_less_than_or_equal.hpp.

bool stan::math::operator<= | ( | const double | a,
|  | const var & | b
| ) |  |

inline

Less than or equal operator comparing a double and variable's value (C++).

Parameters

  a | First value.
  b | Second variable.

Returns
  True if first value is less than or equal to the second variable's value.

Definition at line 52 of file operator_less_than_or_equal.hpp.

template<typename T >

bool stan::math::operator== | ( | const fvar< T > & | x,
|  | const fvar< T > & | y
| ) |  |

inline

Definition at line 14 of file operator_equal.hpp.

template<typename T >

bool stan::math::operator== | ( | const fvar< T > & | x,
|  | double | y
| ) |  |

inline

Definition at line 21 of file operator_equal.hpp.

bool stan::math::operator== | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Equality operator comparing two variables' values (C++).

Parameters

  a | First variable.
  b | Second variable.

Returns
  True if the first variable's value is the same as the second's.

Definition at line 26 of file operator_equal.hpp.

template<typename T >

bool stan::math::operator== | ( | double | x,
|  | const fvar< T > & | y
| ) |  |

inline

Definition at line 28 of file operator_equal.hpp.

bool stan::math::operator== | ( | const var & | a,
|  | const double | b
| ) |  |

inline

Equality operator comparing a variable's value and a double (C++).

Parameters

  a | First variable.
  b | Second value.

Returns
  True if the first variable's value is the same as the second value.

Definition at line 39 of file operator_equal.hpp.

bool stan::math::operator== | ( | const double | a,
|  | const var & | b
| ) |  |

inline

Equality operator comparing a scalar and a variable's value (C++).

Parameters

  a | First scalar.
  b | Second variable.

Returns
  True if the variable's value is equal to the scalar.

Definition at line 51 of file operator_equal.hpp.

template<typename T >

bool stan::math::operator> | ( | const fvar< T > & | x,
|  | const fvar< T > & | y
| ) |  |

inline

Definition at line 14 of file operator_greater_than.hpp.

template<typename T >

bool stan::math::operator> | ( | const fvar< T > & | x,
|  | double | y
| ) |  |

inline

Definition at line 21 of file operator_greater_than.hpp.

bool stan::math::operator> | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Greater than operator comparing variables' values (C++).

Parameters

  a | First variable.
  b | Second variable.

Returns
  True if first variable's value is greater than second's.

Definition at line 25 of file operator_greater_than.hpp.

template<typename T >

bool stan::math::operator> | ( | double | x,
|  | const fvar< T > & | y
| ) |  |

inline

Definition at line 28 of file operator_greater_than.hpp.

bool stan::math::operator> | ( | const var & | a,
|  | const double | b
| ) |  |

inline

Greater than operator comparing variable's value and double (C++).

Parameters

  a | First variable.
  b | Second value.

Returns
  True if first variable's value is greater than second value.

Definition at line 37 of file operator_greater_than.hpp.

bool stan::math::operator> | ( | const double | a,
|  | const var & | b
| ) |  |

inline

Greater than operator comparing a double and a variable's value (C++).

Parameters

  a | First value.
  b | Second variable.

Returns
  True if first value is greater than second variable's value.

Definition at line 49 of file operator_greater_than.hpp.

template<typename T >

bool stan::math::operator>= | ( | const fvar< T > & | x,
|  | const fvar< T > & | y
| ) |  |

inline

Definition at line 14 of file operator_greater_than_or_equal.hpp.

template<typename T >

bool stan::math::operator>= | ( | const fvar< T > & | x,
|  | double | y
| ) |  |

inline

Definition at line 21 of file operator_greater_than_or_equal.hpp.

bool stan::math::operator>= | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Greater than or equal operator comparing two variables' values (C++).

Parameters

  a | First variable.
  b | Second variable.

Returns
  True if first variable's value is greater than or equal to the second's.

Definition at line 27 of file operator_greater_than_or_equal.hpp.

template<typename T >

bool stan::math::operator>= | ( | double | x,
|  | const fvar< T > & | y
| ) |  |

inline

Definition at line 28 of file operator_greater_than_or_equal.hpp.

bool stan::math::operator>= | ( | const var & | a,
|  | const double | b
| ) |  |

inline

Greater than or equal operator comparing variable's value and double (C++).

Parameters

  a | First variable.
  b | Second value.

Returns
  True if first variable's value is greater than or equal to second value.

Definition at line 40 of file operator_greater_than_or_equal.hpp.

bool stan::math::operator>= | ( | const double | a,
|  | const var & | b
| ) |  |

inline

Greater than or equal operator comparing double and variable's value (C++).

Parameters

  a | First value.
  b | Second variable.

Returns
  True if the first value is greater than or equal to the second variable's value.

Definition at line 53 of file operator_greater_than_or_equal.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  x | Free vector of scalars.

Returns
  Positive, increasing ordered vector.

Template Parameters

  T | Type of scalar.

Definition at line 23 of file ordered_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  x | Free vector of scalars.
  lp | Log probability reference.

Returns
  Positive, increasing ordered vector.

Template Parameters

  T | Type of scalar.

Definition at line 56 of file ordered_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  y | Vector of positive, ordered scalars.

Returns
  Free vector that transforms into the input vector.

Template Parameters

  T | Type of scalar.

Exceptions

  std::domain_error | if y is not a vector of positive, ordered scalars.

Definition at line 28 of file ordered_free.hpp.

template<bool propto, typename T_lambda , typename T_cut >

boost::math::tools::promote_args<T_lambda, T_cut>::type stan::math::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

  propto | True if calculating up to a proportion.
  T_loc | Location type.
  T_cut | Cut-point type.

Parameters

  y | Outcome.
  lambda | Location.
  c | Positive increasing vector of cutpoints.

Returns
  Log probability of outcome given location and cutpoints.

Exceptions

  std::domain_error | If 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 61 of file ordered_logistic_log.hpp.

template<typename T_lambda , typename T_cut >

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

Definition at line 107 of file ordered_logistic_log.hpp.

template<class RNG >

int stan::math::ordered_logistic_rng | ( | const double | eta,
|  | const Eigen::Matrix< double, Eigen::Dynamic, 1 > & | c,
|  | RNG & | rng
| ) |  |

inline

Definition at line 24 of file ordered_logistic_rng.hpp.

void stan::math::out_of_range | ( | const char * | function,
|  | const int | max,
|  | const int | index,
|  | const char * | msg1 = `""`,
|  | const char * | msg2 = `""`
| ) |  |

inline

Throw an out_of_range exception with a consistently formatted message.

This is an abstraction for all Stan functions to use when throwing out of range. This will allow us to change the behavior for all functions at once.

The message is: "<function>: index <index> out of range; expecting index to be between " "1 and <max><msg1><msg2>"

Parameters

  function | Name of the function
  max | Max
  index | Index
  msg1 | Message to print. Default is "".
  msg2 | Message to print. Default is "".

Definition at line 30 of file out_of_range.hpp.

template<typename T >

fvar<T> stan::math::owens_t | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 14 of file owens_t.hpp.

template<typename T >

fvar<T> stan::math::owens_t | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 34 of file owens_t.hpp.

template<typename T >

fvar<T> stan::math::owens_t | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 48 of file owens_t.hpp.

double stan::math::owens_t | ( | const double | h,
|  | const double | a
| ) |  |

inline

The Owen's T function of h and a.

Used to compute the cumulative density function for the skew normal distribution.

Template Parameters

  T1 | Type of first argument.
  T2 | Type of second argument.

Parameters

  h | First argument
  a | Second argument

Returns
  The Owen's T function.

Definition at line 62 of file owens_t.hpp.

var stan::math::owens_t | ( | const var & | h,
|  | const var & | a
| ) |  |

inline

The Owen's T function of h and a.

Used to compute the cumulative density function for the skew normal distribution.

Parameters

  h | var parameter.
  a | var parameter.

Returns
  The Owen's T function.

Definition at line 66 of file owens_t.hpp.

var stan::math::owens_t | ( | const var & | h,
|  | double | a
| ) |  |

inline

The Owen's T function of h and a.

Used to compute the cumulative density function for the skew normal distribution.

Parameters

  h | var parameter.
  a | double parameter.

Returns
  The Owen's T function.

Definition at line 80 of file owens_t.hpp.

var stan::math::owens_t | ( | double | h,
|  | const var & | a
| ) |  |

inline

The Owen's T function of h and a.

Used to compute the cumulative density function for the skew normal distribution.

Parameters

  h | double parameter.
  a | var parameter.

Returns
  The Owen's T function.

Definition at line 94 of file owens_t.hpp.

template<typename T_y , typename T_scale , typename T_shape >

return_type<T_y, T_scale, T_shape>::type stan::math::pareto_ccdf_log | ( | const T_y & | y,
|  | const T_scale & | y_min,
|  | const T_shape & | alpha
| ) |  |

Definition at line 23 of file pareto_ccdf_log.hpp.

template<typename T_y , typename T_scale , typename T_shape >

return_type<T_y, T_scale, T_shape>::type stan::math::pareto_cdf | ( | const T_y & | y,
|  | const T_scale & | y_min,
|  | const T_shape & | alpha
| ) |  |

Definition at line 24 of file pareto_cdf.hpp.

template<typename T_y , typename T_scale , typename T_shape >

return_type<T_y, T_scale, T_shape>::type stan::math::pareto_cdf_log | ( | const T_y & | y,
|  | const T_scale & | y_min,
|  | const T_shape & | alpha
| ) |  |

Definition at line 23 of file pareto_cdf_log.hpp.

template<bool propto, typename T_y , typename T_scale , typename T_shape >

return_type<T_y, T_scale, T_shape>::type stan::math::pareto_log | ( | const T_y & | y,
|  | const T_scale & | y_min,
|  | const T_shape & | alpha
| ) |  |

Definition at line 27 of file pareto_log.hpp.

template<typename T_y , typename T_scale , typename T_shape >

return_type<T_y, T_scale, T_shape>::type stan::math::pareto_log | ( | const T_y & | y,
|  | const T_scale & | y_min,
|  | const T_shape & | alpha
| ) |  |

inline

Definition at line 130 of file pareto_log.hpp.

template<class RNG >

double stan::math::pareto_rng | ( | const double | y_min,
|  | const double | alpha,
|  | RNG & | rng
| ) |  |

inline

Definition at line 22 of file pareto_rng.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::math::pareto_type_2_ccdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | lambda,
|  | const T_shape & | alpha
| ) |  |

Definition at line 25 of file pareto_type_2_ccdf_log.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::math::pareto_type_2_cdf | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | lambda,
|  | const T_shape & | alpha
| ) |  |

Definition at line 25 of file pareto_type_2_cdf.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::math::pareto_type_2_cdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | lambda,
|  | const T_shape & | alpha
| ) |  |

Definition at line 25 of file pareto_type_2_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >

return_type<T_y, T_loc, T_scale, T_shape>::type stan::math::pareto_type_2_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | lambda,
|  | const T_shape & | alpha
| ) |  |

Definition at line 28 of file pareto_type_2_log.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::math::pareto_type_2_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | lambda,
|  | const T_shape & | alpha
| ) |  |

inline

Definition at line 147 of file pareto_type_2_log.hpp.

template<class RNG >

double stan::math::pareto_type_2_rng | ( | const double | mu,
|  | const double | lambda,
|  | const double | alpha,
|  | RNG & | rng
| ) |  |

inline

Definition at line 23 of file pareto_type_2_rng.hpp.

template<typename T , typename F >

void stan::math::partial_derivative | ( | const F & | f,
|  | const Eigen::Matrix< T, Dynamic, 1 > & | x,
|  | int | n,
|  | T & | fx,
|  | T & | dfx_dxn
| ) |  |

Return the partial derivative of the specified multiivariate function at the specified argument.

Template Parameters

  T | Argument type
  F | Function type

Parameters

  | f | Function
  [in] | x | Argument vector
  [in] | n | Index of argument with which to take derivative
  [out] | fx | Value of function applied to argument
  [out] | dfx_dxn | Value of partial derivative

Definition at line 29 of file partial_derivative.hpp.

template<typename T >

fvar<T> stan::math::Phi | ( | const fvar< T > & | x | ) |

inline

Definition at line 14 of file Phi.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::Phi | ( | const T | x | ) |

inline

The unit normal cumulative distribution function.

The return value for a specified input is the probability that a random unit normal variate is less than or equal to the specified value, defined by

This function can be used to implement the inverse link function for probit regression.

Phi will underflow to 0 below -37.5 and overflow to 1 above 8

Parameters

  x | Argument.

Returns
  Probability random sample is less than or equal to argument.

Definition at line 31 of file Phi.hpp.

var stan::math::Phi | ( | const stan::math::var & | a | ) |

inline

The unit normal cumulative density function for variables (stan).

See stan::math::Phi() for the double-based version.

The derivative is the unit normal density function,

.

Parameters

  a | Variable argument.

Returns
  The unit normal cdf evaluated at the specified argument.

Definition at line 66 of file Phi.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::Phi_approx | ( | T | x | ) |

inline

Approximation of the unit normal CDF.

http://www.jiem.org/index.php/jiem/article/download/60/27

This function can be used to implement the inverse link function for probit regression.

Parameters

  x | Argument.

Returns
  Probability random sample is less than or equal to argument.

Definition at line 23 of file Phi_approx.hpp.

var stan::math::Phi_approx | ( | const stan::math::var & | a | ) |

inline

Approximation of the unit normal CDF for variables (stan).

http://www.jiem.org/index.php/jiem/article/download/60/27

Parameters

  a | Variable argument.

Returns
  The corresponding unit normal cdf approximation.

Definition at line 47 of file Phi_approx.hpp.

double stan::math::pi | ( |  | ) |

inline

Return the value of pi.

Returns
  Pi.

Definition at line 86 of file constants.hpp.

template<typename T_n , typename T_rate >

return_type<T_rate>::type stan::math::poisson_ccdf_log | ( | const T_n & | n,
|  | const T_rate & | lambda
| ) |  |

Definition at line 25 of file poisson_ccdf_log.hpp.

template<typename T_n , typename T_rate >

return_type<T_rate>::type stan::math::poisson_cdf | ( | const T_n & | n,
|  | const T_rate & | lambda
| ) |  |

Definition at line 26 of file poisson_cdf.hpp.

template<typename T_n , typename T_rate >

return_type<T_rate>::type stan::math::poisson_cdf_log | ( | const T_n & | n,
|  | const T_rate & | lambda
| ) |  |

Definition at line 25 of file poisson_cdf_log.hpp.

template<bool propto, typename T_n , typename T_rate >

return_type<T_rate>::type stan::math::poisson_log | ( | const T_n & | n,
|  | const T_rate & | lambda
| ) |  |

Definition at line 27 of file poisson_log.hpp.

template<typename T_n , typename T_rate >

return_type<T_rate>::type stan::math::poisson_log | ( | const T_n & | n,
|  | const T_rate & | lambda
| ) |  |

inline

Definition at line 99 of file poisson_log.hpp.

template<bool propto, typename T_n , typename T_log_rate >

return_type<T_log_rate>::type stan::math::poisson_log_log | ( | const T_n & | n,
|  | const T_log_rate & | alpha
| ) |  |

Definition at line 30 of file poisson_log_log.hpp.

template<typename T_n , typename T_log_rate >

return_type<T_log_rate>::type stan::math::poisson_log_log | ( | const T_n & | n,
|  | const T_log_rate & | alpha
| ) |  |

inline

Definition at line 110 of file poisson_log_log.hpp.

template<class RNG >

int stan::math::poisson_log_rng | ( | const double | alpha,
|  | RNG & | rng
| ) |  |

inline

Definition at line 24 of file poisson_log_rng.hpp.

template<class RNG >

int stan::math::poisson_rng | ( | const double | lambda,
|  | RNG & | rng
| ) |  |

inline

Definition at line 25 of file poisson_rng.hpp.

template<typename T >

T stan::math::positive_constrain | ( | const T | x | ) |

inline

Return the positive value for the specified unconstrained input.

The transform applied is

.

Parameters

  x | Arbitrary input scalar.

Returns
  Input transformed to be positive.

Definition at line 22 of file positive_constrain.hpp.

template<typename T >

T stan::math::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

.

Parameters

  x | Arbitrary input scalar.
  lp | Log probability reference.

Returns
  Input transformed to be positive.

Template Parameters

  T | Type of scalar.

Definition at line 44 of file positive_constrain.hpp.

template<typename T >

T stan::math::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 applied by `positive_constrain(T)`, namely

.

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

Parameters

  y | Input scalar.

Returns
  Unconstrained value that produces the input when constrained.

Template Parameters

  T | Type of scalar.

Exceptions

  std::domain_error | if the variable is negative.

Definition at line 29 of file positive_free.hpp.

double stan::math::positive_infinity | ( |  | ) |

inline

Return positive infinity.

Returns
  Positive infinity.

Definition at line 123 of file constants.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  x | Free vector of scalars.

Returns
  Positive, increasing ordered vector.

Template Parameters

  T | Type of scalar.

Definition at line 23 of file positive_ordered_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  x | Free vector of scalars.
  lp | Log probability reference.

Returns
  Positive, increasing ordered vector.

Template Parameters

  T | Type of scalar.

Definition at line 55 of file positive_ordered_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  y | Vector of positive, ordered scalars.

Returns
  Free vector that transforms into the input vector.

Template Parameters

  T | Type of scalar.

Exceptions

  std::domain_error | if y is not a vector of positive, ordered scalars.

Definition at line 28 of file positive_ordered_free.hpp.

template<typename T >

fvar<T> stan::math::pow | ( | const fvar< T > & | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 18 of file pow.hpp.

template<typename T >

fvar<T> stan::math::pow | ( | const double | x1,
|  | const fvar< T > & | x2
| ) |  |

inline

Definition at line 30 of file pow.hpp.

template<typename T >

fvar<T> stan::math::pow | ( | const fvar< T > & | x1,
|  | const double | x2
| ) |  |

inline

Definition at line 40 of file pow.hpp.

var stan::math::pow | ( | const var & | base,
|  | const var & | exponent
| ) |  |

inline

Return the base raised to the power of the exponent (cmath).

The partial derivatives are

, and

.

Parameters

  base | Base variable.
  exponent | Exponent variable.

Returns
  Base raised to the exponent.

Definition at line 103 of file pow.hpp.

var stan::math::pow | ( | const var & | base,
|  | const double | exponent
| ) |  |

inline

Return the base variable raised to the power of the exponent scalar (cmath).

The derivative for the variable is

.

Parameters

  base | Base variable.
  exponent | Exponent scalar.

Returns
  Base raised to the exponent.

Definition at line 119 of file pow.hpp.

var stan::math::pow | ( | const double | base,
|  | const var & | exponent
| ) |  |

inline

Return the base scalar raised to the power of the exponent variable (cmath).

The derivative for the variable is

.

Parameters

  base | Base scalar.
  exponent | Exponent variable.

Returns
  Base raised to the exponent.

Definition at line 141 of file pow.hpp.

var stan::math::precomputed_gradients | ( | const double | value,
|  | const std::vector< var > & | operands,
|  | const std::vector< double > & | gradients
| ) |  |

This function returns a var for an expression that has the specified value, vector of operands, and vector of partial derivatives of value with respect to the operands.

Parameters

  [in] | value | The value of the resulting dependent variable.
  [in] | operands | operands.
  [in] | gradients | vector of partial derivatives of result with respect to operands.

Returns
  An auto-diff variable that uses the precomputed gradients provided.

Definition at line 98 of file precomputed_gradients.hpp.

double stan::math::primitive_value | ( | const var & | v | ) |

inline

Return the primitive double value for the specified auto-diff variable.

Parameters

  v | input variable.

Returns
  value of input.

Definition at line 17 of file primitive_value.hpp.

template<typename T >

double stan::math::primitive_value | ( | const fvar< T > & | v | ) |

inline

Return the primitive value of the specified forward-mode autodiff variable.

This function applies recursively to higher-order autodiff types to return a primitive double value.

Template Parameters

  T | scalar type for autodiff variable.

Parameters

  v | input variable.

Returns
  primitive value of input.

Definition at line 22 of file primitive_value.hpp.

template<typename T >

boost::enable_if<boost::is_arithmetic<T>, T>::type stan::math::primitive_value | ( | T | x | ) |

inline

Return the value of the specified arithmetic argument unmodified with its own declared type.

This template function can only be instantiated with arithmetic types as defined by Boost's `is_arithmetic` trait metaprogram.

This function differs from `stan::math::value_of` in that it does not cast all return types to `double`.

Template Parameters

  T | type of arithmetic input.

Parameters

  x | input.

Returns
  input unmodified.

Definition at line 30 of file primitive_value.hpp.

template<typename T >

boost::disable_if<boost::is_arithmetic<T>, double>::type stan::math::primitive_value | ( | const T & | x | ) |

inline

Return the primitive value of the specified argument.

This implementation only applies to non-arithmetic types as defined by Boost's `is_arithmetic` trait metaprogram.

Template Parameters

  T | type of non-arithmetic input.

Parameters

  x | input.

Returns
  value of input.

Definition at line 47 of file primitive_value.hpp.

void stan::math::print_stack | ( | std::ostream & | o | ) |

inline

Prints the auto-dif variable stack.

This function is used for debugging purposes.

Only works if all members of stack are vari* as it casts to vari*.

Parameters

  o | ostream to modify

Definition at line 22 of file print_stack.hpp.

template<typename T >

T stan::math::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,

.

Parameters

  x | Free scalar.

Returns
  Probability-constrained result of transforming the free scalar.

Template Parameters

  T | Type of scalar.

Definition at line 27 of file prob_constrain.hpp.

template<typename T >

T stan::math::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

.

Parameters

  x | Free scalar.
  lp | Log probability reference.

Returns
  Probability-constrained result of transforming the free scalar.

Template Parameters

  T | Type of scalar.

Definition at line 55 of file prob_constrain.hpp.

template<typename T >

T stan::math::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,

.

Parameters

  y | Scalar input.

Template Parameters

  T | Type of scalar.

Exceptions

  std::domain_error | if y is less than 0 or greater than 1.

Definition at line 27 of file prob_free.hpp.

template<typename T >

T stan::math::prod | ( | const std::vector< T > & | v | ) |

inline

Returns the product of the coefficients of the specified standard vector.

Parameters

  v | Specified vector.

Returns
  Product of coefficients of vector.

Definition at line 17 of file prod.hpp.

template<typename T , int R, int C>

T stan::math::prod | ( | const Eigen::Matrix< T, R, C > & | v | ) |

inline

Returns the product of the coefficients of the specified column vector.

Parameters

  v | Specified vector.

Returns
  Product of coefficients of vector.

Definition at line 32 of file prod.hpp.

template<typename T1 , typename T2 , typename F >

common_type<T1, T2>::type stan::math::promote_common | ( | const F & | u | ) |

inline

Definition at line 14 of file promote_common.hpp.

template<typename T , typename S >

promote_scalar_type<T, S>::type stan::math::promote_scalar | ( | const S & | x | ) |

This is the top-level function to call to promote the scalar types of an input of type S to type T.

Template Parameters

  T | scalar type of output.
  S | input type.

Parameters

  x | input vector.

Returns
  input vector with scalars promoted to type T.

Definition at line 100 of file promote_scalar.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::qr_Q | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m | ) |

Definition at line 14 of file qr_Q.hpp.

template<typename T >

Eigen::Matrix<fvar<T>, Eigen::Dynamic, Eigen::Dynamic> stan::math::qr_Q | ( | const Eigen::Matrix< fvar< T >, Eigen::Dynamic, Eigen::Dynamic > & | m | ) |

Definition at line 15 of file qr_Q.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::qr_R | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m | ) |

Definition at line 14 of file qr_R.hpp.

template<typename T >

Eigen::Matrix<fvar<T>, Eigen::Dynamic, Eigen::Dynamic> stan::math::qr_R | ( | const Eigen::Matrix< fvar< T >, Eigen::Dynamic, Eigen::Dynamic > & | m | ) |

Definition at line 15 of file qr_R.hpp.

template<int RA, int CA, int RB, int CB, typename T >

Eigen::Matrix<T, CB, CB> stan::math::quad_form | ( | const Eigen::Matrix< T, RA, CA > & | A,
|  | const Eigen::Matrix< T, RB, CB > & | B
| ) |  |

inline

Compute B^T A B.

Definition at line 21 of file quad_form.hpp.

template<int RA, int CA, int RB, typename T >

T stan::math::quad_form | ( | const Eigen::Matrix< T, RA, CA > & | A,
|  | const Eigen::Matrix< T, RB, 1 > & | B
| ) |  |

inline

Definition at line 33 of file quad_form.hpp.

template<typename TA , int RA, int CA, typename TB , int RB, int CB>

boost::enable_if_c< boost::is_same<TA, var>::value || boost::is_same<TB, var>::value, Eigen::Matrix<var, CB, CB> >::type stan::math::quad_form | ( | const Eigen::Matrix< TA, RA, CA > & | A,
|  | const Eigen::Matrix< TB, RB, CB > & | B
| ) |  |

inline

Definition at line 124 of file quad_form.hpp.

template<typename TA , int RA, int CA, typename TB , int RB>

boost::enable_if_c< boost::is_same<TA, var>::value || boost::is_same<TB, var>::value, var >::type stan::math::quad_form | ( | const Eigen::Matrix< TA, RA, CA > & | A,
|  | const Eigen::Matrix< TB, RB, 1 > & | B
| ) |  |

inline

Definition at line 141 of file quad_form.hpp.

template<typename T1 , typename T2 , int R, int C>

Matrix<typename promote_args<T1, T2>::type, Dynamic, Dynamic> stan::math::quad_form_diag | ( | const Matrix< T1, Dynamic, Dynamic > & | mat,
|  | const Matrix< T2, R, C > & | vec
| ) |  |

inline

Definition at line 20 of file quad_form_diag.hpp.

template<int RA, int CA, int RB, int CB, typename T >

Eigen::Matrix<T, CB, CB> stan::math::quad_form_sym | ( | const Eigen::Matrix< T, RA, CA > & | A,
|  | const Eigen::Matrix< T, RB, CB > & | B
| ) |  |

inline

Definition at line 19 of file quad_form_sym.hpp.

template<typename TA , int RA, int CA, typename TB , int RB, int CB>

boost::enable_if_c< boost::is_same<TA, var>::value || boost::is_same<TB, var>::value, Eigen::Matrix<var, CB, CB> >::type stan::math::quad_form_sym | ( | const Eigen::Matrix< TA, RA, CA > & | A,
|  | const Eigen::Matrix< TB, RB, CB > & | B
| ) |  |

inline

Definition at line 25 of file quad_form_sym.hpp.

template<int RA, int CA, int RB, typename T >

T stan::math::quad_form_sym | ( | const Eigen::Matrix< T, RA, CA > & | A,
|  | const Eigen::Matrix< T, RB, 1 > & | B
| ) |  |

inline

Definition at line 34 of file quad_form_sym.hpp.

template<typename TA , int RA, int CA, typename TB , int RB>

boost::enable_if_c< boost::is_same<TA, var>::value || boost::is_same<TB, var>::value, var >::type stan::math::quad_form_sym | ( | const Eigen::Matrix< TA, RA, CA > & | A,
|  | const Eigen::Matrix< TB, RB, 1 > & | B
| ) |  |

inline

Definition at line 43 of file quad_form_sym.hpp.

template<typename T >

size_t stan::math::rank | ( | const std::vector< T > & | v,
|  | int | s
| ) |  |

inline

Return the number of components of v less than v[s].

Returns
  Number of components of v less than v[s].

Template Parameters

  T | Type of elements of the vector.

Definition at line 18 of file rank.hpp.

template<typename T , int R, int C>

size_t stan::math::rank | ( | const Eigen::Matrix< T, R, C > & | v,
|  | int | s
| ) |  |

inline

Return the number of components of v less than v[s].

Returns
  Number of components of v less than v[s].

Template Parameters

  T | Type of elements of the vector.

Definition at line 38 of file rank.hpp.

template<typename T_y , typename T_scale >

return_type<T_y, T_scale>::type stan::math::rayleigh_ccdf_log | ( | const T_y & | y,
|  | const T_scale & | sigma
| ) |  |

Definition at line 27 of file rayleigh_ccdf_log.hpp.

template<typename T_y , typename T_scale >

return_type<T_y, T_scale>::type stan::math::rayleigh_cdf | ( | const T_y & | y,
|  | const T_scale & | sigma
| ) |  |

Definition at line 28 of file rayleigh_cdf.hpp.

template<typename T_y , typename T_scale >

return_type<T_y, T_scale>::type stan::math::rayleigh_cdf_log | ( | const T_y & | y,
|  | const T_scale & | sigma
| ) |  |

Definition at line 28 of file rayleigh_cdf_log.hpp.

template<bool propto, typename T_y , typename T_scale >

return_type<T_y, T_scale>::type stan::math::rayleigh_log | ( | const T_y & | y,
|  | const T_scale & | sigma
| ) |  |

Definition at line 29 of file rayleigh_log.hpp.

template<typename T_y , typename T_scale >

return_type<T_y, T_scale>::type stan::math::rayleigh_log | ( | const T_y & | y,
|  | const T_scale & | sigma
| ) |  |

inline

Definition at line 109 of file rayleigh_log.hpp.

template<class RNG >

double stan::math::rayleigh_rng | ( | const double | sigma,
|  | RNG & | rng
| ) |  |

inline

Definition at line 27 of file rayleigh_rng.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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

  CPCs | The (K choose 2) canonical partial correlations in (-1, 1).
  K | Dimensionality of correlation matrix.

Returns
  Cholesky factor of correlation matrix for specified canonical partial correlations.

Template Parameters

  T | Type of underlying scalar.

Definition at line 41 of file read_corr_L.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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

  CPCs | The (K choose 2) canonical partial correlations in (-1, 1).
  K | Dimensionality of correlation matrix.
  log_prob | Reference to variable to increment with the log Jacobian determinant.

Returns
  Cholesky factor of correlation matrix for specified partial correlations.

Template Parameters

  T | Type of underlying scalar.

Definition at line 95 of file read_corr_L.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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

  CPCs | The (K choose 2) canonical partial correlations in (-1, 1).
  K | Dimensionality of correlation matrix.

Returns
  Cholesky factor of correlation matrix for specified canonical partial correlations.

Template Parameters

  T | Type of underlying scalar.

Definition at line 28 of file read_corr_matrix.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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

  CPCs | The (K choose 2) canonical partial correlations in (-1, 1).
  K | Dimensionality of correlation matrix.
  log_prob | Reference to variable to increment with the log Jacobian determinant.

Returns
  Correlation matrix for specified partial correlations.

Template Parameters

  T | Type of underlying scalar.

Definition at line 56 of file read_corr_matrix.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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

  CPCs | on (-1, 1)
  sds | on (0, inf)
  log_prob | the log probability value to increment with the Jacobian

Returns
  Cholesky factor of covariance matrix for specified partial correlations.

Definition at line 23 of file read_cov_L.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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

  CPCs | on (-1, 1)
  sds | on (0, inf)
  log_prob | the log probability value to increment with the Jacobian

Returns
  Covariance matrix for specified partial correlations.

Definition at line 23 of file read_cov_matrix.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::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

  CPCs | in (-1, 1)
  sds | in (0, inf)

Definition at line 41 of file read_cov_matrix.hpp.

static void stan::math::recover_memory | ( |  | ) |

inlinestatic

Recover memory used for all variables for reuse.

Exceptions

  std::logic_error | if `empty_nested()` returns `false`

Definition at line 19 of file recover_memory.hpp.

static void stan::math::recover_memory_nested | ( |  | ) |

inlinestatic

Recover only the memory used for the top nested call.

If there is nothing on the nested stack, then a `std::logic_error` exception is thrown.

Exceptions

  std::logic_error | if `empty_nested()` returns `true`

Definition at line 21 of file recover_memory_nested.hpp.

template<typename T >

std::vector<T> stan::math::rep_array | ( | const T & | x,
|  | int | n
| ) |  |

inline

Definition at line 13 of file rep_array.hpp.

template<typename T >

std::vector<std::vector<T> > stan::math::rep_array | ( | const T & | x,
|  | int | m,
|  | int | n
| ) |  |

inline

Definition at line 21 of file rep_array.hpp.

template<typename T >

std::vector<std::vector<std::vector<T> > > stan::math::rep_array | ( | const T & | x,
|  | int | k,
|  | int | m,
|  | int | n
| ) |  |

inline

Definition at line 31 of file rep_array.hpp.

template<typename T >

Eigen::Matrix<typename boost::math::tools::promote_args<T>::type, Eigen::Dynamic, Eigen::Dynamic> stan::math::rep_matrix | ( | const T & | x,
|  | int | m,
|  | int | n
| ) |  |

inline

Definition at line 16 of file rep_matrix.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::rep_matrix | ( | const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | v,
|  | int | n
| ) |  |

inline

Definition at line 26 of file rep_matrix.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, Eigen::Dynamic> stan::math::rep_matrix | ( | const Eigen::Matrix< T, 1, Eigen::Dynamic > & | rv,
|  | int | m
| ) |  |

inline

Definition at line 36 of file rep_matrix.hpp.

template<typename T >

Eigen::Matrix<typename boost::math::tools::promote_args<T>::type, 1, Eigen::Dynamic> stan::math::rep_row_vector | ( | const T & | x,
|  | int | m
| ) |  |

inline

Definition at line 15 of file rep_row_vector.hpp.

template<typename T >

Eigen::Matrix<typename boost::math::tools::promote_args<T>::type, Eigen::Dynamic, 1> stan::math::rep_vector | ( | const T & | x,
|  | int | n
| ) |  |

inline

Definition at line 16 of file rep_vector.hpp.

template<typename T >

void stan::math::resize | ( | T & | x,
|  | std::vector< size_t > | dims
| ) |  |

inline

Recursively resize the specified vector of vectors, which must bottom out at scalar values, Eigen vectors or Eigen matrices.

Parameters

  x | Array-like object to resize.
  dims | New dimensions.

Template Parameters

  T | Type of object being resized.

Definition at line 63 of file resize.hpp.

template<typename T >

fvar<T> stan::math::rising_factorial | ( | const fvar< T > & | x,
|  | const fvar< T > & | n
| ) |  |

inline

Definition at line 16 of file rising_factorial.hpp.

template<typename T >

fvar<T> stan::math::rising_factorial | ( | const fvar< T > & | x,
|  | const double | n
| ) |  |

inline

Definition at line 28 of file rising_factorial.hpp.

template<typename T >

fvar<T> stan::math::rising_factorial | ( | const double | x,
|  | const fvar< T > & | n
| ) |  |

inline

Definition at line 41 of file rising_factorial.hpp.

var stan::math::rising_factorial | ( | const var & | a,
|  | const double & | b
| ) |  |

inline

Definition at line 54 of file rising_factorial.hpp.

template<typename T1 , typename T2 >

boost::math::tools::promote_args<T1, T2>::type stan::math::rising_factorial | ( | const T1 | x,
|  | const T2 | n
| ) |  |

inline

Definition at line 54 of file rising_factorial.hpp.

var stan::math::rising_factorial | ( | const var & | a,
|  | const var & | b
| ) |  |

inline

Definition at line 59 of file rising_factorial.hpp.

var stan::math::rising_factorial | ( | const double & | a,
|  | const var & | b
| ) |  |

inline

Definition at line 64 of file rising_factorial.hpp.

template<typename T >

fvar<T> stan::math::round | ( | const fvar< T > & | x | ) |

inline

Definition at line 11 of file round.hpp.

var stan::math::round | ( | const var & | a | ) |

inline

Returns the rounded form of the specified variable (C99).

See round() for the double-based version.

The derivative is zero everywhere but numbers half way between whole numbers, so for convenience the derivative is defined to be everywhere zero,

.

Parameters

  a | Specified variable.

Returns
  Rounded variable.

Definition at line 57 of file round.hpp.

template<typename T >

Eigen::Matrix<T, 1, Eigen::Dynamic> stan::math::row | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m,
|  | size_t | i
| ) |  |

inline

Return the specified row of the specified matrix, using start-at-1 indexing.

This is equivalent to calling `m.row(i - 1)` and assigning the resulting template expression to a row vector.

Template Parameters

  T | Scalar value type for matrix.

Parameters

  m | Matrix.
  i | Row index (count from 1).

Returns
  Specified row of the matrix.

Definition at line 25 of file row.hpp.

template<typename T , int R, int C>

size_t stan::math::rows | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Definition at line 12 of file rows.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, 1> stan::math::rows_dot_product | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | v1,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | v2
| ) |  |

inline

Definition at line 18 of file rows_dot_product.hpp.

template<int R1, int C1, int R2, int C2>

Eigen::Matrix<double, R1, 1> stan::math::rows_dot_product | ( | const Eigen::Matrix< double, R1, C1 > & | v1,
|  | const Eigen::Matrix< double, R2, C2 > & | v2
| ) |  |

inline

Returns the dot product of the specified vectors.

Parameters

  v1 | First vector.
  v2 | Second vector.

Returns
  Dot product of the vectors.

Exceptions

  std::domain_error | If the vectors are not the same size or if they are both not vector dimensioned.

Definition at line 22 of file rows_dot_product.hpp.

template<typename T1 , int R1, int C1, typename T2 , int R2, int C2>

boost::enable_if_c<boost::is_same<T1, var>::value || boost::is_same<T2, var>::value, Eigen::Matrix<var, R1, 1> >::type stan::math::rows_dot_product | ( | const Eigen::Matrix< T1, R1, C1 > & | v1,
|  | const Eigen::Matrix< T2, R2, C2 > & | v2
| ) |  |

inline

Definition at line 25 of file rows_dot_product.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, 1> stan::math::rows_dot_product | ( | const Eigen::Matrix< double, R1, C1 > & | v1,
|  | const Eigen::Matrix< fvar< T >, R2, C2 > & | v2
| ) |  |

inline

Definition at line 35 of file rows_dot_product.hpp.

template<typename T , int R1, int C1, int R2, int C2>

Eigen::Matrix<fvar<T>, R1, 1> stan::math::rows_dot_product | ( | const Eigen::Matrix< fvar< T >, R1, C1 > & | v1,
|  | const Eigen::Matrix< double, R2, C2 > & | v2
| ) |  |

inline

Definition at line 52 of file rows_dot_product.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, R, 1> stan::math::rows_dot_self | ( | const Eigen::Matrix< fvar< T >, R, C > & | x | ) |

inline

Definition at line 15 of file rows_dot_self.hpp.

template<typename T , int R, int C>

Eigen::Matrix<T, R, 1> stan::math::rows_dot_self | ( | const Eigen::Matrix< T, R, C > & | x | ) |

inline

Returns the dot product of each row of a matrix with itself.

Parameters

  x | Matrix.

Template Parameters

  T | scalar type

Definition at line 16 of file rows_dot_self.hpp.

void stan::math::scaled_add | ( | std::vector< double > & | x,
|  | const std::vector< double > & | y,
|  | const double | lambda
| ) |  |

inline

Definition at line 11 of file scaled_add.hpp.

template<typename T_y , typename T_dof , typename T_scale >

return_type<T_y, T_dof, T_scale>::type stan::math::scaled_inv_chi_square_ccdf_log | ( | const T_y & | y,
|  | const T_dof & | nu,
|  | const T_scale & | s
| ) |  |

Definition at line 31 of file scaled_inv_chi_square_ccdf_log.hpp.

template<typename T_y , typename T_dof , typename T_scale >

return_type<T_y, T_dof, T_scale>::type stan::math::scaled_inv_chi_square_cdf | ( | const T_y & | y,
|  | const T_dof & | nu,
|  | const T_scale & | s
| ) |  |

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

Parameters

  y | A scalar variable.
  nu | Degrees of freedom.
  s | Scale parameter.

Exceptions

  std::domain_error | if nu is not greater than 0
  std::domain_error | if s is not greater than 0.
  std::domain_error | if y is not greater than 0.

Template Parameters

  T_y | Type of scalar.
  T_dof | Type of degrees of freedom.

Definition at line 46 of file scaled_inv_chi_square_cdf.hpp.

template<typename T_y , typename T_dof , typename T_scale >

return_type<T_y, T_dof, T_scale>::type stan::math::scaled_inv_chi_square_cdf_log | ( | const T_y & | y,
|  | const T_dof & | nu,
|  | const T_scale & | s
| ) |  |

Definition at line 32 of file scaled_inv_chi_square_cdf_log.hpp.

template<bool propto, typename T_y , typename T_dof , typename T_scale >

return_type<T_y, T_dof, T_scale>::type stan::math::scaled_inv_chi_square_log | ( | const T_y & | y,
|  | const T_dof & | nu,
|  | const T_scale & | s
| ) |  |

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

Parameters

  y | A scalar variable.
  nu | Degrees of freedom.
  s | Scale parameter.

Exceptions

  std::domain_error | if nu is not greater than 0
  std::domain_error | if s is not greater than 0.
  std::domain_error | if y is not greater than 0.

Template Parameters

  T_y | Type of scalar.
  T_dof | Type of degrees of freedom.

Definition at line 51 of file scaled_inv_chi_square_log.hpp.

template<typename T_y , typename T_dof , typename T_scale >

return_type<T_y, T_dof, T_scale>::type stan::math::scaled_inv_chi_square_log | ( | const T_y & | y,
|  | const T_dof & | nu,
|  | const T_scale & | s
| ) |  |

inline

Definition at line 173 of file scaled_inv_chi_square_log.hpp.

template<class RNG >

double stan::math::scaled_inv_chi_square_rng | ( | const double | nu,
|  | const double | s,
|  | RNG & | rng
| ) |  |

inline

Definition at line 29 of file scaled_inv_chi_square_rng.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::sd | ( | const std::vector< T > & | v | ) |

inline

Returns the unbiased sample standard deviation of the coefficients in the specified column vector.

Parameters

  v | Specified vector.

Returns
  Sample variance of vector.

Definition at line 22 of file sd.hpp.

template<typename T , int R, int C>

boost::math::tools::promote_args<T>::type stan::math::sd | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Returns the unbiased sample standard deviation of the coefficients in the specified vector, row vector, or matrix.

Parameters

  m | Specified vector, row vector or matrix.

Returns
  Sample variance.

Definition at line 37 of file sd.hpp.

var stan::math::sd | ( | const std::vector< var > & | v | ) |

Return the sample standard deviation of the specified standard vector.

Raise domain error if size is not greater than zero.

Parameters

  [in] | v | a vector

Returns
  sample standard deviation of specified vector

Definition at line 65 of file sd.hpp.

template<int R, int C>

var stan::math::sd | ( | const Eigen::Matrix< var, R, C > & | m | ) |

Definition at line 82 of file sd.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::segment | ( | const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | v,
|  | size_t | i,
|  | size_t | n
| ) |  |

inline

Return the specified number of elements as a vector starting from the specified element - 1 of the specified vector.

Definition at line 19 of file segment.hpp.

template<typename T >

Eigen::Matrix<T, 1, Eigen::Dynamic> stan::math::segment | ( | const Eigen::Matrix< T, 1, Eigen::Dynamic > & | v,
|  | size_t | i,
|  | size_t | n
| ) |  |

inline

Definition at line 35 of file segment.hpp.

template<typename T >

std::vector<T> stan::math::segment | ( | const std::vector< T > & | sv,
|  | size_t | i,
|  | size_t | n
| ) |  |

Definition at line 52 of file segment.hpp.

static void stan::math::set_zero_all_adjoints | ( |  | ) |

static

Reset all adjoint values in the stack to zero.

Definition at line 14 of file set_zero_all_adjoints.hpp.

template<typename T >

int stan::math::sign | ( | const T & | z | ) |

inline

Definition at line 9 of file sign.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  y | Free vector input of dimensionality K - 1.

Returns
  Simplex of dimensionality K.

Template Parameters

  T | Type of scalar.

Definition at line 30 of file simplex_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  y | Free vector input of dimensionality K - 1.
  lp | Log probability reference to increment.

Returns
  Simplex of dimensionality K.

Template Parameters

  T | Type of scalar.

Definition at line 69 of file simplex_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  x | Simplex of dimensionality K.

Returns
  Free vector of dimensionality (K-1) that transfroms to the simplex.

Template Parameters

  T | Type of scalar.

Exceptions

  std::domain_error | if x is not a valid simplex

Definition at line 30 of file simplex_free.hpp.

template<typename T >

fvar<T> stan::math::sin | ( | const fvar< T > & | x | ) |

inline

Definition at line 14 of file sin.hpp.

var stan::math::sin | ( | const var & | a | ) |

inline

Return the sine of a radian-scaled variable (cmath).

The derivative is defined by

.

Parameters

  a | Variable for radians of angle.

Returns
  Sine of variable.

Definition at line 49 of file sin.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::singular_values | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m | ) |

Return the vector of the singular values of the specified matrix in decreasing order of magnitude.

See the documentation for `svd()` for information on the signular values.

Parameters

  m | Specified matrix.

Returns
  Singular values of the matrix.

Definition at line 21 of file singular_values.hpp.

template<typename T >

fvar<T> stan::math::sinh | ( | const fvar< T > & | x | ) |

inline

Definition at line 14 of file sinh.hpp.

var stan::math::sinh | ( | const var & | a | ) |

inline

Return the hyperbolic sine of the specified variable (cmath).

The derivative is defined by

.

Parameters

  a | Variable.

Returns
  Hyperbolic sine of variable.

Definition at line 49 of file sinh.hpp.

template<typename T >

int stan::math::size | ( | const std::vector< T > & | x | ) |

inline

Definition at line 11 of file size.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::math::skew_normal_ccdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma,
|  | const T_shape & | alpha
| ) |  |

Definition at line 26 of file skew_normal_ccdf_log.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::math::skew_normal_cdf | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma,
|  | const T_shape & | alpha
| ) |  |

Definition at line 26 of file skew_normal_cdf.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::math::skew_normal_cdf_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma,
|  | const T_shape & | alpha
| ) |  |

Definition at line 26 of file skew_normal_cdf_log.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale , typename T_shape >

return_type<T_y, T_loc, T_scale, T_shape>::type stan::math::skew_normal_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma,
|  | const T_shape & | alpha
| ) |  |

Definition at line 27 of file skew_normal_log.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::math::skew_normal_log | ( | const T_y & | y,
|  | const T_loc & | mu,
|  | const T_scale & | sigma,
|  | const T_shape & | alpha
| ) |  |

inline

Definition at line 146 of file skew_normal_log.hpp.

template<class RNG >

double stan::math::skew_normal_rng | ( | const double | mu,
|  | const double | sigma,
|  | const double | alpha,
|  | RNG & | rng
| ) |  |

inline

Definition at line 24 of file skew_normal_rng.hpp.

template<typename T >

Eigen::Matrix<fvar<T>, Eigen::Dynamic, 1> stan::math::softmax | ( | const Eigen::Matrix< fvar< T >, Eigen::Dynamic, 1 > & | alpha | ) |

inline

Definition at line 14 of file softmax.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::softmax | ( | const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | v | ) |

inline

Return the softmax of the specified vector.

The entries in the Jacobian of the softmax function are given by

Template Parameters

  T | Scalar type of values in vector.

Parameters

  [in] | v | Vector to transform.

Returns
  Unit simplex result of the softmax transform of the vector.

Definition at line 46 of file softmax.hpp.

Eigen::Matrix<var, Eigen::Dynamic, 1> stan::math::softmax | ( | const Eigen::Matrix< var, Eigen::Dynamic, 1 > & | alpha | ) |

inline

Return the softmax of the specified Eigen vector.

Softmax is guaranteed to return a simplex.

The gradient calculations are unfolded.

Parameters

  alpha | Unconstrained input vector.

Returns
  Softmax of the input.

Exceptions

  std::domain_error | If the input vector is size 0.

Definition at line 59 of file softmax.hpp.

template<typename T >

std::vector< fvar<T> > stan::math::sort_asc | ( | std::vector< fvar< T > > | xs | ) |

inline

Definition at line 17 of file sort_asc.hpp.

template<typename T >

std::vector<T> stan::math::sort_asc | ( | std::vector< T > | xs | ) |

inline

Return the specified standard vector in ascending order.

Parameters

  xs | Standard vector to order.

Returns
  Standard vector ordered.

Template Parameters

  T | Type of elements of the vector.

Definition at line 20 of file sort.hpp.

std::vector<var> stan::math::sort_asc | ( | std::vector< var > | xs | ) |

inline

Return the specified standard vector in ascending order with gradients kept.

Parameters

  xs | Standard vector to order.

Returns
  Standard vector ordered.

Template Parameters

  T | Type of elements of the vector.

Definition at line 21 of file sort_asc.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, R, C> stan::math::sort_asc | ( | Eigen::Matrix< fvar< T >, R, C > | xs | ) |

inline

Definition at line 25 of file sort_asc.hpp.

template<int R, int C>

Eigen::Matrix<var, R, C> stan::math::sort_asc | ( | Eigen::Matrix< var, R, C > | xs | ) |

inline

Return the specified eigen vector in ascending order with gradients kept.

Parameters

  xs | Eigen vector to order.

Returns
  Eigen vector ordered.

Template Parameters

  T | Type of elements of the vector.

Definition at line 35 of file sort_asc.hpp.

template<typename T , int R, int C>

Eigen::Matrix<T, R, C> stan::math::sort_asc | ( | Eigen::Matrix< T, R, C > | xs | ) |

inline

Return the specified eigen vector in ascending order.

Parameters

  xs | Eigen vector to order.

Returns
  Eigen vector ordered.

Template Parameters

  T | Type of elements of the vector.

Definition at line 46 of file sort.hpp.

template<typename T >

std::vector< fvar<T> > stan::math::sort_desc | ( | std::vector< fvar< T > > | xs | ) |

inline

Definition at line 17 of file sort_desc.hpp.

std::vector<var> stan::math::sort_desc | ( | std::vector< var > | xs | ) |

inline

Return the specified standard vector in descending order with gradients kept.

Parameters

  xs | Standard vector to order.

Returns
  Standard vector ordered.

Template Parameters

  T | Type of elements of the vector.

Definition at line 21 of file sort_desc.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, R, C> stan::math::sort_desc | ( | Eigen::Matrix< fvar< T >, R, C > | xs | ) |

inline

Definition at line 25 of file sort_desc.hpp.

template<typename T >

std::vector<T> stan::math::sort_desc | ( | std::vector< T > | xs | ) |

inline

Return the specified standard vector in descending order.

Parameters

  xs | Standard vector to order.

Returns
  Standard vector ordered.

Template Parameters

  T | Type of elements of the vector.

Definition at line 33 of file sort.hpp.

template<int R, int C>

Eigen::Matrix<var, R, C> stan::math::sort_desc | ( | Eigen::Matrix< var, R, C > | xs | ) |

inline

Return the specified eigen vector in descending order with gradients kept.

Parameters

  xs | Eigen vector to order.

Returns
  Eigen vector ordered.

Template Parameters

  T | Type of elements of the vector.

Definition at line 35 of file sort_desc.hpp.

template<typename T , int R, int C>

Eigen::Matrix<T, R, C> stan::math::sort_desc | ( | Eigen::Matrix< T, R, C > | xs | ) |

inline

Return the specified eigen vector in descending order.

Parameters

  xs | Eigen vector to order.

Returns
  Eigen vector ordered.

Template Parameters

  T | Type of elements of the vector.

Definition at line 60 of file sort.hpp.

template<typename C >

std::vector<int> stan::math::sort_indices_asc | ( | const C & | xs | ) |

Return a sorted copy of the argument container in ascending order.

Template Parameters

  C | type of container

Parameters

  xs | Container to sort

Returns
  sorted version of container

Definition at line 23 of file sort_indices_asc.hpp.

template<typename C >

std::vector<int> stan::math::sort_indices_desc | ( | const C & | xs | ) |

Return a sorted copy of the argument container in ascending order.

Template Parameters

  C | type of container

Parameters

  xs | Container to sort

Returns
  sorted version of container

Definition at line 23 of file sort_indices_desc.hpp.

template<typename T >

fvar<T> stan::math::sqrt | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file sqrt.hpp.

var stan::math::sqrt | ( | const var & | a | ) |

inline

Return the square root of the specified variable (cmath).

The derivative is defined by

.

Parameters

  a | Variable whose square root is taken.

Returns
  Square root of variable.

Definition at line 50 of file sqrt.hpp.

double stan::math::sqrt2 | ( |  | ) |

inline

Return the square root of two.

Returns
  Square root of two.

Definition at line 104 of file constants.hpp.

template<typename T >

fvar<T> stan::math::square | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file square.hpp.

template<typename T >

T stan::math::square | ( | const T | x | ) |

inline

Return the square of the specified argument.

.

The implementation of `square(x)` is just `x * x`. Given this, this method is mainly useful in cases where `x` is not a simple primitive type, particularly when it is an auto-dif type.

Parameters

  x | Input to square.

Returns
  Square of input.

Template Parameters

  T | Type of scalar.

Definition at line 22 of file square.hpp.

var stan::math::square | ( | const var & | x | ) |

inline

Return the square of the input variable.

Using `square(x)` is more efficient than using `x * x`.

Parameters

  x | Variable to square.

Returns
  Square of variable.

Definition at line 46 of file square.hpp.

template<int R1, int C1, int R2, int C2, typename T1 , typename T2 >

boost::math::tools::promote_args<T1, T2>::type stan::math::squared_distance | ( | const Eigen::Matrix< T1, R1, C1 > & | v1,
|  | const Eigen::Matrix< T2, R2, C2 > & | v2
| ) |  |

inline

Returns the squared distance between the specified vectors.

Parameters

  v1 | First vector.
  v2 | Second vector.

Returns
  Dot product of the vectors.

Exceptions

  std::domain_error | If the vectors are not the same size or if they are both not vector dimensioned.

Definition at line 22 of file squared_distance.hpp.

template<int R1, int C1, int R2, int C2>

var stan::math::squared_distance | ( | const Eigen::Matrix< var, R1, C1 > & | v1,
|  | const Eigen::Matrix< var, R2, C2 > & | v2
| ) |  |

inline

Definition at line 112 of file squared_distance.hpp.

template<int R1, int C1, int R2, int C2>

var stan::math::squared_distance | ( | const Eigen::Matrix< var, R1, C1 > & | v1,
|  | const Eigen::Matrix< double, R2, C2 > & | v2
| ) |  |

inline

Definition at line 122 of file squared_distance.hpp.

template<int R1, int C1, int R2, int C2>

var stan::math::squared_distance | ( | const Eigen::Matrix< double, R1, C1 > & | v1,
|  | const Eigen::Matrix< var, R2, C2 > & | v2
| ) |  |

inline

Definition at line 132 of file squared_distance.hpp.

void stan::math::stan_print | ( | std::ostream * | o,
|  | const var & | x
| ) |  |

Definition at line 10 of file stan_print.hpp.

template<typename T >

void stan::math::stan_print | ( | std::ostream * | o,
|  | const T & | x
| ) |  |

Definition at line 12 of file stan_print.hpp.

template<typename T >

void stan::math::stan_print | ( | std::ostream * | o,
|  | const std::vector< T > & | x
| ) |  |

Definition at line 17 of file stan_print.hpp.

template<typename T >

void stan::math::stan_print | ( | std::ostream * | o,
|  | const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | x
| ) |  |

Definition at line 27 of file stan_print.hpp.

template<typename T >

void stan::math::stan_print | ( | std::ostream * | o,
|  | const Eigen::Matrix< T, 1, Eigen::Dynamic > & | x
| ) |  |

Definition at line 38 of file stan_print.hpp.

template<typename T >

void stan::math::stan_print | ( | std::ostream * | o,
|  | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | x
| ) |  |

Definition at line 49 of file stan_print.hpp.

static void stan::math::start_nested | ( |  | ) |

inlinestatic

Record the current position so that `recover_memory_nested()` can find it.

Definition at line 13 of file start_nested.hpp.

var stan::math::step | ( | const stan::math::var & | a | ) |

inline

Return the step, or heaviside, function applied to the specified variable (stan).

See stan::math::step() for the double-based version.

The derivative of the step function is zero everywhere but at 0, so for convenience, it is taken to be everywhere zero,

.

Parameters

  a | Variable argument.

Returns
  The constant variable with value 1.0 if the argument's value is greater than or equal to 0.0, and value 0.0 otherwise.

Definition at line 25 of file step.hpp.

template<typename T >

int stan::math::step | ( | const T | y | ) |

inline

The step, or Heaviside, function.

The function is defined by

`step(y) = (y < 0.0) ? 0 : 1`.

Parameters

  y | Scalar argument.

Returns
  1 if the specified argument is greater than or equal to 0.0, and 0 otherwise.

Definition at line 29 of file step.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::math::student_t_ccdf_log | ( | const T_y & | y,
|  | const T_dof & | nu,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 31 of file student_t_ccdf_log.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::math::student_t_cdf | ( | const T_y & | y,
|  | const T_dof & | nu,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 31 of file student_t_cdf.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::math::student_t_cdf_log | ( | const T_y & | y,
|  | const T_dof & | nu,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

Definition at line 31 of file student_t_cdf_log.hpp.

template<bool propto, typename T_y , typename T_dof , typename T_loc , typename T_scale >

return_type<T_y, T_dof, T_loc, T_scale>::type stan::math::student_t_log | ( | const T_y & | y,
|  | const T_dof & | nu,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

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

The scale parameter must be greater than 0.

Parameters

  y | A scalar variable.
  nu | Degrees of freedom.
  mu | The mean of the Student-t distribution.
  sigma | The scale parameter of the Student-t distribution.

Returns
  The log of the Student-t density at y.

Exceptions

  std::domain_error | if sigma is not greater than 0.
  std::domain_error | if nu is not greater than 0.

Template Parameters

  T_y | Type of scalar.
  T_dof | Type of degrees of freedom.
  T_loc | Type of location.
  T_scale | Type of scale.

Definition at line 56 of file student_t_log.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::math::student_t_log | ( | const T_y & | y,
|  | const T_dof & | nu,
|  | const T_loc & | mu,
|  | const T_scale & | sigma
| ) |  |

inline

Definition at line 220 of file student_t_log.hpp.

template<class RNG >

double stan::math::student_t_rng | ( | const double | nu,
|  | const double | mu,
|  | const double | sigma,
|  | RNG & | rng
| ) |  |

inline

Definition at line 29 of file student_t_rng.hpp.

void stan::math::sub | ( | std::vector< double > & | x,
|  | std::vector< double > & | y,
|  | std::vector< double > & | result
| ) |  |

inline

Definition at line 10 of file sub.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::sub_col | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m,
|  | size_t | i,
|  | size_t | j,
|  | size_t | nrows
| ) |  |

inline

Return a nrows x 1 subcolumn starting at (i-1, j-1).

Parameters

  m | Matrix
  i | Starting row + 1
  j | Starting column + 1
  nrows | Number of rows in block

Definition at line 22 of file sub_col.hpp.

template<typename T >

Eigen::Matrix<T, 1, Eigen::Dynamic> stan::math::sub_row | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m,
|  | size_t | i,
|  | size_t | j,
|  | size_t | ncols
| ) |  |

inline

Return a 1 x nrows subrow starting at (i-1, j-1).

Parameters

  m | Matrix
  i | Starting row + 1
  j | Starting column + 1
  ncols | Number of columns in block

Definition at line 23 of file sub_row.hpp.

template<typename T1 , typename T2 , int R, int C>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R, C> stan::math::subtract | ( | const Eigen::Matrix< T1, R, C > & | m1,
|  | const Eigen::Matrix< T2, R, C > & | m2
| ) |  |

inline

Return the result of subtracting the second specified matrix from the first specified matrix.

The return scalar type is the promotion of the input types.

Template Parameters

  T1 | Scalar type of first matrix.
  T2 | Scalar type of second matrix.
  R | Row type of matrices.
  C | Column type of matrices.

Parameters

  m1 | First matrix.
  m2 | Second matrix.

Returns
  Difference between first matrix and second matrix.

Definition at line 27 of file subtract.hpp.

template<typename T1 , typename T2 , int R, int C>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R, C> stan::math::subtract | ( | const T1 & | c,
|  | const Eigen::Matrix< T2, R, C > & | m
| ) |  |

inline

Definition at line 43 of file subtract.hpp.

template<typename T1 , typename T2 , int R, int C>

Eigen::Matrix<typename boost::math::tools::promote_args<T1, T2>::type, R, C> stan::math::subtract | ( | const Eigen::Matrix< T1, R, C > & | m,
|  | const T2 & | c
| ) |  |

inline

Definition at line 56 of file subtract.hpp.

template<typename T >

T stan::math::sum | ( | const std::vector< T > & | xs | ) |

inline

Return the sum of the values in the specified standard vector.

Template Parameters

  T | Type of elements summed.

Parameters

  xs | Standard vector to sum.

Returns
  Sum of elements.

Definition at line 18 of file sum.hpp.

template<typename T >

fvar<T> stan::math::sum | ( | const std::vector< fvar< T > > & | m | ) |

inline

Return the sum of the entries of the specified standard vector.

Template Parameters

  T | Type of vector entries.

Parameters

  m | Vector.

Returns
  Sum of vector entries.

Definition at line 20 of file sum.hpp.

template<typename T , int R, int C>

fvar<T> stan::math::sum | ( | const Eigen::Matrix< fvar< T >, R, C > & | m | ) |

inline

Return the sum of the entries of the specified matrix.

Template Parameters

  T | Type of matrix entries.
  R | Row type of matrix.
  C | Column type of matrix.

Parameters

  m | Matrix.

Returns
  Sum of matrix entries.

Definition at line 21 of file sum.hpp.

template<typename T , int R, int C>

double stan::math::sum | ( | const Eigen::Matrix< T, R, C > & | v | ) |

inline

Returns the sum of the coefficients of the specified column vector.

Template Parameters

  T | Type of elements in matrix.
  R | Row type of matrix.
  C | Column type of matrix.

Parameters

  v | Specified vector.

Returns
  Sum of coefficients of vector.

Definition at line 22 of file sum.hpp.

template<int R, int C>

var stan::math::sum | ( | const Eigen::Matrix< var, R, C > & | m | ) |

inline

Returns the sum of the coefficients of the specified matrix, column vector or row vector.

Template Parameters

  R | Row type for matrix.
  C | Column type for matrix.

Parameters

  m | Specified matrix or vector.

Returns
  Sum of coefficients of matrix.

Definition at line 50 of file sum.hpp.

var stan::math::sum | ( | const std::vector< var > & | m | ) |

inline

Returns the sum of the entries of the specified vector.

Parameters

  m | Vector.

Returns
  Sum of vector entries.

Definition at line 53 of file sum.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::tail | ( | const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | v,
|  | size_t | n
| ) |  |

inline

Return the specified number of elements as a vector from the back of the specified vector.

Definition at line 23 of file tail.hpp.

template<typename T >

Eigen::Matrix<T, 1, Eigen::Dynamic> stan::math::tail | ( | const Eigen::Matrix< T, 1, Eigen::Dynamic > & | rv,
|  | size_t | n
| ) |  |

inline

Return the specified number of elements as a row vector from the back of the specified row vector.

Definition at line 38 of file tail.hpp.

template<typename T >

std::vector<T> stan::math::tail | ( | const std::vector< T > & | sv,
|  | size_t | n
| ) |  |

Definition at line 46 of file tail.hpp.

template<typename T >

fvar<T> stan::math::tan | ( | const fvar< T > & | x | ) |

inline

Definition at line 14 of file tan.hpp.

var stan::math::tan | ( | const var & | a | ) |

inline

Return the tangent of a radian-scaled variable (cmath).

The derivative is defined by

.

Parameters

  a | Variable for radians of angle.

Returns
  Tangent of variable.

Definition at line 49 of file tan.hpp.

template<typename T >

fvar<T> stan::math::tanh | ( | const fvar< T > & | x | ) |

inline

Definition at line 14 of file tanh.hpp.

var stan::math::tanh | ( | const var & | a | ) |

inline

Return the hyperbolic tangent of the specified variable (cmath).

The derivative is defined by

.

Parameters

  a | Variable.

Returns
  Hyperbolic tangent of variable.

Definition at line 50 of file tanh.hpp.

matrix_d stan::math::tcrossprod | ( | const matrix_d & | M | ) |

inline

Returns the result of post-multiplying a matrix by its own transpose.

Parameters

  M | Matrix to multiply.

Returns
  M times its transpose.

Definition at line 17 of file tcrossprod.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, R, R> stan::math::tcrossprod | ( | const Eigen::Matrix< fvar< T >, R, C > & | m | ) |

inline

Definition at line 17 of file tcrossprod.hpp.

matrix_v stan::math::tcrossprod | ( | const matrix_v & | M | ) |

inline

Returns the result of post-multiplying a matrix by its own transpose.

Parameters

  M | Matrix to multiply.

Returns
  M times its transpose.

Definition at line 25 of file tcrossprod.hpp.

template<typename T >

fvar<T> stan::math::tgamma | ( | const fvar< T > & | x | ) |

inline

Definition at line 15 of file tgamma.hpp.

var stan::math::tgamma | ( | const stan::math::var & | a | ) |

inline

Return the Gamma function applied to the specified variable (C99).

See boost::math::tgamma() for the double-based version.

The derivative with respect to the argument is

where is the digamma function.

See boost::math::digamma() for the double-based version.

Parameters

  a | Argument to function.

Returns
  The Gamma function applied to the specified argument.

Definition at line 65 of file tgamma.hpp.

template<typename T , int R, int C>

vector<T> stan::math::to_array_1d | ( | const Matrix< T, R, C > & | matrix | ) |

inline

Definition at line 19 of file to_array_1d.hpp.

template<typename T >

vector<T> stan::math::to_array_1d | ( | const vector< T > & | x | ) |

inline

Definition at line 31 of file to_array_1d.hpp.

template<typename T >

vector<typename scalar_type<T>::type> stan::math::to_array_1d | ( | const vector< vector< T > > & | x | ) |

inline

Definition at line 38 of file to_array_1d.hpp.

template<typename T >

vector< vector<T> > stan::math::to_array_2d | ( | const Matrix< T, Dynamic, Dynamic > & | matrix | ) |

inline

Definition at line 17 of file to_array_2d.hpp.

template<typename T >

fvar<T> stan::math::to_fvar | ( | const T & | x | ) |

inline

Definition at line 16 of file to_fvar.hpp.

template<typename T >

fvar<T> stan::math::to_fvar | ( | const fvar< T > & | x | ) |

inline

Definition at line 23 of file to_fvar.hpp.

template<int R, int C, typename T >

Eigen::Matrix<T, R, C> stan::math::to_fvar | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Definition at line 31 of file to_fvar.hpp.

template<int R, int C>

Eigen::Matrix<fvar<double>, R, C> stan::math::to_fvar | ( | const Eigen::Matrix< double, R, C > & | m | ) |

inline

Definition at line 38 of file to_fvar.hpp.

template<typename T , int R, int C>

Eigen::Matrix<fvar<T>, R, C> stan::math::to_fvar | ( | const Eigen::Matrix< T, R, C > & | val,
|  | const Eigen::Matrix< T, R, C > & | deriv
| ) |  |

inline

Definition at line 48 of file to_fvar.hpp.

template<typename T , int R, int C>

Matrix<T, Dynamic, Dynamic> stan::math::to_matrix | ( | Matrix< T, R, C > | matrix | ) |

inline

Definition at line 20 of file to_matrix.hpp.

template<typename T >

Matrix<T, Dynamic, Dynamic> stan::math::to_matrix | ( | const vector< vector< T > > & | vec | ) |

inline

Definition at line 27 of file to_matrix.hpp.

Matrix<double, Dynamic, Dynamic> stan::math::to_matrix | ( | const vector< vector< int > > & | vec | ) |

inline

Definition at line 44 of file to_matrix.hpp.

template<typename T , int R, int C>

Matrix<T, 1, Dynamic> stan::math::to_row_vector | ( | const Matrix< T, R, C > & | matrix | ) |

inline

Definition at line 20 of file to_row_vector.hpp.

template<typename T >

Matrix<T, 1, Dynamic> stan::math::to_row_vector | ( | const vector< T > & | vec | ) |

inline

Definition at line 28 of file to_row_vector.hpp.

Matrix<double, 1, Dynamic> stan::math::to_row_vector | ( | const vector< int > & | vec | ) |

inline

Definition at line 34 of file to_row_vector.hpp.

var stan::math::to_var | ( | const double & | x | ) |

inline

Converts argument to an automatic differentiation variable.

Returns a stan::math::var variable with the input value.

Parameters

  [in] | x | A scalar value

Returns
  An automatic differentiation variable with the input value.

Definition at line 21 of file to_var.hpp.

var stan::math::to_var | ( | const var & | x | ) |

inline

Converts argument to an automatic differentiation variable.

Returns a stan::math::var variable with the input value.

Parameters

  [in] | x | An automatic differentiation variable.

Returns
  An automatic differentiation variable with the input value.

Definition at line 32 of file to_var.hpp.

matrix_v stan::math::to_var | ( | const stan::math::matrix_d & | m | ) |

inline

Converts argument to an automatic differentiation variable.

Returns a stan::math::var variable with the input value.

Parameters

  [in] | m | A Matrix with scalars

Returns
  A Matrix with automatic differentiation variables

Definition at line 43 of file to_var.hpp.

matrix_v stan::math::to_var | ( | const matrix_v & | m | ) |

inline

Converts argument to an automatic differentiation variable.

Returns a stan::math::var variable with the input value.

Parameters

  [in] | m | A Matrix with automatic differentiation variables.

Returns
  A Matrix with automatic differentiation variables.

Definition at line 58 of file to_var.hpp.

vector_v stan::math::to_var | ( | const stan::math::vector_d & | v | ) |

inline

Converts argument to an automatic differentiation variable.

Returns a stan::math::var variable with the input value.

Parameters

  [in] | v | A Vector of scalars

Returns
  A Vector of automatic differentiation variables with values of v

Definition at line 70 of file to_var.hpp.

vector_v stan::math::to_var | ( | const vector_v & | v | ) |

inline

Converts argument to an automatic differentiation variable.

Returns a stan::math::var variable with the input value.

Parameters

  [in] | v | A Vector of automatic differentiation variables

Returns
  A Vector of automatic differentiation variables with values of v

Definition at line 85 of file to_var.hpp.

row_vector_v stan::math::to_var | ( | const stan::math::row_vector_d & | rv | ) |

inline

Converts argument to an automatic differentiation variable.

Returns a stan::math::var variable with the input value.

Parameters

  [in] | rv | A row vector of scalars

Returns
  A row vector of automatic differentation variables with values of rv.

Definition at line 97 of file to_var.hpp.

row_vector_v stan::math::to_var | ( | const row_vector_v & | rv | ) |

inline

Converts argument to an automatic differentiation variable.

Returns a stan::math::var variable with the input value.

Parameters

  [in] | rv | A row vector with automatic differentiation variables

Returns
  A row vector with automatic differentiation variables with values of rv.

Definition at line 112 of file to_var.hpp.

template<typename T , int R, int C>

Matrix<T, Dynamic, 1> stan::math::to_vector | ( | const Matrix< T, R, C > & | matrix | ) |

inline

Definition at line 20 of file to_vector.hpp.

template<typename T >

Matrix<T, Dynamic, 1> stan::math::to_vector | ( | const vector< T > & | vec | ) |

inline

Definition at line 28 of file to_vector.hpp.

Matrix<double, Dynamic, 1> stan::math::to_vector | ( | const vector< int > & | vec | ) |

inline

Definition at line 34 of file to_vector.hpp.

template<typename T >

T stan::math::trace | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m | ) |

inline

Returns the trace of the specified matrix.

The trace is defined as the sum of the elements on the diagonal. The matrix is not required to be square. Returns 0 if matrix is empty.

Parameters

  [in] | m | Specified matrix.

Returns
  Trace of the matrix.

Definition at line 20 of file trace.hpp.

template<typename T >

T stan::math::trace | ( | const T & | m | ) |

inline

Definition at line 26 of file trace.hpp.

template<typename T1 , int R1, int C1, typename T2 , int R2, int C2, typename T3 , int R3, int C3>

boost::enable_if_c<stan::is_var<T1>::value || stan::is_var<T2>::value || stan::is_var<T3>::value, var>::type stan::math::trace_gen_inv_quad_form_ldlt | ( | const Eigen::Matrix< T1, R1, C1 > & | D,
|  | const stan::math::LDLT_factor< T2, R2, C2 > & | A,
|  | const Eigen::Matrix< T3, R3, C3 > & | B
| ) |  |

inline

Compute the trace of an inverse quadratic form.

I.E., this computes trace(D B^T A^-1 B) where D is a square matrix and the LDLT_factor of A is provided.

Definition at line 27 of file trace_gen_inv_quad_form_ldlt.hpp.

template<typename T1 , typename T2 , typename T3 , int R1, int C1, int R2, int C2, int R3, int C3>

boost::enable_if_c<!stan::is_var<T1>::value && !stan::is_var<T2>::value && !stan::is_var<T3>::value, typename boost::math::tools::promote_args<T1, T2, T3>::type>::type stan::math::trace_gen_inv_quad_form_ldlt | ( | const Eigen::Matrix< T1, R1, C1 > & | D,
|  | const stan::math::LDLT_factor< T2, R2, C2 > & | A,
|  | const Eigen::Matrix< T3, R3, C3 > & | B
| ) |  |

inline

Definition at line 30 of file trace_gen_inv_quad_form_ldlt.hpp.

template<int RD, int CD, int RA, int CA, int RB, int CB, typename T >

fvar<T> stan::math::trace_gen_quad_form | ( | const Eigen::Matrix< fvar< T >, RD, CD > & | D,
|  | const Eigen::Matrix< fvar< T >, RA, CA > & | A,
|  | const Eigen::Matrix< fvar< T >, RB, CB > & | B
| ) |  |

inline

Definition at line 15 of file trace_gen_quad_form.hpp.

template<int RD, int CD, int RA, int CA, int RB, int CB>

double stan::math::trace_gen_quad_form | ( | const Eigen::Matrix< double, RD, CD > & | D,
|  | const Eigen::Matrix< double, RA, CA > & | A,
|  | const Eigen::Matrix< double, RB, CB > & | B
| ) |  |

inline

Compute trace(D B^T A B).

Definition at line 17 of file trace_gen_quad_form.hpp.

template<typename TD , int RD, int CD, typename TA , int RA, int CA, typename TB , int RB, int CB>

boost::enable_if_c< boost::is_same<TD, var>::value || boost::is_same<TA, var>::value || boost::is_same<TB, var>::value, var >::type stan::math::trace_gen_quad_form | ( | const Eigen::Matrix< TD, RD, CD > & | D,
|  | const Eigen::Matrix< TA, RA, CA > & | A,
|  | const Eigen::Matrix< TB, RB, CB > & | B
| ) |  |

inline

Definition at line 116 of file trace_gen_quad_form.hpp.

template<typename T1 , typename T2 , int R2, int C2, int R3, int C3>

boost::enable_if_c<!stan::is_var<T1>::value && !stan::is_var<T2>::value, typename boost::math::tools::promote_args<T1, T2>::type>::type stan::math::trace_inv_quad_form_ldlt | ( | const stan::math::LDLT_factor< T1, R2, C2 > & | A,
|  | const Eigen::Matrix< T2, R3, C3 > & | B
| ) |  |

inline

Definition at line 27 of file trace_inv_quad_form_ldlt.hpp.

template<typename T2 , int R2, int C2, typename T3 , int R3, int C3>

boost::enable_if_c<stan::is_var<T2>::value || stan::is_var<T3>::value, var>::type stan::math::trace_inv_quad_form_ldlt | ( | const stan::math::LDLT_factor< T2, R2, C2 > & | A,
|  | const Eigen::Matrix< T3, R3, C3 > & | B
| ) |  |

inline

Compute the trace of an inverse quadratic form.

I.E., this computes trace(B^T A^-1 B) where the LDLT_factor of A is provided.

Definition at line 177 of file trace_inv_quad_form_ldlt.hpp.

template<int RA, int CA, int RB, int CB>

double stan::math::trace_quad_form | ( | const Eigen::Matrix< double, RA, CA > & | A,
|  | const Eigen::Matrix< double, RB, CB > & | B
| ) |  |

inline

Compute trace(B^T A B).

Definition at line 17 of file trace_quad_form.hpp.

template<int RA, int CA, int RB, int CB, typename T >

stan::math::fvar<T> stan::math::trace_quad_form | ( | const Eigen::Matrix< stan::math::fvar< T >, RA, CA > & | A,
|  | const Eigen::Matrix< stan::math::fvar< T >, RB, CB > & | B
| ) |  |

inline

Definition at line 18 of file trace_quad_form.hpp.

template<typename TA , int RA, int CA, typename TB , int RB, int CB>

boost::enable_if_c< boost::is_same<TA, var>::value || boost::is_same<TB, var>::value, var >::type stan::math::trace_quad_form | ( | const Eigen::Matrix< TA, RA, CA > & | A,
|  | const Eigen::Matrix< TB, RB, CB > & | B
| ) |  |

inline

Definition at line 98 of file trace_quad_form.hpp.

template<typename T , int R, int C>

Eigen::Matrix<T, C, R> stan::math::transpose | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Definition at line 12 of file transpose.hpp.

template<typename T >

T stan::math::trigamma | ( | T | x | ) |

inline

Definition at line 50 of file trigamma.hpp.

template<typename T >

fvar<T> stan::math::trunc | ( | const fvar< T > & | x | ) |

inline

Definition at line 12 of file trunc.hpp.

var stan::math::trunc | ( | const var & | a | ) |

inline

Returns the truncatation of the specified variable (C99).

See trunc() for the double-based version.

The derivative is zero everywhere but at integer values, so for convenience the derivative is defined to be everywhere zero,

.

Parameters

  a | Specified variable.

Returns
  Truncation of the variable.

Definition at line 55 of file trunc.hpp.

template<typename T , typename TU >

boost::math::tools::promote_args<T, TU>::type stan::math::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

where is the upper bound.

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

Parameters

  x | Free scalar.
  ub | Upper bound.

Returns
  Transformed scalar with specified upper bound.

Template Parameters

  T | Type of scalar.
  TU | Type of upper bound.

Definition at line 37 of file ub_constrain.hpp.

template<typename T , typename TU >

boost::math::tools::promote_args<T, TU>::type stan::math::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

.

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

Parameters

  x | Free scalar.
  ub | Upper bound.
  lp | Log probability reference.

Returns
  Transformed scalar with specified upper bound.

Template Parameters

  T | Type of scalar.
  TU | Type of upper bound.

Definition at line 70 of file ub_constrain.hpp.

template<typename T , typename TU >

boost::math::tools::promote_args<T, TU>::type stan::math::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,

where is the upper bound.

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

Parameters

  y | Upper-bounded scalar.
  ub | Upper bound.

Returns
  Free scalar corresponding to upper-bounded scalar.

Template Parameters

  T | Type of scalar.
  TU | Type of upper bound.

Exceptions

  std::invalid_argument | if y is greater than the upper bound.

Definition at line 39 of file ub_free.hpp.

template<typename T_y , typename T_low , typename T_high >

return_type<T_y, T_low, T_high>::type stan::math::uniform_ccdf_log | ( | const T_y & | y,
|  | const T_low & | alpha,
|  | const T_high & | beta
| ) |  |

Definition at line 23 of file uniform_ccdf_log.hpp.

template<typename T_y , typename T_low , typename T_high >

return_type<T_y, T_low, T_high>::type stan::math::uniform_cdf | ( | const T_y & | y,
|  | const T_low & | alpha,
|  | const T_high & | beta
| ) |  |

Definition at line 22 of file uniform_cdf.hpp.

template<typename T_y , typename T_low , typename T_high >

return_type<T_y, T_low, T_high>::type stan::math::uniform_cdf_log | ( | const T_y & | y,
|  | const T_low & | alpha,
|  | const T_high & | beta
| ) |  |

Definition at line 23 of file uniform_cdf_log.hpp.

template<bool propto, typename T_y , typename T_low , typename T_high >

return_type<T_y, T_low, T_high>::type stan::math::uniform_log | ( | const T_y & | y,
|  | const T_low & | alpha,
|  | const T_high & | beta
| ) |  |

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

Parameters

  y | A scalar variable.
  alpha | Lower bound.
  beta | Upper bound.

Exceptions

  std::invalid_argument | if the lower bound is greater than or equal to the lower bound

Template Parameters

  T_y | Type of scalar.
  T_low | Type of lower bound.
  T_high | Type of upper bound.

Definition at line 46 of file uniform_log.hpp.

template<typename T_y , typename T_low , typename T_high >

return_type<T_y, T_low, T_high>::type stan::math::uniform_log | ( | const T_y & | y,
|  | const T_low & | alpha,
|  | const T_high & | beta
| ) |  |

inline

Definition at line 124 of file uniform_log.hpp.

template<class RNG >

double stan::math::uniform_rng | ( | const double | alpha,
|  | const double | beta,
|  | RNG & | rng
| ) |  |

inline

Definition at line 22 of file uniform_rng.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  y | of K - 1 spherical coordinates

Returns
  Unit length vector of dimension K

Template Parameters

  T | Scalar type.

Definition at line 24 of file unit_vector_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::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

  y | of K - 1 spherical coordinates

Returns
  Unit length vector of dimension K

Parameters

  lp | Log probability reference to increment.

Template Parameters

  T | Scalar type.

Definition at line 53 of file unit_vector_constrain.hpp.

template<typename T >

Eigen::Matrix<T, Eigen::Dynamic, 1> stan::math::unit_vector_free | ( | const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | x | ) |

Definition at line 16 of file unit_vector_free.hpp.

void stan::math::validate_non_negative_index | ( | const char * | var_name,
|  | const char * | expr,
|  | int | val
| ) |  |

inline

Definition at line 12 of file validate_non_negative_index.hpp.

template<typename T >

T stan::math::value_of | ( | const fvar< T > & | v | ) |

inline

Return the value of the specified variable.

Parameters

  v | Variable.

Returns
  Value of variable.

Definition at line 16 of file value_of.hpp.

double stan::math::value_of | ( | const var & | v | ) |

inline

Return the value of the specified variable.

This function is used internally by auto-dif functions along with `stan::math::value_of(T x)` to extract the `double` value of either a scalar or an auto-dif variable. This function will be called when the argument is a `stan::math::var` even if the function is not referred to by namespace because of argument-dependent lookup.

Parameters

  v | Variable.

Returns
  Value of variable.

Definition at line 22 of file value_of.hpp.

template<typename T >

double stan::math::value_of | ( | const T | x | ) |

inline

Return the value of the specified scalar argument converted to a double value.

See the `stan::math::primitive_value` function to extract values without casting to `double`.

This function is meant to cover the primitive types. For types requiring pass-by-reference, this template function should be specialized.

Template Parameters

  T | Type of scalar.

Parameters

  x | Scalar to convert to double.

Returns
  Value of scalar cast to a double.

Definition at line 24 of file value_of.hpp.

template<typename T , int R, int C>

Eigen::Matrix<typename child_type<T>::type, R, C> stan::math::value_of | ( | const Eigen::Matrix< T, R, C > & | M | ) |

inline

Convert a matrix of type T to a matrix of doubles.

T must implement value_of. See test/math/fwd/mat/fun/value_of.cpp for fvar and var usage.

Template Parameters

  T | Scalar type in matrix
  R | Rows of matrix
  C | Columns of matrix

Parameters

  [in] | M | Matrix to be converted

Returns
  Matrix of values

Definition at line 25 of file value_of.hpp.

template<>

double stan::math::value_of< double > | ( | const double | x | ) |

inline

Return the specified argument.

See `value_of(T)` for a polymorphic implementation using static casts.

This inline pass-through no-op should be compiled away.

Parameters

  x | Specified value.

Returns
  Specified value.

Definition at line 40 of file value_of.hpp.

double stan::math::value_of_rec | ( | const var & | v | ) |

inline

Return the value of the specified variable.

Parameters

  v | Variable.

Returns
  Value of variable.

Definition at line 15 of file value_of_rec.hpp.

template<typename T >

double stan::math::value_of_rec | ( | const fvar< T > & | v | ) |

inline

Return the value of the specified variable.

T must implement value_of_rec.

Template Parameters

  T | Scalar type

Parameters

  v | Variable.

Returns
  Value of variable.

Definition at line 21 of file value_of_rec.hpp.

template<typename T >

double stan::math::value_of_rec | ( | const T | x | ) |

inline

Return the value of the specified scalar argument converted to a double value.

See the `stan::math::primitive_value` function to extract values without casting to `double`.

This function is meant to cover the primitive types. For types requiring pass-by-reference, this template function should be specialized.

Template Parameters

  T | Type of scalar.

Parameters

  x | Scalar to convert to double.

Returns
  Value of scalar cast to a double.

Definition at line 24 of file value_of_rec.hpp.

template<typename T , int R, int C>

Eigen::Matrix<double, R, C> stan::math::value_of_rec | ( | const Eigen::Matrix< T, R, C > & | M | ) |

inline

Convert a matrix of type T to a matrix of doubles.

T must implement value_of_rec. See test/unit/math/fwd/mat/fun/value_of_test.cpp for fvar and var usage.

Template Parameters

  T | Scalar type in matrix
  R | Rows of matrix
  C | Columns of matrix

Parameters

  [in] | M | Matrix to be converted

Returns
  Matrix of values

Definition at line 24 of file value_of_rec.hpp.

template<>

double stan::math::value_of_rec< double > | ( | const double | x | ) |

inline

Return the specified argument.

See `value_of(T)` for a polymorphic implementation using static casts.

This inline pass-through no-op should be compiled away.

Parameters

  x | Specified value.

Returns
  Specified value.

Definition at line 40 of file value_of_rec.hpp.

template<typename T >

boost::math::tools::promote_args<T>::type stan::math::variance | ( | const std::vector< T > & | v | ) |

inline

Returns the sample variance (divide by length - 1) of the coefficients in the specified standard vector.

Parameters

  v | Specified vector.

Returns
  Sample variance of vector.

Exceptions

  std::domain_error | if the size of the vector is less than 1.

Definition at line 24 of file variance.hpp.

template<typename T , int R, int C>

boost::math::tools::promote_args<T>::type stan::math::variance | ( | const Eigen::Matrix< T, R, C > & | m | ) |

inline

Returns the sample variance (divide by length - 1) of the coefficients in the specified column vector.

Parameters

  m | Specified vector.

Returns
  Sample variance of vector.

Definition at line 46 of file variance.hpp.

var stan::math::variance | ( | const std::vector< var > & | v | ) |

Return the sample variance of the specified standard vector.

Raise domain error if size is not greater than zero.

Parameters

  [in] | v | a vector

Returns
  sample variance of specified vector

Definition at line 52 of file variance.hpp.

template<int R, int C>

var stan::math::variance | ( | const Eigen::Matrix< var, R, C > & | m | ) |

Definition at line 69 of file variance.hpp.

template<bool propto, typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::von_mises_log | ( | T_y const & | y,
|  | T_loc const & | mu,
|  | T_scale const & | kappa
| ) |  |

Definition at line 26 of file von_mises_log.hpp.

template<typename T_y , typename T_loc , typename T_scale >

return_type<T_y, T_loc, T_scale>::type stan::math::von_mises_log | ( | T_y const & | y,
|  | T_loc const & | mu,
|  | T_scale const & | kappa
| ) |  |

inline

Definition at line 132 of file von_mises_log.hpp.

template<class RNG >

double stan::math::von_mises_rng | ( | const double | mu,
|  | const double | kappa,
|  | RNG & | rng
| ) |  |

inline

Definition at line 33 of file von_mises_rng.hpp.

template<typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::weibull_ccdf_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | sigma
| ) |  |

Definition at line 27 of file weibull_ccdf_log.hpp.

template<typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::weibull_cdf | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | sigma
| ) |  |

Definition at line 27 of file weibull_cdf.hpp.

template<typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::weibull_cdf_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | sigma
| ) |  |

Definition at line 27 of file weibull_cdf_log.hpp.

template<bool propto, typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::weibull_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | sigma
| ) |  |

Definition at line 30 of file weibull_log.hpp.

template<typename T_y , typename T_shape , typename T_scale >

return_type<T_y, T_shape, T_scale>::type stan::math::weibull_log | ( | const T_y & | y,
|  | const T_shape & | alpha,
|  | const T_scale & | sigma
| ) |  |

inline

Definition at line 141 of file weibull_log.hpp.

template<class RNG >

double stan::math::weibull_rng | ( | const double | alpha,
|  | const double | sigma,
|  | RNG & | rng
| ) |  |

inline

Definition at line 24 of file weibull_rng.hpp.

template<bool propto, typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta >

return_type<T_y, T_alpha, T_tau, T_beta, T_delta>::type stan::math::wiener_log | ( | const T_y & | y,
|  | const T_alpha & | alpha,
|  | const T_tau & | tau,
|  | const T_beta & | beta,
|  | const T_delta & | delta
| ) |  |

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

and must be greater than 0, and must be between 0 and 1. should contain reaction times in seconds, with upper-boundary responses strictly positive and lower-boundary response times coded as strictly negative numbers.

Parameters

  y | A scalar variate.
  alpha | The boundary separation.
  tau | The nondecision time.
  beta | The relative bias.
  delta | The drift rate.

Returns
  The log of the Wiener first passage time density of the specified arguments.

Definition at line 68 of file wiener_log.hpp.

template<typename T_y , typename T_alpha , typename T_tau , typename T_beta , typename T_delta >

return_type<T_y, T_alpha, T_tau, T_beta, T_delta>::type stan::math::wiener_log | ( | const T_y & | y,
|  | const T_alpha & | alpha,
|  | const T_tau & | tau,
|  | const T_beta & | beta,
|  | const T_delta & | delta
| ) |  |

inline

Definition at line 221 of file wiener_log.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::math::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

Parameters

  W | A scalar matrix
  nu | Degrees of freedom
  S | The scale matrix

Returns
  The log of the Wishart density at W given nu and S.

Exceptions

  std::domain_error | if nu is not greater than k-1
  std::domain_error | if S is not square, not symmetric, or not semi-positive definite.

Template Parameters

  T_y | Type of scalar.
  T_dof | Type of degrees of freedom.
  T_scale | Type of scale.

Definition at line 58 of file wishart_log.hpp.

template<typename T_y , typename T_dof , typename T_scale >

boost::math::tools::promote_args<T_y, T_dof, T_scale>::type stan::math::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 127 of file wishart_log.hpp.

template<class RNG >

Eigen::Matrix<double, Eigen::Dynamic, Eigen::Dynamic> stan::math::wishart_rng | ( | const double | nu,
|  | const Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > & | S,
|  | RNG & | rng
| ) |  |

inline

Definition at line 29 of file wishart_rng.hpp.

## Variable Documentation

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

The tolerance for checking arithmetic bounds In rank and in simplexes.

The default value is `1E-8`.

Definition at line 11 of file constraint_tolerance.hpp.

const double stan::math::E = boost::math::constants::e<double>()

The base of the natural logarithm, .

Definition at line 15 of file constants.hpp.

const double stan::math::EPSILON = std::numeric_limits<double>::epsilon()

Smallest positive value.

Definition at line 61 of file constants.hpp.

const double stan::math::INFTY = std::numeric_limits<double>::infinity()

Positive infinity.

Definition at line 44 of file constants.hpp.

const double stan::math::INV_SQRT_2 = 1.0 / SQRT_2

The value of 1 over the square root of 2, .

Definition at line 27 of file constants.hpp.

const double stan::math::INV_SQRT_TWO_PI = 1.0 / std::sqrt(2.0 * boost::math::constants::pi<double>())

Definition at line 166 of file constants.hpp.

const double stan::math::LOG_10 = std::log(10.0)

The natural logarithm of 10, .

Definition at line 39 of file constants.hpp.

const double stan::math::LOG_2 = std::log(2.0)

The natural logarithm of 2, .

Definition at line 33 of file constants.hpp.

const double stan::math::LOG_HALF = std::log(0.5)

Definition at line 179 of file constants.hpp.

const double stan::math::LOG_PI = std::log(boost::math::constants::pi<double>())

Definition at line 170 of file constants.hpp.

const double stan::math::LOG_PI_OVER_FOUR = std::log(boost::math::constants::pi<double>()) / 4.0

Log pi divided by 4 .

Definition at line 79 of file constants.hpp.

const double stan::math::LOG_SQRT_PI = std::log(SQRT_PI)

Definition at line 173 of file constants.hpp.

const double stan::math::LOG_TWO = std::log(2.0)

Definition at line 177 of file constants.hpp.

const double stan::math::LOG_TWO_PI = LOG_TWO + LOG_PI

Definition at line 193 of file constants.hpp.

const double stan::math::LOG_ZERO = std::log(0.0)

Definition at line 175 of file constants.hpp.

const std::string stan::math::MAJOR_VERSION = STAN_STRING(STAN_MATH_MAJOR)

Major version number for Stan math library.

Definition at line 22 of file version.hpp.

const std::string stan::math::MINOR_VERSION = STAN_STRING(STAN_MATH_MINOR)

Minor version number for Stan math library.

Definition at line 25 of file version.hpp.

const double stan::math::NEG_LOG_PI = - LOG_PI

Definition at line 186 of file constants.hpp.

const double stan::math::NEG_LOG_SQRT_PI = -std::log(std::sqrt(boost::math::constants::pi<double>()))

Definition at line 189 of file constants.hpp.

const double stan::math::NEG_LOG_SQRT_TWO_PI = - std::log(std::sqrt(2.0 * boost::math::constants::pi<double>()))

Definition at line 184 of file constants.hpp.

const double stan::math::NEG_LOG_TWO = - LOG_TWO

Definition at line 181 of file constants.hpp.

const double stan::math::NEG_LOG_TWO_OVER_TWO = - LOG_TWO / 2.0

Definition at line 191 of file constants.hpp.

const double stan::math::NEG_LOG_TWO_PI = - LOG_TWO_PI

Definition at line 195 of file constants.hpp.

const double stan::math::NEG_TWO_OVER_SQRT_PI = -TWO_OVER_SQRT_PI

Definition at line 163 of file constants.hpp.

const double stan::math::NEGATIVE_EPSILON = - std::numeric_limits<double>::epsilon()

Largest negative value (i.e., smallest absolute value).

Definition at line 67 of file constants.hpp.

const double stan::math::NEGATIVE_INFTY = - std::numeric_limits<double>::infinity()

Negative infinity.

Definition at line 50 of file constants.hpp.

const double stan::math::NOT_A_NUMBER = std::numeric_limits<double>::quiet_NaN()

(Quiet) not-a-number value.

Definition at line 56 of file constants.hpp.

const std::string stan::math::PATCH_VERSION = STAN_STRING(STAN_MATH_PATCH)

Patch version for Stan math library.

Definition at line 28 of file version.hpp.

const double stan::math::POISSON_MAX_RATE = std::pow(2.0, 30)

Largest rate parameter allowed in Poisson RNG.

Definition at line 72 of file constants.hpp.

const double stan::math::SQRT_2 = std::sqrt(2.0)

The value of the square root of 2, .

Definition at line 21 of file constants.hpp.

const double stan::math::SQRT_2_TIMES_SQRT_PI = SQRT_2 * SQRT_PI

Definition at line 158 of file constants.hpp.

const double stan::math::SQRT_PI = std::sqrt(boost::math::constants::pi<double>())

Definition at line 156 of file constants.hpp.

const double stan::math::TWO_OVER_SQRT_PI = 2.0 / SQRT_PI

Definition at line 161 of file constants.hpp.

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