| Library: | cafpe |
| Quantlet: | wei | |
| Description: |
Quantlet for weighting the observations.
It returns either a 1 or 0 for each observation
according to whether it should be kept or ignored.
This is decided on whether the density of the vector
of lags is larger than a certain threshold. The threshold is computed
such that per*#obs observations are thrown away
which are those with the lowest density.
If a density matrix is handed over, the operation is
done on column i.
|
| Usage: | w = wei(den,per,i) | |
| Input: | ||
| den | (nn x d) matrix of estimated density | |
| per | scalar, 0<=per<=1, fraction to be cut off | |
| i | scalar, column in den used for evaluation | |
| Output: | ||
| w | (nn x 1) matrix of zeros and ones | |
| Library: | cafpe |