Be the first to rate this file! 13 downloads (last 30 days) File Size: 3 KB File ID: #25434

nhygepdf

by Antonio Trujillo-Ortiz

 

29 Sep 2009 (Updated 29 Sep 2009)

Code covered by BSD License  

Negative hypergeometric probability density function.

Download Now | Watch this File

File Information
Description

This m-function returns the negative hypergeometric probability density function with parameters M, N and A at the values in X. Note: The density function is zero unless M, N and A are integers.

If a lot consists of M acceptable items and N defective ones. Suppose that items are drawn at random one by one without replacement and x defectives are observed before the a'th acceptable one. According to Johnson et al. (2005), in an inspection sampling, instead of taking a sample of fixed size from a batch of items and then accepting the batch if the observed number of defectives is less than or equal to some predetermined value (otherwise rejecting). Here, items are drawn one at a time until either defectives are observed (at which point the batch is rejected) or nondefectives are observed (and the batch is accepted). The number of observations required to reach a decision then has a negative hypergeometric distribution.

This discrete distribution is also known as Beta-Binomial, Inverse hypergeometric, Hypergeometric waiting time, and Markov-Polya.

Its distribution function is expresed as,

         f(x) = P(X=x) = (x+a-1_C_x)(m+n-a-x_C_m-x)/(m+n_C_m)

    'Probability of x failures one will have before the a success(es)'

where: m=number of acceptables, n=number of not acceptables (defectives), x=number of observed defectives, before a=acceptable ones. C means combination. m+n=N, total number of elements.

Syntax: function y = nhygepdf(x,m,n,a)
     
Inputs:
m - number of acceptables
n - number of not acceptables (defectives)
x - number of observed defectives, before
a - acceptable ones

Output:
y - negative hypergeometric probability value

Required Products Statistics Toolbox
MATLAB release MATLAB 7 (R14)
Zip File Content  
Other Files license.txt,
nhygepdf.m
Tags for This File  
Everyone's Tags
Tags I've Applied
Add New Tags Please login to tag files.
Please login to add a comment or rating.
Updates
29 Sep 2009

It was added an appropriate format to cite this file.

Tag Activity for this File
Tag Applied By Date/Time
negative hypergeometric Antonio Trujillo-Ortiz 29 Sep 2009 12:33:00
probability Antonio Trujillo-Ortiz 29 Sep 2009 12:33:01
probability density function Antonio Trujillo-Ortiz 29 Sep 2009 12:33:01
pdf Antonio Trujillo-Ortiz 29 Sep 2009 12:33:01
discrete Antonio Trujillo-Ortiz 29 Sep 2009 12:33:01
 

MATLAB Central Terms of Use

NOTICE: Any content you submit to MATLAB Central, including personal information, is not subject to the protections which may be afforded information collected under other sections of The MathWorks, Inc. Web site. You are entirely responsible for all content that you upload, post, e-mail, transmit or otherwise make available via MATLAB Central. The MathWorks does not control the content posted by visitors to MATLAB Central and, does not guarantee the accuracy, integrity, or quality of such content. Under no circumstances will The MathWorks be liable in any way for any content not authored by The MathWorks, or any loss or damage of any kind incurred as a result of the use of any content posted, e-mailed, transmitted or otherwise made available via MATLAB Central. Read the complete Terms prior to use.

Contact us at files@mathworks.com