quantile_conflation: quantile_conflation: Calculate the quantile for a given...

View source: R/conflate.R

quantile_conflationR Documentation

quantile_conflation: Calculate the quantile for a given probabiliy under a conflated distribution

Description

quantile_conflation: Calculate the quantile for a given probabiliy under a conflated distribution

Usage

quantile_conflation(p, data, output = c("quantile", "optim"))

Arguments

p

A float with the desired probability for which the quantile is to be calculated.

data

A data frame which results from calling 'conflate'.

output

One of two values, either "quantile" or "optim". The former returns only the optimised quantile value, whereas the latter returns the complete output from 'optim'. Useful for checking whether optimisation converged.

Value

Either a vector of length one withe the quantile value, or a list as returned by optim.

Examples


conflated = density(rnorm(1000000, 0, 1))[c("x", "y")]
quantile_conflation(0.5, conflated, output = "quantile")
quantile_conflation(0.5, conflated, output = "opt")
quantile_conflation(0.025, conflated, "quan")
quantile_conflation(0.975, conflated, "q")



tbea documentation built on April 12, 2025, 1:25 a.m.