Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions stan/math/prim/prob.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,11 @@
#include <stan/math/prim/prob/weibull_rng.hpp>
#include <stan/math/prim/prob/wiener5_lpdf.hpp>
#include <stan/math/prim/prob/wiener_lpdf.hpp>
#include <stan/math/prim/prob/wiener4_lcdf.hpp>
#include <stan/math/prim/prob/wiener4_lccdf.hpp>
#include <stan/math/prim/prob/wiener4_lcdf_defective.hpp>
#include <stan/math/prim/prob/wiener4_lccdf_defective.hpp>
#include <stan/math/prim/prob/wiener_full_lpdf.hpp>
#include <stan/math/prim/prob/wiener_full_lcdf.hpp>
#include <stan/math/prim/prob/wiener_full_lccdf.hpp>
#include <stan/math/prim/prob/wiener_full_lcdf_defective.hpp>
#include <stan/math/prim/prob/wiener_full_lccdf_defective.hpp>
#include <stan/math/prim/prob/wishart_cholesky_lpdf.hpp>
#include <stan/math/prim/prob/wishart_cholesky_rng.hpp>
#include <stan/math/prim/prob/wishart_lpdf.hpp>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef STAN_MATH_PRIM_PROB_WIENER4_LCCDF_HPP
#define STAN_MATH_PRIM_PROB_WIENER4_LCCDF_HPP
#ifndef STAN_MATH_PRIM_PROB_WIENER4_LCCDF_DEFECTIVE_HPP
#define STAN_MATH_PRIM_PROB_WIENER4_LCCDF_DEFECTIVE_HPP

#include <stan/math/prim/prob/wiener4_lcdf.hpp>
#include <stan/math/prim/prob/wiener4_lcdf_defective.hpp>

namespace stan {
namespace math {
Expand Down Expand Up @@ -224,9 +224,9 @@ inline auto wiener4_ccdf_grad_w(const T_y& y, const T_a& a, const T_v& v,
*/
template <bool propto = false, typename T_y, typename T_a, typename T_t0,
typename T_w, typename T_v>
inline auto wiener_lccdf(const T_y& y, const T_a& a, const T_t0& t0,
const T_w& w, const T_v& v,
const double& precision_derivatives) {
inline auto wiener_lccdf_defective(const T_y& y, const T_a& a, const T_t0& t0,
const T_w& w, const T_v& v,
const double& precision_derivatives) {
using T_partials_return = partials_return_t<T_y, T_a, T_t0, T_w, T_v>;
using ret_t = return_type_t<T_y, T_a, T_t0, T_w, T_v>;
using T_y_ref = ref_type_if_t<!is_constant<T_y>::value, T_y>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef STAN_MATH_PRIM_PROB_WIENER4_LCDF_HPP
#define STAN_MATH_PRIM_PROB_WIENER4_LCDF_HPP
#ifndef STAN_MATH_PRIM_PROB_WIENER4_LCDF_DEFECTIVE_HPP
#define STAN_MATH_PRIM_PROB_WIENER4_LCDF_DEFECTIVE_HPP

#include <stan/math/prim/prob/wiener5_lpdf.hpp>

Expand Down Expand Up @@ -586,9 +586,9 @@ inline auto wiener4_cdf_grad_w(const T_y& y, const T_a& a, const T_v& v,
*/
template <bool propto = false, typename T_y, typename T_a, typename T_t0,
typename T_w, typename T_v>
inline auto wiener_lcdf(const T_y& y, const T_a& a, const T_t0& t0,
const T_w& w, const T_v& v,
const double& precision_derivatives = 1e-4) {
inline auto wiener_lcdf_defective(const T_y& y, const T_a& a, const T_t0& t0,
const T_w& w, const T_v& v,
const double& precision_derivatives = 1e-4) {
using T_partials_return = partials_return_t<T_y, T_a, T_t0, T_w, T_v>;
using T_y_ref = ref_type_if_t<!is_constant<T_y>::value, T_y>;
using T_a_ref = ref_type_if_t<!is_constant<T_a>::value, T_a>;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
#ifndef STAN_MATH_PRIM_PROB_WIENER_FULL_LCCDF_HPP
#define STAN_MATH_PRIM_PROB_WIENER_FULL_LCCDF_HPP
#ifndef STAN_MATH_PRIM_PROB_WIENER_FULL_LCCDF_DEFECTIVE_HPP
#define STAN_MATH_PRIM_PROB_WIENER_FULL_LCCDF_DEFECTIVE_HPP

#include <stan/math/prim/prob/wiener4_lccdf.hpp>
#include <stan/math/prim/prob/wiener_full_lcdf.hpp>
#include <stan/math/prim/prob/wiener4_lccdf_defective.hpp>
#include <stan/math/prim/prob/wiener_full_lcdf_defective.hpp>

namespace stan {
namespace math {
Expand Down Expand Up @@ -84,10 +84,10 @@ inline auto wiener7_ccdf_grad_sw(const T_y& y, const T_a& a, const T_v& v,
template <bool propto = false, typename T_y, typename T_a, typename T_t0,
typename T_w, typename T_v, typename T_sv, typename T_sw,
typename T_st0>
inline auto wiener_lccdf(const T_y& y, const T_a& a, const T_t0& t0,
const T_w& w, const T_v& v, const T_sv& sv,
const T_sw& sw, const T_st0& st0,
const double& precision_derivatives = 1e-8) {
inline auto wiener_lccdf_defective(const T_y& y, const T_a& a, const T_t0& t0,
const T_w& w, const T_v& v, const T_sv& sv,
const T_sw& sw, const T_st0& st0,
const double& precision_derivatives = 1e-8) {
using ret_t = return_type_t<T_y, T_a, T_t0, T_w, T_v, T_sv, T_sw, T_st0>;
using T_y_ref = ref_type_if_t<!is_constant<T_y>::value, T_y>;
using T_a_ref = ref_type_if_t<!is_constant<T_a>::value, T_a>;
Expand Down Expand Up @@ -124,7 +124,7 @@ inline auto wiener_lccdf(const T_y& y, const T_a& a, const T_t0& t0,
return ret_t(0.0);
}

static constexpr const char* function_name = "wiener_lccdf";
static constexpr const char* function_name = "wiener_lccdf_defective";
check_consistent_sizes(function_name, "Random variable", y,
"Boundary separation", a, "Drift rate", v,
"A-priori bias", w, "Nondecision time", t0,
Expand Down Expand Up @@ -211,8 +211,9 @@ inline auto wiener_lccdf(const T_y& y, const T_a& a, const T_t0& t0,
// calculate density and partials
for (size_t i = 0; i < N; i++) {
if (sv_vec[i] == 0 && sw_vec[i] == 0 && st0_vec[i] == 0) {
result += wiener_lccdf<propto>(y_vec[i], a_vec[i], t0_vec[i], w_vec[i],
v_vec[i], precision_derivatives);
result += wiener_lccdf_defective<propto>(y_vec[i], a_vec[i], t0_vec[i],
w_vec[i], v_vec[i],
precision_derivatives);
continue;
}
const T_partials_return y_value = y_vec.val(i);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#ifndef STAN_MATH_PRIM_PROB_WIENER_FULL_LCDF_HPP
#define STAN_MATH_PRIM_PROB_WIENER_FULL_LCDF_HPP
#ifndef STAN_MATH_PRIM_PROB_WIENER_FULL_LCDF_DEFECTIVE_HPP
#define STAN_MATH_PRIM_PROB_WIENER_FULL_LCDF_DEFECTIVE_HPP

#include <stan/math/prim/prob/wiener4_lcdf.hpp>
#include <stan/math/prim/prob/wiener4_lcdf_defective.hpp>
#include <stan/math/prim/prob/wiener_full_lpdf.hpp>

namespace stan {
Expand Down Expand Up @@ -260,10 +260,10 @@ inline auto wiener7_integrate_cdf(const Wiener7FunctorT& wiener7_functor,
template <bool propto = false, typename T_y, typename T_a, typename T_t0,
typename T_w, typename T_v, typename T_sv, typename T_sw,
typename T_st0>
inline auto wiener_lcdf(const T_y& y, const T_a& a, const T_t0& t0,
const T_w& w, const T_v& v, const T_sv& sv,
const T_sw& sw, const T_st0& st0,
const double& precision_derivatives = 1e-8) {
inline auto wiener_lcdf_defective(const T_y& y, const T_a& a, const T_t0& t0,
const T_w& w, const T_v& v, const T_sv& sv,
const T_sw& sw, const T_st0& st0,
const double& precision_derivatives = 1e-8) {
using ret_t = return_type_t<T_y, T_a, T_t0, T_w, T_v, T_sv, T_sw, T_st0>;
using T_y_ref = ref_type_if_t<!is_constant<T_y>::value, T_y>;
using T_a_ref = ref_type_if_t<!is_constant<T_a>::value, T_a>;
Expand Down Expand Up @@ -300,7 +300,7 @@ inline auto wiener_lcdf(const T_y& y, const T_a& a, const T_t0& t0,
return ret_t(0);
}

static constexpr const char* function_name = "wiener_lcdf";
static constexpr const char* function_name = "wiener_lcdf_defective";
check_consistent_sizes(function_name, "Random variable", y,
"Boundary separation", a, "Drift rate", v,
"A-priori bias", w, "Nondecision time", t0,
Expand Down Expand Up @@ -387,8 +387,9 @@ inline auto wiener_lcdf(const T_y& y, const T_a& a, const T_t0& t0,
// calculate density and partials
for (size_t i = 0; i < N; i++) {
if (sv_vec[i] == 0 && sw_vec[i] == 0 && st0_vec[i] == 0) {
result += wiener_lcdf<propto>(y_vec[i], a_vec[i], t0_vec[i], w_vec[i],
v_vec[i], precision_derivatives);
result += wiener_lcdf_defective<propto>(y_vec[i], a_vec[i], t0_vec[i],
w_vec[i], v_vec[i],
precision_derivatives);
continue;
}
const T_partials_return y_value = y_vec.val(i);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TEST(mathMixDouble, wiener4_lccdf) {
double t0 = 0.2;
double w = 0.5;
double v = 1.5;
stan::math::wiener_lccdf(y, a, t0, w, v, 1e-4);
stan::math::wiener_lccdf_defective(y, a, t0, w, v, 1e-4);
}

TEST(mathMixVar, wiener4_lccdf) {
Expand All @@ -17,7 +17,7 @@ TEST(mathMixVar, wiener4_lccdf) {
var t0 = 0.2;
var w = 0.5;
var v = 1.5;
stan::math::wiener_lccdf(y, a, t0, w, v, 1e-4);
stan::math::wiener_lccdf_defective(y, a, t0, w, v, 1e-4);
}

TEST(mathMixFVar, wiener4_lccdf) {
Expand All @@ -29,5 +29,5 @@ TEST(mathMixFVar, wiener4_lccdf) {
fvar<var> w = 0.5;
fvar<var> v = 1.5;
double error = 1e-4;
stan::math::wiener_lccdf(y, a, t0, w, v, error);
stan::math::wiener_lccdf_defective(y, a, t0, w, v, error);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,46 @@
#include <test/unit/math/test_ad.hpp>
#include <test/unit/math/mix/prob/util.hpp>

TEST_F(Wiener4MixArgs, wiener_lcdf_y_a_t0) {
TEST_F(Wiener4MixArgs, wiener_lccdf_defective_y_a_t0) {
auto f_y_a_t0 = [](const auto& w, const auto& v) {
return [&w, &v](const auto& y, const auto& a, const auto& t0) {
return stan::math::wiener_lcdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lccdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_y_a_t0(w, v), y, a, t0);
}

TEST_F(Wiener4MixArgs, wiener_lcdf_y_a_w) {
TEST_F(Wiener4MixArgs, wiener_lccdf_defective_y_a_w) {
auto f_y_a_w = [](const auto& t0, const auto& v) {
return [&t0, &v](const auto& y, const auto& a, const auto& w) {
return stan::math::wiener_lcdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lccdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_y_a_w(t0, v), y, a, w);
}

TEST_F(Wiener4MixArgs, wiener_lcdf_y_a_v) {
TEST_F(Wiener4MixArgs, wiener_lccdf_defective_y_a_v) {
auto f_y_a_v = [](const auto& t0, const auto& w) {
return [&t0, &w](const auto& y, const auto& a, const auto& v) {
return stan::math::wiener_lcdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lccdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_y_a_v(t0, w), y, a, v);
}

TEST_F(Wiener4MixArgs, wiener_lcdf_y_t0_w) {
TEST_F(Wiener4MixArgs, wiener_lccdf_defective_y_t0_w) {
auto f_y_t0_w = [](const auto& a, const auto& v) {
return [&a, &v](const auto& y, const auto& t0, const auto& w) {
return stan::math::wiener_lcdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lccdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_y_t0_w(a, v), y, t0, w);
}

TEST_F(Wiener4MixArgs, wiener_lcdf_y_t0_v) {
TEST_F(Wiener4MixArgs, wiener_lccdf_defective_y_t0_v) {
auto f_y_t0_v = [](const auto& a, const auto& w) {
return [&a, &w](const auto& y, const auto& t0, const auto& v) {
return stan::math::wiener_lcdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lccdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_y_t0_v(a, w), y, t0, v);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,46 @@
#include <test/unit/math/test_ad.hpp>
#include <test/unit/math/mix/prob/util.hpp>

TEST_F(Wiener4MixArgs, wiener_lcdf_y_w_v) {
TEST_F(Wiener4MixArgs, wiener_lccdf_defective_y_w_v) {
auto f_y_w_v = [](const auto& a, const auto& t0) {
return [&a, &t0](const auto& y, const auto& w, const auto& v) {
return stan::math::wiener_lcdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lccdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_y_w_v(a, t0), y, w, v);
}

TEST_F(Wiener4MixArgs, wiener_lcdf_a_t0_w) {
TEST_F(Wiener4MixArgs, wiener_lccdf_defective_a_t0_w) {
auto f_a_t0_w = [](const auto& y, const auto& v) {
return [&y, &v](const auto& a, const auto& t0, const auto& w) {
return stan::math::wiener_lcdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lccdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_a_t0_w(y, v), a, t0, w);
}

TEST_F(Wiener4MixArgs, wiener_lcdf_a_t0_v) {
TEST_F(Wiener4MixArgs, wiener_lccdf_defective_a_t0_v) {
auto f_a_t0_v = [](const auto& y, const auto& w) {
return [&y, &w](const auto& a, const auto& t0, const auto& v) {
return stan::math::wiener_lcdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lccdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_a_t0_v(y, w), a, t0, v);
}

TEST_F(Wiener4MixArgs, wiener_lcdf_a_w_v) {
TEST_F(Wiener4MixArgs, wiener_lccdf_defective_a_w_v) {
auto f_a_w_v = [](const auto& y, const auto& t0) {
return [&y, &t0](const auto& a, const auto& w, const auto& v) {
return stan::math::wiener_lcdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lccdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_a_w_v(y, t0), a, w, v);
}

TEST_F(Wiener4MixArgs, wiener_lcdf_t0_w_v) {
TEST_F(Wiener4MixArgs, wiener_lccdf_defective_t0_w_v) {
auto f_t0_w_v = [](const auto& y, const auto& a) {
return [&y, &a](const auto& t0, const auto& w, const auto& v) {
return stan::math::wiener_lcdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lccdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_t0_w_v(y, a), t0, w, v);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ TEST(mathMixDouble, wiener4_lcdf) {
double t0 = 0.2;
double w = 0.5;
double v = 1.5;
stan::math::wiener_lcdf(y, a, t0, w, v, 1e-4);
stan::math::wiener_lcdf_defective(y, a, t0, w, v, 1e-4);
}

TEST(mathMixVar, wiener4_lcdf) {
Expand All @@ -17,7 +17,7 @@ TEST(mathMixVar, wiener4_lcdf) {
var t0 = 0.2;
var w = 0.5;
var v = 1.5;
stan::math::wiener_lcdf(y, a, t0, w, v, 1e-4);
stan::math::wiener_lcdf_defective(y, a, t0, w, v, 1e-4);
}

TEST(mathMixFVar, wiener4_lcdf) {
Expand All @@ -29,5 +29,5 @@ TEST(mathMixFVar, wiener4_lcdf) {
fvar<var> w = 0.5;
fvar<var> v = 1.5;
double error = 1e-4;
stan::math::wiener_lcdf(y, a, t0, w, v, error);
stan::math::wiener_lcdf_defective(y, a, t0, w, v, error);
}
Original file line number Diff line number Diff line change
Expand Up @@ -2,46 +2,46 @@
#include <test/unit/math/test_ad.hpp>
#include <test/unit/math/mix/prob/util.hpp>

TEST_F(Wiener4MixArgs, wiener_lccdf_y_a_t0) {
TEST_F(Wiener4MixArgs, wiener_lcdf_defective_y_a_t0) {
auto f_y_a_t0 = [](const auto& w, const auto& v) {
return [&w, &v](const auto& y, const auto& a, const auto& t0) {
return stan::math::wiener_lccdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lcdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_y_a_t0(w, v), y, a, t0);
}

TEST_F(Wiener4MixArgs, wiener_lccdf_y_a_w) {
TEST_F(Wiener4MixArgs, wiener_lcdf_defective_y_a_w) {
auto f_y_a_w = [](const auto& t0, const auto& v) {
return [&t0, &v](const auto& y, const auto& a, const auto& w) {
return stan::math::wiener_lccdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lcdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_y_a_w(t0, v), y, a, w);
}

TEST_F(Wiener4MixArgs, wiener_lccdf_y_a_v) {
TEST_F(Wiener4MixArgs, wiener_lcdf_defective_y_a_v) {
auto f_y_a_v = [](const auto& t0, const auto& w) {
return [&t0, &w](const auto& y, const auto& a, const auto& v) {
return stan::math::wiener_lccdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lcdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_y_a_v(t0, w), y, a, v);
}

TEST_F(Wiener4MixArgs, wiener_lccdf_y_t0_w) {
TEST_F(Wiener4MixArgs, wiener_lcdf_defective_y_t0_w) {
auto f_y_t0_w = [](const auto& a, const auto& v) {
return [&a, &v](const auto& y, const auto& t0, const auto& w) {
return stan::math::wiener_lccdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lcdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_y_t0_w(a, v), y, t0, w);
}

TEST_F(Wiener4MixArgs, wiener_lccdf_y_t0_v) {
TEST_F(Wiener4MixArgs, wiener_lcdf_defective_y_t0_v) {
auto f_y_t0_v = [](const auto& a, const auto& w) {
return [&a, &w](const auto& y, const auto& t0, const auto& v) {
return stan::math::wiener_lccdf(y, a, t0, w, v, 1e-4);
return stan::math::wiener_lcdf_defective(y, a, t0, w, v, 1e-4);
};
};
stan::test::expect_ad(f_y_t0_v(a, w), y, t0, v);
Expand Down
Loading