Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Problem using MISO #43

Closed
micheloz opened this issue Feb 27, 2021 · 3 comments
Closed

Problem using MISO #43

micheloz opened this issue Feb 27, 2021 · 3 comments

Comments

@micheloz
Copy link

Applying the example of article "SysIdentPy: A Python package for System Identificationusing NARMAX models" gives an error.
Typing :
model = PolynomialNarmax(non_degree=2,order_selection=True,ylag=2, xlag=[[1, 2], [1, 2]],info_criteria='aic', estimator='least_squares',)
Gives : -

TypeError Traceback (most recent call last)

in ()
----> 1 model = PolynomialNarmax(non_degree=2,order_selection=True,ylag=2, xlag=[[1, 2], [1, 2]],info_criteria='aic', estimator='least_squares',)

2 frames

/content/gdrive/My Drive/python/03_WP/sysidentpy/base.py in (.0)
116 # create only the lags passed from list
117 x_vec_tmp = []
--> 118 x_vec_tmp.extend([lag + 1000*np.ones(np.size(lag)) for lag in xlag])
119 x_vec_tmp = np.array(x_vec_tmp)
120 elif isinstance(xlag, int) and n_inputs == 1:

TypeError: can only concatenate list (not "int") to list

@wilsonrljr
Copy link
Owner

wilsonrljr commented Feb 28, 2021

Hi @micheloz . You just have to set the n_inputs=2. You can check some examples here: http://sysidentpy.org/examples/multiple_inputs_example.html

PolynomialNarmax(non_degree=2, order_selection=True, ylag=2, xlag=[[1, 2], [1, 2]], info_criteria='aic', estimator='least_squares', n_inputs=2)

Let me know if everything works as expected with that modification. There were some modifications and new features since the article was published, so I suggest you to take a look on our documentation.

@micheloz
Copy link
Author

micheloz commented Mar 1, 2021

Hi, thanks it works fine with following additional options (given in http://sysidentpy.org/examples/multiple_inputs_example.html) :
"n_info_values=15, n_terms=4, extended_least_squares=False"
However, there is still something wrong as the example given in the paper (without these options) leads to above errors.
Regards

@wilsonrljr
Copy link
Owner

Thanks, @micheloz. The paper is missing the "n_inputs" parameter. As we show in the docs, now you have to set the number of inputs when modeling a multiple input system.

The paper is a reference to cite our package, but since we are implementing changes and new features all the time, the best place to get into SysIdentPy is the package documentation. Actually, we try not to change much of the current state, even if we add new feature. But the "n_inputs" is really missing in the paper.

I'm closing this issue, but feel free to re-open or open a new one if get some error using the package.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants