Ad
  • Custom User Avatar

    Assets should be a superset of both equities and currencies. I think the problems are the places in the descriptions where assets and equities are used interchangably.

    Edit: Or, since he seems to want separate imports for these different asset classes, he should specify the asset types in the argument, like you suggest.

    Second Edit: On third thought, I think get_shift arguments are named just fine, but asset_import should either handle all types of assets or be renamed to equity_import but also include in its name evidence that we're importing historical data and not data regarding the users holdings.

  • Custom User Avatar
  • 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

    Thanks for your kind words.

    i happy the the sheer length of the kata-description-text did not scare you away from this kata ( since i think the that the underlying topic is pretty interesting ).

    Have a nice day :-)

  • Custom User Avatar

    I would say this kata is pretty tough to solve, but I'm glad I finally completed it after 3 days of thoughts.

    I liked this kata, but some parts of kata were pretty unclear to deal with. Still, I managed to resolve them and, with some accuracy tricks, I passed this problem.

    Thanks for the kata! :)

  • Custom User Avatar

    No lists were harmed in this solution!

  • Custom User Avatar

    i think that carloscerro is right.

    The valuation-test seems to rely on an unchanged input variable.

    please check the following code. It will fail for the first basic test (One toggle), but will succeed if you out-commend the lines 2 and 3:

    def solve(puzzle):
      if 0 < len(puzzle):
        puzzle[0][0] = (puzzle[0][0] + 1) % 2
      return [(1, 1)]
    
  • Custom User Avatar

    Hi Reswin,

    thanks for the feedback.
    In fact, uttumuttu did a good job and seems to be very clever in general.

    PS:
    This kind of approach ( using past or self-defined relative shifts for the risk-factors ) is not only used to calculate Vaule-at-Risk, but also other by risk-measures like "expected shortfall", or scenarios ( e.g. black friday ) or sensitivities ( checking how much win/loss e.g. a yield shift of 1% would induce ).

  • Custom User Avatar

    @uttumuttu's second suggestion to describe VAR was helfpul for me: "The simplest explanation (of VAR) is that each equity's total shifts are obtained as the relative shifts of its currency-converted price series." I enjoyed the kata because it not only allowed me to practice Python but also to learn about VAR.

  • Custom User Avatar

    Sorry have written, before thinking:

    VAR is not sub-additive in both dimensions ( over Risk-Classes and over sub-Positions ).

    Will modify th desciption accordingly.

  • Loading more items...