0. error function

erf(x)=1π∫−xxe−t2dt" role="presentation">erf(x)=1π−−√∫x−xe−t2dterf(x)=1π∫−xxe−t2dt

python 下的 math 标准库定义着 erf 的实现。

1. 从 error function 到标准正态分布 cdf 的实现

标准正态分布的累积分布函数无法用基本的解析形式表示,但却可通过的简单形式变换而计算得到:

Φ(x)=12+12erf⁡(x/2)=12erfc⁡(−x/2)" role="presentation">Φ(x)=12+12erf(x/2–√)=12erfc(−x/2–√)Φ(x)=12+12erf⁡(x/2)=12erfc⁡(−x/2)

2. python 实现

def phi(x, mu=0, sigma=1):
return (1 + math.erf((x-mu) / math.sqrt(2) / math.sqrt(sigma)))/2

Gauss error function的更多相关文章

  1. 转:ORA-15186: ASMLIB error function = [asm_open], error = [1], 2009-05-24 13:57:38

    转:ORA-15186: ASMLIB error function = [asm_open], error = [1], 2009-05-24 13:57:38http://space.itpub. ...

  2. Hive错误:Error: FUNCTION 'NUCLEUS_ASCII' already exists. (state=X0Y68,code=30000)

    问题 初始化derby失败: [root@bigdata111 apache-hive-2.3.0-bin]# schematool -dbType derby -initSchemaSLF4J: C ...

  3. LR接口性能测试提示Code - 60990 Error: Two Way Communication Error: Function two_way_comm_post_message / two_ (转载)

    一.在做JAVA接口性能测试时,场景在运行中出现:Code - 60990 Error: Two Way Communication Error: Function two_way_comm_post ...

  4. 机器学习 损失函数(Loss/Error Function)、代价函数(Cost Function)和目标函数(Objective function)

    损失函数(Loss/Error Function): 计算单个训练集的误差,例如:欧氏距离,交叉熵,对比损失,合页损失 代价函数(Cost Function): 计算整个训练集所有损失之和的平均值 至 ...

  5. complementary error function

    首先正态分布的概率密度函数为: P{|X-μ|<σ}=2Φ(1)-1=0.6826,  P{|X-μ|<2σ}=2Φ(2)-1=0.9544,  P{|X-μ|<3σ}=2Φ(3)- ...

  6. Compiler Error: Function call with parameters that may be unsafe

    如下的代码: #include <stdio.h> #include <string> #include <algorithm> #include <cass ...

  7. ERROR Function not available to this responsibility.Change responsibilities or contact your System Administrator.

    APPLIES TO: Navigation:  Help > Diagnostics > Custom Code > Personalize  or  Help > Diag ...

  8. error: function declaration isn’t a prototype [-Werror=strict-prototypes]

    "warning: function declaration isn't a prototype" was caused by the function like that:   ...

  9. /include/caffe/common.cuh(9): error: function "atomicAdd(double *, double)" has already been defined

    https://stackoverflow.com/questions/39274472/error-function-atomicadddouble-double-has-already-been- ...

随机推荐

  1. 将你的Vim 打造成轻巧强大的IDE

    Vim和Emacs一个称为神之编辑器一个被称为编辑器之神,固然很是夸张,但也足以说明这两 款软件的优秀和在程序员界的地位.但是它们都已漫长的学习曲线让人望而生畏,阻止了大 多数人进入.作为一名几乎完全 ...

  2. Django之WSGI 和MVC/MTV

    一.什么是WSGI? WEB框架的本质是一个socket服务端接收用户请求,加工数据返回给客户端(Django),但是Django没有自带socket需要使用 别人的 socket配合Django才能 ...

  3. mysql 数据库的CUDR

    mysql删表和建表语句: DROP TABLE IF EXISTS `t_blog_user`;CREATE TABLE `t_blog_user` ( `id` int(11) NOT NULL ...

  4. 快速搭建springboot框架以及整合ssm+shiro+安装Rabbitmq和Erlang、Mysql下载与配置

    1.快速搭建springboot框架(在idea中): file–>new project–>Spring Initializr–>next–>然后一直下一步. 然后复制一下代 ...

  5. Mysql 用户ip访问根据省份查询

    表名:shop_interview_customer 表结构:customerId空为游客模式 interviedId customerId interviewIP iPdetail 1 1001 1 ...

  6. linux因勿删或误操作导致登录界面异常,命令无法使用,显示/bin/bash:No such file or directory

    一.故障现象 1.用secure CRT连接服务器时显示: /bin/bash:No such file or directory 翻译成中文是:没有此类文件或目录 2.直接登录服务器执行命令时显示: ...

  7. R中sort(), rank(), order()

    在R中,和排序相关的函数主要有三个:sort(),rank(),order(). sort(x)是对向量x进行排序,返回值排序后的数值向量.rank()是求秩的函数,它的返回值是这个向量中对应元素的“ ...

  8. 容错机制和熔断(Hystrix)

    雪崩效应 在微服务架构中,由于服务众多,通常会涉及多个服务层级的调用,而一旦基础服务发生故障,很可能会导致级联故障,进而造成整个系统不可用,这种现象被称为服务雪崩效应.服务雪崩效应是一种因“服务提供者 ...

  9. SmartGit(我工作中使用git图形化界面工具)

    http://www.syntevo.com/smartgit/ 这个工具用了快两年,之前在逸橙工作时同事(目前就职百姓网)推荐使用的,查看更改了哪些文档很方便,前天试用版过期,现在贴个 破解的链接 ...

  10. 深入研究sqlalchemy连接池

    简介: 相对于最新的MySQL5.6,MariaDB在性能.功能.管理.NoSQL扩展方面包含了更丰富的特性.比如微秒的支持.线程池.子查询优化.组提交.进度报告等. 本文就主要探索MariaDB当中 ...