Skip to content

Commit

Permalink
Update SimTools.jl
Browse files Browse the repository at this point in the history
  • Loading branch information
jiewenTsai committed Dec 25, 2024
1 parent 9af60f5 commit e88aec9
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/SimTools.jl
Original file line number Diff line number Diff line change
Expand Up @@ -384,27 +384,27 @@ end
# ╔═╡ d792cfdb-503f-4986-a62d-02338db36ac4

"""
comparePara(Mcmc; name=:a)
comparePara(Mcmc; par=:a)
"""
function comparePara(Mcmc; name=:a)
function comparePara(Mcmc; par=:a)

if name==
True = getfield(Mcmc.truePara, Symbol(name))
Esti = vec(getfield(Mcmc.Post.mean, Symbol(name))[2:end,:])
if par==
True = getfield(Mcmc.truePara, Symbol(par))
Esti = vec(getfield(Mcmc.Post.mean, Symbol(par))[2:end,:])
else
True = getfield(Mcmc.truePara, Symbol(name))
Esti = getfield(Mcmc.Post.mean, Symbol(name))
True = getfield(Mcmc.truePara, Symbol(par))
Esti = getfield(Mcmc.Post.mean, Symbol(par))
end
Diff = abs.(Esti .- True)

names = ["Esti", "True", "|Diff|"]
par = ["Esti", "True", "|Diff|"]
values = [Esti True Diff]
values = round.(values, digits=3)


# print title
println(join(names, "\t"))
println(join(fill("=======", length(names)), "\t"))
println(join(par, "\t"))
println(join(fill("=======", length(par)), "\t"))
# print data
for row in 1:size(values, 1)
rounded_row = round.(values[row,:], digits=3)
Expand Down

0 comments on commit e88aec9

Please sign in to comment.