<< Chapter < Page Chapter >> Page >

oddsdf.m Sets up calibrating frequencies for calculating posterior odds.

% ODDSDF file oddsdf.m Frequencies for calculating odds % Version of 12/4/93% Sets up calibrating frequencies % for calculating posterior oddsA = input('Enter matrix A of frequencies for calibration group 1 '); B = input('Enter matrix B of frequencies for calibration group 2 ');n = length(A(:,1)); % Number of questions (rows of A) m = length(A(1,:)); % Number of answers to each questionp1 = sum(A(1,:)); % Number in calibration group 1 p2 = sum(B(1,:)); % Number in calibration group 2a = A/p1; b = B/p2;disp(' ') % Blank line in presentation disp(['Number of questions = ',num2str(n),]) % Size of profile disp(['Answers per question = ',num2str(m),]) % Usually 3: yes, no, uncertain disp(' Enter code for answers and call for procedure "odds" ')disp(' ')
Got questions? Get instant answers now!

oddsdp.m Sets up conditional probabilities for odds calculations.

% ODDSDP file oddsdp.m Conditional probs for calculating posterior odds % Version of 12/4/93% Sets up conditional probabilities % for odds calculationsa = input('Enter matrix A of conditional probabilities for Group 1 '); b = input('Enter matrix B of conditional probabilities for Group 2 ');p1 = input('Probability p1 an individual is from Group 1 '); n = length(a(:,1));m = length(a(1,:)); p2 = 1 - p1;disp(' ') % Blank line in presentation disp(['Number of questions = ',num2str(n),]) % Size of profile disp(['Answers per question = ',num2str(m),]) % Usually 3: yes, no, uncertain disp(' Enter code for answers and call for procedure "odds" ')disp(' ')
Got questions? Get instant answers now!

Bernoulli and multinomial trials

btdata.m Sets parameter p and number n of trials for generating Bernoulli sequences. Prompts for bt to generate the trials.

% BTDATA file btdata.m Parameters for Bernoulli trials % Version of 11/28/92% Sets parameters for generating Bernoulli trials % Prompts for bt to generate the trialsn = input('Enter n, the number of trials '); p = input('Enter p, the probability of success on each trial ');disp(' ') disp(' Call for bt')disp(' ')
Got questions? Get instant answers now!

bt.m Generates Bernoulli sequence for parameters set by btdata. Calculates relative frequency of “successes.”

% BT file bt.m Generates Bernoulli sequence % version of 8/11/95 Revised 7/31/97 for version 4.2 and 5.1, 5.2% Generates Bernoulli sequence for parameters set by btdata % Calculates relative frequency of 'successes'clear SEQ; B = rand(n,1)<= p; % ones for random numbers<= p F = sum(B)/n; % relative frequency of onesN = [1:n]'; % display detailsdisp(['n = ',num2str(n),' p = ',num2str(p),])disp(['Relative frequency = ',num2str(F),])SEQ = [N B];clear N; clear B;disp('To view the sequence, call for SEQ') disp(' ')
Got questions? Get instant answers now!

binomial.m Uses ibinom and cbinom to generate tables of the individual and cumulative binomial probabilities for specified parameters. Note that for calculation in MATLAB it is usually much more convenient and efficient to use ibinom and/or cbinom .

% BINOMIAL file binomial.m Generates binomial tables % Version of 12/10/92 (Display modified 4/28/96)% Calculates a TABLE of binomial probabilities % for specified n, p, and row vector k,% Uses the m-functions ibinom and cbinom.n = input('Enter n, the number of trials '); p = input('Enter p, the probability of success ');k = input('Enter k, a row vector of success numbers '); y = ibinom(n,p,k);z = cbinom(n,p,k); disp([' n = ',int2str(n),' p = ' num2str(p)]) H = [' k P(X = k) P(X>= k)'];disp(H) disp([k;y;z]')
Got questions? Get instant answers now!

Questions & Answers

summarize halerambos & holbon
David Reply
the Three stages of Auguste Comte
Clementina Reply
what are agents of socialization
Antonio Reply
sociology of education
Nuhu Reply
definition of sociology of education
Nuhu
what is culture
Abdulrahim Reply
shared beliefs, values, and practices
AI-Robot
What are the two type of scientific method
ogunniran Reply
I'm willing to join you
Aceng Reply
what are the scientific method of sociology
Man
what is socialization
ogunniran Reply
the process wherein people come to understand societal norms and expectations, to accept society's beliefs, and to be aware of societal values
AI-Robot
scientific method in doing research
ogunniran
defimition of sickness in afica
Anita
Cosmology
ogunniran
Hmmm
ogunniran
list and explain the terms that found in society
REMMY Reply
list and explain the terms that found in society
Mukhtar
what are the agents of socialization
Antonio
Family Peer group Institution
Abdulwajud
I mean the definition
Antonio
ways of perceived deviance indifferent society
Naomi Reply
reasons of joining groups
SAM
to bring development to the nation at large
Hyellafiya
entails of consultative and consensus building from others
Gadama
World first Sociologist?
Abu
What is evolutionary model
Muhammad Reply
Evolution models refer to mathematical and computational representations of the processes involved in biological evolution. These models aim to simulate and understand how species change over time through mechanisms such as natural selection, genetic drift, and mutation. Evolutionary models can be u
faruk
what are the modern trends in religious behaviours
Selekeye Reply
what are social norms
Daniel Reply
shared standards of acceptable behavior by the group or appropriate behavior in a particular institution or those behaviors that are acceptable in a society
Lucius
that is how i understood it
Lucius
examples of societal norms
Diamond
Discuss the characteristics of the research located within positivist and the interpretivist paradigm
Tariro Reply
what is Industrialisation
Selekeye Reply
industrialization
Angelo
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