Wrong toolbox is being called for simulate()

I have a simple ARIMA model:
Mdl = regARIMA(minBIClags(v),0,0);
that is estimated for some variable v:
[EstMdl.v{v},~,~] = estimate(Mdl,y,'Display','off');
The class of the model is stored correctly:
class(EstMdl.v{v})
ans =
'regARIMA'
However, when I call the simulate() function:
sim_y = simulate(EstMdl.v{v}, num_observations, NumPaths=num_simulations, Y0=y, E0=innovations);
it uses the simulate() from the Risk Management Toolbox.
How can I ensure that the correct toolbox is used for this?
Thanks.

5 Commenti

Hi,
I am trying to reproduce this. Code I've used:
Mdl = regARIMA(1,0,0);
[v,~,~] = estimate(Mdl,(1:5)','Display','off');
%The class of the model is stored correctly:
class(v)
sim_y = simulate(v, 10, NumPaths=100, Y0=(1:5)', E0=rand(5,1));
This errors:
'Y0' is not a recognized parameter. For a list of valid name-value pair arguments, see the documentation for this function.
When setting a breakpoint in the sim_y = ... line and stepping in, MATLAB jumps into \toolbox\econ\econ\@regARIMA.
Can you try my reproduction example? If the behavior is as expected for my example but not for yours, please supply a reproducible example, i.e., include minBIClags and y.
Best wishes,
Harald
Thanks a lot, Harald!
I added
dbstop if error
before your code and it ran exactly like you described. The problem is that the sim_y=... command is inside a (double) loop and so it is not a practicable solution. My guess is that whichever prog is supposed to select the right version of simulate() based on class() is not working as intended. I'll proceed with the breakpoint approach for now but would really appreciate a heads-up on a solution that doesn't require manual intervention.
Best,
Pavel
Hi Pavel,
could you supply a reproducible example that demonstrates the unexpected use of simulate from Risk Management Toolbox?
Best wishes,
Harald
Thanks, Harald. I've used your code:
Mdl = regARIMA(1,0,0);
[v,~,~] = estimate(Mdl,(1:5)','Display','off');
%The class of the model is stored correctly:
class(v)
sim_y = simulate(v, 10, NumPaths=100, Y0=(1:5)', E0=rand(5,1));
This yields:
ans =
'regARIMA'
'Y0' is not a recognized parameter. For a list of valid name-value pair arguments, see the documentation for this function.
If instead I do:
Mdl = regARIMA(1,0,0);
[v,~,~] = estimate(Mdl,(1:5)','Display','off');
%The class of the model is stored correctly:
class(v)
dbstop if error
sim_y = simulate(v, 10, NumPaths=100, Y0=(1:5)', E0=rand(5,1));
then the output is:
ans =
'regARIMA'
'Y0' is not a recognized parameter. For a list of valid name-value pair arguments, see the documentation for this function.
K>>
Clicking on Step In pops up arima/simulate in the Editor but sim_y is still not computed even after that.
I don't know if that matters but because I'm working on multiple machines, I'm running everything in Matlab Online 2025b.
Thanks again,
Pavel
Harald
Harald il 10 Ott 2025
Modificato: Harald il 10 Ott 2025
Hi Pavel,
The effect of dbstop if error should in this case be the same as setting the breakpoint and stepping in.
Desktop or online version should not make a difference.
The problem in this case is just that there is no Y0 parameter in regARIMA/simulate:
Again, we'd need to see reproducible code that ends up incorrectly calling simulate from the Risk Management Toolbox.
Best wishes,
Harald

Accedi per commentare.

Risposte (0)

Categorie

Scopri di più su Biotech and Pharmaceutical in Centro assistenza e File Exchange

Richiesto:

PK
il 10 Ott 2025

Modificato:

il 10 Ott 2025

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by