Dear all,
Is this a good way to define parameters in Julia?
using Parameters
para_def = @with_kw (
β=0.87,
δ=0.06,
γ=2,
α=0.35,
wage=1,
za=1,
ϵ=3,
μ=ϵ / (ϵ - 1),
D=1,
phil=0.00,
nzp=2,
zp_sd_target=0.43,
piL=0.80,
nq=1,
ntau=1,
nzt=11,
rho_zt=0.59,
sigma_zt=0.13,
runexp=1,
nr=6,
chi0=0.98,
chi1=0.047,
psi=3.2,
k_l=0.01,
k_h=6.0,
a_l=0.01,
a_h=3.0,
na=50,
nk=50,
Nh=20,
Tshock=400,
Nfirms = 10000,
Tperiods = 500)
paras = para_def()
If they are constant this looks reasonable to me. If not use a mutable struct.
I use .yaml files for readability, but that has more overhead:
2 Likes