Loading [MathJax]/extensions/TeX/AMSsymbols.js
Automatic Differentiation
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Loading...
Searching...
No Matches
OpenCL

Detailed Description

Stan's OpenCL backend allows for computation to be executed in parallel on a GPU or in multithreaded CPUs.

It is meant to easily conform with Eigen such that you can create and read from a matrix_cl by doing

Eigen::MatrixXd A_eig = Eigen::MatrixXd::Random(10, 10);
matrix_cl<double> A(A_eig);
matrix_cl<double> B = to_matrix_cl(A_eig);
matrix_cl<double> C = cholesky_decompose(A * B);
// Read back to eigen matrix.
Eigen::MatrixXd C_eig = from_matrix_cl(C);
// Also for vectors and raw pointers of pointers
std::vector<var> A_vec(10, 0);
matrix_cl<var> B_var(A_vec, 10, 1);
vari** A_vari= // fill
matrix_cl<var> B_vari(A_vari, 10, 1);

Execution is performed in async and Kernel operations are compounded and compiled Just In Time. This allows for a low amount of overhead when passing data to and from the device and executing computations.

For more details see the paper on Arvix. https://arxiv.org/pdf/1907.01063.pdf

Modules

 OpenCL Kernel Generator
 The OpenCL kernel generator is used to combine multiple matrix operations into a single OpenCL kernel.
 
 Matrix
 The matrix_cl class - allocates memory space on the OpenCL device.
 
 OpenCL Context
 Initialization for OpenCL Context:
 
 Error Checks
 
 Kernel Executor
 The kernel executor allows OpenCL kernels to be executed in async.
 
 Custom OpenCL kernels
 
 OpenCL overloads of stan/math/prim functions
 

Functions

template<typename T , typename = require_floating_point_t<T>>
void stan::math::opencl::cholesky_decompose (matrix_cl< T > &A)
 Performs an in-place computation of the lower-triangular Cholesky factor (i.e., matrix square root) of the specified square, symmetric matrix.
 
template<typename T , require_st_arithmetic< T > * = nullptr>
matrix_cl< scalar_type_t< T > > stan::math::to_matrix_cl (T &&src)
 Copies the source Eigen matrix, std::vector or scalar to the destination matrix that is stored on the OpenCL device.
 
template<typename T_ret , typename T , require_eigen_t< T_ret > * = nullptr, require_matrix_cl_t< T > * = nullptr, require_st_same< T_ret, T > * = nullptr>
auto stan::math::from_matrix_cl (const T &src)
 Copies the source matrix that is stored on the OpenCL device to the destination Eigen matrix.
 
template<typename T_ret , typename T , require_all_kernel_expressions_t< T > * = nullptr, require_not_matrix_cl_t< T > * = nullptr>
auto stan::math::from_matrix_cl (const T &src)
 Copies result of a kernel generator expression to the specified destination type.
 
template<typename T_dst , typename T , require_arithmetic_t< T > * = nullptr, require_same_t< T_dst, T > * = nullptr>
T_dst stan::math::from_matrix_cl (const matrix_cl< T > &src)
 Copy A 1 by 1 source matrix from the Device to the host.
 
template<typename T , require_all_kernel_expressions_t< T > * = nullptr>
auto stan::math::from_matrix_cl (const T &src)
 Copies the source kernel generator expression or matrix that is stored on the OpenCL device to the destination Eigen matrix.
 
template<typename T , require_matrix_cl_t< T > * = nullptr>
auto stan::math::packed_copy (const T &src)
 Packs the square flat triangular matrix on the OpenCL device and copies it to the std::vector.
 
template<matrix_cl_view matrix_view, typename Vec , typename Vec_scalar = scalar_type_t<Vec>, require_vector_vt< std::is_arithmetic, Vec > * = nullptr>
matrix_cl< Vec_scalar > stan::math::packed_copy (Vec &&src, int rows)
 Copies the packed triangular matrix from the source std::vector to an OpenCL buffer and unpacks it to a flat matrix on the OpenCL device.
 
template<typename T , require_matrix_cl_t< T > * = nullptr>
plain_type_t< T > stan::math::copy_cl (const T &src)
 Copies the source matrix to the destination matrix.
 
const matrix_cl_view stan::math::either (const matrix_cl_view left_view, const matrix_cl_view right_view)
 Determines which parts are nonzero in any of the input views.
 
const matrix_cl_view stan::math::both (const matrix_cl_view left_view, const matrix_cl_view right_view)
 Determines which parts are nonzero in both input views.
 
bool stan::math::contains_nonzero (const matrix_cl_view view, const matrix_cl_view part)
 Check whether a view contains certain nonzero part.
 
const matrix_cl_view stan::math::transpose (const matrix_cl_view view)
 Transposes a view - swaps lower and upper parts.
 
const matrix_cl_view stan::math::invert (const matrix_cl_view view)
 Inverts a view.
 
matrix_cl_view stan::math::from_eigen_uplo_type (Eigen::UpLoType eigen_type)
 Creates a view from Eigen::UpLoType.
 
template<typename T , typename = require_arithmetic_t<T>>
matrix_cl< T > stan::math::multiply_transpose (const matrix_cl< T > &A)
 Computes the product of a square OpenCL matrix with its transpose.
 
template<bool propto, typename T_x_cl , typename T_y_cl , typename T_alpha_cl , typename T_beta_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_x_cl, T_alpha_cl, T_beta_cl > * = nullptr>
return_type_t< T_x_cl, T_alpha_cl, T_beta_cl > stan::math::bernoulli_logit_glm_lpmf (const T_y_cl &y, const T_x_cl &x, const T_alpha_cl &alpha, const T_beta_cl &beta)
 Returns the log PMF of the Generalized Linear Model (GLM) with Bernoulli distribution and logit link function.
 
template<bool propto, typename T_n_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_prob_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > stan::math::bernoulli_lpmf (const T_n_cl &n, const T_prob_cl &theta)
 Returns the log PMF of the Bernoulli distribution.
 
template<bool propto, typename T_n_cl , typename T_N_cl , typename T_size1_cl , typename T_size2_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_size1_cl, T_size2_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_size1_cl, T_size2_cl > * = nullptr>
return_type_t< T_n_cl, T_size1_cl, T_size2_cl > stan::math::beta_binomial_lpmf (const T_n_cl &n, const T_N_cl N, const T_size1_cl &alpha, const T_size2_cl &beta)
 Returns the log PMF of the Beta-Binomial distribution with given population size, prior success, and prior failure parameters.
 
template<bool propto, typename T_y_cl , typename T_scale_succ_cl , typename T_scale_fail_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_succ_cl, T_scale_fail_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_succ_cl, T_scale_fail_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_succ_cl, T_scale_fail_cl > stan::math::beta_lpdf (const T_y_cl &y, const T_scale_succ_cl &alpha, const T_scale_fail_cl &beta)
 The log of the beta density for the specified scalar(s) given the specified sample stan::math::size(s).
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_prec_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_prec_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_prec_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_prec_cl > stan::math::beta_proportion_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_prec_cl &kappa)
 The log of the beta density for specified y, location, and precision: beta_proportion_lpdf(y | mu, kappa) = beta_lpdf(y | mu * kappa, (1 - mu) * kappa).
 
template<bool propto, typename T_n_cl , typename T_N_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_N_cl, T_prob_cl > * = nullptr, require_any_nonscalar_prim_or_rev_kernel_expression_t< T_n_cl, T_N_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > stan::math::binomial_logit_lpmf (const T_n_cl &n, const T_N_cl N, const T_prob_cl &alpha)
 Binomial log PMF in logit parametrization.
 
template<bool propto, typename T_n_cl , typename T_N_cl , typename T_prob_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_N_cl, T_prob_cl > * = nullptr, require_any_nonscalar_prim_or_rev_kernel_expression_t< T_n_cl, T_N_cl, T_prob_cl > * = nullptr>
return_type_t< T_prob_cl > stan::math::binomial_lpmf (const T_n_cl &n, const T_N_cl N, const T_prob_cl &theta)
 Returns the log PMF for the binomial distribution evaluated at the specified success, population size, and chance of success.
 
template<bool propto, typename T_y , typename T_x , typename T_alpha , typename T_beta , require_all_prim_or_rev_kernel_expression_t< T_y, T_x, T_alpha, T_beta > * = nullptr>
return_type_t< T_x, T_alpha, T_beta > stan::math::categorical_logit_glm_lpmf (const T_y &y, const T_x &x, const T_alpha &alpha, const T_beta &beta)
 Returns the log PMF of the Generalized Linear Model (GLM) with categorical distribution and logit (softmax) link function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::cauchy_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the cauchy cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::cauchy_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the cauchy log complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::cauchy_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the cauchy cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::cauchy_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 The log of the Cauchy density for the specified scalar(s) given the specified location parameter(s) and scale parameter(s).
 
template<bool propto, typename T_y_cl , typename T_dof_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_dof_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_dof_cl > * = nullptr>
return_type_t< T_y_cl, T_dof_cl > stan::math::chi_square_lpdf (const T_y_cl &y, const T_dof_cl &nu)
 The log of a chi-squared density for y with the specified degrees of freedom parameter.
 
template<typename T_x , typename = require_nonscalar_prim_or_rev_kernel_expression_t<T_x>>
auto stan::math::col (T_x &&x, size_t j)
 Return the specified column of the specified kernel generator expression using start-at-1 indexing.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
int64_t stan::math::cols (const T_x &x)
 Returns the number of columns in the specified kernel generator expression.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
void stan::math::dims (const T_x &x, std::vector< int > &result)
 matrix_cl overload of the dims helper function in prim/fun/dims.hpp.
 
template<bool propto, typename T_prob_cl , typename T_prior_size_cl , require_all_prim_or_rev_kernel_expression_t< T_prob_cl, T_prior_size_cl > * = nullptr, require_any_not_stan_scalar_t< T_prob_cl, T_prior_size_cl > * = nullptr>
return_type_t< T_prob_cl, T_prior_size_cl > stan::math::dirichlet_lpdf (const T_prob_cl &theta, const T_prior_size_cl &alpha)
 The log of the Dirichlet density for the given theta and a vector of prior sample sizes, alpha.
 
template<typename T_a , typename = require_all_kernel_expressions_and_none_scalar_t<T_a>>
auto stan::math::divide (T_a &&a, double d)
 Returns the elementwise division of the kernel generator expression.
 
template<typename T1 , typename T2 , typename = require_all_arithmetic_t<T1, T2>>
void stan::math::divide_columns (matrix_cl< T1 > &A, const matrix_cl< T2 > &B)
 Divides each column of a matrix by a vector.
 
template<typename T1 , typename T2 , typename = require_all_arithmetic_t<T1, T2>>
void stan::math::divide_columns (matrix_cl< T1 > &A, const T2 &divisor)
 Divides each column of a matrix by a scalar.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::double_exponential_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the double exponential cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::double_exponential_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the double exponential log complementary cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::double_exponential_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the double exponential log cumulative density function.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::double_exponential_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the double exponential log probability density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > stan::math::exp_mod_normal_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_inv_scale_cl &lambda)
 Returns the double exponential cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > stan::math::exp_mod_normal_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_inv_scale_cl &lambda)
 Returns the exp mod normal log complementary cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > stan::math::exp_mod_normal_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_inv_scale_cl &lambda)
 Returns the exp mod normal log cumulative density function.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_inv_scale_cl > stan::math::exp_mod_normal_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_inv_scale_cl &lambda)
 Returns the log PMF of the exp mod normal distribution.
 
template<typename T_y_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_inv_scale_cl > stan::math::exponential_cdf (const T_y_cl &y, const T_inv_scale_cl &beta)
 Calculates the exponential cumulative distribution function for the given y and beta.
 
template<typename T_y_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_inv_scale_cl > stan::math::exponential_lccdf (const T_y_cl &y, const T_inv_scale_cl &beta)
 Calculates the log exponential cumulative distribution function for the given y and beta.
 
template<typename T_y_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_inv_scale_cl > stan::math::exponential_lcdf (const T_y_cl &y, const T_inv_scale_cl &beta)
 Calculates the log exponential cumulative distribution function for the given y and beta.
 
template<bool propto, typename T_y_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_inv_scale_cl > stan::math::exponential_lpdf (const T_y_cl &y, const T_inv_scale_cl &beta)
 The log of an exponential density for y with the specified inverse scale parameter.
 
template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > stan::math::frechet_cdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the frechet cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > stan::math::frechet_lccdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the frechet log complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > stan::math::frechet_lcdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the frechet log cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > stan::math::frechet_lpdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 The log of the frechet density for the specified scalar(s) given the specified sample stan::math::size(s).
 
template<bool propto, typename T_y_cl , typename T_shape_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_inv_scale_cl > stan::math::gamma_lpdf (const T_y_cl &y, const T_shape_cl &alpha, const T_inv_scale_cl &beta)
 The log of a gamma density for y with the specified shape and inverse scale parameters.
 
template<typename T_x , typename T_sigma , require_all_prim_or_rev_kernel_expression_t< T_x > * = nullptr, require_stan_scalar_t< T_sigma > * = nullptr>
auto stan::math::gp_dot_prod_cov (const T_x &x, const T_sigma sigma)
 Dot product kernel on the GPU.
 
template<typename T_x , typename T_y , typename T_sigma , require_all_prim_or_rev_kernel_expression_t< T_x, T_y > * = nullptr, require_stan_scalar_t< T_sigma > * = nullptr>
auto stan::math::gp_dot_prod_cov (const T_x &x, const T_y &y, const T_sigma sigma)
 Dot product kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , typename = require_all_arithmetic_t<T1, T2, T3>>
matrix_cl< return_type_t< T1, T2, T3 > > stan::math::gp_exp_quad_cov (const matrix_cl< T1 > &x, const T2 sigma, const T3 length_scale)
 Squared exponential kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , typename T4 , typename = require_all_arithmetic_t<T1, T2, T3, T4>>
matrix_cl< return_type_t< T1, T2, T3, T4 > > stan::math::gp_exp_quad_cov (const matrix_cl< T1 > &x, const matrix_cl< T2 > &y, const T3 sigma, const T4 length_scale)
 Squared exponential kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , require_all_kernel_expressions_and_none_scalar_t< T1 > * = nullptr, require_all_arithmetic_t< T2, T3 > * = nullptr>
matrix_cl< return_type_t< T1, T2, T3 > > stan::math::gp_exponential_cov (const T1 &x, const T2 sigma, const T3 length_scale)
 Matern exponential kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , typename T4 , require_all_kernel_expressions_and_none_scalar_t< T1, T2 > * = nullptr, require_all_arithmetic_t< T3, T4 > * = nullptr>
matrix_cl< return_type_t< T1, T2, T3, T4 > > stan::math::gp_exponential_cov (const T1 &x, const T2 &y, const T3 sigma, const T4 length_scale)
 Matern exponential kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , require_all_kernel_expressions_and_none_scalar_t< T1 > * = nullptr, require_all_arithmetic_t< T2, T3 > * = nullptr>
matrix_cl< return_type_t< T1, T2, T3 > > stan::math::gp_matern32_cov (const T1 &x, const T2 sigma, const T3 length_scale)
 Matern 3/2 kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , typename T4 , require_all_kernel_expressions_and_none_scalar_t< T1, T2 > * = nullptr, require_all_arithmetic_t< T3, T4 > * = nullptr>
matrix_cl< return_type_t< T1, T2, T3, T4 > > stan::math::gp_matern32_cov (const T1 &x, const T2 &y, const T3 sigma, const T4 length_scale)
 Matern 3/2 kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , require_all_kernel_expressions_and_none_scalar_t< T1 > * = nullptr, require_all_arithmetic_t< T2, T3 > * = nullptr>
matrix_cl< return_type_t< T1, T2, T3 > > stan::math::gp_matern52_cov (const T1 &x, const T2 sigma, const T3 length_scale)
 Matern 5/2 kernel on the GPU.
 
template<typename T1 , typename T2 , typename T3 , typename T4 , require_all_kernel_expressions_and_none_scalar_t< T1, T2 > * = nullptr, require_all_arithmetic_t< T3, T4 > * = nullptr>
matrix_cl< return_type_t< T1, T2, T3, T4 > > stan::math::gp_matern52_cov (const T1 &x, const T2 &y, const T3 sigma, const T4 length_scale)
 Matern 5/2 kernel on the GPU.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::gumbel_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &beta)
 Returns the gumbel cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::gumbel_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &beta)
 Returns the Gumbel log complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::gumbel_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &beta)
 Returns the Gumbel log complementary cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::gumbel_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &beta)
 Returns the Gumbel log probability density for the given location and scale.
 
template<bool propto, typename T_y_cl , typename T_dof_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_dof_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_dof_cl > * = nullptr>
return_type_t< T_y_cl, T_dof_cl > stan::math::inv_chi_square_lpdf (const T_y_cl &y, const T_dof_cl &nu)
 The log of an inverse chi-squared density for y with the specified degrees of freedom parameter.
 
template<bool propto, typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > stan::math::inv_gamma_lpdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &beta)
 The log of an inverse gamma density for y with the specified shape and scale parameters.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::logistic_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the logistic cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::logistic_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the logistic cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::logistic_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the logistic cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::logistic_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 The log of a logistic density for y with the specified location and scale parameters.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::lognormal_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the loghormal cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::lognormal_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the lognormal log complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::lognormal_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the lognormal log cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::lognormal_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 The log of the lognormal density for the specified scalar(s) given the specified sample stan::math::size(s).
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_covar_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_covar_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_covar_cl > stan::math::multi_normal_cholesky_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_covar_cl &L)
 The log of the multivariate normal density for the given y, mu, and a Cholesky factor L of the variance matrix.
 
template<typename T1 , typename T2 , typename = require_all_kernel_expressions_and_none_scalar_t<T1, T2>>
matrix_cl< return_type_t< T1, T2 > > stan::math::multiply (const T1 &A, const T2 &B)
 Computes the product of the specified matrices with the option of specifying the triangularity of either input matrices.
 
template<bool propto, typename T_y_cl , typename T_x_cl , typename T_alpha_cl , typename T_beta_cl , typename T_phi_cl , require_all_prim_or_rev_kernel_expression_t< T_x_cl, T_y_cl, T_alpha_cl, T_beta_cl, T_phi_cl > * = nullptr>
return_type_t< T_x_cl, T_alpha_cl, T_beta_cl, T_phi_cl > stan::math::neg_binomial_2_log_glm_lpmf (const T_y_cl &y, const T_x_cl &x, const T_alpha_cl &alpha, const T_beta_cl &beta, const T_phi_cl &phi)
 Returns the log PMF of the Generalized Linear Model (GLM) with Negative-Binomial-2 distribution and log link function.
 
template<bool propto, typename T_n_cl , typename T_log_location_cl , typename T_precision_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_log_location_cl, T_precision_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_log_location_cl, T_precision_cl > * = nullptr>
return_type_t< T_n_cl, T_log_location_cl, T_precision_cl > stan::math::neg_binomial_2_log_lpmf (const T_n_cl &n, const T_log_location_cl &eta, const T_precision_cl &phi)
 The log of the log transformed negative binomial density for the specified scalars given the specified mean(s) and deviation(s).
 
template<bool propto, typename T_n_cl , typename T_location_cl , typename T_precision_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_location_cl, T_precision_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_location_cl, T_precision_cl > * = nullptr>
return_type_t< T_n_cl, T_location_cl, T_precision_cl > stan::math::neg_binomial_2_lpmf (const T_n_cl &n, const T_location_cl &mu, const T_precision_cl &phi)
 The log of the negative binomial density for the specified scalars given the specified mean(s) and deviation(s).
 
template<bool propto, typename T_n_cl , typename T_shape_cl , typename T_inv_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_shape_cl, T_inv_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_shape_cl, T_inv_scale_cl > * = nullptr>
return_type_t< T_n_cl, T_shape_cl, T_inv_scale_cl > stan::math::neg_binomial_lpmf (const T_n_cl &n, const T_shape_cl &alpha, const T_inv_scale_cl &beta)
 The log of the negative binomial density for the specified scalars given the specified mean(s) and deviation(s).
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::normal_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the normal cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_x_cl , typename T_alpha_cl , typename T_beta_cl , typename T_sigma_cl , require_all_prim_or_rev_kernel_expression_t< T_x_cl, T_y_cl, T_alpha_cl, T_beta_cl, T_sigma_cl > * = nullptr>
return_type_t< T_y_cl, T_x_cl, T_alpha_cl, T_beta_cl, T_sigma_cl > stan::math::normal_id_glm_lpdf (const T_y_cl &y, const T_x_cl &x, const T_alpha_cl &alpha, const T_beta_cl &beta, const T_sigma_cl &sigma)
 Returns the log PDF of the Generalized Linear Model (GLM) with Normal distribution and id link function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::normal_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the normal log complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::normal_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 Returns the normal log complementary cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl > stan::math::normal_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma)
 The log of the normal density for the specified scalar(s) given the specified mean(s) and deviation(s).
 
template<bool propto, typename T_y , typename T_x , typename T_beta , typename T_cuts , require_all_prim_or_rev_kernel_expression_t< T_y, T_x, T_beta, T_cuts > * = nullptr>
return_type_t< T_x, T_beta, T_cuts > stan::math::ordered_logistic_glm_lpmf (const T_y &y, const T_x &x, const T_beta &beta, const T_cuts &cuts)
 Returns the log PMF of the ordinal regression Generalized Linear Model (GLM).
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_cuts_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_cuts_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_cuts_cl > stan::math::ordered_logistic_lpmf (const T_y_cl &y, const T_loc_cl &lambda, const T_cuts_cl &cuts)
 Returns the (natural) log probability of the specified array of integers given the vector of continuous locations and specified cutpoints in an ordered logistic model.
 
template<typename T_y_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl, T_shape_cl > stan::math::pareto_cdf (const T_y_cl &y, const T_scale_cl &y_min, const T_shape_cl &alpha)
 Returns the Pareto cumulative density function.
 
template<typename T_y_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl, T_shape_cl > stan::math::pareto_lccdf (const T_y_cl &y, const T_scale_cl &y_min, const T_shape_cl &alpha)
 Returns the Pareto cumulative density function.
 
template<typename T_y_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl, T_shape_cl > stan::math::pareto_lcdf (const T_y_cl &y, const T_scale_cl &y_min, const T_shape_cl &alpha)
 Returns the Pareto cumulative density function.
 
template<bool propto, typename T_y_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl, T_shape_cl > stan::math::pareto_lpdf (const T_y_cl &y, const T_scale_cl &y_min, const T_shape_cl &alpha)
 The log of the Cauchy density for the specified scalar(s) given the specified location parameter(s) and scale parameter(s).
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > stan::math::pareto_type_2_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &lambda, const T_shape_cl &alpha)
 Returns the pareto type 2 cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > stan::math::pareto_type_2_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &lambda, const T_shape_cl &alpha)
 Returns the pareto type 2 log complementaty cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > stan::math::pareto_type_2_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &lambda, const T_shape_cl &alpha)
 Returns the pareto type 2 log cumulative density function.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > stan::math::pareto_type_2_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &lambda, const T_shape_cl &alpha)
 Returns the log PMF of the Pareto type 2 distribution.
 
template<bool propto, typename T_y_cl , typename T_x_cl , typename T_alpha_cl , typename T_beta_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_x_cl, T_alpha_cl, T_beta_cl > * = nullptr>
return_type_t< T_x_cl, T_alpha_cl, T_beta_cl > stan::math::poisson_log_glm_lpmf (const T_y_cl &y, const T_x_cl &x, const T_alpha_cl &alpha, const T_beta_cl &beta)
 Returns the log PMF of the Generalized Linear Model (GLM) with Poisson distribution and log link function.
 
template<bool propto, typename T_n_cl , typename T_log_rate_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_log_rate_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_log_rate_cl > * = nullptr>
return_type_t< T_log_rate_cl > stan::math::poisson_log_lpmf (const T_n_cl &n, const T_log_rate_cl &alpha)
 Returns the log PMF of the Poisson log distribution.
 
template<bool propto, typename T_n_cl , typename T_rate_cl , require_all_prim_or_rev_kernel_expression_t< T_n_cl, T_rate_cl > * = nullptr, require_any_not_stan_scalar_t< T_n_cl, T_rate_cl > * = nullptr>
return_type_t< T_rate_cl > stan::math::poisson_lpmf (const T_n_cl &n, const T_rate_cl &lambda)
 Returns the log PMF of the Poisson distribution.
 
template<typename T_y_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl > stan::math::rayleigh_cdf (const T_y_cl &y, const T_scale_cl &sigma)
 Returns the Rayleigh cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl > stan::math::rayleigh_lccdf (const T_y_cl &y, const T_scale_cl &sigma)
 Returns the Rayleigh log complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl > stan::math::rayleigh_lcdf (const T_y_cl &y, const T_scale_cl &sigma)
 Returns the Rayleigh log cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_scale_cl > stan::math::rayleigh_lpdf (const T_y_cl &y, const T_scale_cl &sigma)
 The log of an Rayleigh density for y with the specified scale parameter.
 
template<typename T , require_any_t< is_matrix_cl< T >, math::conjunction< is_var< T >, is_matrix_cl< value_type_t< T > > > > * = nullptr>
auto stan::math::rep_array (const scalar_type_t< T > &x, int n)
 Creates a matrix_cl representing an array by replicating the input value.
 
template<typename T , require_matrix_cl_t< T > * = nullptr>
auto stan::math::rep_matrix (const value_type_t< T > &x, int n, int m)
 Creates a matrix_cl by replicating the given value of arithmetic type.
 
template<typename T , require_arithmetic_t< T > * = nullptr>
auto stan::math::rep_matrix (const matrix_cl< T > &x, int m)
 Creates a matrix_cl by replicating the input vector or row_vector.
 
template<typename T , require_any_t< is_matrix_cl< T >, math::conjunction< is_var< T >, is_matrix_cl< value_type_t< T > > > > * = nullptr>
auto stan::math::rep_row_vector (const scalar_type_t< T > &x, int n)
 Creates a matrix_cl representing a row vector by replicating the input value.
 
template<typename T , require_any_t< is_matrix_cl< T >, math::conjunction< is_var< T >, is_matrix_cl< value_type_t< T > > > > * = nullptr>
auto stan::math::rep_vector (const scalar_type_t< T > &x, int n)
 Creates a matrix_cl representing a vector by replicating the input value.
 
template<typename T_x , typename = require_nonscalar_prim_or_rev_kernel_expression_t<T_x>>
auto stan::math::row (T_x &&x, size_t j)
 Return the specified row of the specified kernel generator expression using start-at-1 indexing.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
int64_t stan::math::rows (const T_x &x)
 Returns the number of rows in the specified kernel generator expression.
 
template<bool propto, typename T_y_cl , typename T_dof_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_dof_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_dof_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_dof_cl, T_scale_cl > stan::math::scaled_inv_chi_square_lpdf (const T_y_cl &y, const T_dof_cl &nu, const T_scale_cl &s)
 The log of a scaled inverse chi-squared density for y with the specified degrees of freedom parameter and scale parameter.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_skewness_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > stan::math::skew_double_exponential_cdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_skewness_cl &tau)
 Returns the skew double exponential cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_skewness_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > stan::math::skew_double_exponential_lccdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_skewness_cl &tau)
 Returns the skew double exponential cumulative density function.
 
template<typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_skewness_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > stan::math::skew_double_exponential_lcdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_skewness_cl &tau)
 Returns the skew double exponential cumulative density function.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_skewness_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_skewness_cl > stan::math::skew_double_exponential_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_skewness_cl &tau)
 Returns the log PMF of the skew double exponential distribution.
 
template<bool propto, typename T_y_cl , typename T_loc_cl , typename T_scale_cl , typename T_shape_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > * = nullptr>
return_type_t< T_y_cl, T_loc_cl, T_scale_cl, T_shape_cl > stan::math::skew_normal_lpdf (const T_y_cl &y, const T_loc_cl &mu, const T_scale_cl &sigma, const T_shape_cl &alpha)
 The log of the skew normal density for the specified scalar(s) given the specified mean(s), deviation(s) and shape(s).
 
template<typename T_y_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl > * = nullptr>
return_type_t< T_y_cl > stan::math::std_normal_cdf (const T_y_cl &y)
 Returns the standard normal cumulative distribution function.
 
template<typename T_y_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl > * = nullptr>
return_type_t< T_y_cl > stan::math::std_normal_lccdf (const T_y_cl &y)
 Returns the log standard normal complementary cumulative distribution function.
 
template<typename T_y_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl > * = nullptr>
return_type_t< T_y_cl > stan::math::std_normal_lcdf (const T_y_cl &y)
 Returns the log standard normal complementary cumulative distribution function.
 
template<bool propto, typename T_y_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl > * = nullptr>
return_type_t< T_y_cl > stan::math::std_normal_lpdf (const T_y_cl &y)
 The log of the normal density for the specified scalar(s) given a location of 0 and a scale of 1.
 
template<bool propto, typename T_y_cl , typename T_dof_cl , typename T_loc_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_dof_cl, T_loc_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_dof_cl, T_loc_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_dof_cl, T_loc_cl, T_scale_cl > stan::math::student_t_lpdf (const T_y_cl &y, const T_dof_cl &nu, const T_loc_cl &mu, const T_scale_cl &sigma)
 The log of the Student-t density for the given y, nu, mean, and scale parameter.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
auto stan::math::to_array_1d (T_x &&x)
 Returns input matrix reshaped into a vector.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
T_x stan::math::to_array_2d (T_x &&x)
 Returns input matrix converted into a nested std vector.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
T_x stan::math::to_matrix (T_x &&x)
 Returns input matrix.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
auto stan::math::to_row_vector (T_x &&x)
 Returns input matrix reshaped into a row vector.
 
template<typename T_x , require_nonscalar_prim_or_rev_kernel_expression_t< T_x > * = nullptr>
auto stan::math::to_vector (T_x &&x)
 Returns input matrix reshaped into a vector.
 
template<typename T_y_cl , typename T_low_cl , typename T_high_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr>
return_type_t< T_y_cl, T_low_cl, T_high_cl > stan::math::uniform_cdf (const T_y_cl &y, const T_low_cl &alpha, const T_high_cl &beta)
 Returns the uniform cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_low_cl , typename T_high_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr>
return_type_t< T_y_cl, T_low_cl, T_high_cl > stan::math::uniform_lccdf (const T_y_cl &y, const T_low_cl &alpha, const T_high_cl &beta)
 Returns the log uniform complementary cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_low_cl , typename T_high_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr>
return_type_t< T_y_cl, T_low_cl, T_high_cl > stan::math::uniform_lcdf (const T_y_cl &y, const T_low_cl &alpha, const T_high_cl &beta)
 Returns the log uniform cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_low_cl , typename T_high_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_low_cl, T_high_cl > * = nullptr>
return_type_t< T_y_cl, T_low_cl, T_high_cl > stan::math::uniform_lpdf (const T_y_cl &y, const T_low_cl &alpha, const T_high_cl &beta)
 The log of a uniform density for the given y, lower, and upper bound.
 
template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > stan::math::weibull_cdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the weibull cumulative distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > stan::math::weibull_lccdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the weibull log cumulative complementary distribution function for the given location, and scale.
 
template<typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > stan::math::weibull_lcdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the weibull log cumulative distribution function for the given location, and scale.
 
template<bool propto, typename T_y_cl , typename T_shape_cl , typename T_scale_cl , require_all_prim_or_rev_kernel_expression_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr, require_any_not_stan_scalar_t< T_y_cl, T_shape_cl, T_scale_cl > * = nullptr>
return_type_t< T_y_cl, T_shape_cl, T_scale_cl > stan::math::weibull_lpdf (const T_y_cl &y, const T_shape_cl &alpha, const T_scale_cl &sigma)
 Returns the Weibull log probability density for the given location and scale.
 
template<typename T >
var_value< matrix_cl< value_type_t< T > > > stan::math::to_matrix_cl (const var_value< T > &a)
 Copies the source var containing Eigen matrices to destination var that has data stored on the OpenCL device.
 
template<typename T , require_stan_scalar_t< T > * = nullptr>
var_value< matrix_cl< value_type_t< T > > > stan::math::to_matrix_cl (const std::vector< var_value< T > > &a)
 Copies the source std::vector of vars to a destination var that has data stored on the OpenCL device.
 
template<typename T , require_eigen_vt< is_var, T > * = nullptr>
var_value< matrix_cl< value_type_t< value_type_t< T > > > > stan::math::to_matrix_cl (const T &src)
 Copies the source Eigen matrix of vars to the destination matrix that is stored on the OpenCL device.
 
template<typename T , require_eigen_vt< is_var, T > * = nullptr>
var_value< matrix_cl< value_type_t< value_type_t< T > > > > stan::math::to_matrix_cl (const std::vector< T > &src)
 Copies the source vector of Eigen matrices of vars to the destination matrix that is stored on the OpenCL device.
 
template<typename T_dst , typename T , require_var_vt< is_eigen, T_dst > * = nullptr, require_all_kernel_expressions_t< T > * = nullptr>
T_dst stan::math::from_matrix_cl (const var_value< T > &a)
 Copies the source var that has data stored on the OpenCL device to destination var containing Eigen matrix.
 
template<typename T_dst , typename T , require_std_vector_vt< is_var, T_dst > * = nullptr, require_all_stan_scalar_t< value_type_t< T_dst > > * = nullptr, require_all_kernel_expressions_t< T > * = nullptr>
T_dst stan::math::from_matrix_cl (const var_value< T > &a)
 Copies the source var that has data stored on the OpenCL device to destination std::vector containing vars.
 
template<typename T , require_all_kernel_expressions_t< T > * = nullptr>
auto stan::math::from_matrix_cl (const var_value< T > &src)
 Copies the source var that has data stored on the OpenCL device to destination Eigen matrix containing vars.
 
template<typename T_ret , require_var_vt< is_matrix_cl, T_ret > * = nullptr>
var_value< matrix_cl< double > > stan::math::rep_matrix (const var &A, int n, int m)
 Creates a matrix_cl by replicating the given value of arithmetic type.
 
template<typename T , require_all_kernel_expressions_and_none_scalar_t< T > * = nullptr>
var_value< matrix_cl< double > > stan::math::rep_matrix (const var_value< T > &A, int m)
 Creates a matrix_cl by replicating the input vector or row_vector.
 
template<matrix_cl_view matrix_view = matrix_cl_view::Entire, typename T , require_matrix_cl_st< std::is_floating_point, T > * = nullptr>
plain_type_t< T > stan::math::tri_inverse (const T &A)
 Computes the inverse of a triangular matrix.