plot.SUNdistr-method | R Documentation |
SUNdistr
Plotting method for class SUNdistr
## S4 method for signature 'SUNdistr'
plot(x, range, nlevels = 8, levels, npt, main, comp, compLabs, gap = 0.5, ...)
x |
an object of class |
range |
in the univariate case, a vector of length 2 which defines the plotting range; in the multivariate case, a matrix with two rows where each column defines the plotting range of the corresponding component variable. If missing, a sensible choice is made. |
nlevels |
number of contour levels desired iff levels is not supplied. |
levels |
numeric vector of levels at which to draw contour lines. |
npt |
a numeric value or vector (in the univariate and in the
multivariate case, respectively) to assign the number of evaluation points
of the distribution, on an equally-spaced grid over the |
main |
a character string for main title; if missing, one is built from the available ingredients. |
comp |
an optional integer vector representing the subset of the vector
|
compLabs |
a vector of character strings or expressions used to label
the variables in the plot;
if missing, |
gap |
a numeric value which regulates the gap between panels of a
multivariate plot when |
... |
additional graphical parameters |
For univariate density plots, probs
are used to compute quantiles
from the appropriate distribution, and these are superimposed to the plot of
the density function, unless probs=NULL
. In the multivariate case,
each bivariate plot is constructed as a collection of contour curves,
one curve for each probability level; consequently, probs
cannot be
missing or NULL
. The level of the density contour lines are chosen
so that each curve circumscribes a region with the quoted probability,
to a good degree of approssimation; for additional information, see
Azzalini and Capitanio (2014), specifically Complement 5.2 and p.179,
and references therein.
an invisible list. In the univariate case the list has three components:
the input object representing the distribution and two numeric vectors with
the coordinates of the plotted density values.
In the multivariate case, the first element of the list is the input object
representing the distribution and all subsequent list elements are lists with
components of the panels comprising the matrix plot;
the elements of these sub-lists are:
the vectors of x
and y
coordinates, the names of the variables,
the density values at the (x,y)
points, a vector of the density levels
of the curves appearing in each panel plot.
Adelchi Azzalini
makeSUNdistr
, SUNdistr-class
xi <- c(1, 0, -1)
Omega <- matrix(c(2,1,1, 1,3,1, 1,1,4), 3, 3)
Delta <- matrix(c(0.72,0.20, 0.51,0.42, 0.88, 0.94), 3, 2, byrow=TRUE)
Gamma <- matrix(c(1, 0.8, 0.8, 1), 2, 2)
dp3 <- list(xi=xi, Omega=Omega, Delta=Delta, tau=c(-0.5, 0), Gamma=Gamma)
sun3 <- makeSUNdistr(dp=dp3, name="SUN3", compNames=c("x", "w", "z"))
plot(sun3, npt=rep(51,3))
p <- plot(sun3, comp=2:3, compLabs=c(expression(x[2]), expression(x[3])))
# str(p)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.