Hello,
I am generating an array with some numeric parameters that then I pass to a function as:
parms = [1,2,3,4,5]
function x!(pt)
μ, κ, δ, ω, η = p
return( ((μ+κ)*(δ+ω))^(1/η) )
end
x(parms)
It would be useful to address the single parameters by name, so that I can have flexibility in the definition of the function. That is: I don’t have to put the arguments in the same order as the function’s structure. This is equivalent to R’s
parms <- c(kappa=2, mu=1, delta=3, eta=5, omega=4)
x <- function(p) {
m = p["mu"]
k = p["kappa"]
d = p["delta"]
o = p["omega"]
e = p["eta"]
return( ((m+k)*(d+o))^(1/e) )
}
x(parms)
I have seen some people use TOML
but I think it is an overkill and generates files .tomls that break the Julia environment.
Thanks