Ad
  • Custom User Avatar

    The check_list test function always returns True if one of the arrays is empty.

  • Custom User Avatar

    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).

  • Custom User Avatar

    The method should be named "get_shift", and should take 1 argument: Name of the Equity/Currency Using our previously imported data

    The argument name in the code is misleading:

    def get_shift(self, asset):
    

    It is not an asset, it's asset | currency.

    Similarly, typo:

    def get_var(self, asset, risk_class, convidence):
    

    convidence -> confidence. Tests also uses conv when conf should be the correct term.

  • Custom User Avatar

    Test messages are kind of unacceptable:

    MartyCorp un-ordered relative shift should be [0.044444, -0.010638, -0.021505, -0.010989, 0.111111, 0.04, -0.009615, -0.019417, -0.019802, 0.010101]: False should equal True
    

    it only shows the expected value, but not the actual value.

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution

  • Custom User Avatar

    permutation tests is passing in a tuple instead of a list.

  • Custom User Avatar

    Two suggestions related to the issues faced by Reswin, aimed to make the kata more accessible to people without a quantitative finance background:

    1. 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.

    2. 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).