Plots a 1- or 2-parameter GAIT combo probability mass function.
dgaitplot(theta.p, fam = "pois", alt.mix = NULL, inf.mix = NULL,
alt.mlm = NULL, inf.mlm = NULL, truncate = NULL,
max.support = Inf, pobs.mix = 0, pobs.mlm = 0,
pstr.mix = 0, pstr.mlm = 0, byrow.ai = FALSE,
theta.a = theta.p, theta.i = 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,
lty.p = "solid", lty.a.mix = "longdash", lty.a.mlm = "longdash",
lty.i.mix = "dashed", lty.i.mlm = "dashed", col.p = "pink2",
col.a.mix = "#007FFF", col.a.mlm = "blue",
col.i.mix = "#3F00FF", col.i.mlm = "purple",
col.t = "tan", cex.p = 1, lwd.p = NULL, lwd.a = NULL, lwd.i = NULL,
iontop = TRUE, las = 0, lend = "round",
axes.x = TRUE, axes.y = TRUE, Plot.trunc = TRUE, cex.t = 1,
pch.t = 1, baseparams.argnames = NULL, ...)
Numeric, usually scalar but may have length 2.
This matches with, e.g., lambda.p
for Gaitpois
.
A length 2 example is
c(mean.p, dispind.p)
for Gaitgenpois1
, in
which case fam = "genpois1"
.
Character, paste0("dgait", fam)
should be a
d
-type function returning the PMF.
The default is for the GAIT Poisson combo.
See Gaitpois
and gaitpoisson
.
See Gaitpois
and gaitpoisson
.
See Gaitpois
and gaitpoisson
.
Similar to theta.p
, and they should have the same length
too.
Logical. Allow deflation?
Logical. Plot the PMF?
If new.plot
then plot
is called.
If multiple plots are desired then use offset.x
to
shift the lines.
See par
and plot.default
.
Character, size and position of main
for the title.
See title
,
par
and plot.default
.
The position is used if it is a 2-vector.
Line type for parent, altered and inflated.
See par
and plot.default
.
Line colour for parent (nonspecial), altered and inflated
values.
See par
and plot.default
.
Roughly, by default,
the parent is pink, the altered are azure (blue)
and the inflated are indigo (purplish/violet).
Point colour for truncated values, the default is "tan"
.
The former matches 'type' argument in plot.default
.
The latter is the size of the point if type.plot = "p"
or type.plot = "b"
, etc.
Line width for parent, altered and inflated.
See par
and plot.default
.
By default par()\$lwd
is used for all of them.
See par
.
Logical. Draw the inflated bars on top?
The default is to draw the spikes on top, but if
FALSE
then the spikes are drawn from the bottom---this
makes it easier to see their distribution.
Logical. Plot axes?
See par
and plot.default
.
Logical. Plot the truncated values?
If so, then specify the size and plotting character.
See par
and plot.default
.
Character string specifying the argument name for the generic
parameter theta
, e.g.,
"lambda"
for gaitpoisson
,
By appending .p
, there is an argument called
lambda.p
in dgaitpois
.
Another example is for gaitlog
:
"shape"
appended with .p
means that
dgaitlog
should have an argument
called shape.p
.
This argument is optional and increases the reliability of the
do.call
call internally.
Currently unused but there is provision for passing graphical
arguments in in the future;
see par
.
A list is returned invisibly. The components are:
The integer values between the values of xlim
.
The value of the PMF, by calling the
d
-type function with all the arguments fed in.
For inflated values, the value where the spikes begin,
which are at the same level as the scaled parent
distribution.
This is a convenient way to obtain them as it is quite
cumbersome to compute manually.
For non-inflated values, they are the value of pmf.z
.
This is meant to be a crude function to plot the PMF of the GAIT combo model. Some flexibility is offered via many graphical arguments, but there are still many improvements that could be done.
# NOT RUN {
i.mix <- seq(0, 25, by = 5)
mean.p <- 10
dispind.p <- 8^2 / mean.p # Var(Y) = dispind.p * mean.p
dgaitplot(c(mean.p, dispind.p), fam = "genpois1",
alt.mix = i.mix + 1, inf.mix = i.mix, max.support = 33,
pobs.mix = 0.1, pstr.mix = 0.1, lwd.p = 2, lwd.a = 2, lwd.i = 2)
# }
Run the code above in your browser using DataLab