UndefVarError: update_param! not defined

Hi there,

I’ve been following the tutorials and was trying to use update_param! on the MimiFUND model but keep getting the following error:

update_param!(m, :climatesensitivity, 5)
ERROR: UndefVarError: update_param! not defined
Stacktrace:
 [1] top-level scope at none:1

The only thing that I’ve run before this is:

using MimiFUND
m = MimiFUND.get_model()

as instructed in the Tutorial. Would appreciate any help! I’ve already tried pkg> up. Thanks!

Hi there,

Have you run using Mimi yet? Since update_param! is a Mimi function, not a MimiFUND function, it is not yet in your namespace if you have not run using Mimi. As in the readme for MimiFUND, I think the steps you are looking for are:

using Mimi
using MimiFUND

m = MimiFUND.get_model()                        # Get the default version of the FUND model
set_param!(m, :climatesensitivity, 5)        # make any modifications to your model using Mimi
run(m)

# later we can do
update_param!(m, :climatesensitivity, 6)        # make any modifications to your model using Mimi

Note that since the default MimiFUND model sets the parameter :climatesensitivity using the default keyword argument, we actually need to use set_param! for this first call and then going forward you can modify the model with update_param!. This is a complexity we are currently working to remove, and only applies in certain cases where a default is used in model construction instead of an explicit call to set_param!.

Lisa

Thanks so much! I think it’s working now. Much appreciated :slight_smile:

1 Like