Learn R Programming

probhat (version 0.4.1)

61_main_multivariate_probabilities: Multivariate Probabilities

Description

Compute the probability of observing a point within a rectangular/cuboidal/etc region.

Currently, these functions are limited to nonconditional CKS models. The function probmv can be used for almost-arbitrary continuous CDFs, but is deprecated.

Usage

pwith (…)

# S3 method for cksuv pwith(sf, xlim = c (a, b), …, a=-Inf, b=Inf) # S3 method for cksmv pwith(sf, xlim = cbind (a, b), …, a=-Inf, b=Inf)

Arguments

sf

A suitable function object. (Here, this is a cksuv or cksmv object, which are nonconditional CKS objects.) PDFs, CDFs and quantile functions, are all allowed.

xlim

A length-two numeric vector or a two-column numeric matrix. A standard vector is the same as a one-row matrix. And the number of rows needs to match the number of random variables. This represents the lower and upper limits, corresponding to the limits of integration, if one was integrating the corresponding PDF. By default, this is just the combination a and b, meaning that limits can be specified in two ways.

a, b

Numeric vectors, giving the lower and upper limits, respectively.

Ignored.

Value

A single numeric value.

Details

Refer to the vignette for more information.

Note that evaluating a spline-based CDF is likely to faster, ignoring the construction of the object.

References

Refer to the vignette for an overview, references and better examples.

See Also

pdist, probmv

cdfmv.cks, cdfmvc.cks

ph.mean moment

rng

quartiles, ntiles, ph.median, ph.quantile ph.mode, ph.modes\

Examples

Run this code
# NOT RUN {
prep.ph.data ()

cfh3 <- pdfmv.cks (trees2)

xlim <- matrix (c (
    22, 24,    #height in 22 to 24
    28, 38,    #girth  in 28 to 38
    0.55, 1.05 #volume in 0.55 to 1.05
    ),, 2, byrow=TRUE, dimnames = list (colnames (trees), c ("a", "b") ) )

pwith (cfh3, xlim=xlim)
# }

Run the code above in your browser using DataLab