Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Allow distributions to return vectors #2751

Open
wants to merge 8 commits into
base: develop
Choose a base branch
from
Prev Previous commit
fix normal lpdf test names
  • Loading branch information
SteveBronder committed Jul 8, 2022
commit 704533f1b6562ccb864306c806d2d9598f16682d
2 changes: 1 addition & 1 deletion stan/math/prim/prob/normal_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ inline auto normal_lpdf(const T_y& y, const T_loc& mu, const T_scale& sigma) {
}
if (include_summand<propto, T_scale>::value) {
if (RetType == ProbReturnType::Scalar) {
logp -= sum(log(sigma_val)) * N / size(sigma);
logp -= sum(log(sigma_val)) * N / math::size(sigma);
} else {
logp -= log(sigma_val);
}
Expand Down
4 changes: 2 additions & 2 deletions test/unit/math/rev/prob/normal_log_test.cpp
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#include <stan/math/rev.hpp>
#include <gtest/gtest.h>

TEST(ProbDistributionsNormal, intVsDouble) {
TEST(ProbDistributionsNormal, intVsDoublerev) {
using stan::math::var;
for (double thetaval = -5.0; thetaval < 6.0; thetaval += 0.5) {
var theta(thetaval);
Expand All @@ -22,7 +22,7 @@ TEST(ProbDistributionsNormal, intVsDouble) {
}
}

TEST(ProbNormal, test_vlpdf) {
TEST(ProbNormal, test_vlpdf_rev) {
using stan::math::var;
Eigen::Matrix<var, -1, 1> Y = Eigen::Matrix<double, -1, 1>::Random(5);
Eigen::Matrix<var, -1, 1> Mu = Eigen::Matrix<double, -1, 1>::Random(5);
Expand Down
You are viewing a condensed version of this merge commit. You can view the full changes here.