| plot.SECdistr | R Documentation |
SECdistrUv and SECdistrMvPlotting methods for classes SECdistrUv and SECdistrMv
using ggplot2
## S4 method for signature 'SECdistrUv'
plot(x, range, probs, main, npt = 251, data=NULL,
plot.it=TRUE, ...)
## S4 method for signature 'SECdistrMv'
plot(x, range, probs, npt, landmarks = "auto", main,
comp, compLabs, data = NULL, data.par = NULL, gap = 0.5, plot.it=TRUE, ...)
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. |
probs |
a vector of probability values. In the univariate case, the
corresponding quantiles are plotted on the horizontal axis; it can be
skipped by setting |
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 |
landmarks |
a character string which affects the placement of some
landmark values in the multivariate case, that is, the origin, the mode
and the mean (or its substitute pseudo-mean), which are all aligned.
Possible values: |
main |
a character string for main title; if missing, one is built from the available ingredients. |
comp |
a subset of the vector |
compLabs |
a vector of character strings or expressions used to denote
the variables in the plot;
if missing, |
data |
an optional set of data of matching dimensionity of
|
data.par |
an optional list of graphical parameters used for plotting
|
gap |
unused; only present for compatibility with the sn method. |
plot.it |
logical value (default: |
... |
additional graphical parameters |
An invisible list. In the univariate case, the list has four components:
the input object representing the distribution, two numeric vectors with the
coordinates of the plotted density values and the ggplot2 plot object,
named gg.obj.
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, with the corresponding approximate
probability content as a vector attribute, and the ggplot2 plot object
For univariate density plots where range has not been specified,
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 NULL
and must only include values strictly within the (0, 1) interval.
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, p. 179, and references therein.
If range has not been specified in the calling statement, a suitable
plottiung range is computed from a set of reasonable quantiles for each
univariate marginal distribution. Next, if data is not NULL,
that plotting range may be expanded to accommodate all the data points.
signature(x = "SECdistrUv")Plot an object x
of class SECdistrUv.
signature(x = "SECdistrMv")Plot an object x
of class SECdistrMv.
Adelchi Azzalini
Azzalini, A. with the collaboration of Capitanio, A. (2014). The Skew-Normal and Related Families. Cambridge University Press, IMS Monographs series.
makeSECdistr, summary.SECdistr,
dp2cp in package sn
# d=1
f1 <- makeSECdistr(dp=c(3,2,5), family="SC", name="Univariate Skew-Cauchy")
plot(f1)
plot(f1, range=c(-5, 30), probs=NULL, col=4, main="SC(3,2,5) density function")
plot(f1, col=2, lty=2, probs=c(0.25, 0.75), )
#
# d=2
Omega2 <- matrix(c(3, -3, -3, 5), 2, 2)
f2 <- makeSECdistr(dp=list(c(10,30), Omega=Omega2, alpha=c(-3, 5)),
family="sn", name="SN-2d", compNames=c("x1","x2"))
plot(f2)
x2 <- rmsn(100, dp=slot(f2,"dp"))
plot(f2, main="Distribution 'f2'", probs=c(0.5,0.9), cex.main=1.5, col=2,
cex=0.8, compLabs=c(expression(x[1]), expression(log(z[2]-beta^{1/3}))),
data=x2, data.par=list(col=4, cex=0.6, pch=5))
#
# d=3
Omega3 <- toeplitz(1/1:3)
f3 <- makeSECdistr(dp=list(c(-9, 0, 8), Omega=Omega3, alpha=c(2, -3, 5), nu=4),
family="ST", name="ST-3d", compNames=c("x1","x2", "z"))
plot(f3, landmarks="")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.