Description Usage Arguments Details Value Examples

Estimate quantiles of distribution

1 | ```
estQdf(p, x, cdf)
``` |

`p` |
A vector of probabilities. |

`x` |
The x-axis values corresponding to the cumulative distribution function. |

`cdf` |
A cumulative distributions function, i.e. output of |

Quantiles are obtained in the following manner. For p = 0 and p = 1,
the minimum and maximum of x is used. For other probabilities the quantiles are obtained
via `q[i] = uniroot(x, cdf - p[i])$root`

. Y values are interpolated via
`approxfun`

.

Quantiles of cumulative distribution function(s). If the input was a matrix of cumulative distributions functions, a matrix of quantiles is returned.

1 2 3 4 5 6 7 8 | ```
x = seq(-9, 9, .1) # x-grid
d = dnorm(x) # density functions
p = seq(0, 1, .2) # probabilities of interest
cEst = estCdf(d) # estimate cumulative distribution functions
qEst = estQdf(p = p, x = x, cdf = cEst) # estimate quantiles
plot(x, cEst, bty = 'n', las = 1, type = 'l', ylab = 'Probability') # plot cdf
abline(h = p, v = qEst, col = 1:6, lty = 2) # add lines for p and for obtained quantiles
points(x = qEst, y = p, pch = 18, col = 1:6, cex = 1.75) # add points for intersections
``` |

DstarM documentation built on May 18, 2018, 5:04 p.m.

Embedding an R snippet on your website

Add the following code to your website.

For more information on customizing the embed code, read Embedding Snippets.