Description Usage Arguments Details Examples
This function takes a parameter vector and computes the corresponding distribution over all variables (including the latent variable).
1 | compute.P(theta)
|
theta |
A list of length m+1, where m is the number of observed variables. The first m elements are kxr[i] matrices with the corresponding conditional probabilities. The last a element is a vector of the marginal distribution of the latent variable. |
If the parameters are given in form of a vector, theta.list(theta,r,n.class)
converts
them to the desired format.
1 2 3 4 5 6 7 8 9 10 | theta <- list()
length(theta) <- 5
theta[[1]] <- matrix(c(0.8,1-0.7,1-0.8,0.7),2,2)
theta[[2]] <- matrix(c(0.8,1-0.7,1-0.8,0.7),2,2)
theta[[3]] <- matrix(c(0.8,1-0.7,1-0.8,0.7),2,2)
theta[[4]] <- matrix(c(0.8,1-0.9,1-0.8,0.9),2,2)
theta[[5]] <- c(1-0.7,0.7)
P <- compute.P(theta)
# to get the induced observed distribution
mP <- Reduce("+",P)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.