Skip to content

Commit

Permalink
fix: Set the simulation state count in each independent `modelLikelih…
Browse files Browse the repository at this point in the history
…ood` class

This is necessary so that, for example, the `modelLikelihoodGalaxyPopulation` class can store results to groups numbered by the state count.
  • Loading branch information
abensonca committed Dec 13, 2024
1 parent 07dff48 commit 8557bc3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 0 deletions.
1 change: 1 addition & 0 deletions source/models.likelihoods.independent_likelihoods.F90
Original file line number Diff line number Diff line change
Expand Up @@ -307,6 +307,7 @@ Return the log-likelihood for the halo mass function likelihood function.
end forall
call modelLikelihood_%simulationState%update (stateVectorMapped(1:size(modelLikelihood_%parameterMap)),logState=.false.,isConverged=.false.)
call modelLikelihood_%simulationState%chainIndexSet(simulationState%chainIndex())
call modelLikelihood_%simulationState%countSet (simulationState%count ())
! Determine if the chain is already accepted - if it is we set the proposed prior to be impossible so that the model will not actually be evaluated.
if (logLikelihoodCurrent > self%logLikelihoodAccept) then
logPriorProposed_=logImpossible
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -262,6 +262,7 @@ Return the log-likelihood for the halo mass function likelihood function.
end forall
call modelLikelihood_%simulationState%update (stateVectorMapped(1:size(modelLikelihood_%parameterMap)),logState=.false.,isConverged=.false.)
call modelLikelihood_%simulationState%chainIndexSet(simulationState%chainIndex())
call modelLikelihood_%simulationState%countSet (simulationState%count ())
! Evaluate this likelihood
timeEvaluate_=-1.0
logLikelihood =+modelLikelihood_%modelLikelihood_%evaluate( &
Expand Down

0 comments on commit 8557bc3

Please sign in to comment.