Returns weighted percentiles of a sample
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, t