Learn R Programming

distfromq

Given a set of predictive quantiles from a distribution, estimate the distribution and create d, p, q, and r functions to evaluate its density function, distribution function, and quantile function, and generate random samples. On the interior of the provided quantiles, an interpolation method such as a monotonic cubic spline is used; the tails are approximated by a location-scale family.

Copy Link

Version

Install

install.packages('distfromq')

Monthly Downloads

209

Version

1.0.4

License

GPL (>= 3)

Maintainer

Evan Ray

Last Published

September 13th, 2024

Functions in distfromq (1.0.4)

split_disc_cont_ps_qs

Split ps and qs into those corresponding to discrete and continuous parts of a distribution.
make_r_fn

Creates a function that generates random deviates from an approximation to a distribution obtained by interpolating and extrapolating from a set of quantiles of the distribution.
make_p_fn

Creates a function that evaluates the cumulative distribution function of an approximation to a distribution obtained by interpolating and extrapolating from a set of quantiles of the distribution.
get_dup_run_inds

Get indices of starts and ends of runs of duplicate values
spline_cdf

Approximate density function, CDF, or quantile function on the interior of provided quantiles by representing the distribution as a sum of a discrete part at any duplicated qs and a continuous part for which the CDF is estimated using a monotonic Hermite spline. See details for more.
make_q_fn

Creates a function that evaluates the quantile function of an approximation to a distribution obtained by interpolating and extrapolating from a set of quantiles of the distribution.
mono_Hermite_spline

Create a polySpline object representing a monotonic Hermite spline interpolating a given set of points.
duplicated_tol

Identify duplicated values in a sorted numeric vector, where comparison is up to a specified numeric tolerance. If there is a run of values where each consecutive pair is closer together than the tolerance, all are labeled as duplicates even if not all values in the run are within the tolerance.
step_interp_factory

A factory that returns a function that performs linear interpolation, allowing for "steps" or discontinuities.
make_d_fn

Creates a function that evaluates the probability density function of an approximation to a distribution obtained by interpolating and extrapolating from a set of quantiles of the distribution.
unique_tol

Get unique values in a sorted numeric vector, where comparison is up to a specified numeric tolerance. If there is a run of values where each consecutive pair is closer together than the tolerance, all are labeled as corresponding to a single unique value even if not all values in the run are within the tolerance.