Comments (5)
Yes this is doable. There are constrained SINDy versions available in the optimizers folder for affine constraints. Since your example constraint is equivalent to dS/dt + dI/dt + dR/dt = 0, and SINDy is fitting d/dt[S, I, R] = Theta(...) * Xi, this can be cast as a constraint on the coefficients in Xi -- i.e. that Xi^S + Xi^I + Xi^R = 0 since the Theta matrix is the same for each. This can be put into the affine form C*Xi = d = 0, which you will have to work out. Let me know if you have any more questions.
from pysindy.
Thank you for the suggestion Alan, it is very useful. I will check the implemented optimizers and the related examples.
from pysindy.
Hello @akaptano,
I wonder if there is a way to specify which interaction to be done between the terms, in other words how to constrain the theta matrix. For ex: if i have x,y,z , I would like to constrain theta to have only the individual terms (x, y, z) + the interaction: xz.
Thanks for your help
from pysindy.
The answer is yes, but your example can be done in two ways in the code. The first way is to constrain the model coefficient Xi, rather than constraining theta. This is what I described above, and it can be done in a way that the model only produces (x, y, z) terms + an interaction xz term.
The other way is to design a theta matrix that only contains the interaction term xz. This can be done with the GeneralizedLibrary class since this allows you to specify only a subset of the inputs for library generation -- check out the example at the bottom of the Example 1 Jupyter notebook to see how this can be done, or the last of the recent Youtube lectures that I put online.
Best,
Alan
from pysindy.
Hi @akaptano,
Thanks so much for your reply Alan, I will check both methods.
Best,
Slimane
from pysindy.
Related Issues (20)
- LinearRegression unknown keyword normalize HOT 5
- Implementation of graph data HOT 7
- Issue in plotting the graph using model.simulate HOT 1
- Total freedom in library functions with CustomLibrary HOT 1
- SINDy-PI for a system of ODEs
- simulating error(overflow) when expanded to the third order HOT 3
- [BUG] A lot of issues with the bayesian implementation (UQ-SINDy) HOT 3
- [BUG] No consistency in model.fit() HOT 8
- SINDy-PI/ one state derivative per model HOT 3
- Modeling Issues with Using Ensemble Methods HOT 1
- differentiation for cylindrical coordinate HOT 1
- There is a significant divergence between the model based on experimental data and the analytical solution HOT 1
- Can not import pysindy after installation HOT 8
- [BUG] SmoothedFiniteDifference does not have 'save_smooth' HOT 1
- [BUG] SSR optimizer always picks the first model it generates HOT 1
- [BUG] bad shape of model.coefficients() when using Lasso sklearn optimizer HOT 1
- Extracting dynamics and faster simulation HOT 2
- [BUG] 'PolynomialLibrary' object has no attribute 'calc_trajectory' HOT 1
- Feature library does not obey the set inputs_per_library [BUG] HOT 1
- Optimizer parameters validation improvement HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pysindy.