1

When running the AutoTs package with a VAR model as one of the component models, i get the following error:

"Maxlags is too large for the number of observations and the number of equations. The largest model cannot be estimated"

After looking at the module associated with the VAR model, i noticed that setting "Maxlags=None" would probably fix this.

However, there does not appear to be an option when fitting a model using the AutoTs package to fix any of the parameters (in this case, "Maxlags") of the component models (VAR for example), here. So I am wondering how I can fix this issue or otherwise set "MaxLags=None" in the context of running a VAR as part of the AutoTs procedure, rather than independently?

1 Answers1

4

Option 1

In the package documentation, they give this hack:

A Hack for Passing in Parameters (that aren’t otherwise available)
There are a lot of parameters available here, but not always all of the options available for a particular parameter are actually used in generated templates. Usually, very slow options are left out. If you are familiar with a model, you can try manualy adding those parameter values in for a run in this way… To clarify, you can’t usually add in entirely new parameters in this way, but you can often pass in new choices for existing parameter values.

Run AutoTS with your desired model and export a template.

Open the template in a text editor or Excel and manually change the param values to what you want.

Run AutoTS again, this time importing the template before running .fit().

There is no guarantee it will choose the model with the given params- choices are made based on validation accuracy, but it will at least run it, and if it does well, it will be incorporated into new models in that run (that’s how the genetic algorithms work).

Option 2

I saw on this page of the documentation that they give the signature of their wrappers for the different models used. For example, for VAR model:

class autots.models.statsmodels.VAR(name: str = 'VAR', frequency: str = 'infer', prediction_interval: float = 0.9, regression_type: str | None = None, holiday_country: str = 'US', random_seed: int = 2020, verbose: int = 0, maxlags: int = 15, ic: str = 'fpe', **kwargs)

Then I went to their code on github and found the class definition there:
https://github.com/winedarksea/AutoTS/blob/master/autots/models/statsmodels.py#L1757

So on your computer, where the libraries are installed for your project environment, you will be able to find the similar file autots/models/statsmodels.py
There, in the class __init() method, you can update the parameter maxlags: int = 15 to another default value like None.

Actually, this will not be enough as maxlags seems to be one of the parameters they tune, so you will need to go to the get_new_params(self, method: str = 'random') method and replace maxlags_choice = np.random.choice([None, 5, 15], size=1).item() by None.

rehaqds
  • 1,801
  • 4
  • 13