Description Usage Arguments Value Note Warning Author(s) See Also Examples
Creates a plot of type "h"
of the probabilities of
each possible x
value of a db distribution where
the probabilities are calculated on the basis of parameters
estimated by the function mleDb()
. If obsd
is supplied it also superimposes/juxtaposes vertical lines
representing the observed proportions.
1 2 3 4 |
x |
An object of class |
... |
Not used. |
plot |
Logical scalar; should a plot be produced (or should the function simply return a data frame consisting of the relevant values)? |
col.fit |
The colour for the (vertical) lines corresponding to the “fitted” probabilities, i.e. the probabilities calculated from the fitted parameters. |
col.obsd |
The colour for the (vertical) lines corresponding to the
“observed” probabilities (proportions), i.e. the
probabilities calculated by tabulating the data (from which the
parameters were estimated. Ignored if |
tikx |
(Optional) vector of locations of the tick marks on the |
xlim |
A numeric vector of length 2 specifying the limits
of the |
ylim |
A numeric vector of length 2 specifying the limits
of the |
xlab |
A label for the x-axis; defaults to |
ylab |
A label for the y-axis; defaults to |
obsd |
The data set from which the parameters were estimated, i.e. from
which |
incr |
Numeric scalar; defaults to 0.1 if |
main |
A main title for the plot; defaults to the empty string. |
legPos |
A list with components |
A data frame with numeric columns x
, p
and possibly
po
. The x
column consists of the integers from
0 to ntop
or from 1 to ntop
depending on whether
zeta
is TRUE
. The p
column consists of
the appropriate probabilities of the x
values, calculated
by link{ddb}()
. The po
column is present only if
obsd
is supplied and consists of the observed proportions.
The value is returned invisibly. A plot is produced as a
side-effect if plot
is TRUE
.
This function calls plotDb()
to do the heavy lifting.
It is up to the user to make sure that the obsd
argument,
if specified, is indeed the data set from which the object x
was calculated.
Rolf Turner r.turner@auckland.ac.nz
1 2 3 4 5 6 7 8 9 10 11 12 | if(require(hmm.discnp)) {
xxx <- hmm.discnp::Downloads
fit <- mleDb(xxx,ntop=14,z=TRUE)
plot(fit)
plot(fit,obsd=xxx)
plot(fit,obsd=xxx,legPos=list(x=3,y=0.25))
plot(fit,obsd=xxx,legPos=NULL) # No legend is plotted.
}
set.seed(42)
yyy <- rbinom(300,10,0.7)
fit <- mleDb(yyy,ntop=10,z=TRUE)
plot(fit,obsd=yyy,legPos="topleft")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.