Setting specific lagsΒΆ

Different ways to set the maximum lag for input and output

[2]:
import numpy as np
import pandas as pd
import matplotlib.pyplot as plt
from sysidentpy.polynomial_basis import PolynomialNarmax

If you pass int values for ylag and xlag, the lags are defined as a range from 1-ylag and 1-xlag.

For example: if ylag=4 then the candidate regressors are \(y_{k-1}, y_{k-2}, y_{k-3}, y_{k-4}\)

[7]:
model = PolynomialNarmax(non_degree=1,
                         order_selection=True,
                         n_info_values=10,
                         extended_least_squares=False,
                         ylag=4, xlag=4,
                         info_criteria='aic',
                         estimator='least_squares',
                         )

model.regressor_code
[7]:
array([[   0],
       [1001],
       [1002],
       [1003],
       [1004],
       [2001],
       [2002],
       [2003],
       [2004]])

If you pass the ylag and xlag as a list, only the lags related to values in the list will be created.

[8]:
model = PolynomialNarmax(non_degree=1,
                         order_selection=True,
                         n_info_values=10,
                         extended_least_squares=False,
                         ylag=[1, 4], xlag=[1, 4],
                         info_criteria='aic',
                         estimator='least_squares',
                         )

model.regressor_code
[8]:
array([[   0],
       [1001],
       [1004],
       [2001],
       [2004]])
[ ]: