![]() |
Stan
1.3
probability, sampling & optimization
|
Matrices and templated mathematical functions. More...
Namespaces | |
| namespace | policies |
| Extending boost functionality. | |
Typedefs | |
| typedef boost::math::policies::policy | default_policy |
| Default error-handling policy from Boost. | |
| typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > ::size_type | size_type |
| typedef Eigen::Matrix< double, Eigen::Dynamic, Eigen::Dynamic > | matrix_d |
| Type for matrix of double values. | |
| typedef Eigen::Matrix< double, Eigen::Dynamic, 1 > | vector_d |
| Type for (column) vector of double values. | |
| typedef Eigen::Matrix< double, 1, Eigen::Dynamic > | row_vector_d |
| Type for (row) vector of double values. | |
Functions | |
| double | pi () |
| Return the value of pi. | |
| double | e () |
| Return the base of the natural logarithm. | |
| double | sqrt2 () |
| Return the square root of two. | |
| double | log10 () |
| Return natural logarithm of ten. | |
| double | positive_infinity () |
| Return positive infinity. | |
| double | negative_infinity () |
| Return negative infinity. | |
| double | not_a_number () |
| Return (quiet) not-a-number. | |
| double | epsilon () |
| Return minimum positive number representable. | |
| double | negative_epsilon () |
| Return maximum negative number (i.e., negative number with smallest absolute value). | |
| template<typename T_y , typename T_low , typename T_high , typename T_result , class Policy > | |
| bool | check_bounded (const char *function, const T_y &y, const T_low &low, const T_high &high, const char *name, T_result *result, const Policy &) |
| 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_y , typename T_low , typename T_high > | |
| bool | check_bounded (const char *function, const T_y &y, const T_low &low, const T_high &high, const char *name) |
| template<typename T , typename T_result , class Policy > | |
| bool | check_consistent_size (size_t max_size, const char *function, const T &x, const char *name, T_result *result, const Policy &) |
| template<typename T1 , typename T2 , typename T_result , class Policy > | |
| bool | check_consistent_sizes (const char *function, const T1 &x1, const T2 &x2, const char *name1, const char *name2, T_result *result, const Policy &) |
| 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 , class Policy > | |
| 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, const Policy &) |
| 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 , class Policy > | |
| 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, const Policy &) |
| 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_result , class Policy > | |
| bool | check_finite (const char *function, const T_y &y, const char *name, T_result *result, const Policy &) |
| Checks if the variable y is finite. | |
| template<typename T_y , typename T_result > | |
| bool | check_finite (const char *function, const T_y &y, const char *name, T_result *result) |
| template<typename T > | |
| bool | check_finite (const char *function, const T &y, const char *name) |
| template<typename T_y , typename T_low , typename T_result , class Policy > | |
| bool | check_greater (const char *function, const T_y &y, const T_low &low, const char *name, T_result *result, const Policy &) |
| 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 > | |
| bool | check_greater (const char *function, const T_y &y, const T_low &low, const char *name) |
| template<typename T_y , typename T_low , typename T_result , class Policy > | |
| bool | check_greater_or_equal (const char *function, const T_y &y, const T_low &low, const char *name, T_result *result, const Policy &) |
| 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_low > | |
| bool | check_greater_or_equal (const char *function, const T_y &y, const T_low &low, const char *name) |
| template<typename T_y , typename T_high , typename T_result , class Policy > | |
| bool | check_less (const char *function, const T_y &y, const T_high &high, const char *name, T_result *result, const Policy &) |
| 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 > | |
| bool | check_less (const char *function, const T_y &y, const T_high &high, const char *name) |
| template<typename T_y , typename T_high , typename T_result , class Policy > | |
| bool | check_less_or_equal (const char *function, const T_y &y, const T_high &high, const char *name, T_result *result, const Policy &) |
| 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_high > | |
| bool | check_less_or_equal (const char *function, const T_y &y, const T_high &high, const char *name) |
| template<typename T_y , typename T_result , class Policy > | |
| bool | check_nonnegative (const char *function, const T_y &y, const char *name, T_result *result, const Policy &) |
| 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 > | |
| bool | check_nonnegative (const char *function, const T_y &y, const char *name) |
| template<typename T_y , typename T_result , class Policy > | |
| bool | check_not_nan (const char *function, const T_y &y, const char *name, T_result *result, const Policy &) |
| Checks if the variable y is nan. | |
| template<typename T_y , typename T_result > | |
| bool | check_not_nan (const char *function, const T_y &y, const char *name, T_result *result=0) |
| Checks if the variable y is nan. | |
| template<typename T > | |
| bool | check_not_nan (const char *function, const T &y, const char *name) |
| template<typename T_y , typename T_result , class Policy > | |
| bool | check_positive (const char *function, const T_y &y, const char *name, T_result *result, const Policy &) |
| template<typename T_x , typename T_result > | |
| bool | check_positive (const char *function, const T_x &x, const char *name, T_result *result) |
| template<typename T > | |
| bool | check_positive (const char *function, const T &x, const char *name) |
| template<typename T_y , typename T_result , typename T_msg2 , class Policy > | |
| bool | dom_err (const char *function, const T_y &y, const char *name, const char *error_msg, T_msg2 error_msg2, T_result *result, const Policy &) |
| template<typename T_y , typename T_result , typename T_msg2 , class Policy > | |
| bool | dom_err_vec (size_t i, const char *function, const T_y &y, const char *name, const char *error_msg, T_msg2 error_msg2, T_result *result, const Policy &) |
| template<typename T_y , typename T_result , class Policy > | |
| bool | check_corr_matrix (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result, const Policy &) |
Return true if the specified matrix is a valid correlation matrix. | |
| 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) |
| template<typename T > | |
| bool | check_corr_matrix (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 , class Policy > | |
| bool | check_cov_matrix (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result, const Policy &) |
Return true if the specified matrix is a valid covariance matrix. | |
| 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) |
| template<typename T > | |
| bool | check_cov_matrix (const char *function, const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T *result=0) |
| template<typename T_covar , typename T_result , class Policy > | |
| bool | check_cov_matrix (const char *function, const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &Sigma, T_result *result, const Policy &) |
Return true if the specified matrix is a valid covariance matrix. | |
| template<typename T_covar , typename T_result > | |
| bool | check_cov_matrix (const char *function, const Eigen::Matrix< T_covar, Eigen::Dynamic, Eigen::Dynamic > &Sigma, T_result *result) |
| template<typename T > | |
| bool | check_cov_matrix (const char *function, const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &Sigma, T *result=0) |
| template<typename T_y , typename T_result , class Policy > | |
| bool | check_ordered (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > &y, const char *name, T_result *result, const Policy &) |
Return true if the specified vector is sorted into increasing order. | |
| 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) |
| 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_y , typename T_result , class Policy > | |
| bool | check_pos_definite (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result, const Policy &) |
Return true if the specified matrix is positive definite. | |
| 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) |
| template<typename T > | |
| bool | check_pos_definite (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 , class Policy > | |
| bool | check_positive_ordered (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > &y, const char *name, T_result *result, const Policy &) |
Return true if the specified vector contains only non-negative values and is sorted into increasing order. | |
| 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) |
| template<typename T > | |
| bool | check_positive_ordered (const char *function, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &y, const char *name, T *result=0) |
| template<typename T_prob , typename T_result , class Policy > | |
| bool | check_simplex (const char *function, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta, const char *name, T_result *result, const Policy &) |
Return true if the specified vector is simplex. | |
| template<typename T_y , typename T_result > | |
| bool | check_simplex (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > &theta, const char *name, T_result *result) |
| template<typename T > | |
| bool | check_simplex (const char *function, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &theta, const char *name, T *result=0) |
| template<typename T_size1 , typename T_size2 , typename T_result , class Policy > | |
| bool | check_size_match (const char *function, T_size1 i, const char *name_i, T_size2 j, const char *name_j, T_result *result, const Policy &) |
| 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_size1 , typename T_size2 > | |
| bool | check_size_match (const char *function, T_size1 i, const char *name_i, T_size2 j, const char *name_j, T_size1 *result=0) |
| template<typename T_y , typename T_result , class Policy > | |
| bool | check_symmetric (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T_result *result, const Policy &) |
Return true if the specified matrix is symmetric. | |
| 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) |
| template<typename T > | |
| bool | check_symmetric (const char *function, const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &y, const char *name, T *result=0) |
| template<typename T_prob , typename T_result , class Policy > | |
| bool | check_unit_vector (const char *function, const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > &theta, const char *name, T_result *result, const Policy &) |
Return true if the specified vector is unit vector. | |
| template<typename T_y , typename T_result > | |
| bool | check_unit_vector (const char *function, const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > &theta, const char *name, T_result *result) |
| template<typename T > | |
| bool | check_unit_vector (const char *function, const Eigen::Matrix< T, Eigen::Dynamic, 1 > &theta, const char *name, T *result=0) |
| void | validate_non_negative_index (const std::string &var_name, const std::string &expr, int val) |
| template<typename T > | |
| int | as_bool (const T x) |
| Return 1 if the argument is unequal to zero and 0 otherwise. | |
| template<> | |
| int | as_bool< int > (const int x) |
| Return an integer with an equivalent boolean value to specified input. | |
| 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. | |
| 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. | |
| double | dist (const std::vector< double > &x, const std::vector< double > &y) |
| double | dot (const std::vector< double > &x, const std::vector< double > &y) |
| double | dot_self (const std::vector< double > &x) |
| template<typename T > | |
| boost::math::tools::promote_args < T >::type | exp2 (const T y) |
| Return the exponent base 2 of the specified argument (C99). | |
| template<typename T1 , typename T2 > | |
| boost::math::tools::promote_args < T1, T2 >::type | fdim (T1 a, T2 b) |
| The positive difference function (C99). | |
| template<typename T1 , typename T2 , typename T3 > | |
| boost::math::tools::promote_args < T1, T2, T3 >::type | fma (const T1 a, const T2 b, const T3 c) |
| The fused multiply-add operation (C99). | |
| double | ibeta (const double a, const double b, const double x) |
| The normalized incomplete beta function of a, b, and x. | |
| 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. | |
| template<typename T > | |
| unsigned int | int_step (const T y) |
| The integer step, or Heaviside, function. | |
| template<typename T > | |
| boost::math::tools::promote_args < T >::type | inv_cloglog (T x) |
| The inverse complementary log-log function. | |
| template<typename T > | |
| boost::math::tools::promote_args < T >::type | inv_logit (const T a) |
| Returns the inverse logit function applied to the argument. | |
| template<typename Vector > | |
| void | inverse_softmax (const Vector &simplex, Vector &y) |
| Writes the inverse softmax of the simplex argument into the second argument. | |
| 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. | |
| double | lgamma (double x) |
| template<typename T > | |
| boost::math::tools::promote_args < T >::type | lmgamma (unsigned int k, T x) |
| Return the natural logarithm of the multivariate gamma function with the speciifed dimensions and argument. | |
| template<typename T > | |
| boost::math::tools::promote_args < T >::type | log1m (T x) |
| Return the natural logarithm of one minus the specified value. | |
| 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. | |
| template<typename T > | |
| boost::math::tools::promote_args < T >::type | log1p (const T x) |
| Return the natural logarithm of one plus the specified value. | |
| 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. | |
| template<typename T > | |
| boost::math::tools::promote_args < T >::type | log2 (const T a) |
| Returns the base 2 logarithm of the argument (C99). | |
| double | log2 () |
| Return natural logarithm of two. | |
| 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. | |
| 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. | |
| template<typename T > | |
| T | log_sum_exp (const std::vector< T > &x) |
| Return the log of the sum of the exponentiated values of the specified sequence of values. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| template<typename T1 , typename T2 > | |
| int | logical_lt (T1 x1, T2 x2) |
| Return 1 if the first argument is strictly less than the second. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| template<typename T > | |
| boost::math::tools::promote_args < T >::type | logit (const T a) |
| Returns the logit function applied to the argument. | |
| double | max (const double a, const double b) |
| double | min (const double a, const double b) |
| 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. | |
| 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. | |
| template<typename T > | |
| boost::math::tools::promote_args < T >::type | Phi (const T x) |
| The unit normal cumulative distribution function. | |
| template<typename T > | |
| boost::math::tools::promote_args < T >::type | Phi_approx (T x) |
| Approximation of the unit normal CDF. | |
| void | scaled_add (std::vector< double > &x, const std::vector< double > &y, const double lambda) |
| template<typename Vector , typename Scalar > | |
| void | softmax (const Vector &x, Vector &simplex) |
| Write the values of the softmax transformed first argument into the second argument. | |
| template<typename T > | |
| T | square (const T x) |
| Return the square of the specified argument. | |
| template<typename T > | |
| int | step (const T y) |
| The step, or Heaviside, function. | |
| void | sub (std::vector< double > &x, std::vector< double > &y, std::vector< double > &result) |
| double | sum (std::vector< double > &x) |
| template<typename T > | |
| double | value_of (const T x) |
| Return the value of the specified scalar argument converted to a double value. | |
| template<> | |
| double | value_of< double > (const double x) |
| Return the specified argument. | |
| 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. | |
| 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. | |
| 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. | |
| 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,j). | |
| void | check_range (size_t max, size_t i, const char *msg, size_t idx) |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| matrix_d | crossprod (const matrix_d &M) |
| Returns the result of pre-multiplying a matrix by its own transpose. | |
| template<typename T , int R, int C> | |
| T | determinant (const Eigen::Matrix< T, R, C > &m) |
| Returns the determinant of the specified square matrix. | |
| 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. | |
| 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. | |
| 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<int R1, int C1, int R2, int C2> | |
| double | dist (const Eigen::Matrix< double, R1, C1 > &v1, const Eigen::Matrix< double, R2, C2 > &v2) |
| Returns the distance between the specified vectors. | |
| template<int R1, int C1, int R2, int C2> | |
| double | squared_dist (const Eigen::Matrix< double, R1, C1 > &v1, const Eigen::Matrix< double, R2, C2 > &v2) |
| Returns the squared distance between the specified vectors. | |
| template<int R, int C> | |
| Eigen::Matrix< double, R, C > | divide (const Eigen::Matrix< double, R, C > &m, double c) |
| Return specified matrix divided by specified scalar. | |
| 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. | |
| double | dot_product (const double *v1, const double *v2, size_t length) |
| Returns the dot product of the specified arrays of doubles. | |
| double | dot_product (const std::vector< double > &v1, const std::vector< double > &v2) |
| Returns the dot product of the specified arrays of doubles. | |
| 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. | |
| 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. | |
| 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 matrices. | |
| 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. | |
| 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. | |
| template<typename T > | |
| T & | get_base1 (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. | |
| template<typename T > | |
| T & | get_base1 (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. | |
| template<typename T > | |
| T & | get_base1 (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. | |
| template<typename T > | |
| T & | get_base1 (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. | |
| template<typename T > | |
| T & | get_base1 (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. | |
| template<typename T > | |
| T & | get_base1 (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. | |
| template<typename T > | |
| T & | get_base1 (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. | |
| template<typename T > | |
| T & | get_base1 (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. | |
| template<typename T > | |
| Eigen::Matrix< T, 1, Eigen::Dynamic > | get_base1 (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. | |
| template<typename T > | |
| T & | get_base1 (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. | |
| template<typename T > | |
| T & | get_base1 (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. | |
| template<typename T > | |
| T & | get_base1 (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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| int | max (const std::vector< int > &x) |
| Returns the maximum coefficient in the specified column vector. | |
| template<typename T > | |
| T | max (const std::vector< T > &x) |
| Returns the maximum coefficient in the specified column vector. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| int | min (const std::vector< int > &x) |
| Returns the minimum coefficient in the specified column vector. | |
| template<typename T > | |
| T | min (const std::vector< T > &x) |
| Returns the minimum coefficient in the specified column vector. | |
| 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. | |
| template<typename T > | |
| T | minus (const T &x) |
| Returns the negation of the specified scalar or matrix. | |
| template<int R, int C> | |
| Eigen::Matrix< double, R, C > | multiply (const Eigen::Matrix< double, R, C > &m, double c) |
| Return specified matrix multiplied by specified scalar. | |
| template<int R, int C> | |
| Eigen::Matrix< double, R, C > | multiply (double c, const Eigen::Matrix< double, R, C > &m) |
| Return specified scalar multiplied by specified matrix. | |
| 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. | |
| 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. | |
| 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. | |
| template<typename T > | |
| T | prod (const std::vector< T > &v) |
| Returns the product of the coefficients of the specified standard vector. | |
| 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. | |
| template<typename T1 , typename T2 , typename F > | |
| common_type< T1, T2 >::type | promote_common (const F &u) |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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. | |
| 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 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. | |
| 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. | |
| 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. | |
| matrix_d | tcrossprod (const matrix_d &M) |
| Returns the result of post-multiplying a matrix by its own transpose. | |
| template<typename T > | |
| T | trace (const Eigen::Matrix< T, Eigen::Dynamic, Eigen::Dynamic > &m) |
| Returns the trace of the specified matrix. | |
| template<typename T , int R, int C> | |
| Eigen::Matrix< T, C, R > | transpose (const Eigen::Matrix< T, R, C > &m) |
| template<typename T , int R, int C> | |
| void | validate_column_index (const Eigen::Matrix< T, R, C > &m, size_t j, const char *msg) |
| template<typename T1 , typename T2 > | |
| void | validate_greater (const T1 &x, const T2 &y, const char *x_name, const char *y_name, const char *fun_name) |
| template<typename T1 , typename T2 > | |
| void | validate_greater_or_equal (const T1 &x, const T2 &y, const char *x_name, const char *y_name, const char *fun_name) |
| template<typename T1 , typename T2 > | |
| void | validate_less (const T1 &x, const T2 &y, const char *x_name, const char *y_name, const char *fun_name) |
| template<typename T1 , typename T2 > | |
| void | validate_less_or_equal (const T1 &x, const T2 &y, const char *x_name, const char *y_name, const char *fun_name) |
| template<typename T1 , int R1, int C1, typename T2 , int R2, int C2> | |
| void | validate_matching_dims (const Eigen::Matrix< T1, R1, C1 > &x1, const Eigen::Matrix< T2, R2, C2 > &x2, const char *msg) |
| template<typename T1 , typename T2 > | |
| void | validate_matching_sizes (const std::vector< T1 > &x1, const std::vector< T2 > &x2, const char *msg) |
| template<typename T1 , int R1, int C1, typename T2 , int R2, int C2> | |
| void | validate_matching_sizes (const Eigen::Matrix< T1, R1, C1 > &x1, const Eigen::Matrix< T2, R2, C2 > &x2, const char *msg) |
| template<typename Derived , typename T2 , int R2, int C2> | |
| void | validate_matching_sizes (const Eigen::Block< Derived > &x1, const Eigen::Matrix< T2, R2, C2 > &x2, const char *msg) |
| template<typename T1 , int R1, int C1, typename Derived > | |
| void | validate_matching_sizes (const Eigen::Matrix< T1, R1, C1 > &x1, const Eigen::Block< Derived > &x2, const char *msg) |
| template<typename Derived1 , typename Derived2 > | |
| void | validate_matching_sizes (const Eigen::Block< Derived1 > &x1, const Eigen::Block< Derived2 > &x2, const char *msg) |
| template<typename T1 , int R1, int C1, typename T2 , int R2, int C2> | |
| void | validate_multiplicable (const Eigen::Matrix< T1, R1, C1 > &x1, const Eigen::Matrix< T2, R2, C2 > &x2, const char *msg) |
| template<typename T > | |
| void | validate_nonzero_size (const T &x, const char *msg) |
| template<typename T , int R, int C> | |
| void | validate_row_index (const Eigen::Matrix< T, R, C > &m, size_t i, const char *msg) |
| template<typename T , int R, int C> | |
| void | validate_square (const Eigen::Matrix< T, R, C > &x, const char *msg) |
| template<typename T , int R, int C> | |
| void | validate_symmetric (const Eigen::Matrix< T, R, C > &x, const char *msg) |
| template<typename T , int R, int C> | |
| void | validate_vector (const Eigen::Matrix< T, R, C > &x, const char *msg) |
| 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. | |
| 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. | |
| void | validate_non_negative_rep (int n, const std::string &fun) |
| 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< T, 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< T, 1, Eigen::Dynamic > | rep_row_vector (const T &x, int m) |
| template<typename T > | |
| Eigen::Matrix< T, 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, . | |
| const double | SQRT_2 = std::sqrt(2.0) |
The value of the square root of 2, . | |
| const double | INV_SQRT_2 = 1.0 / SQRT_2 |
The value of 1 over the square root of 2, . | |
| const double | LOG_2 = std::log(2.0) |
The natural logarithm of 2, . | |
| const double | LOG_10 = std::log(10.0) |
The natural logarithm of 10, . | |
| const double | INFTY = std::numeric_limits<double>::infinity() |
| Positive infinity. | |
| const double | NEGATIVE_INFTY = - std::numeric_limits<double>::infinity() |
| Negative infinity. | |
| const double | NOT_A_NUMBER = std::numeric_limits<double>::quiet_NaN() |
| (Quiet) not-a-number value. | |
| const double | EPSILON = std::numeric_limits<double>::epsilon() |
| Smallest positive value. | |
| const double | NEGATIVE_EPSILON = - std::numeric_limits<double>::epsilon() |
| Largest negative value (i.e., smallest absolute value). | |
| 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. | |
Matrices and templated mathematical functions.
| typedef boost::math::policies::policy stan::math::default_policy |
Default error-handling policy from Boost.
Definition at line 12 of file default_policy.hpp.
| typedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic> stan::math::matrix_d |
Type for matrix of double values.
Definition at line 16 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 30 of file typedefs.hpp.
| typedef Eigen::Matrix<double,Eigen::Dynamic,Eigen::Dynamic>::size_type stan::math::size_type |
Definition at line 9 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 23 of file typedefs.hpp.
|
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 |
|
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 |
Return an integer with an equivalent boolean value to specified input.
For integers, this reduces to the identity function.
| x | value. |
Definition at line 26 of file as_bool.hpp.
|
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 31 of file binomial_coefficient_log.hpp.
|
inline |
|
inline |
Definition at line 73 of file check_bounded.hpp.
|
inline |
Definition at line 85 of file check_bounded.hpp.
|
inline |
Definition at line 94 of file check_bounded.hpp.
|
inline |
Definition at line 11 of file check_consistent_size.hpp.
|
inline |
Definition at line 14 of file check_consistent_sizes.hpp.
|
inline |
Definition at line 27 of file check_consistent_sizes.hpp.
|
inline |
Definition at line 39 of file check_consistent_sizes.hpp.
|
inline |
Definition at line 55 of file check_consistent_sizes.hpp.
|
inline |
Definition at line 69 of file check_consistent_sizes.hpp.
|
inline |
Definition at line 89 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 33 of file check_corr_matrix.hpp.
|
inline |
Definition at line 69 of file check_corr_matrix.hpp.
|
inline |
Definition at line 77 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 31 of file check_cov_matrix.hpp.
|
inline |
Definition at line 51 of file check_cov_matrix.hpp.
|
inline |
Definition at line 59 of file check_cov_matrix.hpp.
|
inline |
Return true if the specified matrix is a valid covariance matrix.
A valid covariance matrix must be symmetric and positive definite.
| function | |
| Sigma | Matrix to test. |
| result |
true if the matrix is a valid covariance matrix. | T | Type of scalar. |
Definition at line 81 of file check_cov_matrix.hpp.
|
inline |
Definition at line 97 of file check_cov_matrix.hpp.
|
inline |
Definition at line 104 of file check_cov_matrix.hpp.
|
inline |
Checks if the variable y is finite.
Definition at line 54 of file check_finite.hpp.
|
inline |
Definition at line 65 of file check_finite.hpp.
|
inline |
Definition at line 73 of file check_finite.hpp.
|
inline |
Definition at line 61 of file check_greater.hpp.
|
inline |
Definition at line 71 of file check_greater.hpp.
|
inline |
Definition at line 79 of file check_greater.hpp.
|
inline |
Definition at line 61 of file check_greater_or_equal.hpp.
|
inline |
Definition at line 70 of file check_greater_or_equal.hpp.
|
inline |
Definition at line 79 of file check_greater_or_equal.hpp.
|
inline |
Definition at line 60 of file check_less.hpp.
|
inline |
Definition at line 70 of file check_less.hpp.
|
inline |
Definition at line 78 of file check_less.hpp.
|
inline |
Definition at line 60 of file check_less_or_equal.hpp.
|
inline |
Definition at line 71 of file check_less_or_equal.hpp.
|
inline |
Definition at line 79 of file check_less_or_equal.hpp.
|
inline |
Definition at line 54 of file check_nonnegative.hpp.
|
inline |
Definition at line 64 of file check_nonnegative.hpp.
|
inline |
Definition at line 71 of file check_nonnegative.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. |
| Policy | Error handling policy. |
Definition at line 65 of file check_not_nan.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. |
| Policy | Error handling policy. |
Definition at line 88 of file check_not_nan.hpp.
|
inline |
Definition at line 97 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, | ||
| const Policy & | |||
| ) |
Return true if the specified vector is sorted into increasing order.
There may be duplicate values. Otherwise, raise a domain error according to the specified policy.
| function | |
| y | Vector to test. |
| name | |
| result |
| Policy | Only the policy's type matters. |
true if the vector has positive, ordered values. Definition at line 27 of file check_ordered.hpp.
| bool stan::math::check_ordered | ( | const char * | function, |
| const Eigen::Matrix< T_y, Eigen::Dynamic, 1 > & | y, | ||
| const char * | name, | ||
| T_result * | result | ||
| ) |
Definition at line 56 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 63 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 27 of file check_pos_definite.hpp.
|
inline |
Definition at line 66 of file check_pos_definite.hpp.
|
inline |
Definition at line 75 of file check_pos_definite.hpp.
|
inline |
Definition at line 56 of file check_positive.hpp.
|
inline |
Definition at line 66 of file check_positive.hpp.
|
inline |
Definition at line 73 of file check_positive.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, | ||
| const Policy & | |||
| ) |
Return true if the specified vector contains only non-negative values and is sorted into increasing order.
There may be duplicate values. Otherwise, raise a domain error according to the specified policy.
| function | |
| y | Vector to test. |
| name | |
| result |
| Policy | Only the policy's type matters. |
true if the vector has positive, ordered values. Definition at line 27 of file check_positive_ordered.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 | ||
| ) |
Definition at line 68 of file check_positive_ordered.hpp.
| bool stan::math::check_positive_ordered | ( | const char * | function, |
| const Eigen::Matrix< T, Eigen::Dynamic, 1 > & | y, | ||
| const char * | name, | ||
| T * | result = 0 |
||
| ) |
Definition at line 75 of file check_positive_ordered.hpp.
|
inline |
Definition at line 30 of file check_range.hpp.
| bool stan::math::check_simplex | ( | const char * | function, |
| const Eigen::Matrix< T_prob, Eigen::Dynamic, 1 > & | theta, | ||
| const char * | name, | ||
| T_result * | result, | ||
| const Policy & | |||
| ) |
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 30 of file check_simplex.hpp.
|
inline |
Definition at line 83 of file check_simplex.hpp.
|
inline |
Definition at line 90 of file check_simplex.hpp.
|
inline |
Definition at line 15 of file check_size_match.hpp.
|
inline |
Definition at line 39 of file check_size_match.hpp.
|
inline |
Definition at line 50 of file check_size_match.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 27 of file check_symmetric.hpp.
|
inline |
Definition at line 61 of file check_symmetric.hpp.
|
inline |
Definition at line 69 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, | ||
| const Policy & | |||
| ) |
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 28 of file check_unit_vector.hpp.
|
inline |
Definition at line 64 of file check_unit_vector.hpp.
|
inline |
Definition at line 71 of file check_unit_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 22 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 |
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.
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
inline |
|
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 20 of file divide.hpp.
|
inline |
Definition at line 25 of file dom_err.hpp.
|
inline |
Definition at line 15 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 35 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 48 of file dot_product.hpp.
|
inline |
Definition at line 10 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 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_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 |
Return minimum positive number representable.
Definition at line 141 of file constants.hpp.
|
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 13 of file internal_math.hpp.
|
inline |
|
inline |
|
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 285 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 311 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 337 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 362 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.
| void stan::math::grad2F1 | ( | double & | gradA, |
| double & | gradC, | ||
| double | a, | ||
| double | b, | ||
| double | c, | ||
| double | z, | ||
| double | precision = 1e-6 |
||
| ) |
Definition at line 101 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 49 of file internal_math.hpp.
| void stan::math::gradIncBeta | ( | double & | g1, |
| double & | g2, | ||
| double | a, | ||
| double | b, | ||
| double | z | ||
| ) |
Definition at line 139 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 160 of file internal_math.hpp.
| double stan::math::gradRegIncGamma | ( | double | a, |
| double | z, | ||
| double | g, | ||
| double | dig, | ||
| double | precision = 1e-6 |
||
| ) |
Definition at line 177 of file internal_math.hpp.
|
inline |
|
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.
| unsigned int stan::math::int_step | ( | const T | y | ) |
The integer step, or Heaviside, function.
| y | Value to test. |
| T | Scalar argument type. |
Definition at line 14 of file int_step.hpp.
|
inline |
The inverse complementary log-log function.
The function is defined by
inv_cloglog(x) = -exp(-exp(x)).
This function can be used to implement the inverse link function for complementary-log-log regression.
| x | Argument. |
Definition at line 24 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 27 of file inv_logit.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 |
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 | ) |
Definition at line 11 of file lgamma.hpp.
|
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 30 of file lmgamma.hpp.
|
inline |
|
inline |
Return natural logarithm of ten.
Definition at line 105 of file constants.hpp.
|
inline |
|
inline |
Returns the natural logarithm of 1 minus the inverse logit of the specified argument.
| T | Scalar type |
| u | Input. |
Definition at line 19 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:
log_1p_exp(x)
= log1p(exp(a))
= log(1 + exp(x))
= log_sum_exp(0,x).
Definition at line 26 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 |
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 |
Returns the natural logarithm of the inverse logit of the specified argument.
| T | Scalar type |
| u | Input. |
Definition at line 19 of file log_inv_logit.hpp.
|
inline |
Calculates the log sum of exponetials without overflow.
,
where
.
| a | the first variable |
| b | the second variable |
Definition at line 24 of file log_sum_exp.hpp.
| T stan::math::log_sum_exp | ( | const std::vector< T > & | 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.
.
| x | array of specified values |
Definition at line 43 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 21 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 20 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 |
|
inline |
Returns the maximum coefficient in the specified column vector.
| v | 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 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 25 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 47 of file mdivide_left_tri.hpp.
|
inline |
Definition at line 15 of file mdivide_left_tri_low.hpp.
|
inline |
Definition at line 29 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 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 26 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 |
Return specified matrix multiplied by specified scalar.
| R | Row type for matrix. |
| C | Column type for matrix. |
| m | Matrix. |
| c | Scalar. |
Definition at line 23 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 38 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 55 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 72 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 23 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 |
Return maximum negative number (i.e., negative number with smallest absolute value).
Definition at line 151 of file constants.hpp.
|
inline |
|
inline |
Return (quiet) not-a-number.
Definition at line 132 of file constants.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 25 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.
| 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 |
|
inline |
|
inline |
Definition at line 14 of file promote_common.hpp.
|
inline |
Definition at line 24 of file rep_array.hpp.
|
inline |
Definition at line 31 of file rep_array.hpp.
|
inline |
Definition at line 40 of file rep_array.hpp.
|
inline |
Definition at line 17 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 16 of file rep_row_vector.hpp.
|
inline |
Definition at line 17 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 |
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 |
Definition at line 10 of file scaled_add.hpp.
|
inline |
|
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.
| T | Scalar type of values in vector. |
| [in] | v | Vector to transform. |
Definition at line 18 of file softmax.hpp.
| void stan::math::softmax | ( | const Vector & | x, |
| Vector & | simplex | ||
| ) |
Write the values of the softmax transformed first argument into the second argument.
Values in the first argument are unbounded and values in the output form a simplex.
The softmax transformed generalizes the inverse logistic function by transforming a vector
of length
as
.
By construction, the result is a simplex, which means the values are all non-negative and sum to 1.0,
.
The type Vector is for a vector with values of type Scalar. Vectors x must support x.size() and return assignable references of type Scalar through x[int]. Variables a of type Scalar need to support division (in context x[i] /= a) and exponentiation (exp(a)). Conforming examples include
Vector = std::vector<double> and Scalar = double,
Vector = std::vector<stan::agrad::var> and Scalar = stan::agrad::var,
Vector = Eigen::Matrix<double,Eigen::Dynamic,1><double> and Scalar = double,
and so on.
The function stan::math::inverse_softmax provides an inverse of this operation up to an additive constant. Specifically, if x is a simplex argument, then
softmax(inv_softmax(x)) = x.
If y is an arbitrary vector, then we only have identification up to an additive constant c, as in
inv_softmax(softmax(y)) = y + c * I.
| x | Input vector of unbounded parameters. |
| simplex | Output vector of simplex values. |
| std::invalid_argument | if size of the input and output vectors differ. |
Definition at line 75 of file softmax.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 |
| 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 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 40 of file subtract.hpp.
|
inline |
Definition at line 52 of file subtract.hpp.
|
inline |
|
inline |
|
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 |
|
inline |
Definition at line 12 of file transpose.hpp.
| void stan::math::validate_column_index | ( | const Eigen::Matrix< T, R, C > & | m, |
| size_t | j, | ||
| const char * | msg | ||
| ) |
Definition at line 12 of file validate_column_index.hpp.
|
inline |
Definition at line 12 of file validate_greater.hpp.
|
inline |
Definition at line 12 of file validate_greater_or_equal.hpp.
|
inline |
Definition at line 12 of file validate_less.hpp.
|
inline |
Definition at line 12 of file validate_less_or_equal.hpp.
|
inline |
Definition at line 12 of file validate_matching_dims.hpp.
|
inline |
Definition at line 13 of file validate_matching_sizes.hpp.
|
inline |
Definition at line 26 of file validate_matching_sizes.hpp.
|
inline |
Definition at line 41 of file validate_matching_sizes.hpp.
|
inline |
Definition at line 56 of file validate_matching_sizes.hpp.
|
inline |
Definition at line 71 of file validate_matching_sizes.hpp.
|
inline |
Definition at line 12 of file validate_multiplicable.hpp.
|
inline |
Definition at line 12 of file validate_non_negative_index.hpp.
|
inline |
Definition at line 13 of file rep_array.hpp.
|
inline |
Definition at line 11 of file validate_nonzero_size.hpp.
| void stan::math::validate_row_index | ( | const Eigen::Matrix< T, R, C > & | m, |
| size_t | i, | ||
| const char * | msg | ||
| ) |
Definition at line 13 of file validate_row_index.hpp.
| void stan::math::validate_square | ( | const Eigen::Matrix< T, R, C > & | x, |
| const char * | msg | ||
| ) |
Definition at line 12 of file validate_square.hpp.
| void stan::math::validate_symmetric | ( | const Eigen::Matrix< T, R, C > & | x, |
| const char * | msg | ||
| ) |
Definition at line 13 of file validate_symmetric.hpp.
|
inline |
Definition at line 12 of file validate_vector.hpp.
|
inline |
Return the value of the specified scalar argument converted to a double value.
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 20 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 36 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 23 of file variance.hpp.
|
inline |
Returns the sample variance (divide by length - 1) of the coefficients in the specified column vector.
| v | Specified vector. |
Definition at line 45 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 159 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 157 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 155 of file constants.hpp.