1#ifndef STAN_MATH_PRIM_PROB_VON_MISES_LCCDF_HPP
2#define STAN_MATH_PRIM_PROB_VON_MISES_LCCDF_HPP
31template <
typename T_x,
typename T_mu,
typename T_k>
42 static char const* function =
"von_mises_lccdf";
44 mu,
"Scale parameter", k);
65 for (
size_t n = 0; n < N; ++n) {
67 auto mu_n = mu_vec[n];
72 }
else if (x_n ==
pi) {
76 T_return x2 = x_n - mu_n;
81 const auto x_modded = x2 - x_floor *
TWO_PI;
85 T_return mu2 = mu_n +
pi;
87 const auto mu_modded = mu2 - mu_floor *
TWO_PI;
91 T_return cut, bound_val;
94 bound_val = -
pi - mu2;
101 T_return f_bound_val = von_mises_cdf_centered(bound_val, k_n);
104 cdf_n = von_mises_cdf_centered(x2, k_n) - f_bound_val;
106 cdf_n = von_mises_cdf_centered(x2, k_n) + 1 - f_bound_val;
scalar_seq_view provides a uniform sequence-like wrapper around either a scalar or a sequence of scal...
return_type_t< T_x, T_mu, T_k > von_mises_lccdf(const T_x &x, const T_mu &mu, const T_k &k)
Calculates the log of the complement of the cumulative distribution function of the von Mises distrib...
typename return_type< Ts... >::type return_type_t
Convenience type for the return type of the specified template parameters.
return_type_t< T_x, T_k > von_mises_cdf_centered(const T_x &x, const T_k &k)
This function calculates the cdf of the von Mises distribution in the case where the distribution has...
bool size_zero(const T &x)
Returns 1 if input is of length 0, returns 0 otherwise.
void check_bounded(const char *function, const char *name, const T_y &y, const T_low &low, const T_high &high)
Check if the value is between the low and high values, inclusively.
T value_of(const fvar< T > &v)
Return the value of the specified variable.
static constexpr double NEGATIVE_INFTY
Negative infinity.
void check_consistent_sizes(const char *)
Trivial no input case, this function is a no-op.
void check_finite(const char *function, const char *name, const T_y &y)
Return true if all values in y are finite.
fvar< T > floor(const fvar< T > &x)
static constexpr double TWO_PI
Twice the value of , .
void check_positive(const char *function, const char *name, const T_y &y)
Check if y is positive.
static constexpr double pi()
Return the value of pi.
int64_t max_size(const T1 &x1, const Ts &... xs)
Calculate the size of the largest input.
fvar< T > log1m(const fvar< T > &x)
typename ref_type_if< true, T >::type ref_type_t
The lgamma implementation in stan-math is based on either the reentrant safe lgamma_r implementation ...