plot.npEM | R Documentation |
Takes an object of class npEM
and returns a set of plots of the
density estimates for each block and each component. There is one plot
per block, with all the components displayed on each block so it is possible
to see the mixture structure for each block.
## S3 method for class 'npEM' plot(x, blocks = NULL, hist=TRUE, addlegend = TRUE, scale=TRUE, title=NULL, breaks="Sturges", ylim=NULL, dens.col, newplot = TRUE, pos.legend = "topright", cex.legend = 1, ...) ## S3 method for class 'spEM' plot(x, blocks = NULL, hist=TRUE, addlegend = TRUE, scale=TRUE, title=NULL, breaks="Sturges", ylim=NULL, dens.col, newplot = TRUE, pos.legend = "topright", cex.legend = 1, ...)
x |
An object of class |
blocks |
Blocks (of repeated measures coordinates) to plot; not relevant for univariate case. Default is to plot all blocks. |
hist |
If TRUE, superimpose density estimate plots on a histogram of the data |
addlegend |
If TRUE, adds legend to the plot. |
scale |
If TRUE, scale each density estimate by its corresponding estimated mixing proportion, so that the total area under all densities equals 1 and the densities plotted may be added to produce an estimate of the mixture density. When FALSE, each density curve has area 1 in the plot. |
title |
Alternative vector of main titles for plots (recycled as many times as needed) |
breaks |
Passed directly to the |
ylim |
|
dens.col |
Color values to use for the individual component density
functions, repeated as necessary. Default value is |
newplot |
If TRUE, creates a new plot. |
pos.legend |
Single argument specifying the
position of the legend. See ‘Details’ section of
|
cex.legend |
Character expansion factor for |
... |
Any remaining arguments are passed to the |
plot.npEM
returns a list with two elements:
x |
List of matrices. The jth column of the ith matrix is the vector of x-values for the jth density in the ith plot. |
y |
y-values, given in the same form as the x-values. |
npEM
, density.npEM
, spEMsymloc
,
plotseq.npEM
## Examine and plot water-level task data set. ## First, try a 3-component solution where no two coordinates are ## assumed i.d. data(Waterdata) set.seed(100) ## Not run: a <- npEM(Waterdata[,3:10], 3, bw=4) par(mfrow=c(2,4)) plot(a) # This produces 8 plots, one for each coordinate ## End(Not run) ## Not run: ## Next, same thing but pairing clock angles that are directly opposite one ## another (1:00 with 7:00, 2:00 with 8:00, etc.) b <- npEM(Waterdata[,3:10], 3, blockid=c(4,3,2,1,3,4,1,2), bw=4) par(mfrow=c(2,2)) plot(b) # Now only 4 plots, one for each block ## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.