Loading collection data...
Collections are a way for you to organize kata so that you can create your own training routines. Every collection you create is public and automatically sharable with other warriors. After you have added a few kata to a collection you and others can train on the kata contained within the collection.
Get started now by creating a new collection.
The
check_list
test function always returnsTrue
if one of the arrays is empty.Description for VAR is extremely dense; it definitely requires much more description on what should be used for the calculation of predicted gain/loss. Even the description in Investopedia provides a formula and denotes each term, which is infinitely easier to understand than the current kata description (which is hopeless to grasp).
The argument name in the code is misleading:
It is not an
asset
, it'sasset | currency
.Similarly, typo:
convidence
->confidence
. Tests also usesconv
whenconf
should be the correct term.Test messages are kind of unacceptable:
it only shows the expected value, but not the actual value.
This comment is hidden because it contains spoiler information about the solution
permutation tests
is passing in a tuple instead of a list.Two suggestions related to the issues faced by Reswin, aimed to make the kata more accessible to people without a quantitative finance background:
The non-additive nature of VAR could be incorporated into the description. That is, the reader should understand that they are to first construct the daily gain-loss distribution summed across equities, and only then calculate the quantile.
Calculation of total (equity plus currency) shifts could be described more clearly. The simplest explanation is that each equity's total shifts are obtained as the relative shifts of its currency-converted price series. An even simpler alternative is to simply spell out the geometric compounding formula (or, less spoilerly, the equations leading to it), which is equivalent but easier to code on top of existing equity and currency shifts calculated by
get_shift
).