Skip to content

Commit 0061232

Browse files
committed
updated parameter names
reordered legend for convergence plot to still make sense
1 parent b6ea6d0 commit 0061232

File tree

5 files changed

+8
-3
lines changed

5 files changed

+8
-3
lines changed

figures.jl

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ for file_type in file_types
3636

3737
# Plot results
3838
plot_params = (linewidth=2., dpi=300)
39-
paramNames = ["gNa" "gK" "gL" "σ"]
39+
paramNames = ["p₁" "p₂" "p₃" "σ"]
4040

4141
# Plot acceptance rate
4242
plot([mean(accepts[max(i-499,1):i]) for i in 1:numSamples], xlabel="Iteration",
@@ -56,11 +56,16 @@ for file_type in file_types
5656

5757
# Plot parameter convergence
5858
pTrueWithNoise = [1.0, 1.0, 1.0, 2.0]
59-
order = [4, 3, 1, 2] # TODO: Order needs fixing so all are visible
60-
plot(chain[:,order]./pTrueWithNoise[order]', label=paramNames[order'], xticks=([0,20000,40000],["0","2×10⁵","4×10⁵"]),
59+
order = [4, 3, 1, 2]
60+
plot(chain[:,order]./pTrueWithNoise[order]', label="", xticks=([0,20000,40000],["0","2×10⁵","4×10⁵"]),
6161
xlabel="Iteration", xlim=(0,numSamples);
6262
plot_params...)
63+
# Hodge podge of lines in the right order for the legend
64+
for i in 1:4
65+
plot!([-1], [-1], label=paramNames[i], color=findfirst(i.==order); plot_params...)
66+
end
6367
vline!([numSamples*0.25+0.5], label="Burn In", color=:red, linewidth=1.5, linestyle=:dot)
68+
ylims!(0.7,1.2)
6469
plots = [plots... vline!([numSamples*0.1+0.5], label="Adaption", color=:green, linewidth=1.5, linestyle=:dot, legend=nothing)]
6570

6671
# Plot posterior histograms

results/mcmc/cont_posterior.pdf

-344 Bytes
Binary file not shown.

results/mcmc/convergence.pdf

-8.48 KB
Binary file not shown.
-364 Bytes
Binary file not shown.
-344 Bytes
Binary file not shown.

0 commit comments

Comments
 (0)