MATLAB函数和命令的用法

发布时间 : 星期二 文章MATLAB函数和命令的用法更新完毕开始阅读

Binocdf二项式累积分布函数

语法格式

Y = binocdf(X,N,P)

函数功能

Y = binocdf(X,N,P)

计算X中每个X(i)的二项式累积分布函数,其中,N中对应的N(i)为试验数,P中对应的P(i)为每次试验成功的概率。Y, N, 和 P 的大小类型相同,可以是向量、矩阵或多维数组。输入的标量将扩展成一个数组,使其大小类型与其它输入相一致。

The values in N must all be positive integers, the values in X must lie on the interval [0,N], and the values in P must lie on the interval [0, 1].

The binomial cdf for a given value x and a given pair of parameters n and p is

?n?i(n?i)y?F(x|n,p)????pqI(0,1,i?0?i?x,n)(x)

The result, y, is the probability of observing up to x successes in n independent trials, where the probability of success in any given trial is p. The indicator function I(0,1,...,n)(i)ensures that x only adopts values of 0,1,...,n.

示例

若一个棒球队在一个赛季要比赛162场,每场比赛取胜的机会是50-50,则该队取胜超过100 场的概率为:

>> 1-binocdf(100,162,0.5) ans = 0.0010433 相关函数

binofit | binoinv | binopdf | binornd | binostat | cdf

1

附:二项式分布(binomial distribution )

定义

二项分布的概率密度函数为

?n?kf(k|n,p)???p(1?p)n?k

?k?where k is the number of successes in n trials of a Bernoulli process with

probability of success p.

The binomial distribution is discrete, defined for integers k = 0, 1, 2, ... n, where it is nonzero.

背景

The binomial distribution models the total number of successes in repeated trials from an infinite population under the following conditions:

Only two outcomes are possible on each of n trials. The probability of success for each trial is constant. All trials are independent of each other.

The binomial distribution is a generalization of the Bernoulli distribution; it generalizes to the multinomial distribution.

参数

Suppose you are collecting data from a widget manufacturing process, and you record the number of widgets within specification in each batch of 100. You might be interested in the probability that an individual widget is within specification. Parameter estimation is the process of determining the parameter, p, of the binomial distribution that fits this data best in some sense.

One popular criterion of goodness is to maximize the likelihood function. The likelihood has the same form as the binomial pdf above. But for the pdf, the parameters (n and p) are known constants and the variable is x. The likelihood function reverses the roles of the variables. Here, the sample values (the x's) are already observed. So they are the fixed constants. The variables are the unknown parameters. MLE involves calculating the value of p that give the highest likelihood given the particular set of data.

The function binofit returns the MLEs and confidence intervals for the parameters of the binomial distribution. Here is an example using random

2

numbers from the binomial distribution with n = 100 and p = 0.9.

>> r = binornd(100,0.9) r = 85 >> [phat, pci] = binofit(r,100) phat = 0.85 pci = 0.76469 0.91355 The MLE for parameter p is 0.8800, compared to the true value of 0.9. The 95% confidence interval for p goes from 0.7998 to 0.9364, which includes the true value. In this made-up example you know the \value\of p. In experimentation you do not.

示例

The following commands generate a plot of the binomial pdf for n = 10 and

p = 1/2.

x = 0:10; y = binopdf(x,10,0.5); plot(x,y,'+')

3

0.250.20.150.10.0500246810 相关内容

Discrete Distributions

附:二项式分布(网上)

定义

若某事件概率为p,现重复试验n次,该事件发生k次的概率为:

P=C(k,n)pk(1-p)(n-k)

C(k,n)表示组合数,即从n个事物中拿出k个的方法数。

二项分布的概念

考虑只有两种可能结果的随机试验,当成功的概率(π)是恒定的,且各次试验相互独立,这种试验在统计学上称为贝努里试验(Bernoullitrial)。

如果进行n次贝努里试验,取得成功次数为X(X=0,1,…,n)的概率可用下面的二项分布概率公式来描述:

P=C(X,n) πX(1-π)(n-X)

式中的n为独立的贝努里试验次数,π为成功的概率,(1-π)为失败的概率,X为在n次贝努里试验中出现成功的次数,C(X,n)表示在n次试验中出现X的各种组合情况,在此称为二项系数(binomialcoefficient)。

内容简介

二项分布,伯努里分布:进行一系列试验,如果

4

联系合同范文客服:xxxxx#qq.com(#替换为@)