The following is a summary of all the various probability functions provided in the Real Statistics Resource Pack.
These functions are organized into the following categories:
- Queueing Theory
- Markov Chains
- Hidden Markov Models
Queueing Theory
The following is a list of array functions, where if lab = TRUE (default FALSE) then an extra column of labels is appended to the output.
MM1X(λ, μ, lab): returns a column array with L, Lq, W, Wq, ρ for the M/M/1 queueing model with exponential arrival and service rates with a mean arrival rate of λ and mean service rate of μ.
MMs(λ, μ, s, lab): returns a column array with the L, Lq, W, Wq, ρ for the M/M/s queueing model with s servers and exponential arrival and service rates with mean arrival rate λ and mean service rate μ.
MM1K(λ, μ, k, lab): returns a column array with the L, Lq, W, Wq, ρ, λ-bar for the M/M/1/K queueing model with parameters K = k, λ and μ.
MMsK(λ, μ, s, k, lab): returns a column array with the L, Lq, W, Wq, ρ, λ-bar for the M/M/s/K queueing model with parameters K = k, s, λ and μ.
MM1N(λ, μ, nn, lab): returns a column array with the L, Lq, W, Wq, λ-bar in the steady state for the M/M/1/N queueing model with exponential arrival and service rates with mean arrival rate λ and mean service rate μ, and where the population size is nn.
MMsN(λ, μ, s, nn, lab): returns a column array with the L, Lq, W, Wq, λ-bar in the steady state for the M/M/s/N queueing model with exponential arrival and service rates with mean arrival rate λ and mean service rate μ, and with s servers and a population of size nn.
MM1P(R1, μ, lab): returns an array with L, Lq, W, Wq, ρ for each priority class in an M/M/1 non-preemptive priority queueing model with the mean arrival rates in R1 and mean service rate of μ.
MMsP(R1, μ, s, lab): returns an array with L, Lq, W, Wq, ρ for each priority class in an M/M/s non-preemptive priority queueing model with s servers, mean arrival rates in R1, and a mean service rate of μ.
MM1PS(R1, R2, lab): returns an array with L, Lq, W, Wq, ρ for each priority class in an M/M/1 non-preemptive priority queueing model, mean arrival rates in R1, and mean service rates in R2.
MM1PP(R1, μ, lab): returns an array with L, Lq, W, Wq, ρ for each priority class in an M/M/1 model with pre-emptive priority queueing with mean arrival rates described in R1 and a mean service rate of μ.
MMsPP(R1, μ, s): returns a row array with Wq for the m priority classes for an M/M/s model with pre-emptive priority queueing, s servers, mean arrival rates described in R1 and a mean service rate of μ.
MD1X(λ, μ, lab): returns a column array with the L, Lq, W, Wq, ρ in the steady state for the M/D/1 queueing model with exponential arrival and service rates with mean arrival rate λ and mean service rate μ.
MG1X(λ, μ, σ, lab): returns a column array with L, Lq, W, Wq for the M/G/1 queueing model, with exponential arrivals with a mean arrival rate of λ and a service time with mean 1/μ and standard deviation of σ.
MGinf(λ, μ, lab): returns a column array with L, Lq, W, Wq for the M/G/∞ queueing model with exponential arrivals with a mean arrival rate of λ and a general service distribution with a mean service rate of μ.
The following is a list of non-array functions:
MM1Pn(λ, μ, n, cum) = pn for the M/M/1 queueing model defined by λ and μ if cum = FALSE (default) and Pn otherwise.
MM1W(λ, μ, t) = P(w > t) for the M/M/1 queueing model defined by λ and μ
MM1Wq(λ, μ, t) = P(wq > t) for the M/M/1 queueing model defined by λ and μ
MMsPn(λ, μ, s, n, cum) = pn for the M/M/s queueing model defined by s, λ, and μ if cum = FALSE (default) and Pn otherwise.
MMsW(λ, μ, s, t) = P(w > t) for the M/M/s queueing model defined by s, λ and μ
MMsWq(λ, μ, s, t) = P(wq > t) for the M/M/s queueing model defined by s, λ and μ
MM1KPn(λ, μ, k, n, cum) = pn for the M/M/1/K queueing model defined by K = k, λ, and μ if cum = FALSE (default) and Pn otherwise.
MM1KW(λ, μ, k, t) = P(w > t) for the M/M/1/K queueing defined by K = k, λ, and μ
MM1KWq(λ, μ, k, t) = P(wq > t) for the M/M/1/K queueing defined by K = k, λ, and μ
MMsKPn(λ, μ, s, k, n, cum) = pn for the M/M/s/K queueing model defined by K = k, s, λ, and μ if cum = FALSE (default) and Pn otherwise.
MMsKWq(λ, μ, s, k, t) = P(wq > t) for the M/M/s/K queueing model defined by K = k, s, λ, and μ
MM1NPn(λ, μ, nn, n, cum) = pn for the M/M/1/N queueing model defined by nn, λ and μ if cum = FALSE (default) and Pn otherwise.
MMsNPn(λ, μ, s, nn, n, cum) = pn for the M/M/s/N queueing model defined by s, nn, λ and μ if cum = FALSE (default) and Pn otherwise.
MD1Pn(λ, μ, n, cum) = pn for the M/D/1 queueing model defined by λ and μ if cum = FALSE (default) and Pn otherwise.
MD1W(λ, μ, t) = P(w > t) for the M/D/1 queueing model defined by λ and μ
MD1Wq(λ, μ, t) = P(wq > t) for the M/D/1 queueing model defined by λ and μ
MGinfPn(λ, μ, n, cum) = pn for the M/G/∞ queueing model defined by λ and μ if cum = FALSE (default) and Pn otherwise.
The following is a list of queueing models using simulation. Here, R1 is an array containing customer inter-arrival times and R2 is an array containing the corresponding service times.
QUEUE_SIM(R1, R2, lab): returns an array with the values L, Lq, W, Wq, and Rho based on a simulation of a single-server queueing model for m customers.
QUEUE_SIMX(R1, R2, s, lab): returns an array with the values L, Lq, W, Wq, and Rho based on a simulation of a queueing model with s servers for m customers. If lab = TRUE (default FALSE) then a column of labels is appended to the output.
Markov Chains
For these functions, Rp contains the Markov chain transition matrix, and Rd contains the transpose of the distribution vector π. Rd may be replaced by an integer between 1 and k (the initial state)
MarkovProb(Rp, Rd, n): returns a k × 1 distribution array for xn, i.e. πPn
MarkovSim(Rp, Rd, n): returns a column array with n entries from the simulation of a Markov chain based on the k × k transition matrix in Rp and the k × 1 initial distribution array Rd.
MarkovSimProb(Rp, Rd, n, m): returns a k × 1 distribution array with an estimated xn based on the average of the distribution values from m simulations.
MarkovParams(R1, k): returns a k × k+1 array, where the leftmost k × k array is the estimated transition matrix and the rightmost k × 1 column array is the estimated distribution, based on the observed state data in R1. k defaults to the largest state in R1.
In the following, start is the initial state.
MarkovSimHit (Rp, start, Ra, n, m): returns a 2 × 1 array. The first entry is the fraction of the m simulations that hit A (i.e. for which xj belongs to A for some j ≤ n). The second entry is the average of min {h: xh ∈ A} restricted to the simulations that hit A.
MarkovSimHitFreq (Rp, start, Ra, n, m): returns an array with two columns. The first two entries in column 2 are the same as those output by MarkovSimHit. The remaining entries in column 2 estimate the probability of hitting A in 1 to n steps based on the m simulations (only entries with non-zero probability are listed). Column 1 contains labels for the corresponding entries in column 2.
MarkovSimReturn (Rp, start, n, m): returns a k × 3 array based on m simulations, each of length n, starting from state start. For each state s = 1, …, k, column 1 provides the probability that the Markov chain returns to s. Column 2 provides the estimated first return (when there is a return), and column 3 provides the average frequencies of returns (when there is a return) divided by n.
Random Walks
RandWalkDist(i, n, p) = P(xn = i) for the random walk Markov chain with the stated value of p (the probability of one step to the right)
RandWalkDist(i, n, p, j) = the sum of P(xn = k) for k = i to j, for the random walk Markov chain with the stated value of p.
RandWalkSim(p, n, start, bound1, bound2): returns an n × 1 array with the states of the random walk or gambler’s ruin simulation.
RandWalkSimReturn(p, n, m, start): returns a 4 × 2 array whose second column contains (1) the probability that the random walk returns to start, (2) the expected number of steps needed to return to start, (3) the average farthest distance from start when there is a return to start, and (4) the average farthest distance from start when there isn’t a return to start. The first column contains labels for the second column.
Hidden Markov Models
For these functions, Rp contains the k × k Markov chain transition matrix, Rd contains the transpose of the distribution vector π, and Rq contains the k × m emission matrix.
HMM_Sim(Rp, Rd, Rq, n): returns an n × 2 array whose first column contains a sequence of n hidden states from a simulation run of the HMM, and whose second column contains the corresponding observations.
HMM_SimX(Rq, Rs): returns an n × h array with the observations corresponding to the hidden states in the h runs of the HMM, each of length n, in Rs.
HMM_Forward (Rp, Rd, Rq, n, total): returns an n × k array containing the αi(s) values if total = FALSE (default). If total = TRUE, then a column is appended to the output containing the P(z1:i) values.
HMM_Backward (Rp, Rd, Rq, n, total): returns an n × k array containing the βi(s) values if total = FALSE (default). If total = TRUE, then a column is appended to the output containing the P(z1:n) value in the first row and blanks elsewhere.
HMM_Params(Rs, Ro, k, m): returns a k × k+m+1 array with an estimate of the transition, distribution, and emission matrices that produced the hidden states in Rs and corresponding observations in Ro. k defaults to the largest state in Rs, and m defaults to the largest observation in Ro.
Where Ro is an n × 1 array containing observations:
HMM_Viterbi0(Rp, Rd, Rq, Ro): returns an n × k+k array, with the full output of the Viterbi Algorithm
HMM_Viterbi(Rp, Rd, Rq, Ro): returns an n × 1 array with the sequence of hidden states output from the Viterbi alg
HMM_Rho(Rp, Rd, Rq, Ro): returns a revised k × k transition matrix using one iteration of the Baum-Welch algorithm
HMM_Pi(Rp, Rd, Rq, Ro): returns a revised k × 1 distribution array using one iteration of the Baum-Welch algorithm
HMM_Kappa(Rp, Rd, Rq, Ro): returns a revised k × m emission matrix using one iteration of the Baum-Welch algorithm
HMM_Baum(Rp, Rd, Rq, Ro, iter, prec): returns a k × k+m+2 array with the revised transition, distribution, and emission matrices from the Baum-Welch algorithm
Where Ro is an n × h array containing multiple sequences of observations:
HMM_ViterbiX(Rp, Rd, Rq, Ro): returns an n × h array with the hidden states corresponding to the observations in R0, generated by the Viterbi algorithm.
HMM_RhoX(Rp, Rd, Rq, Ro): returns a revised k × k transition matrix using one iteration of the Baum-Welch algorithm
HMM_PiX(Rp, Rd, Rq, Ro): returns a revised k × 1 distribution array using one iteration of the Baum-Welch algorithm
HMM_KappaX(Rp, Rd, Rq, Ro): returns a revised k × m emission matrix using one iteration of the Baum-Welch algorithm
HMM_BaumX(Rp, Rd, Rq, Ro, iter, prec): returns a k × k+m+2 array with the revised transition, distribution, and emission matrices from the Baum-Welch algorithm
HMM_ParamsX(Rp, Rd, Rq, Ro, iter): returns a k × k+m+2 array with the revised transition, distribution, and emission matrices employing the observations in Ro, and the Viterbi algorithm to iteratively produce corresponding states for use by the algorithm in HMM_Params.