Returns weighted percentiles of a sample

버전 1.0.0.0 (3.81 KB) 작성자: Durga Lal Shrestha
Returns weighted percentiles of a sample with six algorithms given weight vector
다운로드 수: 2.9K
업데이트 날짜: 2008/4/3

라이선스 보기

The idea is to give more emphasis in some examples of data as compared to
others by giving more weight. For example, we could give lower weights to
the outliers. The motivation to write this function is to compute percentiles
for Monte Carlo simulations where some simulations are very bad (in terms of
goodness of fit between simulated and actual value) than the others and to
give the lower weights based on some goodness of fit criteria.

USAGE:
y = WPRCTILE(X,p) % This is same as PRCTILE
y = WPRCTILE(X,p,w)
y = WPRCTILE(X,p,w,type)

INPUT:
X - vector or matrix of the sample data
p - scalar or a vector of percent values between 0 and 100

w - positive weight vector for the sample data. Length of w must be equal to either number of rows or columns of X. If the weights are equal, then WPRCTILE is same as PRCTILE.

type - an integer between 4 and 9 selecting one of the 6 quantile algorithms.

OUTPUT:
y - percentiles of the values in X
When X is a vector, y is the same size as p, and y(i) contains the
P(i)-th percentile.
When X is a matrix, WPRCTILE calculates percentiles along dimension DIM which is based on: if size(X,1) == length(w), DIM = 1; elseif size(X,2) == length(w), DIM = 2;

EXAMPLES:
x = randn(1000,1);
w = rand(1000,1);
y = wprctile(x,[2.5 25 50 75],w,7)

인용 양식

Durga Lal Shrestha (2024). Returns weighted percentiles of a sample (https://www.mathworks.com/matlabcentral/fileexchange/16920-returns-weighted-percentiles-of-a-sample), MATLAB Central File Exchange. 검색됨 .

MATLAB 릴리스 호환 정보
개발 환경: R2007b
모든 릴리스와 호환
플랫폼 호환성
Windows macOS Linux
카테고리
Help CenterMATLAB Answers에서 Time Series에 대해 자세히 알아보기
도움

줌: Quantile calculation

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
버전 게시됨 릴리스 정보
1.0.0.0

Added option with different 5 algorithm to compute the quantile