Learn R Programming

probhat (version 0.3.1)

32_range_and_sequence_methods: Range and Sequence Functions

Description

Range and sequence methods for probability distributions.

Usage

# S3 method for dpduv
min(sf, infv=FALSE, …)
# S3 method for dpduv
max(sf, infv=FALSE, …)
# S3 method for cpduv
min(sf, infv=FALSE, …)
# S3 method for cpduv
max(sf, infv=FALSE, …)

# S3 method for dpduv range(sf, infv=FALSE, …, freq) # S3 method for cpduv range(sf, infv=FALSE, …)

# S3 method for dpduv seq(sf, infv=FALSE, …, midpoints=TRUE, freq) # S3 method for cpduv seq(sf, infv=FALSE, …, n=200)

Arguments

sf

A suitable function object. Here, this refers to a univariate probability distribution. Refer to the references and see also sections.

infv

Logical, in function value. Except for quantile functions, where this refers to the probabilities. Refer to the details section.

midpoints

Logical, if true, return midpoints. Ignored, except for discrete quantile functions with infv=TRUE. Refer to the details section.

freq

Logical, if true, return frequencies. Ignored, except for PMFs with infv=TRUE.

n

Integer, the number of points in the resulting sequence.

Ignored.

Value

Integer types are returned for discrete probability distributions with infv=FALSE. Otherwise, numeric types are returned.

The min and max methods return a single integer/numeric value. The range methods return an length-two integer/numeric vector.

And the seq methods return an integer/numeric vector. This will be equally-spaced, if infv=FALSE.

Details

By default, the min/max, range and sequence methods apply to range of the random variable. Often this the range of the observations plus/minus half the bandwidth at each end.

Calling the sequence method on a discrete quantile function, with infv=TRUE:

If midpoints is true, then midpoints of the intervals are returned. If midpoints is false, then breakpoints, including the outermost values, are returned.

Each interval is defined by one consecutive pair of breakpoints. Where the breakpoints are (unique) values from the CDF, including zero (at the start) and one (at the end).

In general, these sequences are not equally-spaced.

Calling the sequence method on a continuous quantile function, with infv=TRUE:

Simply returns a returns an equally-spaced sequence between zero and one.

References

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

See Also

Succinct Constructors Discrete Kernel Smoothing, Continuous Kernel Smoothing Categorical Distributions, Empirical-Like Distributions

Examples

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

dfh <- pmfuv.dks (traffic.bins, traffic.freq, lower=0)

seq (dfh)
seq (dfh, TRUE)
# }

Run the code above in your browser using DataLab