<< Chapter < Page Chapter >> Page >

ckn.m function y = ckn(P,k) determines the probability of the occurrence of k or more of the n independent events whose probabilities are in row or column vector P ( k may be a row or column vector)

function y = ckn(P,k) % CKN y = ckn(P,k) Probability of k or more successes% Version of 5/15/95 % Probabilities of k or more of n independent events% Uses the m-functions mintable, minprob, csort n = length(P);m = length(k); T = sum(mintable(n)); % The number of successes in each mintermpm = minprob(P); % The probability of each minterm [t,p]= csort(T,pm); % Sorts and consolidates success numbers % and adds corresponding probabilitiesfor i = 1:m % Sums probabilities for each k value y(i) = sum(p(k(i)+1:n+1));end
Got questions? Get instant answers now!

parallel.m function y = parallel(p) determines the probability of a parallel combination of the independent events whose probabilities are in row or columnvector p .

function y = parallel(p) % PARALLEL y = parallel(p) Probaaability of parallel combination% Version of 3/3/93 % Probability of parallel combination.% Individual probabilities in row matrix p. y = 1 - prod(1 - p);
Got questions? Get instant answers now!

Conditional probability and conditional idependence

bayes.m produces a Bayesian reversal of conditional probabilities. The input consists of P ( E | A i ) and P ( A i ) for a disjoint class { A i : 1 i n } whose union contains E . The procedure calculates P ( A i | E ) and P ( A i | E c ) for 1 i n .

% BAYES file bayes.m Bayesian reversal of conditional probabilities % Version of 7/6/93% Input P(E|Ai) and P(Ai) % Calculates P(Ai|E) and P(Ai|Ec)disp('Requires input PEA = [P(E|A1) P(E|A2) ... P(E|An)]')disp(' and PA = [P(A1) P(A2) ... P(An)]')disp('Determines PAE = [P(A1|E) P(A2|E) ... P(An|E)]')disp(' and PAEc = [P(A1|Ec) P(A2|Ec) ... P(An|Ec)]')PEA = input('Enter matrix PEA of conditional probabilities '); PA = input('Enter matrix PA of probabilities ');PE = PEA*PA'; PAE = (PEA.*PA)/PE;PAEc = ((1 - PEA).*PA)/(1 - PE); disp(' ')disp(['P(E) = ',num2str(PE),])disp(' ') disp(' P(E|Ai) P(Ai) P(Ai|E) P(Ai|Ec)')disp([PEA; PA; PAE; PAEc]')disp('Various quantities are in the matrices PEA, PA, PAE, PAEc, named above')
Got questions? Get instant answers now!

odds.m The procedure calculates posterior odds for for a specified profile E . Assumes data have been entered by the procedure oddsf or oddsp .

% ODDS file odds.m Posterior odds for profile % Version of 12/4/93% Calculates posterior odds for profile E % Assumes data has been entered by oddsdf or oddsdpE = input('Enter profile matrix E '); C = diag(a(:,E))'; % aa = a(:,E) is an n by n matrix whose ith columnD = diag(b(:,E))'; % is the E(i)th column of a. The elements on the % diagonal are b(i, E(i)), 1<= i<= n % Similarly for b(:,E)R = prod(C./D)*(p1/p2); % Calculates posterior odds for profile disp(' ')disp(['Odds favoring Group 1: ',num2str(R),])if R>1 disp('Classify in Group 1')else disp('Classify in Group 2')end
Got questions? Get instant answers now!

Questions & Answers

if three forces F1.f2 .f3 act at a point on a Cartesian plane in the daigram .....so if the question says write down the x and y components ..... I really don't understand
Syamthanda Reply
hey , can you please explain oxidation reaction & redox ?
Boitumelo Reply
hey , can you please explain oxidation reaction and redox ?
Boitumelo
for grade 12 or grade 11?
Sibulele
the value of V1 and V2
Tumelo Reply
advantages of electrons in a circuit
Rethabile Reply
we're do you find electromagnetism past papers
Ntombifuthi
what a normal force
Tholulwazi Reply
it is the force or component of the force that the surface exert on an object incontact with it and which acts perpendicular to the surface
Sihle
what is physics?
Petrus Reply
what is the half reaction of Potassium and chlorine
Anna Reply
how to calculate coefficient of static friction
Lisa Reply
how to calculate static friction
Lisa
How to calculate a current
Tumelo
how to calculate the magnitude of horizontal component of the applied force
Mogano
How to calculate force
Monambi
a structure of a thermocouple used to measure inner temperature
Anna Reply
a fixed gas of a mass is held at standard pressure temperature of 15 degrees Celsius .Calculate the temperature of the gas in Celsius if the pressure is changed to 2×10 to the power 4
Amahle Reply
How is energy being used in bonding?
Raymond Reply
what is acceleration
Syamthanda Reply
a rate of change in velocity of an object whith respect to time
Khuthadzo
how can we find the moment of torque of a circular object
Kidist
Acceleration is a rate of change in velocity.
Justice
t =r×f
Khuthadzo
how to calculate tension by substitution
Precious Reply
hi
Shongi
hi
Leago
use fnet method. how many obects are being calculated ?
Khuthadzo
khuthadzo hii
Hulisani
how to calculate acceleration and tension force
Lungile Reply
you use Fnet equals ma , newtoms second law formula
Masego
please help me with vectors in two dimensions
Mulaudzi Reply
how to calculate normal force
Mulaudzi
Got questions? Join the online conversation and get instant answers!
Jobilize.com Reply

Get Jobilize Job Search Mobile App in your pocket Now!

Get it on Google Play Download on the App Store Now




Source:  OpenStax, Applied probability. OpenStax CNX. Aug 31, 2009 Download for free at http://cnx.org/content/col10708/1.6
Google Play and the Google Play logo are trademarks of Google Inc.

Notification Switch

Would you like to follow the 'Applied probability' conversation and receive update notifications?

Ask