Created
September 15, 2023 14:52
-
-
Save SteveBronder/62911d8ada95c85008325300be834630 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stan/math/mix.hpp> | |
#include <test/unit/math/test_ad.hpp> | |
TEST(mathMixScalFun, wiener5_lpdf) { | |
using stan::math::fvar; | |
using stan::math::var; | |
fvar<var> y = 0; | |
fvar<var> a = 0; | |
fvar<var> t0 = 0; | |
double w = 0; | |
double v = 0; | |
double sv = 0; | |
double sw = 0; | |
double st0 = 0; | |
stan::math::wiener5_lpdf(y, a, t0, w, v, sv, st0); | |
auto f1 = [](const auto& y, const auto& a, const auto& t0, const auto& w, const auto& v) { | |
return [&y, &a, &t0, &w, &v](const auto& sv, const auto& st0) { | |
return stan::math::wiener5_lpdf(y, a, t0, w, v, sv, st0); | |
}; | |
}; | |
double y = 0.1; | |
double a = 2.0; | |
double t0 = 0.2; | |
double w = 0.5; | |
double v = 2.0; | |
double sv = 0.2; | |
double st0 = 0.3; | |
stan::test::expect_ad(f1(y, a, t0, w, v), sv, st0); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment