Skip to content

Commit

Permalink
Merge pull request #74 from federico-baio/master
Browse files Browse the repository at this point in the history
fixed typo in the comments
  • Loading branch information
UniprJRC authored Apr 16, 2024
2 parents 7fb95b1 + 0f9a823 commit b995946
Show file tree
Hide file tree
Showing 6 changed files with 36 additions and 31 deletions.
31 changes: 16 additions & 15 deletions toolbox/utilities_stat/FNChygepdf.m
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,10 @@
% balls are independent and there is no dependence between draws. One may
% as well take all $n$ balls at the same time. Each ball has no "knowledge"
% of what happens to the other balls.
% More formally, if the total number $n$ of balls taken is known then the
% conditional distribution of the number of taken red balls for given $n$ is
% Fisher's noncentral hypergeometric distribution.
% More formally, if the total number $n$ of balls taken is not known before
% the experiment (i.e n is determined just after the experiment), then the
% conditional distribution of the number of taken red balls for given $n$
% is Fisher's noncentral hypergeometric distribution.
%
% These two distributions have important applications in evolutionary
% biology and population genetics. If animals of a particular species are
Expand Down Expand Up @@ -160,12 +161,12 @@
%% Comparison between Wallenius and Fisher.
% we have 20 balls in the urn
M = 20;
%initially, in the urn we have 250 red and 250 white balls
%initially, in the urn we have 10 red and 10 white balls
K = M/2;
% we extract 3 balls without replacement
n = 3;
%red balls have a probability ten times greater to be extracted thab white balls
odds = 5;
%red balls have a probability ten times greater to be extracted than white balls
odds = 10;
% We compute the probability of getting 0, 1, 2 or 3 red balls in drawing
% 3 balls without replacement.
x = (0:n)';
Expand All @@ -191,12 +192,12 @@
%
% we have 20 balls in the urn
M = 20;
% initially, in the urn we have 250 red and 250 white balls
% initially, in the urn we have 10 red and 10 white balls
K = M/2;
% we extract 3 balls without replacement
n = 3;
% red balls have a probability ten times greater to be extracted thab white balls
odds = 5;
% red balls have a probability ten times greater to be extracted than white balls
odds = 10;
% We compute the probability of getting 0, 1, 2 or 3 red balls in drawing
% 3 balls without replacement.
x = (0:n)';
Expand All @@ -219,12 +220,12 @@
%
% we have 20 balls in the urn
M = 20;
% initially, in the urn we have 250 red and 250 white balls
% initially, in the urn we have 10 red and 10 white balls
K = M/2;
% we extract 3 balls without replacement
n = 3;
% red balls have a probability ten times greater to be extracted thab white balls
odds = 5;
% red balls have a probability ten times greater to be extracted than white balls
odds = 10;
% We compute the probability of getting 0, 1, 2 or 3 red balls in drawing
% 3 balls without replacement.
x = (0:n)';
Expand All @@ -247,12 +248,12 @@
%
% we have 20 balls in the urn
M = 20;
% initially, in the urn we have 250 red and 250 white balls
% initially, in the urn we have 10 red and 10 white balls
K = M/2;
% we extract 3 balls without replacement
n = 3;
% red balls have a probability ten times greater to be extracted thab white balls
odds = 5;
% red balls have a probability ten times greater to be extracted than white balls
odds = 10;
% We compute the probability of getting 0, 1, 2 or 3 red balls in drawing
% 3 balls without replacement.
x = (0:n)';
Expand Down
8 changes: 4 additions & 4 deletions toolbox/utilities_stat/WNChygepdf.m
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@
%}

%{
%% Fisher Noncentral Hypergeometric Distributions Property 1.
%% Wallenius Noncentral Hypergeometric Distributions Property 1.
% Taken from Equation (12) of "Sampling Methods for Wallenius' and
% Fishers' Noncentral Hypergeometric Distributions"
%
Expand All @@ -168,12 +168,12 @@
%
% we have 20 balls in the urn
M = 20;
% initially, in the urn we have 250 red and 250 white balls
% initially, in the urn we have 10 red and 10 white balls
K = M/2;
% we extract 3 balls without replacement
n = 3;
% red balls have a probability ten times greater to be extracted thab white balls
odds = 5;
% red balls have a probability ten times greater to be extracted than white balls
odds = 10;
% We compute the probability of getting 0, 1, 2 or 3 red balls in drawing
% 3 balls without replacement.
x = (0:n)';
Expand Down
7 changes: 4 additions & 3 deletions toolbox/utilities_stat/mFNChygepdf.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
% balls are independent and there is no dependence between draws. One may
% as well take all $n$ balls at the same time. Each ball has no "knowledge"
% of what happens to the other balls.
% More formally, if the total number $n$ of balls taken is known then the
% conditional distribution of the number of taken red balls for given $n$ is
% Fisher's noncentral hypergeometric distribution.
% More formally, if the total number $n$ of balls taken is not known before
% the experiment (i.e n is determined just after the experiment), then the
% conditional distribution of the number of taken red balls for given $n$
% is Fisher's noncentral hypergeometric distribution.
%
% These two distributions have important applications in evolutionary
% biology and population genetics. If animals of a particular species are
Expand Down
7 changes: 4 additions & 3 deletions toolbox/utilities_stat/mFNChygernd.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
% balls are independent and there is no dependence between draws. One may
% as well take all $n$ balls at the same time. Each ball has no "knowledge"
% of what happens to the other balls.
% More formally, if the total number $n$ of balls taken is known then the
% conditional distribution of the number of taken red balls for given $n$ is
% Fisher's noncentral hypergeometric distribution.
% More formally, if the total number $n$ of balls taken is not known before
% the experiment (i.e n is determined just after the experiment), then the
% conditional distribution of the number of taken red balls for given $n$
% is Fisher's noncentral hypergeometric distribution.
%
% These two distributions have important applications in evolutionary
% biology and population genetics. If animals of a particular species are
Expand Down
7 changes: 4 additions & 3 deletions toolbox/utilities_stat/mWNChygepdf.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
% balls are independent and there is no dependence between draws. One may
% as well take all $n$ balls at the same time. Each ball has no "knowledge"
% of what happens to the other balls.
% More formally, if the total number $n$ of balls taken is known then the
% conditional distribution of the number of taken red balls for given $n$ is
% Fisher's noncentral hypergeometric distribution.
% More formally, if the total number $n$ of balls taken is not known before
% the experiment (i.e n is determined just after the experiment), then the
% conditional distribution of the number of taken red balls for given $n$
% is Fisher's noncentral hypergeometric distribution.
%
% These two distributions have important applications in evolutionary
% biology and population genetics. If animals of a particular species are
Expand Down
7 changes: 4 additions & 3 deletions toolbox/utilities_stat/mWNChygernd.m
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,10 @@
% balls are independent and there is no dependence between draws. One may
% as well take all $n$ balls at the same time. Each ball has no "knowledge"
% of what happens to the other balls.
% More formally, if the total number $n$ of balls taken is known then the
% conditional distribution of the number of taken red balls for given $n$ is
% Fisher's noncentral hypergeometric distribution.
% More formally, if the total number $n$ of balls taken is not known before
% the experiment (i.e n is determined just after the experiment), then the
% conditional distribution of the number of taken red balls for given $n$
% is Fisher's noncentral hypergeometric distribution.
%
% These two distributions have important applications in evolutionary
% biology and population genetics. If animals of a particular species are
Expand Down

0 comments on commit b995946

Please sign in to comment.