Description Usage Arguments Details Value Author(s) References Examples
Calculate the joint probability mass function (joint distribution) from a two-way table of frequencies.
1 | jpmf(m)
|
m |
A matrix of numeric values in the form of a two-way table of frequencies:
|
jpmf
calculates the joint distribution from a matrix
M of frequencies. The joint distribution for discrete variables
X and Y contained in
M is denoted by p(x,y), which is defined as:
P(X = x, Y = y) = p(x,y)
The joint probability at any intersection i,j in M is calculated as:
p(x_i,y_j) = M_i,j / ∑ M
Further, across all i and j the Axioms of probability indicate that
∑ p(x_i,y_j) = p(1,1) + p(1,2) + … + p(i,j) = 1
Returns a matrix with the same dimensions as input M indicating the joint distribution across all interactions of X and Y in the form:
p(x,y) | Y | |||
0.06 | 0.06 | 0.06 | ... | |
X | 0.14 | 0.14 | 0.14 | ... |
0.12 | 0.12 | 0.14 | ... | |
... | ... | ... | ... |
Bjorn J. Brooks, Lars Y. Pomara, Danny C. Lee
PAPER TITLE.
1 2 3 4 5 6 7 8 | data(transitions) # Load example data
b <- brkpts(transitions$phenofr, # Find 10 probabilistically
10) # equivalent breakpoints
m <- xt(transitions, # Make transition matrix
fr.col=2, to.col=3,
cnt.col=4, brk=b)
pxy=jpmf(m) # Joint distribution
sum(pxy) # Check that the joint distribution (PAB) sum to 1
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.