Rank: 5118 based on 2 downloads (last 30 days) and 1 file submitted
photo

William

E-mail

Personal Profile:
Professional Interests:
Alternative Energy

 

Watch this Author's files

 

Files Posted by William
Updated   File Tags Downloads
(last 30 days)
Comments Rating
17 Apr 2009 Non-Uniform Bernoulli Trials Exceedance Probability Calculates the probability of exceeding a given number of hits for a collection of Bernoulli trials Author: William monte carlo statistic... 2 3
  • 1.0
1.0 | 1 rating
Comments and Ratings by William
Updated File Comments Rating
23 Apr 2009 Non-Uniform Bernoulli Trials Exceedance Probability Calculates the probability of exceeding a given number of hits for a collection of Bernoulli trials Author: William

That is rather frank...
Could you point me to a better way to perform this calculation, perhaps an analytical method?
Thanks.

Comments and Ratings on William's Files View all
Updated File Comment by Comments Rating
16 Aug 2010 Non-Uniform Bernoulli Trials Exceedance Probability Calculates the probability of exceeding a given number of hits for a collection of Bernoulli trials Author: William Cotton, Peter

William,

   I was looking for the same thing and ended up re-writing it myself (bernpdf.m). Let me know if you come across other analytic implementations (e.g. by Fourier transform).

   I think you mean 'non-uniform p', for otherwise you can use binopdf.m in the stats toolbox.

Peter

ps: Sorry you find analytical statistics tiresome

23 Apr 2009 Non-Uniform Bernoulli Trials Exceedance Probability Calculates the probability of exceeding a given number of hits for a collection of Bernoulli trials Author: William William

That is rather frank...
Could you point me to a better way to perform this calculation, perhaps an analytical method?
Thanks.

22 Apr 2009 Non-Uniform Bernoulli Trials Exceedance Probability Calculates the probability of exceeding a given number of hits for a collection of Bernoulli trials Author: William Rowland, Darren

The entire contents of the file...
Frankly the quality is not worthy of the FEX. Please remove.

function exc = monte_exceedance( p, h, runs )
%
% MONTE_EXCEEDANCE( P, H, RUNS ) calculates the probability of equaling or
% exceeding h hits for probabilities p (column vector). Uses a monte carlo method,
% as the author finds analytical statistics tiresome. This should reflect
% binomial distribution calculations for uniform p.
%
% Example:
% There is a 30% chance of rain Saturday, and 20% Sunday. What is the
% probability that it rains this weekend?
%
% monte_exceedance([.3; .2],1)
%
% ans =
% 0.4431
%
% Which is reasonably close to the theoretical value of .44

if nargin < 3
    runs = 10000;
end

r = rand(length(p),runs);
exc = mean( sum(bsxfun(@lt,r,p)) >= h );

end

Top Tags Applied by William
monte carlo statistics exceedance bernoulli binomial nonuniform
Files Tagged by William
Updated   File Tags Downloads
(last 30 days)
Comments Rating
17 Apr 2009 Non-Uniform Bernoulli Trials Exceedance Probability Calculates the probability of exceeding a given number of hits for a collection of Bernoulli trials Author: William monte carlo statistic... 2 3
  • 1.0
1.0 | 1 rating

Contact us at files@mathworks.com