![]() |
Stan
2.5.0
probability, sampling & optimization
|
Matrices and templated mathematical functions. More...
Namespaces | |
| detail | |
| policies | |
| Extending boost functionality. | |
Classes | |
| class | LDLT_factor< stan::agrad::var, R, C > |
| A template specialization of src/stan/math/matrix/LDLT_factor.hpp for stan::agrad::var which can be used with all the *_ldlt functions. More... | |
| struct | coupled_ode_system< F, double, stan::agrad::var > |
| The coupled ODE system for known initial values and unknown parameters. More... | |
| struct | coupled_ode_system< F, stan::agrad::var, double > |
| The coupled ODE system for unknown initial values and known parameters. More... | |
| struct | coupled_ode_system< F, stan::agrad::var, stan::agrad::var > |
| The coupled ode system for unknown intial values and unknown parameters. 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... | |
| 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 | 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 | 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< 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 > > |
| 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... | |
| struct | index_type< std::vector< T > > |
| Template metaprogram class to compute the type of index for a standard vector. 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... | |
| 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 | 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 > > |
Typedefs | |
| typedef index_type < Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > >::type | size_type |
| Type for sizes and indexes in an Eigen matrix with double e. More... | |
| 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... | |
Functions | |
| void | add_initial_values (const std::vector< stan::agrad::var > &y0, std::vector< std::vector< stan::agrad::var > > &y) |
| Increment the state derived from the coupled system in the with the original initial state. 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_y , typename T_low , typename T_high , typename T_result > | |
| bool | check_bounded (const char *function, const T_y &y, const T_low &low, const T_high &high, const char *name, T_result *result) |
| template<typename T , typename T_result > | |
| bool | check_consistent_size (size_t max_size, const char *function, const T &x, const char *name, T_result *result) |
| template<typename T1 , typename T2 , typename T_result > | |
| bool | check_consistent_sizes (const char *function, const T1 &x1, const T2 &x2, const char *name1, const char *name2, T_result *result) |
| template<typename T1 , typename T2 , typename T3 , typename T_result > | |
| bool | check_consistent_sizes (const char *function, const T1 &x1, const T2 &x2, const T3 &x3, const char *name1, const char *name2, const char *name3, T_result *result) |
| template<typename T1 , typename T2 , typename T3 , typename T4 , typename T_result > | |
| bool | check_consistent_sizes (const char *function, const T1 &x1, const T2 &x2, const T3 &x3, const T4 &x4, const char *name1, const char *name2, const char *name3, const char *name4, T_result *result) |
| template<typename T_y , typename T_eq , typename T_result > | |
| bool | check_equal (const char *function, const T_y &y, const T_eq &eq, const char *name, T_result *result) |
| template<typename T_y , typename T_result > | |
| bool | check_finite (const char *function, const T_y &y, const char *name, T_result *result) |
| Checks if the variable y is finite. More... | |
| template<typename T_y , typename T_low , typename T_result > | |
| bool | check_greater (const char *function, const T_y &y, const T_low &low, const char *name, T_result *result) |
| template<typename T_y , typename T_low , typename T_result > | |
| bool | check_greater_or_equal (const char *function, const T_y &y, const T_low &low, const char *name, T_result *result) |
| template<typename T_y , typename T_high , typename T_result > | |
| bool | check_less (const char *function, const T_y &y, const T_high &high, const char *name, T_result *result) |
| template<typename T_y , typename T_high , typename T_result > | |
| bool | check_less_or_equal (const char *function, const T_y &y, const T_high &high, const char *name, T_result *result) |
| template<typename T_y , typename T_result > | |
| bool | check_nonnegative (const char *function, const T_y &y, const char *name, T_result *result) |
| template<typename T_y , typename T_result > | |
| bool | check_not_nan (const char *function, const T_y &y, const char *name, T_result *result) |
| Checks if the variable y is nan. More... | |
| template<typename T_y , typename T_result > | |
| bool | check_positive (const char *function, const T_y &y, const char *name, T_result *result) |
| template<typename T_y , typename T_result > | |
| bool | check_positive_finite (const char *function, const T_y &y, const char *name, T_result *result) |
| template<typename T , typename T_result , typename T_msg > | |
| bool | dom_err (const char *function, const T &y, const char *name, const char *error_msg, const T_msg error_msg2, T_result *result) |
| template<typename T , typename T_result , typename T_msg > | |
| bool | dom_err_vec (const size_t i, const char *function, const T &y, const char *name, const char *error_msg, const T_msg error_msg2, T_result *result) |
| template<typename T_y , typename T_result > | |
| bool | check_cholesky_factor (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result) |
Return true if the specified matrix is a valid Cholesky factor. More... | |
| template<typename T_y , typename T_result > | |
| bool | check_cholesky_factor_corr (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result) |
Return true if the specified matrix is a valid Cholesky factor. More... | |
| template<typename T > | |
| bool | check_cholesky_factor_corr (const char *function, const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T *result=0) |
| template<typename T_y , typename T_result > | |
| bool | check_cholesky_factor_corr (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, T_result *result) |
Return true if the specified matrix is a valid Cholesky factor (lower triangular, positive diagonal). More... | |
| template<typename T > | |
| bool | check_cholesky_factor_corr (const char *function, const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &y, T *result=0) |
| template<typename T_y , typename T_result , int R, int C> | |
| bool | check_column_index (const char *function, size_t i, const Eigen::Matrix< T_y, R, C > &y, const char *name, T_result *result) |
Return true if the specified index is a valid column of the matrix. More... | |
| template<typename T_y , typename T_result > | |
| bool | check_corr_matrix (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result) |
Return true if the specified matrix is a valid correlation matrix. More... | |
| template<typename T_y , typename T_result > | |
| bool | check_cov_matrix (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result) |
Return true if the specified matrix is a valid covariance matrix. More... | |
| template<typename T , int R, int C, typename T_result > | |
| bool | check_ldlt_factor (const char *function, stan::math::LDLT_factor< T, R, C > &A, const char *name, T_result *result) |
Return true if the underlying matrix is positive definite. More... | |
| template<typename T_y , typename T_result > | |
| bool | check_lower_triangular (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result) |
Return true if the specified matrix is lower triangular. More... | |
| template<typename T1 , typename T2 , int R1, int C1, int R2, int C2, typename T_result > | |
| bool | check_matching_dims (const char *function, const Eigen::Matrix< T1, R1, C1 > &y1, const char *name1, const Eigen::Matrix< T2, R2, C2 > &y2, const char *name2, T_result *result) |
| template<typename T_y1 , typename T_y2 , typename T_result > | |
| bool | check_matching_sizes (const char *function, const T_y1 &y1, const char *name1, const T_y2 &y2, const char *name2, T_result *result) |
| template<typename T1 , typename T2 , typename T_result > | |
| bool | check_multiplicable (const char *function, const T1 &y1, const char *name1, const T2 &y2, const char *name2, T_result *result) |
| template<typename T_y , typename T_result > | |
| bool | check_nonzero_size (const char *function, const T_y &y, const char *name, T_result *result) |
Return true if the specified matrix/vector is of non-zero size. More... | |
| template<typename T_y , typename T_result > | |
| bool | check_ordered (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > &y, const char *name, T_result *result) |
Return true if the specified vector is sorted into increasing order. More... | |
| template<typename T_y , typename T_result > | |
| bool | check_ordered (const char *function, const std::vector< T_y > &y, const char *name, T_result *result) |
| template<typename T > | |
| bool | check_ordered (const char *function, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y, const char *name, T *result=0) |
| template<typename T > | |
| bool | check_ordered (const char *function, const std::vector< T > &y, const char *name, T *result=0) |
| template<typename T_y , typename T_result > | |
| bool | check_pos_definite (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result) |
Return true if the specified matrix is positive definite. More... | |
| template<typename T_y , typename T_result > | |
| bool | check_pos_semidefinite (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result) |
Return true if the specified matrix is positive definite. More... | |
| template<typename T_y , typename T_result > | |
| bool | check_positive_ordered (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > &y, const char *name, T_result *result) |
Return true if the specified vector contains only non-negative values and is sorted into increasing order. More... | |
| void | check_range (size_t max, size_t i, const char *msg, size_t idx) |
| template<typename T_y , typename T_result , int R, int C> | |
| bool | check_row_index (const char *function, size_t i, const Eigen::Matrix< T_y, R, C > &y, const char *name, T_result *result) |
Return true if the specified index is a valid row of the matrix. More... | |
| template<typename T_prob , typename T_result > | |
| bool | check_simplex (const char *function, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta, const char *name, T_result *result) |
Return true if the specified vector is simplex. More... | |
| template<typename T_size1 , typename T_size2 , typename T_result > | |
| bool | check_size_match (const char *function, T_size1 i, const char *name_i, T_size2 j, const char *name_j, T_result *result) |
| template<typename T_y , typename T_result > | |
| bool | check_spsd_matrix (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result) |
Return true if the specified matrix is a square, symmetric, and positive semi-definite. More... | |
| template<typename T_y , typename T_result > | |
| bool | check_square (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result) |
Return true if the specified matrix is square. More... | |
| template<typename T_y , typename T_result > | |
| bool | check_std_vector_index (const char *function, size_t i, const std::vector< T_y > &y, const char *name, T_result *result) |
Return true if the specified index is valid in std vector. More... | |
| template<typename T_y , typename T_result > | |
| bool | check_symmetric (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result) |
Return true if the specified matrix is symmetric. More... | |
| template<typename T_prob , typename T_result > | |
| bool | check_unit_vector (const char *function, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta, const char *name, T_result *result) |
Return true if the specified vector is unit vector. More... | |
| template<typename T > | |
| bool | check_unit_vector (const char *function, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &theta, const char *name, T *result=0) |
| template<typename T , int R, int C, typename T_result > | |
| bool | check_vector (const char *function, const Eigen::Matrix< T, R, C > &x, const char *name, T_result *result) |
| void | validate_non_negative_index (const std::string &var_name, const std::string &expr, int val) |
| 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) |
| |
| template<typename T2 > | |
| T2 | bessel_second_kind (const int v, const T2 z) |
| |
| 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 | digamma (double x) |
| |
| double | dist (const std::vector< double > &x, const std::vector< double > &y) |
| int | divide (const int x, const int y) |
| double | dot (const std::vector< double > &x, const std::vector< double > &y) |
| double | dot_self (const std::vector< double > &x) |
| 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 T1 , typename T2 > | |
| boost::math::tools::promote_args < T1, T2 >::type | falling_factorial (const T1 x, const T2 n) |
| |
| 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) |
| |
| double | gamma_q (double x, double a) |
| |
| 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_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... | |
| 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... | |
| int | is_nan (const 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 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) |
| |
| 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) |
| |
| 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... | |
| template<typename T1 , typename T2 > | |
| boost::math::tools::promote_args < T1, T2 >::type | log_rising_factorial (const T1 x, const T2 n) |
| |
| 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... | |
| 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 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... | |
| double | max (const double a, const double b) |
| double | min (const double a, const double b) |
| template<typename T2 > | |
| T2 | modified_bessel_first_kind (const int v, const T2 z) |
| |
| template<typename T2 > | |
| T2 | modified_bessel_second_kind (const int v, const T2 z) |
| |
| 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... | |
| template<typename T1 , typename T2 > | |
| boost::math::tools::promote_args < T1, T2 >::type | owens_t (const T1 &h, const T2 &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 > | |
| 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 , 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) |
| |
| void | scaled_add (std::vector< double > &x, const std::vector< double > &y, const double lambda) |
| 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... | |
| void | sub (std::vector< double > &x, std::vector< double > &y, std::vector< double > &result) |
| double | sum (std::vector< double > &x) |
| template<typename T > | |
| T | trigamma (T x) |
| |
| 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 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> | |
| Matrix< typename return_type < T1, T2 >::type, Dynamic, Dynamic > | append_col (const Matrix< T1, R1, C1 > &A, const Matrix< T2, R2, C2 > &B) |
| template<typename T1 , typename T2 , int C1, int C2> | |
| Matrix< typename return_type < T1, T2 >::type, 1, Dynamic > | append_col (const Matrix< T1, 1, C1 > &A, const Matrix< T2, 1, C2 > &B) |
| template<typename T , int R1, int C1, int R2, int C2> | |
| Matrix< T, Dynamic, Dynamic > | append_col (const Matrix< T, R1, C1 > &A, const Matrix< T, R2, C2 > &B) |
| template<typename T , int C1, int C2> | |
| Matrix< T, 1, Dynamic > | append_col (const Matrix< T, 1, C1 > &A, const Matrix< T, 1, C2 > &B) |
| template<typename T1 , typename T2 , int R1, int C1, int R2, int C2> | |
| Matrix< typename return_type < T1, T2 >::type, Dynamic, Dynamic > | append_row (const Matrix< T1, R1, C1 > &A, const Matrix< T2, R2, C2 > &B) |
| template<typename T1 , typename T2 , int R1, int R2> | |
| Matrix< typename return_type < T1, T2 >::type, Dynamic, 1 > | append_row (const Matrix< T1, R1, 1 > &A, const Matrix< T2, R1, 1 > &B) |
| template<typename T , int R1, int C1, int R2, int C2> | |
| Matrix< T, Dynamic, Dynamic > | append_row (const Matrix< T, R1, C1 > &A, const Matrix< T, R2, C2 > &B) |
| template<typename T , int R1, int R2> | |
| Matrix< T, Dynamic, 1 > | append_row (const Matrix< T, R1, 1 > &A, const Matrix< T, R1, 1 > &B) |
| 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 > | |
| 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_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, 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 , 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, 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 , 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 > | |
| vector< vector< T > > | to_array_2d (const Matrix< T, Dynamic, Dynamic > &matrix) |
| 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) |
| 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 , 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 > | |
| Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > | inverse (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &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... | |
| 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 > | |
| 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<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 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<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 > | |
| 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 > | 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 > | |
| T | sum (const std::vector< T > &xs) |
| Return the sum of the values in the specified standard vector. More... | |
| 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 > | |
| 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 > | |
| 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 , 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 > | |
| 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) |
| 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) |
| double | F32 (double a, double b, double c, double d, double e, double z, double precision=1e-6) |
| void | gradF32 (double *g, double a, double b, double c, double d, double e, double z, double precision=1e-6) |
| void | grad2F1 (double &gradA, double &gradC, double a, double b, double c, double z, double precision=1e-6) |
| void | gradIncBeta (double &g1, double &g2, double a, double b, double z) |
| void | gradRegIncBeta (double &g1, double &g2, double a, double b, double z, double digammaA, double digammaB, double digammaSum, double betaAB) |
| double | gradRegIncGamma (double a, double z, double g, double dig, double precision=1e-6) |
Variables | |
| 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 | LOG_PI_OVER_FOUR = std::log(boost::math::constants::pi<double>()) / 4.0 |
| const double | TWO_OVER_SQRT_PI = 2.0 / std::sqrt(boost::math::constants::pi<double>()) |
| 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 | CONSTRAINT_TOLERANCE = 1E-8 |
| The tolerance for checking arithmetic bounds In rank and in simplexes. More... | |
Matrices and templated mathematical functions.
| 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<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 index_type<Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> >::type stan::math::size_type |
Type for sizes and indexes in an Eigen matrix with double e.
Definition at line 16 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.
| double stan::math::abs | ( | double | x | ) |
|
inline |
Return the sum of the specified matrices.
The two matrices must have the same dimensions.
| T1 | Scalar type of first matrix. |
| T2 | Scalar type of second matrix. |
| R | Row type of matrices. |
| C | Column type of matrices. |
| m1 | First matrix. |
| m2 | Second matrix. |
| std::domain_error | if m1 and m2 do not have the same dimensions. |
|
inline |
|
inline |
| void stan::math::add_initial_values | ( | const std::vector< stan::agrad::var > & | y0, |
| std::vector< std::vector< stan::agrad::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.
| [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 34 of file coupled_ode_system.hpp.
|
inline |
Definition at line 23 of file append_col.hpp.
|
inline |
Definition at line 49 of file append_col.hpp.
|
inline |
Definition at line 69 of file append_col.hpp.
|
inline |
Definition at line 85 of file append_col.hpp.
|
inline |
Definition at line 23 of file append_row.hpp.
|
inline |
Definition at line 49 of file append_row.hpp.
|
inline |
Definition at line 68 of file append_row.hpp.
|
inline |
Definition at line 84 of file append_row.hpp.
|
inline |
Return 1 if the argument is unequal to zero and 0 otherwise.
| x | Value. |
Definition at line 14 of file as_bool.hpp.
|
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.
| LHS | Type of left-hand side. |
| RHS | Type of right-hand side. |
| lhs | Left-hand side. |
| rhs | Right-hand side. |
Definition at line 37 of file assign.hpp.
|
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.
| 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. |
| x | Left-hand side matrix. |
| y | Right-hand side matrix. |
| std::domain_error | if sizes do not match. |
Definition at line 63 of file assign.hpp.
|
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.
| 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. |
| x | Left-hand side matrix. |
| y | Right-hand side matrix. |
| std::domain_error | if sizes do not match. |
Definition at line 94 of file assign.hpp.
|
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.
| 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. |
| x | Left-hand side block view of matrix. |
| y | Right-hand side matrix. |
| std::domain_error | if sizes do not match. |
Definition at line 122 of file assign.hpp.
|
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.
| LHS | Type of left-hand side vector elements. |
| RHS | Type of right-hand side vector elements. |
| x | Left-hand side vector. |
| y | Right-hand side vector. |
| std::domain_error | if sizes do not match. |
Definition at line 153 of file assign.hpp.
|
inline |
|
inline |
|
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
.
| y | Reference value in { 0 , 1 }. |
| y_hat | Response value in [0,1]. |
Definition at line 26 of file binary_log_loss.hpp.
|
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.
.
| N | total number of objects. |
| n | number of objects chosen. |
Definition at line 63 of file binomial_coefficient_log.hpp.
|
inline |
|
inline |
Definition at line 79 of file check_bounded.hpp.
|
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).
| function | |
| y | Matrix to test. |
| name | |
| result |
true if the matrix is a valid Cholesky factor. | T_y | Type of elements of Cholesky factor |
| T_result | Type of result. |
Definition at line 30 of file check_cholesky_factor.hpp.
| bool stan::math::check_cholesky_factor_corr | ( | const char * | function, |
| const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > & | y, | ||
| const char * | name, | ||
| T_result * | result | ||
| ) |
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).
Tolerance is specified by math::CONSTRAINT_TOLERANCE.
| function | |
| y | Matrix to test. |
| name | |
| result |
true if the matrix is a valid Cholesky factor. | T_y | Type of elements of Cholesky factor |
| T_result | Type of result. |
Definition at line 34 of file check_cholesky_factor_corr.hpp.
|
inline |
Definition at line 54 of file check_cholesky_factor_corr.hpp.
|
inline |
Return true if the specified matrix is a valid Cholesky factor (lower triangular, positive diagonal).
| function | Name of function. |
| y | Matrix to test. |
| result | Pointer into which to write result. |
true if the matrix is a valid Cholesky factor. | T_y | Type of elements of Cholesky factor |
| T_result | Type of result. |
Definition at line 75 of file check_cholesky_factor_corr.hpp.
|
inline |
Definition at line 83 of file check_cholesky_factor_corr.hpp.
|
inline |
Return true if the specified index is a valid column of the matrix.
NOTE: this will not throw if y contains nan values.
| function | |
| i | is index |
| y | Matrix to test against |
| name | |
| result |
true if the index is a valid column index of the matrix. | T | Type of scalar. |
Definition at line 25 of file check_column_index.hpp.
|
inline |
Definition at line 13 of file check_consistent_size.hpp.
|
inline |
Definition at line 13 of file check_consistent_sizes.hpp.
|
inline |
Definition at line 26 of file check_consistent_sizes.hpp.
|
inline |
Definition at line 41 of file check_consistent_sizes.hpp.
|
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 (inclussive).
| function | |
| y | Matrix to test. |
| name | |
| result |
true if the specified matrix is a valid correlation matrix. | T | Type of scalar. |
Definition at line 38 of file check_corr_matrix.hpp.
|
inline |
Return true if the specified matrix is a valid covariance matrix.
A valid covariance matrix must be square, symmetric, and positive definite.
| function | |
| y | Matrix to test. |
| name | |
| result |
true if the matrix is a valid covariance matrix. | T | Type of scalar. |
Definition at line 29 of file check_cov_matrix.hpp.
|
inline |
Definition at line 57 of file check_equal.hpp.
|
inline |
Checks if the variable y is finite.
NOTE: throws if any element in y is nan.
Definition at line 52 of file check_finite.hpp.
|
inline |
Definition at line 58 of file check_greater.hpp.
|
inline |
Definition at line 58 of file check_greater_or_equal.hpp.
|
inline |
Return true if the underlying matrix is positive definite.
| function | |
| A | |
| name | |
| result |
true if the matrix is positive definite. | T | Type of scalar. |
Definition at line 24 of file check_ldlt_factor.hpp.
|
inline |
Definition at line 52 of file check_less.hpp.
|
inline |
Definition at line 52 of file check_less_or_equal.hpp.
|
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.
| function | |
| y | Matrix to test. |
| name | |
| result |
true if the matrix is symmetric. | T | Type of scalar. |
Definition at line 27 of file check_lower_triangular.hpp.
|
inline |
Definition at line 15 of file check_matching_dims.hpp.
|
inline |
Definition at line 15 of file check_matching_sizes.hpp.
|
inline |
Definition at line 15 of file check_multiplicable.hpp.
|
inline |
Definition at line 52 of file check_nonnegative.hpp.
|
inline |
Return true if the specified matrix/vector is of non-zero size.
Throws a std:domain_error otherwise. The message will indicate that the variable name "has size 0".
NOTE: this will not throw if y contains nan values.
| function | |
| y | matrix/vector to test against |
| name | |
| result |
true if the the specified matrix/vector is of non-zero size | std::domain_error | if the specified matrix/vector is of non-zero size |
| T | Type of scalar. |
Definition at line 33 of file check_nonzero_size.hpp.
|
inline |
Checks if the variable y is nan.
| function | Name of function being invoked. |
| y | Reference to variable being tested. |
| name | Name of variable being tested. |
| result | Pointer to resulting value after test. |
| T_y | Type of variable being tested. |
| T_result | Type of result returned. |
Definition at line 56 of file check_not_nan.hpp.
| bool stan::math::check_ordered | ( | const char * | function, |
| const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > & | y, | ||
| const char * | name, | ||
| T_result * | result | ||
| ) |
Return true if the specified vector is sorted into increasing order.
There may not be duplicate values. Otherwise, raise a domain error according to the specified policy.
| function | |
| y | Vector to test. |
| name | |
| result |
true if the vector has positive, ordered values. Definition at line 29 of file check_ordered.hpp.
| bool stan::math::check_ordered | ( | const char * | function, |
| const std::vector< T_y > & | y, | ||
| const char * | name, | ||
| T_result * | result | ||
| ) |
Definition at line 57 of file check_ordered.hpp.
| bool stan::math::check_ordered | ( | const char * | function, |
| const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | y, | ||
| const char * | name, | ||
| T * | result = 0 |
||
| ) |
Definition at line 81 of file check_ordered.hpp.
| bool stan::math::check_ordered | ( | const char * | function, |
| const std::vector< T > & | y, | ||
| const char * | name, | ||
| T * | result = 0 |
||
| ) |
Definition at line 88 of file check_ordered.hpp.
|
inline |
Return true if the specified matrix is positive definite.
NOTE: symmetry is NOT checked by this function
| function | |
| y | Matrix to test. |
| name | |
| result |
true if the matrix is positive definite. | T | Type of scalar. |
Definition at line 29 of file check_pos_definite.hpp.
|
inline |
Return true if the specified matrix is positive definite.
NOTE: symmetry is NOT checked by this function
| function | |
| y | Matrix to test. |
| name | |
| result |
true if the matrix is positive semi-definite. | T | Type of scalar. |
Definition at line 33 of file check_pos_semidefinite.hpp.
|
inline |
Definition at line 54 of file check_positive.hpp.
|
inline |
Definition at line 12 of file check_positive_finite.hpp.
| bool stan::math::check_positive_ordered | ( | const char * | function, |
| const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > & | y, | ||
| const char * | name, | ||
| T_result * | result | ||
| ) |
Return true if the specified vector contains only non-negative values and is sorted into increasing order.
There may not be duplicate values. Otherwise, raise a domain error according to the specified policy.
| function | |
| y | Vector to test. |
| name | |
| result |
true if the vector has positive, ordered Definition at line 29 of file check_positive_ordered.hpp.
|
inline |
Definition at line 30 of file check_range.hpp.
|
inline |
Return true if the specified index is a valid row of the matrix.
NOTE: this will not throw if y contains nan values.
| function | |
| i | is index |
| y | Matrix to test against |
| name | |
| result |
true if the index is a valid row index of the matrix. | T | Type of scalar. |
Definition at line 25 of file check_row_index.hpp.
| bool stan::math::check_simplex | ( | const char * | function, |
| const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > & | theta, | ||
| const char * | name, | ||
| T_result * | result | ||
| ) |
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.
The test that the values sum to 1 is done to within the tolerance specified by CONSTRAINT_TOLERANCE.
| function | |
| theta | Vector to test. |
| name | |
| result |
true if the vector is a simplex. Definition at line 32 of file check_simplex.hpp.
|
inline |
Definition at line 13 of file check_size_match.hpp.
|
inline |
Return true if the specified matrix is a square, symmetric, and positive semi-definite.
| function | |
| y | Matrix to test. |
| name | |
| result |
true if the matrix is a square, symmetric, and positive semi-definite. | T | Type of scalar. |
Definition at line 29 of file check_spsd_matrix.hpp.
|
inline |
Return true if the specified matrix is square.
NOTE: this will not throw if any elements in y are nan.
| function | |
| y | Matrix to test. |
| name | |
| result |
true if the matrix is a square matrix. | T | Type of scalar. |
Definition at line 24 of file check_square.hpp.
|
inline |
Return true if the specified index is valid in std vector.
NOTE: this will not throw if y contains nan values.
| function | |
| i | is index |
| y | std vector to test against |
| name | |
| result |
true if the index is a valid in std vector. | T | Type of scalar. |
Definition at line 25 of file check_std_vector_index.hpp.
|
inline |
Return true if the specified matrix is symmetric.
NOTE: squareness is not checked by this function
| function | |
| y | Matrix to test. |
| name | |
| result |
true if the matrix is symmetric. | T | Type of scalar. |
Definition at line 31 of file check_symmetric.hpp.
| bool stan::math::check_unit_vector | ( | const char * | function, |
| const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > & | theta, | ||
| const char * | name, | ||
| T_result * | result | ||
| ) |
Return true if the specified vector is unit vector.
The test that the values sum to 1 is done to within the tolerance specified by CONSTRAINT_TOLERANCE.
| function | |
| theta | Vector to test. |
| name | |
| result |
true if the vector is a unit vector. Definition at line 27 of file check_unit_vector.hpp.
|
inline |
Definition at line 55 of file check_unit_vector.hpp.
|
inline |
Definition at line 14 of file check_vector.hpp.
| 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
.
| m | Symmetrix matrix. |
| std::domain_error | if m is not a symmetric matrix. |
Definition at line 23 of file cholesky_decompose.hpp.
|
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.
| m | Matrix. |
| j | Column index (count from 1). |
|
inline |
|
inline |
Returns the dot product of the specified vectors.
| v1 | First vector. |
| v2 | Second vector. |
| 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.
|
inline |
Returns the dot product of each column of a matrix with itself.
| x | Matrix. |
| T | scalar type |
Definition at line 16 of file columns_dot_self.hpp.
|
inline |
Returns the result of pre-multiplying a matrix by its own transpose.
| M | Matrix to multiply. |
Definition at line 17 of file crossprod.hpp.
|
inline |
Return the cumulative sum of the specified vector.
The cumulative sum of a vector of values
| T | Scalar type of vector. |
| x | Vector of values. |
Definition at line 23 of file cumulative_sum.hpp.
|
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
| T | Scalar type of matrix. |
| R | Row type of matrix. |
| C | Column type of matrix. |
| m | Matrix of values. |
Definition at line 49 of file cumulative_sum.hpp.
|
inline |
Returns the determinant of the specified square matrix.
| m | Specified matrix. |
| std::domain_error | if matrix is not square. |
Definition at line 18 of file determinant.hpp.
|
inline |
Return a square diagonal matrix with the specified vector of coefficients as the diagonal values.
| [in] | v | Specified vector. |
Definition at line 18 of file diag_matrix.hpp.
| 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 13 of file diag_post_multiply.hpp.
| 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 13 of file diag_pre_multiply.hpp.
|
inline |
Return a column vector of the diagonal elements of the specified matrix.
The matrix is not required to be square.
| m | Specified matrix. |
Definition at line 18 of file diagonal.hpp.
| double stan::math::digamma | ( | double | x | ) |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Returns the distance between the specified vectors.
| v1 | First vector. |
| v2 | Second vector. |
| 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.
|
inline |
Definition at line 11 of file divide.hpp.
|
inline |
Return specified matrix divided by specified scalar.
| R | Row type for matrix. |
| C | Column type for matrix. |
| m | Matrix. |
| c | Scalar. |
Definition at line 23 of file divide.hpp.
|
inline |
Definition at line 36 of file dom_err.hpp.
|
inline |
Definition at line 33 of file dom_err_vec.hpp.
|
inline |
|
inline |
Returns the dot product of the specified vectors.
| v1 | First vector. |
| v2 | Second vector. |
| 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.
|
inline |
Returns the dot product of the specified arrays of doubles.
| v1 | First array. |
| v2 | Second array. |
| length | Length of both arrays. |
Definition at line 36 of file dot_product.hpp.
|
inline |
Returns the dot product of the specified arrays of doubles.
| v1 | First array. |
| v2 | Second array. |
| std::domain_error | if the vectors are not the same size. |
Definition at line 49 of file dot_product.hpp.
|
inline |
Definition at line 11 of file dot_self.hpp.
|
inline |
Returns the dot product of the specified vector with itself.
| v | Vector. |
| R | number of rows or Eigen::Dynamic for dynamic |
| C | number of rows or Eigen::Dyanmic for dynamic |
| std::domain_error | If v is not vector dimensioned. |
Definition at line 18 of file dot_self.hpp.
|
inline |
Return the base of the natural logarithm.
Definition at line 86 of file constants.hpp.
| 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.
| m | Specified matrix. |
Definition at line 22 of file eigenvalues_sym.hpp.
| 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.
| 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.
| 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. |
| m1 | First matrix |
| m2 | Second matrix |
Definition at line 24 of file elt_divide.hpp.
| 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.
| T1 | Type of scalars in the matrix. |
| T2 | Type of the scalar. |
| R | Row type of the matrix. |
| C | Column type of the matrix. |
| m | matrix |
| s | scalar |
Definition at line 49 of file elt_divide.hpp.
| 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.
| T1 | Type of the scalar. |
| T2 | Type of scalars in the matrix. |
| R | Row type of the matrix. |
| C | Column type of the matrix. |
| s | scalar |
| m | matrix |
Definition at line 67 of file elt_divide.hpp.
| 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.
| 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. |
| m1 | First matrix |
| m2 | Second matrix |
Definition at line 25 of file elt_multiply.hpp.
|
inline |
|
inline |
|
inline |
| double stan::math::F32 | ( | double | a, |
| double | b, | ||
| double | c, | ||
| double | d, | ||
| double | e, | ||
| double | z, | ||
| double | precision = 1e-6 |
||
| ) |
Definition at line 14 of file internal_math.hpp.
|
inline |
|
inline |
| void stan::math::fill | ( | T & | x, |
| const S & | y | ||
| ) |
| void stan::math::fill | ( | Eigen::Matrix< T, R, C > & | x, |
| const S & | y | ||
| ) |
| void stan::math::fill | ( | std::vector< T > & | x, |
| const S & | y | ||
| ) |
| double stan::math::gamma_p | ( | double | x, |
| double | a | ||
| ) |
| double stan::math::gamma_q | ( | double | x, |
| double | a | ||
| ) |
|
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.
| 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. |
i - 1 | T | type of value. |
Definition at line 27 of file get_base1.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 52 of file get_base1.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 79 of file get_base1.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 108 of file get_base1.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 139 of file get_base1.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 172 of file get_base1.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 208 of file get_base1.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 246 of file get_base1.hpp.
|
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.
| 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. |
i - 1. | T | type of value. |
Definition at line 284 of file get_base1.hpp.
|
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.
| 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. |
m - 1 and column n - 1. | T | type of value. |
Definition at line 310 of file get_base1.hpp.
|
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.
| 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. |
m - 1. | T | type of value. |
Definition at line 336 of file get_base1.hpp.
|
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.
| 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. |
n - 1. | T | type of value. |
Definition at line 360 of file get_base1.hpp.
|
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.
| 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. |
i - 1 | T | type of value. |
Definition at line 27 of file get_base1_lhs.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 52 of file get_base1_lhs.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 79 of file get_base1_lhs.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 108 of file get_base1_lhs.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 139 of file get_base1_lhs.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 172 of file get_base1_lhs.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 208 of file get_base1_lhs.hpp.
|
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.
| 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. |
| T | type of value. |
Definition at line 246 of file get_base1_lhs.hpp.
|
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.
| 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. |
i - 1. | T | type of value. |
Definition at line 285 of file get_base1_lhs.hpp.
|
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.
| 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. |
m - 1 and column n - 1. | T | type of value. |
Definition at line 311 of file get_base1_lhs.hpp.
|
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.
| 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. |
m - 1. | T | type of value. |
Definition at line 337 of file get_base1_lhs.hpp.
|
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.
| 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. |
n - 1. | T | type of value. |
Definition at line 362 of file get_base1_lhs.hpp.
|
inline |
Definition at line 11 of file get_lp.hpp.
| void stan::math::grad2F1 | ( | double & | gradA, |
| double & | gradC, | ||
| double | a, | ||
| double | b, | ||
| double | c, | ||
| double | z, | ||
| double | precision = 1e-6 |
||
| ) |
Definition at line 102 of file internal_math.hpp.
| void stan::math::gradF32 | ( | double * | g, |
| double | a, | ||
| double | b, | ||
| double | c, | ||
| double | d, | ||
| double | e, | ||
| double | z, | ||
| double | precision = 1e-6 |
||
| ) |
Definition at line 50 of file internal_math.hpp.
| void stan::math::gradIncBeta | ( | double & | g1, |
| double & | g2, | ||
| double | a, | ||
| double | b, | ||
| double | z | ||
| ) |
Definition at line 140 of file internal_math.hpp.
| void stan::math::gradRegIncBeta | ( | double & | g1, |
| double & | g2, | ||
| double | a, | ||
| double | b, | ||
| double | z, | ||
| double | digammaA, | ||
| double | digammaB, | ||
| double | digammaSum, | ||
| double | betaAB | ||
| ) |
Definition at line 161 of file internal_math.hpp.
| double stan::math::gradRegIncGamma | ( | double | a, |
| double | z, | ||
| double | g, | ||
| double | dig, | ||
| double | precision = 1e-6 |
||
| ) |
Definition at line 181 of file internal_math.hpp.
|
inline |
|
inline |
| std::vector<T> stan::math::head | ( | const std::vector< T > & | sv, |
| size_t | n | ||
| ) |
|
inline |
The normalized incomplete beta function of a, b, and x.
Used to compute the cumulative density function for the beta distribution.
| a | Shape parameter a <= 0; a and b can't both be 0 |
| b | Shape parameter b <= 0 |
| x | Random variate. 0 <= x <= 1 |
| if | constraints are violated or if any argument is NaN |
|
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.
| 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.
|
inline |
Definition at line 17 of file initialize.hpp.
|
inline |
Definition at line 23 of file initialize.hpp.
|
inline |
Definition at line 27 of file initialize.hpp.
|
inline |
Definition at line 32 of file initialize.hpp.
| unsigned int stan::math::int_step | ( | const T | y | ) |
The integer step, or Heaviside, function.
For double NaN input, int_step(NaN) returns 0.
| y | Value to test. |
| T | Scalar argument type. |
Definition at line 25 of file int_step.hpp.
| 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::agrad 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.
| F | type of ODE system function. |
| T1 | type of scalars for initial values. |
| T2 | type of scalars for 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. |
Definition at line 61 of file integrate_ode.hpp.
|
inline |
|
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.
| x | Argument. |
Definition at line 49 of file inv_cloglog.hpp.
|
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.
| a | Argument. |
Definition at line 52 of file inv_logit.hpp.
|
inline |
Definition at line 12 of file inv_sqrt.hpp.
|
inline |
Definition at line 12 of file inv_square.hpp.
|
inline |
Returns the inverse of the specified matrix.
| m | Specified matrix. |
Definition at line 18 of file inverse.hpp.
| 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.
| simplex | Simplex vector input. |
| y | Vector into which the inverse softmax is written. |
| std::invalid_argument | if size of the input and output vectors differ. |
Definition at line 34 of file inverse_softmax.hpp.
|
inline |
Returns the inverse of the specified symmetric, pos/neg-definite matrix.
| m | Specified matrix. |
Definition at line 19 of file inverse_spd.hpp.
|
inline |
Returns 1 if the input is infinite and 0 otherwise.
Delegates to boost::math::isinf.
| x | Value to test. |
1 if the value is infinite. Definition at line 19 of file is_inf.hpp.
|
inline |
Returns 1 if the input is NaN and 0 otherwise.
Delegates to boost::math::isnan.
| x | Value to test. |
1 if the value is NaN. Definition at line 19 of file is_nan.hpp.
|
inline |
Returns true if the specified variable is uninitialized.
Arithmetic types are always initialized by definition (the value is not specified).
| T | Type of object to test. |
| x | Object to test. |
true if the specified object is uninitialized. false if input is NaN. Definition at line 19 of file is_uninitialized.hpp.
|
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::agrad for the variable-based log Gamma function.
| a | First value |
| b | Second value |
| T1 | Type of first value. |
| T2 | Type of second value. |
| double stan::math::lgamma | ( | double | 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.
| k | Number of dimensions. |
| x | Function argument. |
| T | Type of scalar. |
Definition at line 57 of file lmgamma.hpp.
|
inline |
|
inline |
Return natural logarithm of ten.
Definition at line 105 of file constants.hpp.
|
inline |
|
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 40 of file log1m_exp.hpp.
|
inline |
Returns the natural logarithm of 1 minus the inverse logit of the specified argument.
| T | Scalar type |
| u | Input. |
Definition at line 36 of file log1m_inv_logit.hpp.
|
inline |
|
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.
|
inline |
|
inline |
|
inline |
Returns the log absolute determinant of the specified square matrix.
| m | Specified matrix. |
| std::domain_error | if matrix is not square. |
Definition at line 18 of file log_determinant.hpp.
|
inline |
Definition at line 12 of file log_determinant_ldlt.hpp.
|
inline |
Returns the log absolute determinant of the specified square matrix.
| m | Specified matrix. |
| std::domain_error | if matrix is not square. |
Definition at line 20 of file log_determinant_spd.hpp.
|
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 49 of file log_diff_exp.hpp.
|
inline |
|
inline |
Returns the natural logarithm of the inverse logit of the specified argument.
| T | Scalar type |
| u | Input. |
Definition at line 36 of file log_inv_logit.hpp.
|
inline |
|
inline |
Return the natural logarithm of the softmax of the specified vector.

For the log softmax function, the entries in the Jacobian are ![$ \frac{\partial}{\partial y_m} \mbox{softmax}(y)[k] = \left\{ \begin{array}{ll} 1 - \mbox{softmax}(y)[m] & \mbox{ if } m = k, \mbox{ and} \\[6pt] \mbox{softmax}(y)[m] & \mbox{ if } m \neq k. \end{array} \right. $](form_388.png)
| T | Scalar type of values in vector. |
| [in] | v | Vector to transform. |
Definition at line 44 of file log_softmax.hpp.
| 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.
.
| [in] | x | Matrix of specified values |
Definition at line 29 of file log_sum_exp.hpp.
|
inline |
Calculates the log sum of exponetials without overflow.
,
where
.
| a | the first variable |
| b | the second variable |
Definition at line 49 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.
.
| [in] | x | array of specified values |
Definition at line 68 of file log_sum_exp.hpp.
|
inline |
The logical and function which returns 1 if both arguments are unequal to zero and 0 otherwise.
Equivalent to x1 != 0 && x2 != 0.
| T1 | Type of first argument. |
| T2 | Type of second argument. |
| x1 | First argument |
| x2 | Second argument |
true if both x1 and x2 are not equal to 0. Definition at line 30 of file logical_and.hpp.
|
inline |
Return 1 if the first argument is equal to the second.
Equivalent to x1 == x2.
| T1 | Type of first argument. |
| T2 | Type of second argument. |
| x1 | First argument |
| x2 | Second argument |
true iff x1 == x2 Definition at line 19 of file logical_eq.hpp.
|
inline |
Return 1 if the first argument is strictly greater than the second.
Equivalent to x1 < x2.
| T1 | Type of first argument. |
| T2 | Type of second argument. |
| x1 | First argument |
| x2 | Second argument |
true iff x1 > x2 Definition at line 19 of file logical_gt.hpp.
|
inline |
Return 1 if the first argument is greater than or equal to the second.
Equivalent to x1 >= x2.
| T1 | Type of first argument. |
| T2 | Type of second argument. |
| x1 | First argument |
| x2 | Second argument |
true iff x1 >= x2 Definition at line 19 of file logical_gte.hpp.
|
inline |
Return 1 if the first argument is strictly less than the second.
Equivalent to x1 < x2.
| T1 | Type of first argument. |
| T2 | Type of second argument. |
| x1 | First argument |
| x2 | Second argument |
true iff x1 < x2 Definition at line 20 of file logical_lt.hpp.
|
inline |
Return 1 if the first argument is less than or equal to the second.
Equivalent to x1 <= x2.
| T1 | Type of first argument. |
| T2 | Type of second argument. |
| x1 | First argument |
| x2 | Second argument |
true iff x1 <= x2 Definition at line 19 of file logical_lte.hpp.
|
inline |
The logical negation function which returns 1 if the input is equal to zero and 0 otherwise.
| T | Type to compare to zero. |
| x | Value to compare to zero. |
Definition at line 17 of file logical_negation.hpp.
|
inline |
Return 1 if the first argument is unequal to the second.
Equivalent to x1 != x2.
| T1 | Type of first argument. |
| T2 | Type of second argument. |
| x1 | First argument |
| x2 | Second argument |
true iff x1 != x2 Definition at line 19 of file logical_neq.hpp.
|
inline |
The logical or function which returns 1 if either argument is unequal to zero and 0 otherwise.
Equivalent to x1 != 0 || x2 != 0.
| T1 | Type of first argument. |
| T2 | Type of second argument. |
| x1 | First argument |
| x2 | Second argument |
true if either x1 or x2 is not equal to 0. Definition at line 29 of file logical_or.hpp.
|
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.
| a | Argument. |
|
inline |
Returns the difference between 1.0 and the next value representable.
Definition at line 142 of file constants.hpp.
|
inline |
|
inline |
Returns the maximum coefficient in the specified column vector.
| x | Specified vector. |
| Type | of values being compared and returned |
| std::domain_error | If the size of the vector is zero. |
|
inline |
|
inline |
|
inline |
Returns the solution of the system Ax=b.
| A | Matrix. |
| b | Right hand side matrix or vector. |
| std::domain_error | if A is not square or the rows of b don't match the size of A. |
Definition at line 24 of file mdivide_left.hpp.
|
inline |
Returns the solution of the system Ax=b given an LDLT_factor of A.
| A | LDLT_factor |
| b | Right hand side matrix or vector. |
| std::domain_error | if rows of b don't match the size of A. |
Definition at line 24 of file mdivide_left_ldlt.hpp.
|
inline |
Returns the solution of the system Ax=b where A is symmetric positive definite.
| A | Matrix. |
| b | Right hand side matrix or vector. |
| 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_spd.hpp.
|
inline |
Returns the solution of the system Ax=b when A is triangular.
| A | Triangular matrix. Specify upper or lower with TriView being Eigen::Upper or Eigen::Lower. |
| b | Right hand side matrix or vector. |
| 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.
|
inline |
Returns the solution of the system Ax=b when A is triangular and b=I.
| A | Triangular matrix. Specify upper or lower with TriView being Eigen::Upper or Eigen::Lower. |
| std::domain_error | if A is not square |
Definition at line 48 of file mdivide_left_tri.hpp.
|
inline |
Definition at line 16 of file mdivide_left_tri_low.hpp.
|
inline |
Definition at line 31 of file mdivide_left_tri_low.hpp.
|
inline |
Returns the solution of the system Ax=b.
| A | Matrix. |
| b | Right hand side matrix or vector. |
| 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.hpp.
|
inline |
Returns the solution of the system xA=b given an LDLT_factor of A.
| A | LDLT_factor |
| b | Right hand side matrix or vector. |
| std::domain_error | if rows of b don't match the size of A. |
Definition at line 25 of file mdivide_right_ldlt.hpp.
|
inline |
Definition at line 36 of file mdivide_right_ldlt.hpp.
|
inline |
Returns the solution of the system Ax=b where A is symmetric positive definite.
| A | Matrix. |
| b | Right hand side matrix or vector. |
| 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_right_spd.hpp.
|
inline |
Returns the solution of the system Ax=b when A is triangular.
| A | Triangular matrix. Specify upper or lower with TriView being Eigen::Upper or Eigen::Lower. |
| b | Right hand side matrix or vector. |
| 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_right_tri.hpp.
|
inline |
Returns the solution of the system tri(A)x=b when tri(A) is a lower triangular view of the matrix A.
| A | Matrix. |
| b | Right hand side matrix or vector. |
| std::domain_error | if A is not square or the rows of b don't match the size of A. |
Definition at line 24 of file mdivide_right_tri_low.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
Definition at line 11 of file modulus.hpp.
|
inline |
Return specified matrix multiplied by specified scalar.
| R | Row type for matrix. |
| C | Column type for matrix. |
| m | Matrix. |
| c | Scalar. |
Definition at line 25 of file multiply.hpp.
|
inline |
Return specified scalar multiplied by specified matrix.
| R | Row type for matrix. |
| C | Column type for matrix. |
| c | Scalar. |
| m | Matrix. |
Definition at line 45 of file multiply.hpp.
|
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.
| m1 | First matrix. |
| m2 | Second matrix. |
| std::domain_error | if the number of columns of m1 does not match the number of rows of m2. |
Definition at line 61 of file multiply.hpp.
|
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.
| rv | Row vector. |
| v | Column vector. |
| std::domain_error | if rv and v are not the same size. |
Definition at line 79 of file multiply.hpp.
|
inline |
Calculated the value of the first argument times log of the second argument while behaving properly with 0 inputs.
.
| a | the first variable |
| b | the second variable |
Definition at line 51 of file multiply_log.hpp.
|
inline |
Returns the result of multiplying the lower triangular portion of the input matrix by its own transpose.
| L | Matrix to multiply. |
| std::domain_error | If the input matrix is not square. |
Definition at line 18 of file multiply_lower_tri_self_transpose.hpp.
|
inline |
|
inline |
Return (quiet) not-a-number.
Definition at line 132 of file constants.hpp.
|
inline |
Returns 1, the number of elements in a primitive type.
| x | Argument of primitive type. |
Definition at line 19 of file num_elements.hpp.
|
inline |
Returns the size of the specified matrix.
| m | argument matrix |
Definition at line 31 of file num_elements.hpp.
|
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.
| m | argument vector |
Definition at line 45 of file num_elements.hpp.
|
inline |
The Owen's T function of h and a.
Used to compute the cumulative density function for the skew normal distribution.
| T1 | Type of first argument. |
| T2 | Type of second argument. |
| h | First argument |
| a | Second argument |
Definition at line 64 of file owens_t.hpp.
|
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
| x | Argument. |
|
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.
| x | Argument. |
Definition at line 23 of file Phi_approx.hpp.
|
inline |
|
inline |
|
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.
| T | type of arithmetic input. |
| x | input. |
Definition at line 30 of file primitive_value.hpp.
|
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.
| T | type of non-arithmetic input. |
| x | input. |
Definition at line 47 of file primitive_value.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 14 of file promote_common.hpp.
| 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.
| T | scalar type of output. |
| S | input type. |
| x | input vector. |
Definition at line 103 of file promote_scalar.hpp.
| Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::math::qr_Q | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m | ) |
| Eigen::Matrix<T,Eigen::Dynamic,Eigen::Dynamic> stan::math::qr_R | ( | const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | m | ) |
|
inline |
Compute B^T A B.
Definition at line 21 of file quad_form.hpp.
|
inline |
Definition at line 33 of file quad_form.hpp.
|
inline |
Definition at line 20 of file quad_form_diag.hpp.
|
inline |
Definition at line 47 of file quad_form.hpp.
|
inline |
Definition at line 62 of file quad_form.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 14 of file rep_array.hpp.
|
inline |
Definition at line 21 of file rep_array.hpp.
|
inline |
Definition at line 30 of file rep_array.hpp.
|
inline |
Definition at line 16 of file rep_matrix.hpp.
|
inline |
Definition at line 25 of file rep_matrix.hpp.
|
inline |
Definition at line 34 of file rep_matrix.hpp.
|
inline |
Definition at line 15 of file rep_row_vector.hpp.
|
inline |
Definition at line 16 of file rep_vector.hpp.
|
inline |
Recursively resize the specified vector of vectors, which must bottom out at scalar values, Eigen vectors or Eigen matrices.
| x | Array-like object to resize. |
| dims | New dimensions. |
| T | Type of object being resized. |
Definition at line 63 of file resize.hpp.
|
inline |
|
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.
| T | Scalar value type for matrix. |
| m | Matrix. |
| i | Row index (count from 1). |
|
inline |
|
inline |
Returns the dot product of the specified vectors.
| v1 | First vector. |
| v2 | Second vector. |
| 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.
|
inline |
Returns the dot product of each row of a matrix with itself.
| x | Matrix. |
| T | scalar type |
Definition at line 16 of file rows_dot_self.hpp.
|
inline |
Definition at line 11 of file scaled_add.hpp.
|
inline |
|
inline |
|
inline |
Return the specified number of elements as a vector starting from the specified element - 1 of the specified vector.
Definition at line 20 of file segment.hpp.
|
inline |
Definition at line 34 of file segment.hpp.
| std::vector<T> stan::math::segment | ( | const std::vector< T > & | sv, |
| size_t | i, | ||
| size_t | n | ||
| ) |
Definition at line 49 of file segment.hpp.
|
inline |
| 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.
| m | Specified matrix. |
Definition at line 19 of file singular_values.hpp.
|
inline |
|
inline |
Return the softmax of the specified vector.

The entries in the Jacobian of the softmax function are given by ![$ \begin{array}{l} \displaystyle \frac{\partial}{\partial y_m} \mbox{softmax}(y)[k] \\[8pt] \displaystyle \mbox{ } \ \ \ = \left\{ \begin{array}{ll} \mbox{softmax}(y)[k] - \mbox{softmax}(y)[k] \times \mbox{softmax}(y)[m] & \mbox{ if } m = k, \mbox{ and} \\[6pt] \mbox{softmax}(y)[k] * \mbox{softmax}(y)[m] & \mbox{ if } m \neq k. \end{array} \right. \end{array} $](form_390.png)
| T | Scalar type of values in vector. |
| [in] | v | Vector to transform. |
Definition at line 46 of file softmax.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
| std::vector<int> stan::math::sort_indices_asc | ( | const C & | xs | ) |
Return a sorted copy of the argument container in ascending order.
| C | type of container |
| xs | Container to sort |
Definition at line 86 of file sort_indices.hpp.
| std::vector<int> stan::math::sort_indices_desc | ( | const C & | xs | ) |
Return a sorted copy of the argument container in ascending order.
| C | type of container |
| xs | Container to sort |
Definition at line 98 of file sort_indices.hpp.
|
inline |
Return the square root of two.
Definition at line 95 of file constants.hpp.
|
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.
| x | Input to square. |
| T | Type of scalar. |
Definition at line 22 of file square.hpp.
|
inline |
Returns the squared distance between the specified vectors.
| v1 | First vector. |
| v2 | Second vector. |
| 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.
| void stan::math::stan_print | ( | std::ostream * | o, |
| const T & | x | ||
| ) |
Definition at line 12 of file stan_print.hpp.
| void stan::math::stan_print | ( | std::ostream * | o, |
| const std::vector< T > & | x | ||
| ) |
Definition at line 17 of file stan_print.hpp.
| 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.
| void stan::math::stan_print | ( | std::ostream * | o, |
| const Eigen::Matrix< T, 1, Eigen::Dynamic > & | x | ||
| ) |
Definition at line 37 of file stan_print.hpp.
| void stan::math::stan_print | ( | std::ostream * | o, |
| const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > & | x | ||
| ) |
Definition at line 47 of file stan_print.hpp.
|
inline |
|
inline |
|
inline |
Return a nrows x 1 subcolumn starting at (i-1,j-1).
| 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.
|
inline |
Return a 1 x nrows subrow starting at (i-1,j-1).
| 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.
|
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.
| T1 | Scalar type of first matrix. |
| T2 | Scalar type of second matrix. |
| R | Row type of matrices. |
| C | Column type of matrices. |
| m1 | First matrix. |
| m2 | Second matrix. |
Definition at line 27 of file subtract.hpp.
|
inline |
Definition at line 41 of file subtract.hpp.
|
inline |
Definition at line 53 of file subtract.hpp.
|
inline |
|
inline |
|
inline |
|
inline |
| std::vector<T> stan::math::tail | ( | const std::vector< T > & | sv, |
| size_t | n | ||
| ) |
|
inline |
Returns the result of post-multiplying a matrix by its own transpose.
| M | Matrix to multiply. |
Definition at line 17 of file tcrossprod.hpp.
|
inline |
Definition at line 131 of file containers_conversion.hpp.
|
inline |
Definition at line 143 of file containers_conversion.hpp.
|
inline |
Definition at line 150 of file containers_conversion.hpp.
|
inline |
Definition at line 116 of file containers_conversion.hpp.
|
inline |
Definition at line 20 of file containers_conversion.hpp.
|
inline |
Definition at line 27 of file containers_conversion.hpp.
|
inline |
Definition at line 44 of file containers_conversion.hpp.
|
inline |
Definition at line 91 of file containers_conversion.hpp.
|
inline |
Definition at line 98 of file containers_conversion.hpp.
|
inline |
Definition at line 104 of file containers_conversion.hpp.
|
inline |
Definition at line 64 of file containers_conversion.hpp.
|
inline |
Definition at line 71 of file containers_conversion.hpp.
|
inline |
Definition at line 77 of file containers_conversion.hpp.
|
inline |
|
inline |
|
inline |
Definition at line 28 of file trace_gen_inv_quad_form_ldlt.hpp.
|
inline |
Compute trace(D B^T A B).
Definition at line 17 of file trace_gen_quad_form.hpp.
|
inline |
Definition at line 25 of file trace_inv_quad_form_ldlt.hpp.
|
inline |
Compute trace(B^T A B).
Definition at line 17 of file trace_quad_form.hpp.
|
inline |
Definition at line 12 of file transpose.hpp.
|
inline |
|
inline |
Definition at line 12 of file validate_non_negative_index.hpp.
|
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.
| T | Type of scalar. |
| x | Scalar to convert to double. |
Definition at line 24 of file value_of.hpp.
|
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.
| x | Specified value. |
Definition at line 40 of file value_of.hpp.
|
inline |
Returns the sample variance (divide by length - 1) of the coefficients in the specified standard vector.
| v | Specified vector. |
| std::domain_error | if the size of the vector is less than 1. |
Definition at line 24 of file variance.hpp.
|
inline |
Returns the sample variance (divide by length - 1) of the coefficients in the specified column vector.
| m | Specified vector. |
Definition at line 46 of file variance.hpp.
| 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 14 of file constants.hpp.
| const double stan::math::EPSILON = std::numeric_limits<double>::epsilon() |
Smallest positive value.
Definition at line 58 of file constants.hpp.
| const double stan::math::INFTY = std::numeric_limits<double>::infinity() |
Positive infinity.
Definition at line 43 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 26 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 150 of file constants.hpp.
| const double stan::math::LOG_10 = std::log(10.0) |
The natural logarithm of 10,
.
Definition at line 38 of file constants.hpp.
| const double stan::math::LOG_2 = std::log(2.0) |
The natural logarithm of 2,
.
Definition at line 32 of file constants.hpp.
| const double stan::math::LOG_PI_OVER_FOUR = std::log(boost::math::constants::pi<double>()) / 4.0 |
Definition at line 70 of file constants.hpp.
| const double stan::math::NEG_TWO_OVER_SQRT_PI = -TWO_OVER_SQRT_PI |
Definition at line 148 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 63 of file constants.hpp.
| const double stan::math::NEGATIVE_INFTY = - std::numeric_limits<double>::infinity() |
Negative infinity.
Definition at line 48 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 53 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 20 of file constants.hpp.
| const double stan::math::TWO_OVER_SQRT_PI = 2.0 / std::sqrt(boost::math::constants::pi<double>()) |
Definition at line 146 of file constants.hpp.