作者:Jonathan Feinberg

### 作者邮箱:

### 首页:https://github.com/jonathf/chaospy

### 文档:None

### 下载链接

.. image:: https://github.com/jonathf/chaospy/raw/master/docs/_static/chaospy_logo.svg

:height: 200 px :width: 200 px :align: center

|circleci| |codecov| |readthedocs| |downloads| |pypi| |binder|

.. |circleci| image:: https://img.shields.io/circleci/build/github/jonathf/chaospy/master :target: https://circleci.com/gh/jonathf/chaospy/tree/master .. |codecov| image:: https://img.shields.io/codecov/c/github/jonathf/chaospy :target: https://codecov.io/gh/jonathf/chaospy .. |readthedocs| image:: https://img.shields.io/readthedocs/chaospy :target: https://chaospy.readthedocs.io/en/master/?badge=master .. |downloads| image:: https://img.shields.io/pypi/dm/chaospy :target: https://pypistats.org/packages/chaospy .. |pypi| image:: https://img.shields.io/pypi/v/chaospy :target: https://pypi.org/project/chaospy .. |binder| image:: https://mybinder.org/badge_logo.svg :target: https://mybinder.org/v2/gh/jonathf/chaospy/master?filepath=docs%2Ftutorials

Chaospy is a numerical tool for performing uncertainty quantification using polynomial chaos expansions and advanced Monte Carlo methods implemented in Python.

Documentation _

Interactive tutorials with Binder _

Source code _

Issue tracker _

Code of Conduct _

Contribution Guideline _

Changelog _

Installation

Installation should be straight forward using pip _:

.. code-block:: bash

$ pip install chaospy

For more installation details, see the installation guide _.

Example Usage

chaospy is created to work well inside numerical Python ecosystem. You therefore typically need to import Numpy _ along side chaospy:

.. code-block:: python

>>> import numpy

>>> import chaospy

chaospy is problem agnostic, so you can use your own code using any means you find fit. The only requirement is that the output is compatible with numpy.ndarray format:

.. code-block:: python

>>> coordinates = numpy.linspace(0, 10, 100)

>>> def forward_solver(coordinates, parameters):

... """Function to do uncertainty quantification on."""

... param_init, param_rate = parameters

... return param_init*numpy.e**(-param_rate*coordinates)

We here assume that parameters contains aleatory variability with known probability. We formalize this probability in chaospy as a joint probability distribution. For example:

.. code-block:: python

>>> distribution = chaospy.J(chaospy.Uniform(1, 2), chaospy.Normal(0, 2))

>>> print(distribution)

J(Uniform(lower=1, upper=2), Normal(mu=0, sigma=2))

Most probability distributions have an associated expansion of orthogonal polynomials. These can be automatically constructed:

.. code-block:: python

>>> expansion = chaospy.generate_expansion(8, distribution)

>>> print(expansion[:5].round(8))

[1.0 q1 q0-1.5 q0*q1-1.5*q1 q0**2-3.0*q0+2.16666667]

Here the polynomial is defined positional, such that q0 and q1 refers to the uniform and normal distribution respectively.

The distribution can also be used to create (pseudo-)random samples and low-discrepancy sequences. For example to create Sobol sequence samples:

.. code-block:: python

>>> samples = distribution.sample(1000, rule="sobol")

>>> print(samples[:, :4].round(8))

[[ 1.5 1.75 1.25 1.375 ]

[ 0. -1.3489795 1.3489795 -0.63727873]]

We can evaluating the forward solver using these samples:

.. code-block:: python

>>> evaluations = numpy.array([forward_solver(coordinates, sample)

... for sample in samples.T])

>>> print(evaluations[:3, :5].round(8))

[[1.5 1.5 1.5 1.5 1.5 ]

[1.75 2.00546578 2.29822457 2.63372042 3.0181921 ]

[1.25 1.09076905 0.95182169 0.83057411 0.72477163]]

Having all these components in place, we have enough components to perform point collocation. Or in other words, we can create a polynomial approximation of forward_solver:

.. code-block:: python

>>> approx_solver = chaospy.fit_regression(expansion, samples, evaluations)

>>> print(approx_solver[:2].round(4))

[q0 -0.0002*q0*q1**3+0.0051*q0*q1**2-0.101*q0*q1+q0]

Since the model approximations are polynomials, we can do inference on them directly. For example:

.. code-block:: python

>>> expected = chaospy.E(approx_solver, distribution)

>>> deviation = chaospy.Std(approx_solver, distribution)

>>> print(expected[:5].round(8))

[1.5 1.53092356 1.62757217 1.80240142 2.07915608]

>>> print(deviation[:5].round(8))

[0.28867513 0.43364958 0.76501802 1.27106355 2.07110879]

For more extensive guides on this approach an others, see the tutorial collection_.

.. _tutorial collection: https://chaospy.readthedocs.io/en/master/tutorials

Copy from pypi.org

python测量不确定度_chaospy-不确定度量化的数值工具-Jonathan Feinberg Installation Example Usage...相关推荐

  1. python测量不确定度程序设计_测量不确定度计算 - 用于计算测量不确定度的资源...

    测量基础知识 - 测量不确定度计算 您可能会惊讶地发现,没有一个正式的标准说明通用测量仪器是如何规定的,或者是如何确定那些技术指标的.此外,当要求 "校准至制造商的技术指标" 时, ...

  2. excel概率密度函数公式_干货|利用excel公式,快速对定量的化学检测方法进行测量不确定度的评定...

    往期精华 行业|五类原因,两年276名认证人员被撤销资格 分享|浅谈易制爆危险化学品备案经历 分享|实验室空气质量不好?先找找工作习惯的问题! 分享|实验室应该怎样做平行样?一篇文章帮你了解! 干货| ...

  3. 测量不确定度matlab,基于MATLAB用蒙特卡洛法评估测量不确定度简介,目录书摘

    内容简介: <基于MATLAB用蒙特卡洛法 评定测量不确定度>简要介绍与测量不确定度评定有 关的MATLAB的基本知识,编程基础以及随机变量的 模拟,重点介绍了MCM实施的基本方法.MCM ...

  4. 测量误差与准确度,测量不确定度

    准确度是对仪器而言,真值不能测出,只能表明设备的能力 不确定度是对测量结果而言,仪器测量结果与标准器测量结果之间的分析,可见国家的标准文件 对于不确定度的验证 JJF 1033--2016<计量 ...

  5. 螺旋测微器b类不确定度_物理实验直测量不确定度评估.ppt

    物理实验直测量不确定度评估 直接测量不确定度评估 Gauss分布 测量列的平均值.标准差 A类不确定度 t分布 B类不确定度 直接测量的合成不确定度 Gauss分布 也称正态分布. δ的平均值等于0. ...

  6. 螺旋测微器b类不确定度_螺旋测微器b类不确定度_物理实验直测量不确定度评估.ppt...

    物理实验直测量不确定度评估 直接测量不确定度评估 Gauss分布 测量列的平均值.标准差 A类不确定度 t分布 B类不确定度 直接测量的合成不确定度 Gauss分布 也称正态分布. δ的平均值等于0. ...

  7. 七步法计算测量不确定度

    原书信息 文章翻译自指南<七步法计算测量不确定度> 作者信息:https://www.isobudgets.com/contact-rick-hogan/ 目录 七步法计算测量不确定度:第 ...

  8. 七步法计算测量不确定度:第一步

    文章翻译自指南<七步法计算测量不确定度> 作者信息:https://www.isobudgets.com/contact-rick-hogan/ 书籍目录: 七步法计算测量不确定度:第一步 ...

  9. 误差分析基础及测量不确定度笔记

    误差分析的基本概念 几种误差的定义:残差.方差.标准误差.协方差和相关系数 准确度VS精密度 误差分类 系统误差 随机误差 粗大误差 误差的统计处理 置信区间.置信系数.置信概率.置信水平(随机变量在 ...

最新文章

  1. 人脸识别数据集精粹(下)
  2. 11相机不流畅_小米11有望本月发布,小米10退位让贤,256GB版本跌至3799
  3. 如何在hexo中支持Mathjax
  4. Gradle学习之使用java plugin
  5. php检查函数是否存在,php判断类是否存在函数class_exists用法分析
  6. 大数据学习笔记49:Flume Sinks(Flume接收器)
  7. 像msn那样的message提示
  8. Greeting Card 模拟
  9. 004 Leaflet 第四个demo 使用自己的图标替换marker图标
  10. spring5学习笔记
  11. 修复 iPhone X H5 底部安全区域定位按钮下内容穿透 BUG
  12. [ 网络协议篇 ] IGP 详解之 RIP 详解(一)
  13. 人工智能岗位薪资与对应要求
  14. python小车行走_[PYTHON系列教程]→控制小车
  15. ​K歌中的歌唱评价与嗓音分析
  16. snat与dnat的区别
  17. 安装Linux win双系统 无法正常启动 读不出U盘
  18. 计算机公开课课前互动小游戏,七款适合公开课的小游戏,让你的公开课精彩纷呈...
  19. 麻将AI 不完全信息博弈学习笔记(完结)
  20. windows server 2008 英文版安装中文vs2008 sp1补丁失败的解决办法

热门文章

  1. MAC地址表满,广播的去向
  2. 陈春花:数字化的三大本质
  3. 搭建阿里云ecs服务器(一:购买)
  4. 关于Lambda和匿名内部类
  5. comet4j开发指南
  6. Mpg123源代码详解
  7. 关于工具类应用产品界面设计的一点思考
  8. 在参数上使用@Param(“paramName”)注解”解决了传多个参数的问题
  9. J2ME手机文件加密
  10. python购物车程序-Python编写购物车程序