wham icon indicating copy to clipboard operation
wham copied to clipboard

Inputting new parameters (par = ) into simulate() function

Open emilylil opened this issue 2 years ago • 1 comments

I just downloaded the most recent version of WHAM (main branch) and I'm running into the following issue:

When I change the input parameters in the simulate() function of a fitted object, I'm getting this error:

simdata <- mod.OM$simulate(par=simpar,complete=T)

Error in retape(set.defaults = FALSE) : Error when reading the variable: 'agesvec'. Please check data and parameters. In addition: Warning message: In retape(set.defaults = FALSE) : Expected object. Got NULL.

I don't have a variable agesvec, so I know its something internal. And I made sure that par and and simpar have the same number of parameters. I noticed that "mod.OM$last.par" or "mod.OM$last.par.best" now output the fixed and random effects (before it just output the fixed effects). That might be related to the issue, but it's not the issue exactly because I've tried the simulate() function both ways- the fixed effects or the fixed effects and random effects.

I also tried running the simulate() function with par = mod.OM$env$last.par which should ostensibly work because that is the default input value, but no luck.

Any help or insight would be greatly appreciated!

emilylil avatar Jan 09 '23 22:01 emilylil