Skip to content

Commit

Permalink
switch back to tmb distributions
Browse files Browse the repository at this point in the history
  • Loading branch information
msupernaw committed Sep 24, 2024
1 parent bf6e681 commit 513ee9e
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
4 changes: 2 additions & 2 deletions inst/include/distributions/functors/lognormal_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,13 +88,13 @@ namespace fims_distributions
if(this->input_type == "data"){
if(this->observed_values->at(i) != this->observed_values->na_value){
// this->lpdf_vec[i] = this->keep[i] * -dnorm(log(this->observed_values->at(i)), logmu[i], logsd[i], true) - log(this->observed_values->->at(i));
this->lpdf_vec[i] = fims_math::dnorm(log(this->observed_values->at(i)), logmu[i], logsd[i], true) - log(this->observed_values->at(i));
this->lpdf_vec[i] = dnorm(log(this->observed_values->at(i)), logmu[i], logsd[i], true) - log(this->observed_values->at(i));
} else {
this->lpdf_vec[i] = 0;
MODEL_LOG << "lpdf_vec for obs " << i << " is: " << this->lpdf_vec[i] <<std::endl;
}
} else {
this->lpdf_vec[i] = fims_math::dnorm(log(this->x[i]), logmu[i], logsd[i], true);
this->lpdf_vec[i] = dnorm(log(this->x[i]), logmu[i], logsd[i], true);
}

lpdf += this->lpdf_vec[i];
Expand Down
2 changes: 1 addition & 1 deletion inst/include/distributions/functors/multinomial_lpmf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ namespace fims_distributions
}
}

this->lpdf_vec[i] = fims_math::dmultinom(x_vector, prob_vector, true);
this->lpdf_vec[i] = dmultinom((vector<Type>)x_vector, (vector<Type>) prob_vector, true);
lpdf += this->lpdf_vec[i];
/*
if (this->simulate_flag)
Expand Down
4 changes: 2 additions & 2 deletions inst/include/distributions/functors/normal_lpdf.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ struct NormalLPDF : public DensityComponentBase<Type> {
if(this->input_type == "data"){
if(this->observed_values->at(i) != this->observed_values->na_value){
// this->lpdf_vec[i] = this->keep[i] * -dnorm(this->observed_values->at(i), mu[i], sd[i], true);
this->lpdf_vec[i] = fims_math::dnorm(this->observed_values->at(i), mu[i], sd[i], true);
this->lpdf_vec[i] = dnorm(this->observed_values->at(i), mu[i], sd[i], true);
DISTRIBUTIONS_LOG << "obsered_values " << i << " is: " << this->observed_values->at(i) << std::endl;
DISTRIBUTIONS_LOG << "mu " << i << " is: " << mu[i] << std::endl;
DISTRIBUTIONS_LOG << "sd " << i << " is: " << sd[i] << std::endl;
Expand All @@ -93,7 +93,7 @@ struct NormalLPDF : public DensityComponentBase<Type> {
}

} else {
this->lpdf_vec[i] = fims_math::dnorm(this->x[i], mu[i], sd[i], true);
this->lpdf_vec[i] = dnorm(this->x[i], mu[i], sd[i], true);
DISTRIBUTIONS_LOG << "x " << i << " is: " << this->x[i] << std::endl;
DISTRIBUTIONS_LOG << "mu " << i << " is: " << mu[i] << std::endl;
DISTRIBUTIONS_LOG << "sd " << i << " is: " << sd[i] << std::endl;
Expand Down

0 comments on commit 513ee9e

Please sign in to comment.