density_plots: Plot a mixture of normal components

Description Usage Arguments Author(s) See Also Examples

Description

Create a 3d plot and 2d image or contour plots of the density of a mixture of normal components.

For examples see

http://faculty.missouri.edu/~micheasa/sppmix/sppmix_all_examples.html#plot.normmix

Usage

1
2
3
4
## S3 method for class 'normmix'
plot(x, xlim, ylim, contour = FALSE, truncate = FALSE,
  open_new_window = FALSE, grayscale = FALSE, L = 256,
  title1 = "Mixture with normal components", whichplots = 2, ...)

Arguments

x

Object of class normmix.

xlim, ylim

The observation window.

contour

Logical flag requesting the countour plot only.

truncate

Logical flag requesting that the components are truncated within the window.

open_new_window

Open a new window for the plot.

grayscale

Plot in gray scale. Default is FALSE (use colors).

L

Length of the side of the square grid. The intensity is calculated on an L * L grid. The larger this value is, the better the picture resolution.

title1

Optional title for the 3d plot.

whichplots

Requests plots of the normal mixture density (surface). To get only the 2d plot set whichplots=0, only the 3d plot set whichplots=1, or for both the 2d and 3d plots set whichplots=2. Default action is to produce both plots.

...

Additional arguments for the S3 method.

Author(s)

Jiaxun Chen, Sakis Micheas, Yuchen Wang

See Also

normmix, to_int_surf, owin, rsppmix

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
# plot normmix density
truemix<- rnormmix(m = 3, sig0 = .1, df = 5, xlim= c(-1, 2), ylim = c(-1, 2))
summary(truemix)
#plot the normal mixture
plot(truemix, xlim= c(-1, 2), ylim = c(-1,2),
 title1="True mixture density in 3d")+add_title(
 "True mixture of normals density")
plot(truemix,xlim= c(-1, 2), ylim = c(-1, 2),contour = TRUE)+add_title(
 "Contour plot of the true mixture of normals density")
#build a mixture intensity surface for the Poisson point process
trueintsurf=to_int_surf(truemix, lambda = 100, win=
 spatstat::owin( c(-1, 2),c(-1, 2)))
plot(trueintsurf)#plot the surface, it is lambda*normmix

sppmix documentation built on Jan. 13, 2021, 10:04 p.m.