Code Monkey home page Code Monkey logo

pysip's People

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

pysip's Issues

Bug on multi threading

While running the armadillo example "fit bayesian", the chains are running correctly, but at the end the following error appears:

Exception ignored in: <function tqdm.__del__ at 0x000002994E768F28>
Traceback (most recent call last):
  File "xx\anaconda3\lib\site-packages\tqdm\_tqdm.py", line 931, in __del__
    self.close()
  File "xx\anaconda3\lib\site-packages\tqdm\_tqdm.py", line 1133, in close
    self._decr_instances(self)
  File "xx\anaconda3\lib\site-packages\tqdm\_tqdm.py", line 496, in _decr_instances
    cls.monitor.exit()
  File "xx\anaconda3\lib\site-packages\tqdm\_monitor.py", line 52, in exit
    self.join()
  File "xx\anaconda3\lib\threading.py", line 1029, in join
    raise RuntimeError("cannot join current thread")
RuntimeError: cannot join current thread

missing dependencies

arviz & seaborn are not present in the dependencies (appreas in the example "armadillo")

Automatic calculation of matrices for state space models

To code new dynamic models (such as RC network) it is not very straightforward to calculate and write all the matrices A, B, C, D and their derivatives respecting to the different parameters (dA, dB). It takes some time and there is a non-negligible risk of error.

The following notebook presents a conversion function that can be integrated to evaluate automatically the matrces in the "update_continuous_ssm" and "update_continuous_dssm" functions for each model, using only the continuous differential equations.

The example deals with the model twti_rorircawai

Works with sympy version >=1.4

convert_equations_to_matrices_pySIP.pdf
(I can share with you the .ipynb file!)

arviz library update

Hi there!
I am trying to use pysip version 1.0 but experience some trouble with the dependencies.
Currently arviz version 0.14 is installed but it creates some problems with the latest scipy version : ImportError: cannot import name 'gaussian' from 'scipy.signal'
It seems that upgrading arviz to version 0.18 would solve the problem : https://discourse.pymc.io/t/importerror-cannot-import-name-gaussian-from-scipy-signal/14170/4
Would it be possible to update the arviz version in the requirements?

Pickling Error

Hello,
I get the following error when I run the "fit_bayesian" file:

The above exception was the direct cause of the following exception:
Traceback (most recent call last):
  File "Xx\pySIP-0.8\fit_bayesian.py", line 43, in <module>
    fit = reg.fit(df=df, inputs=inputs, outputs='T_int')
  File "Xxx\anaconda3\envs\pysip\lib\site-packages\pysip\regressors\bayesian.py", line 124, in fit
    uchains, stats, options = dhmc.sample(q0, n_draws, n_chains, n_warmup, options)
  File "Xxx\anaconda3\envs\pysip\lib\site-packages\pysip\mcmc\hmc.py", line 193, in sample
    for n in range(n_chains)
  File "Xxx\anaconda3\envs\pysip\lib\site-packages\joblib\parallel.py", line 1017, in __call__
    self.retrieve()
  File "Xxx\anaconda3\envs\pysip\lib\site-packages\joblib\parallel.py", line 909, in retrieve
    self._output.extend(job.get(timeout=self.timeout))
  File "Xxx\anaconda3\envs\pysip\lib\site-packages\joblib\_parallel_backends.py", line 562, in wrap_future_result
    return future.result(timeout=timeout)
  File "Xxx\anaconda3\envs\pysip\lib\concurrent\futures\_base.py", line 435, in result
    return self.__get_result()
  File "Xxx\anaconda3\envs\pysip\lib\concurrent\futures\_base.py", line 384, in __get_result
    raise self._exception
PicklingError: Could not pickle the task to send it to the workers.

Do you have any idea what the problem is?
The "fit_frequentist" file runs properly.
Thanks

lambda (anonymous function) in code disallow correct pickling for multiprocess

Hello !

I'm trying to run pySIP with a distributed backend which is compatible with joblib. I have gone through pickling error. On a local copy of pySIP, I noticed the presence of lambda function in the library core that lead to pickling errors.

I can do a pull request with extra tests to make pySIP more robust to pickling which should improve the compatibility with multiprocessing and distributed computation.

trying to use pySIP with raw field datas

Trying to use the testpySIP.py file with my own datas,

datas_ite_step1800s.zip

AllieHab_ITE

tried with the following params:

parameters = [
    dict(name='Ro', scale=1e-2, transform='log'),
    dict(name='Ri', scale=1e-3, transform='log'),
    dict(name='Cw', scale=1e7 / sT, transform='log'),
    dict(name='Ci', scale=1e6 / sT, transform='log'),
    dict(name='sigw_w', scale=1e-2 * sT**0.5, transform='fixed'),
    dict(name='sigw_i', value=1e-2 * sT**0.5, transform='fixed'),
    dict(name='sigv', scale=1e-1, transform='log'),
    dict(name='x0_w', loc=21.0, transform='none'),
    dict(name='x0_i', value=22, transform='fixed'),
    dict(name='sigx0_w', value=0.1, transform='fixed'),
    dict(name='sigx0_i', value=0.1, transform='fixed'),
]

got this :

Warning: Desired error not necessarily achieved due to precision loss.
         Current function value: 121.075823
         Iterations: 67
         Function evaluations: 159
         Gradient evaluations: 148

             θ      σ(θ)    pvalue    |g(η)|  |dpen(θ)|
Ro   2.684e-08 4.303e-06 9.950e-01 1.283e-04  1.388e-05
Ri   1.897e-03 6.222e-04 2.385e-03 1.926e-04  2.779e-17
Cw   4.645e+08 7.447e+10 9.950e-01 1.274e-04  6.209e-30
Ci   3.083e+02 1.196e+02 1.017e-02 1.990e-05  1.409e-19
sigv 2.352e-05 2.746e-03 9.932e-01 1.251e-06  1.808e-09
x0_w 1.684e+01 1.788e+00 0.000e+00 4.057e-05  0.000e+00
             Ro         Ri         Cw         Ci       sigv       x0_w
Ro    1.000e+00  9.074e-03 -1.000e+00 -7.330e-03  9.972e-01  1.330e-02
Ri    9.074e-03  1.000e+00 -8.487e-03 -6.613e-01 -1.731e-02 -6.531e-01
Cw   -1.000e+00 -8.487e-03  1.000e+00  7.165e-03 -9.972e-01 -1.441e-02
Ci   -7.330e-03 -6.613e-01  7.165e-03  1.000e+00  1.710e-02  2.154e-01
sigv  9.972e-01 -1.731e-02 -9.972e-01  1.710e-02  1.000e+00  4.101e-04
x0_w  1.330e-02 -6.531e-01 -1.441e-02  2.154e-01  4.101e-04  1.000e+00

PySIP_w_smp1

Best

Alex

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.