{"id":22752428,"url":"https://github.com/perrette/iis","last_synced_at":"2025-03-30T06:44:25.142Z","repository":{"id":29903486,"uuid":"33449173","full_name":"perrette/iis","owner":"perrette","description":"Iterative Importance Sampling (IIS) for bayesian parameter estimation of physical models","archived":false,"fork":false,"pushed_at":"2015-04-06T16:32:14.000Z","size":944,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-05T08:51:35.766Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/perrette.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-05T17:37:46.000Z","updated_at":"2015-04-25T11:13:55.000Z","dependencies_parsed_at":"2022-09-17T04:01:13.595Z","dependency_job_id":null,"html_url":"https://github.com/perrette/iis","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perrette%2Fiis","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perrette%2Fiis/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perrette%2Fiis/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/perrette%2Fiis/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/perrette","download_url":"https://codeload.github.com/perrette/iis/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246285668,"owners_count":20752953,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-12-11T05:11:44.920Z","updated_at":"2025-03-30T06:44:25.123Z","avatar_url":"https://github.com/perrette.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"IIS\n===\nIterative Importance Sampling (IIS) for bayesian parameter estimation of physical models\n\nBackground\n----------\nThis module has some bearing with [pymc](https://github.com/pymc-devs/pymc) \nbut focuses on relatively computationally-\nexpensive physical models. It is based on Gaussian approximation of parameter\ndistribution and resulting model state, but is more robust than the Ensemble \nKalman Filter with respect to deviations from non-linearity ([Annan and Hargreave, 2010](http://doi.org/10.1016/j.ocemod.2010.02.003))\nIn the best cases, it allows convergence of a 50 to 500-member model ensemble\nwithin a few 10s of iterations (e.g. notebooks  [here](http://nbviewer.ipython.org/github/perrette/iis/blob/master/notebooks/iis_concept.ipynb)\nand [there](http://nbviewer.ipython.org/github/perrette/iis/blob/master/notebooks/examples.ipynb)). \nThis is much faster than classical Monte Carlo Markov Chains, \nwhich are more general (not limited to Gaussian cases) but require 10,000s of \niterations. Even without perfect, steady convergence of the posterior PDF \n(say, non-linear model with ensemble limited to 50 members), \nthe IIS method can help \"tuning\" the model ensemble to within the range of \nobservations, which is not always a trivial task \"by hand\".\n\nThe concept is explained in more details [as a notebook](http://nbviewer.ipython.org/github/perrette/iis/blob/master/notebooks/iis_concept.ipynb) and in the paper from [Annan and Hargreaves (2010)](http://doi.org/10.1016/j.ocemod.2010.02.003), from which this package took its inspiration from.\n\nGetting started\n---------------\n\nDefine some model to estimate.\n\n- a forward function to integrate the model, here 2-param into scalar:\n\n        def mymodel(params):\n            \"\"\"User-defined model with two parameters\n\n            Parameters\n            ----------\n            params : 1-D numpy.ndarray of size 2\n\n            Returns\n            -------\n            state : float\n                return value\n            \"\"\"\n            return params[0] + params[1]*2\n\n- distributions that represent prior knowledge on model parameter\n  and likelihood functions, using `scipy.stats` distributions:\n\n        from scipy.stats import norm, uniform\n        likelihood = norm(loc=1, scale=1)  # normal, univariate distribution mean 1, s.d. 1\n        prior = [norm(loc=0, scale=10), uniform(loc=-10, scale=20)] \n\n- Use `iis` to estimate parameters and state:\n\n        from iis import IIS, Model\n        model = Model(mymodel, likelihood, prior=prior)  # define the model \n        solver = IIS(model)\n        ensemble = solver.estimate(size=500)\n    \n- A number of methods to analyze the results\n\n        ensemble.to_dataframe()     # convert to pandas dataframe\n        solver.to_panel()           # convert to pandas panel\n        solver.plot_history()\n        ensemble.scatter_matrix()\n\n\nCheck in-line help for more option on `iis.IIS.estimate`, `iis.Model` and so on as well as [notebook examples](http://nbviewer.ipython.org/github/perrette/iis/blob/master/notebooks/examples.ipynb)\n\n\nDependencies\n------------\n\n- Required:\n \n        - numpy (tested with 1.9.2) \n        - scipy (tested with 0.15.1)\n\n- Optional:\n\n        - pandas (plotting only) (tested with 0.15.2)\n\nInstall\n-------\n\npython setup.py install\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperrette%2Fiis","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fperrette%2Fiis","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fperrette%2Fiis/lists"}