# Best practice for storing, passing, and managing parameters in economic models

**URL:** <https://discourse.julialang.org/t/best-practice-for-storing-passing-and-managing-parameters-in-economic-models/64705>\
**Category:** Finance and Economics\
**Tags:** performance\
**Created:** [July 15, 2021, 4:52pm UTC](https://discourse.julialang.org/t/best-practice-for-storing-passing-and-managing-parameters-in-economic-models/64705 "2021-07-15T16:52:37Z")\
**Posts on this page:** 1\
**Showing post:** 15

<div class="post-metadata">

**Author:** ![PatrickMcFarlane](https://sea2.discourse-cdn.com/julialang/user_avatar/discourse.julialang.org/patrickmcfarlane/32/50027_2.png) [@PatrickMcFarlane](https://discourse.julialang.org/u/PatrickMcFarlane)\
**Post date:** [July 17, 2021, 12:21am UTC](https://discourse.julialang.org/t/best-practice-for-storing-passing-and-managing-parameters-in-economic-models/64705/15 "2021-07-17T00:21:39Z")

</div>

> [@lmiq](#):
>
> Using `@set` is of course one of the options. On the other side, how can tuple help there? (If there is a better syntax using a tuple for that I will be glad to know).

Yes you are correct. `@set` alone won’t work - the tuple doesn’t get changed when you call it again. I saw [this thread](https://discourse.julialang.org/t/alternative-to-mutable-named-tuple/38375/8) explaining how to make it work with the BangBang package though. For example:

```julia
julia>using BangBang

julia> ParamTupl = @with_kw (α = 0.5, β = 0.9)
##NamedTuple_kw#257 (generic function with 2 methods)

julia> p = ParamTupl()
(α = 0.5, β = 0.9)

julia> @set p.β = 0.7
(α = 0.5, β = 0.7)

julia> p
(α = 0.5, β = 0.9)

# now with BangBang
julia> @set!! p.β = 0.7
(α = 0.5, β = 0.7)

julia> p
(α = 0.5, β = 0.7)

```

The main advantage with named tuples is that you don’t have to specify types to get optimizations to work so in that sense they may be a bit more user friendly. Not sure there are advantages beyond that.

---

_[View the full topic](https://discourse.julialang.org/t/best-practice-for-storing-passing-and-managing-parameters-in-economic-models/64705)._
