Description Usage Arguments Details Value References See Also Examples
Compute density (and probability) matrices.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 | ########################################
#(du) discrete uniform
#(bn) binomial
#(p) poisson
########################################
## S3 method for class 'DUBV'
bvmat(sf, xlim, ylim, ...)
## S3 method for class 'BNBV'
bvmat(sf, xlim, ylim, ...)
## S3 method for class 'PBV'
bvmat(sf, xlim, ylim, ...)
########################################
#(cu) continuous uniform
#(n) normal
#(bm) bimodal
########################################
## S3 method for class 'CUBV'
bvmat(sf, xlim, ylim, ..., n=10)
## S3 method for class 'NBV'
bvmat(sf, xlim, ylim, ..., n=10)
## S3 method for class 'BMBV'
bvmat(sf, xlim, ylim, ..., n=10)
########################################
#(g) categorical
#(d) dirichlet
#(k) kernel
#(e) empirical
########################################
## S3 method for class 'GBV'
bvmat(sf, ...)
## S3 method for class 'DTV'
bvmat(sf, ..., log=FALSE, n=10)
## S3 method for class 'KBV'
bvmat(sf, xlim, ylim, ..., n=10)
## S3 method for class 'EBV'
bvmat(sf, ..., reg=TRUE)
########################################
#additional functions
#(called by the ebv method, above)
########################################
ebvmat_reg (sf, xlim, ylim, ..., n=10)
ebvmat_step (sf, ..., extend=FALSE)
|
sf |
A suitable function object. |
xlim, ylim |
A length-two vector for the evaluation window. |
n |
Integer vector of length one or two, number of grid points. |
log |
Logical, if true, return log-transformed densities. |
reg |
Logical, if true, evaluate the ECDF over a regularly-spaced grid. |
extend |
Logical vector or length one or two, if true, compute a rim (of probabilities) outside the observed values. |
... |
Ignored. |
These methods work for both PMFs/PDFs and CDFs, where applicable.
For example:
If bvmat is called with a normal density function it will return densities (from the density function), however, if called with a normal distribution function it will return the probabilities (from the distribution function).
Note that the ebv (empirical) method calls either the ebvmat_reg or ebvmat_step function, depending on the reg argument.
An S4 object with:
An fv slot, which is a matrix, of densities or probabilities.
x and y slots, which are the evaluation points.
(This length of x should equal the number of rows, and the length of y should equal the number of columns).
And exception to the above is ECDFs with reg=FALSE, where x and y are breakpoints.
(The length of x should be equal to the number of rows plus one, and the length of y should be equal to the number of columns plus one).
Refer to the vignette for an overview, references, theoretical background and better examples.
Uniform
For uniform distributions.
Binomial, Poisson and Categorical
For other probability distributions of discrete random variables.
Normal, Bimodal, Dirichlet and Nonparametric
For other probability distributions of continuous random variables.
Main Plotting Functions
1 2 3 4 5 6 7 8 9 | data (geyser, package="MASS")
attach (geyser)
#adapted from the KernSmooth package
fh <- kbvpdf (duration, waiting, 0.7, 7)
bvmat (fh)
detach (geyser)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.