Description Usage Arguments Value Examples
A function evaluates density of linearly transformed random vector on a given grid. It is used in processing EMFASTICAALG object to obtain density estimation of the mixture components.
1 | ATRANSDENSITY(grid, A, f)
|
grid |
A matrix whose columns store the grid points. |
A |
Matrix for the linear transformation. |
f |
Density function before the linear transformation. |
answer |
Matrix of the same size as grid, with each element being the evaluated linear transformed density at the corresponding grid point. |
comp2 |
Description of 'comp2' |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 | ## An example that evaluates the 2-D uniform distribution on a linear transformation of [1,3]x[1,3]
## f1ind is the density of the uniform distribution on [1,3]^r
f1ind <- function(grid){# mixture component 1 original signal density function
n <- ncol(grid)
r <- nrow(grid)
answer <- rep(1,n)
for(i in 1:n){
for(j in 1:r){
answer[i] <- answer[i] * (grid[j,i] >= 1 & grid[j,i] <= 3) / 2
}
}
answer
}
A <- matrix(c(6, 9, -12, 15), 2, 2, byrow = FALSE)
gridpoints <- t(as.matrix(expand.grid(seq(-32,12,2),seq(18,80,2))))
f1trans <- ATRANSDENSITY(gridpoints, A, f1ind)
plot(t(gridpoints),col=(f1trans>0))
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.