Sample Weights¶
MlFinLab supports two methods of applying sample weights. The first is weighting an observation based on its given return as well as average uniqueness. The second is weighting an observation based on a time decay.
Implementations¶
By Returns and Average Uniqueness¶
The following function utilizes a samples average uniqueness and its return to compute sample weights:
Example¶
This function can be utilized as shown below assuming we have already found our barrier events
Example¶
This function can be utilized as shown below assuming we have already found our barrier events
Research Notebook¶
The following research notebooks can be used to better understand the previously discussed sampling methods
Note
This is the same notebook as seen in the Sample Uniqueness docs.