fn.PMF_quantile: Calculate the weighted quantile using probability mass...

View source: R/other-functions.R

fn.PMF_quantileR Documentation

Calculate the weighted quantile using probability mass function

Description

Computes a quantile of discrete weighted distribution by constructing the cumulative distribution function from probability masses

Usage

fn.PMF_quantile(val, q, mass)

Arguments

val

Numeric vector of values

q

Quantile to compute (between 0 and 1, e.g., 0.5 for median)

mass

Numeric vector of weights/masses corresponding to each value

Value

Numeric quantile value. For the minimum value, returns that value. Otherwise, returns the average of adjacent values for smoothness.


WMAP documentation built on Oct. 6, 2026, 1:07 a.m.