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

rescale method of functionset.py error #24

Open
andialles opened this issue Jan 4, 2021 · 1 comment
Open

rescale method of functionset.py error #24

andialles opened this issue Jan 4, 2021 · 1 comment

Comments

@andialles
Copy link

andialles commented Jan 4, 2021

the rescale method of functionset.py errors if stdev == 0.

def rescale(y):
ystd = np.std(y)
if ystd != 0:
y_scaled = old_div(y, ystd)
else:
y_scaled = y
return ystd, y_scaled

fixes it for me. idk if this is desired behavior.

EDIT:
Found a second occurrence of the problem in lines 205ff. Fix:
for j in range(m):
if Ustd[j] != 0:
B[:, j] = old_div(B[:, j], Ustd[j])
D[:, j] = old_div(D[:, j], Ustd[j])

@RBdC
Copy link
Collaborator

RBdC commented Jan 8, 2021

Dear andialles,
thank you very much for your post and your interest in Sippy.
Your simple solution actually fixes the problem, but it is not definitive.
Please note that system identification should be avoided when input/output data are low informative, that is, when the standard deviation of even one input/output vector is equal (or very close to) zero.
It will be our our care to solve this issue by implementing a function that checks stdev of I/O data, and then rejects to perform sys-id (and/or emits a warning) below a suitable threshold value.
We will release this update in the next future
All the best
Sippy Team

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