quantile_functions_from_data {simdata} | R Documentation |
Helper to estimate quantile functions from data for NORTA
Description
Helper to estimate quantile functions from data for NORTA
Usage
quantile_functions_from_data(
data,
method_density = "linear",
n_density = 200,
method_quantile = "constant",
probs_quantile = seq(0, 1, 0.01),
n_small = 10,
use_quantile = c(),
...
)
quantile_function_from_density(
x,
method_density = "linear",
n_density = 200,
...
)
quantile_function_from_quantiles(
x,
method_quantile = "constant",
probs_quantile = seq(0, 1, 0.01)
)
Arguments
data |
A matrix or data.frame for which quantile function should be estimated. |
method_density |
Interpolation method used for density based quantile functions,
passed to |
n_density |
Number of points at which the density is estimated for density bsed
quantile, functions, passed to |
method_quantile |
Interpolation method used for quantile based quantile functions,
passed to |
probs_quantile |
Specification of quantiles to be estimated from data for quantile based
quantile functions, passed to |
n_small |
An integer giving the number of distinct values below which quantile
functions are estimated using |
use_quantile |
A vector of names indicating columns for which the quantile function
should be estimated using |
... |
Passed to |
x |
Single vector representing variable input to |
Details
The NORTA approach requires the specification of the marginals by quantile functions. This helper estimates those given a dataset automatically and non-parametrically. There are two ways implemented to estimate quantile functions from data.
Estimate the quantile function by interpolating the observed quantiles from the data. This is most useful for categorical data, when the interpolation is using a step-function (default). Implemented in
quantile_function_from_quantiles()
.Estimate the quantile function via the the empirical cumulative density function derived from the density of the data. Since the density is only estimated at specific points, any values in between are interpolated linearly (default, other options are possible). This is most useful for continuous data. Implemented in
quantile_function_from_density()
.
Value
A named list of functions with length ncol(data)
giving the quantile
functions of the input data. Each entry is a function returned from
stats::approxfun
.