dgaitdplot | R Documentation |
Plots a 1- or 2-parameter GAITD combo probability mass function.
dgaitdplot(theta.p, fam = "pois", a.mix = NULL, i.mix = NULL,
d.mix = NULL, a.mlm = NULL, i.mlm = NULL,
d.mlm = NULL, truncate = NULL, max.support = Inf,
pobs.mix = 0, pobs.mlm = 0,
pstr.mix = 0, pstr.mlm = 0,
pdip.mix = 0, pdip.mlm = 0, byrow.aid = FALSE,
theta.a = theta.p, theta.i = theta.p, theta.d = theta.p,
deflation = FALSE, plot.it = TRUE, new.plot = TRUE,
offset.x = ifelse(new.plot, 0, 0.25), type.plot = "h",
xlim = c(0, min(100, max.support + 2)),
ylim = NULL, xlab = "", ylab = "Probability", main = "",
cex.main = 1.2, posn.main = NULL,
all.col = NULL, all.lty = NULL, all.lwd = NULL,
lty.p = "solid", lty.a.mix = "longdash", lty.a.mlm = "longdash",
lty.i.mix = "dashed", lty.i.mlm = "dashed",
lty.d.mix = "solid", lty.d.mlm = "solid", lty.d.dip = "dashed",
col.p = "pink2",
col.a.mix = artichoke.col, col.a.mlm = asparagus.col,
col.i.mix = indigo.col, col.i.mlm = iris.col,
col.d.mix = deer.col, col.d.mlm = dirt.col, col.d.dip = desire.col,
col.t = turquoise.col, cex.p = 1, lwd.p = NULL, lwd.a = NULL,
lwd.i = NULL, lwd.d = NULL, iontop = TRUE, dontop = TRUE,
las = 0, lend = "round", axes.x = TRUE, axes.y = TRUE,
Plot.trunc = TRUE, cex.t = 1, pch.t = 1,
baseparams.argnames = NULL, nparams = 1, flip.args = FALSE, ...)
theta.p |
Numeric, usually scalar but may have length 2.
This matches with, e.g., |
fam |
Character, |
a.mix , i.mix , a.mlm , i.mlm |
See |
d.mix , d.mlm |
See |
truncate , max.support |
See |
pobs.mix , pobs.mlm , byrow.aid |
See |
pstr.mix , pstr.mlm , pdip.mix , pdip.mlm |
See |
theta.a , theta.i , theta.d |
Similar to |
deflation |
Logical. Plot the deflation (dip) probabilities? |
plot.it |
Logical. Plot the PMF? |
new.plot , offset.x |
If |
xlim , ylim , xlab , ylab |
See |
main , cex.main , posn.main |
Character, size and position of |
all.col , all.lty , all.lwd |
These arguments allow all the colours,
line types and line widths arguments to be
assigned to these values, i.e., so that they
are the same for all values of the support.
For example, if |
lty.p , lty.a.mix , lty.a.mlm , lty.i.mix , lty.i.mlm |
Line type for parent, altered and inflated.
See |
col.p , col.a.mix , col.a.mlm , col.i.mix , col.i.mlm |
Line colour for parent (nonspecial), altered, inflated,
truncated and deflated values.
See |
lty.d.mix , lty.d.mlm , lty.d.dip |
Similar to above.
Used when |
col.d.mix , col.d.mlm , col.d.dip |
Similar to above.
Used when |
col.t |
Point colour for truncated values, the default is
|
type.plot , cex.p |
The former matches 'type' argument in
|
lwd.p , lwd.a , lwd.i , lwd.d |
Line width for parent, altered and inflated.
See |
las , lend |
See |
iontop , dontop |
Logicals.
Draw the inflated and deflated bars on top?
The default is to draw the spikes on top, but if
|
axes.x , axes.y |
Logical. Plot axes?
See |
Plot.trunc , cex.t , pch.t |
Logical. Plot the truncated values?
If so, then specify the size and plotting character.
See |
baseparams.argnames |
Character string specifying the argument name for the generic
parameter |
nparams , flip.args |
Not for use by the user. It is used internally to handle the NBD. |
... |
Currently unused but there is provision for
passing graphical arguments in in the future;
see |
This is meant to be a crude function to plot the PMF of the GAITD combo model. Some flexibility is offered via many graphical arguments, but there are still many improvements that could be done.
A list is returned invisibly. The components are:
x |
The integer values between the values
of |
pmf.z |
The value of the PMF, by
calling the |
sc.parent |
The same level as the scaled parent
distribution. Thus for inflated values,
the value where the spikes begin. And for
deflated values, the value at the top of
the dips. This is a convenient way to obtain
them as it is quite cumbersome to compute
them manually. For any nonspecial value,
such as non-inflated and non-deflated values,
they are equal to |
unsc.parent |
Unscaled parent distribution. If there is no alteration, inflation, deflation and truncation then this is the basic PMF stipulated by the parent distribution only. Usually this is FYI only. |
This utility function may change a lot in the future.
Because this function is called by a shiny app,
if any parameter values lie outside the
parameter space then stop
will be called.
For example, too much deflation results in
NaN
values returned by
dgaitdnbinom
.
T. W. Yee.
plotdgaitd
,
spikeplot
,
meangaitd
,
Gaitdpois
,
gaitdpoisson
,
Gaitdnbinom
,
multilogitlink
.
## Not run: i.mix <- seq(0, 25, by = 5)
mean.p <- 10; size.p <- 8
dgaitdplot(c(size.p, mean.p), fam = "nbinom", xlim = c(0, 25),
a.mix = i.mix + 1, i.mix = i.mix, pobs.mix = 0.1,
pstr.mix = 0.1, lwd.i = 2,lwd.p = 2, lwd.a = 2)
## End(Not run)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.