plot.norMix | R Documentation |
The plot
and lines
methods for norMix
objects draw the normal mixture density, optionally additonally with a
fitted normal density.
## S3 method for class 'norMix'
plot(x, type = "l", n = 511, xout = NULL, xlim = NULL, ylim,
xlab = "x", ylab = "f(x)", main = attr(x, "name"), lwd = 1.4,
p.norm = !p.comp, p.h0 = TRUE, p.comp = FALSE,
parNorm = list(col = 2, lty = 2, lwd = 0.4),
parH0 = list(col = 3, lty = 3, lwd = 0.4),
parComp = list(col= "blue3", lty = 3, lwd = 0.4), ...)
## S3 method for class 'norMix'
lines(x, type = "l", n = 511, xout = NULL,
lwd = 1.4, p.norm = FALSE, parNorm = list(col = 2, lty = 2, lwd = 0.4),
...)
x |
object of class |
type |
character denoting type of plot, see, e.g. |
n |
number of points to generate if |
xout |
numeric or |
xlim |
range of x values to use; particularly important if
|
ylim |
range of y values to use; by default, if not specified (or
containing |
xlab , ylab |
labels for the x and y axis with defaults. |
main |
main title of plot, defaulting to the |
lwd |
line width for plotting with a non-standard default. |
p.norm |
logical indicating if the normal density with the same mean and variance should be drawn as well. |
p.h0 |
logical indicating if the line |
p.comp |
logical indicating if the Gaussian components should also be drawn individually. |
parNorm |
graphical parameters for drawing the normal density if
|
parH0 |
graphical parameters for drawing the line |
parComp |
graphical parameters for drawing the single components if
|
... |
further arguments passed to and from methods. |
Martin Maechler
norMix
for the construction and further methods,
particularly dnorMix
which is used here.
plot(norMix(m=c(0,3), sigma = c(2,1))) # -> var = c(2^2, 1) = c(4, 1)
plot(MW.nm4, p.norm=FALSE, p.comp = TRUE)
plot(MW.nm4, p.norm=FALSE, p.comp = TRUE, ylim = c(0, 2))# now works
stopifnot(all.equal(c(0,2), par("yaxp")[1:2], tol= 1e-15))
## Further examples in ?norMix and ?rnorMix
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.