Skip to content

Commit

Permalink
Fix order of outputs for hiatus methods
Browse files Browse the repository at this point in the history
  • Loading branch information
brenhinkeller committed May 26, 2024
1 parent 51f2f10 commit 530724a
Showing 1 changed file with 15 additions and 7 deletions.
22 changes: 15 additions & 7 deletions src/StratMetropolis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@
model_heights = model_heights[active_height_t]
mdl = StratAgeModel(model_heights, agedist)

return mdl, agedist, lldist, hiatusdist
return mdl, agedist, hiatusdist, lldist
end

## --- Stratigraphic MCMC model without hiatus, with distribution LL # # # # # #
Expand Down Expand Up @@ -264,7 +264,7 @@
model_heights = model_heights[active_height_t]
mdl = StratAgeModel(model_heights, agedist)

return mdl, agedist, lldist, hiatusdist
return mdl, agedist, hiatusdist, lldist
end

## --- Stratigraphic MCMC model without hiatus, for radiocarbon ages # # # # # #
Expand Down Expand Up @@ -405,7 +405,7 @@
model_heights = model_heights[active_height_t]
mdl = StratAgeModel(model_heights, agedist)

return mdl, agedist, lldist, hiatusdist
return mdl, agedist, hiatusdist, lldist
end

## --- # Internals of the Markov chain
Expand Down Expand Up @@ -716,9 +716,13 @@
if model_agesₚ[h-1] == model_agesₚ[h]
n = findclosestunequal(model_agesₚ, h)
if n < h
model_agesₚ[n:h-1] .= model_agesₚ[n]
@inbounds for i = n:h-1
model_agesₚ[i] = model_agesₚ[n]
end
elseif n > h
model_agesₚ[h:n] .= model_agesₚ[n]
@inbounds for i = h:n
model_agesₚ[i] = model_agesₚ[n]
end
end
end
end
Expand Down Expand Up @@ -809,9 +813,13 @@
if model_agesₚ[h-1] == model_agesₚ[h]
n = findclosestunequal(model_agesₚ, h)
if n < h
model_agesₚ[n:h-1] .= model_agesₚ[n]
@inbounds for i = n:h-1
model_agesₚ[i] = model_agesₚ[n]
end
elseif n > h
model_agesₚ[h:n] .= model_agesₚ[n]
@inbounds for i = h:n
model_agesₚ[i] = model_agesₚ[n]
end
end
end
end
Expand Down

0 comments on commit 530724a

Please sign in to comment.