1#ifndef STAN_MATH_PRIM_PROB_STD_NORMAL_LPDF_HPP
2#define STAN_MATH_PRIM_PROB_STD_NORMAL_LPDF_HPP
30 bool propto,
typename T_y,
31 require_all_not_nonscalar_prim_or_rev_kernel_expression_t<T_y>* =
nullptr>
35 static constexpr const char* function =
"std_normal_lpdf";
46 T_partials_return logp(0.0);
52 for (
size_t n = 0; n < N; n++) {
53 const T_partials_return y_val = y_vec.val(n);
54 logp += y_val * y_val;
56 partials<0>(ops_partials)[n] -= y_val;
64 return ops_partials.build(logp);
67template <
typename T_y>
69 return std_normal_lpdf<false>(y);
scalar_seq_view provides a uniform sequence-like wrapper around either a scalar or a sequence of scal...
return_type_t< T_y_cl > 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.
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
int64_t size(const T &m)
Returns the size (number of the elements) of a matrix_cl or var_value<matrix_cl<T>>.
bool size_zero(const T &x)
Returns 1 if input is of length 0, returns 0 otherwise.
const double NEG_LOG_SQRT_TWO_PI
The value of minus the natural logarithm of the square root of , .
void check_not_nan(const char *function, const char *name, const T_y &y)
Check if y is not NaN.
auto make_partials_propagator(Ops &&... ops)
Construct an partials_propagator.
typename ref_type_if< true, T >::type ref_type_t
typename partials_return_type< Args... >::type partials_return_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...
Extends std::true_type when instantiated with zero or more template parameters, all of which extend t...
Template metaprogram to calculate whether a summand needs to be included in a proportional (log) prob...