Skip to content

Commit

Permalink
fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrea-Havron-NOAA committed Aug 6, 2024
1 parent 0abf9c3 commit 1b6898d
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions inst/include/interface/rcpp/rcpp_objects/rcpp_tmb_distribution.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -183,7 +183,15 @@ class DnormDistributionsInterface : public DistributionsInterfaceBase {
distribution->log_sd.resize(this->log_sd.size());
for(size_t i=0; i<this->log_sd.size(); i++){
distribution->log_sd[i] = this->log_sd[i].value_m;
if(distribution->log_sd[i].estimated_m){
info->RegisterParameterName("normal log_sd");
info->RegisterParameter(distribution->log_sd[i]);
}
if (this->log_sd.is_random_effect_m) {
error("standard deviations cannot be set to random effects")
}
}
info->variable_map[this->log_sd] = &(distribution)->log_sd;

info->density_components[distribution->id] = distribution;

Expand Down Expand Up @@ -276,6 +284,13 @@ class DlnormDistributionsInterface : public DistributionsInterfaceBase {
}
for(size_t i=0; i<log_logsd.size(); i++){
dlnorm.log_logsd[i] = this->log_logsd[i].value_m;
if(distribution->log_logsd[i].estimated_m){
info->RegisterParameterName("lognormal log_logsd");
info->RegisterParameter(distribution->log_logsd[i]);
}
if (this->log_logsd.is_random_effect_m) {
error("standard deviations cannot be set to random effects")
}
}
return dlnorm.evaluate();
}
Expand Down

0 comments on commit 1b6898d

Please sign in to comment.