Detailed instructions for use are in the User's Guide.
[. . . ] Statistics ToolboxTM 7 User's Guide
How to Contact The MathWorks
Web Newsgroup www. mathworks. com/contact_TS. html Technical Support
www. mathworks. com comp. soft-sys. matlab suggest@mathworks. com bugs@mathworks. com doc@mathworks. com service@mathworks. com info@mathworks. com
Product enhancement suggestions Bug reports Documentation error reports Order status, license renewals, passcodes Sales, pricing, and general information
508-647-7000 (Phone) 508-647-7001 (Fax) The MathWorks, Inc. 3 Apple Hill Drive Natick, MA 01760-2098
For contact information about worldwide offices, see the MathWorks Web site. Statistics ToolboxTM User's Guide © COPYRIGHT 19932010 by The MathWorks, Inc.
The software described in this document is furnished under a license agreement. The software may be used or copied only under the terms of the license agreement. [. . . ] A and B can be vectors, matrices, or multidimensional arrays that have the same size, which is also the size of M and V. A scalar input for A or B is expanded to a constant array with the same dimensions as the other input.
The mean of the gamma distribution with parameters a and b is ab. The variance is ab2.
Examples
[m, v] = gamstat(1:5, 1:5) m= 1 4 9 16 25 v= 1 8 27 64 125 [m, v] = gamstat(1:5, 1. /(1:5)) m= 1 1 1 1 1 v= 1. 0000 0. 5000 0. 3333 0. 2500
0. 2000
See Also
gampdf, gamcdf, gaminv, gamfit, gamlike, gamrnd
"Gamma Distribution" on page B-27
18-471
qrandstream. ge
Purpose Syntax Description
Greater than or equal relation for handles
h1 >= h2 h1 >= h2 performs element-wise comparisons between handle arrays h1 and h2. h1 and h2 must be of the same dimensions unless one is a
scalar. The result is a logical array of the same dimensions, where each element is an element-wise >= result. If one of h1 or h2 is scalar, scalar expansion is performed and the result will match the dimensions of the array that is not scalar.
tf = ge(h1, h2) stores the result in a logical array of the same
dimensions.
See Also
qrandstream, eq, gt, le, lt, ne
18-472
geocdf
Purpose Syntax Description
Geometric cumulative distribution function
Y = geocdf(X, P) Y = geocdf(X, P) computes the geometric cdf at each of the values in X using the corresponding probabilities in P. X and P can be vectors,
matrices, or multidimensional arrays that all have the same size. A scalar input is expanded to a constant array with the same dimensions as the other input. The parameters in P must lie on the interval [0 1]. The geometric cdf is
floor ( x)
y = F ( x | p) =
where q = 1 - p .
i =0
pqi
The result, y, is the probability of observing up to x trials before a success, when the probability of success in any given trial is p.
Examples
Suppose you toss a fair coin repeatedly. If the coin lands face up (heads), that is a success. What is the probability of observing three or fewer tails before getting a heads?
p = geocdf(3, 0. 5) p= 0. 9375
See Also
cdf, geopdf, geoinv, geostat, geornd, mle
"Geometric Distribution" on page B-41
18-473
geoinv
Purpose Syntax Description
Geometric inverse cumulative distribution function
X = geoinv(Y, P) X = geoinv(Y, P) returns the smallest positive integer X such that the geometric cdf evaluated at X is equal to or exceeds Y. You can think of Y as the probability of observing X successes in a row in independent trials where P is the probability of success in each trial. Y and P can be vectors, matrices, or multidimensional arrays that all have the same size. A scalar input for P or Y is expanded to a constant array with the same dimensions as the other input. The values in P and Y must lie on the interval [0 1].
Examples
The probability of correctly guessing the result of 10 coin tosses in a row is less than 0. 001 (unless the coin is not fair).
psychic = geoinv(0. 999, 0. 5) psychic = 9
The example below shows the inverse method for generating random numbers from the geometric distribution.
rndgeo rndgeo 0 0 = geoinv(rand(2, 5), 0. 5) = 1 3 1 0 1 0 2 0
See Also
icdf, geocdf, geopdf, geostat, geornd
"Geometric Distribution" on page B-41
18-474
geomean
Purpose Syntax Description
Geometric mean
m = geomean(x) geomean(X, dim) m = geomean(x) calculates the geometric mean of a sample. For vectors, geomean(x) is the geometric mean of the elements in x. For matrices, geomean(X) is a row vector containing the geometric means of each column. For N-dimensional arrays, geomean operates along the first nonsingleton dimension of X. geomean(X, dim) takes the geometric mean along the dimension dim of X.
The geometric mean is
1
n n m = xi i=1
Examples
The arithmetic mean is greater than or equal to the geometric mean.
x = exprnd(1, 10, 6); geometric = geomean(x) geometric = 0. 7466 0. 6061 0. 6038 average = mean(x) average = 1. 3509 1. 1583 0. 9741
0. 2569
0. 7539
0. 3478
0. 5319
1. 0088
0. 8122
See Also
mean, median, harmmean, trimmean
"Geometric Distribution" on page B-41
18-475
geopdf
Purpose Syntax Description
Geometric probability density function
Y = geopdf(X, P) Y = geopdf(X, P) computes the geometric pdf at each of the values in X using the corresponding probabilities in P. X and P can be vectors,
matrices, or multidimensional arrays that all have the same size. A scalar input is expanded to a constant array with the same dimensions as the other input. [. . . ] "Large sample properties of simulations using latin hypercube sampling. " Technometrics. "Use of the Kolmogorov-Smirnov, Cramer-Von Mises and Related Statistics Without Extensive Tables. " Journal of the Royal Statistical Society. "A Note on Computing Robust Regression Estimates via Iteratively Reweighted Least Squares. " The American Statistician. "On the Probable Error of the Mean. " Biometrika. [. . . ]