[docs]def__init__(self,mes_training_sample:np.ndarray,lvg_training_sample:np.ndarray,ses_training_sample:np.ndarray,mes_firm:float,lvg_firm:float,)->None:"""__init__ Args: mes_training_sample (np.ndarray): ``(n_firms,)`` array of firm ex ante MES. lvg_training_sample (np.ndarray): ``(n_firms,)`` array of firm ex ante LVG (say, on the last day of the period of training data) ses_training_sample (np.ndarray): ``(n_firms,)`` array of firm ex post cumulative return for date range after `lvg_training_sample`. mes_firm (float): The current firm MES used to calculate the firm (fitted) SES value. lvg_firm (float): The current firm leverage used to calculate the firm (fitted) SES value. """assertmes_training_sample.shape==lvg_training_sample.shapeassertmes_training_sample.shape==ses_training_sample.shapeself.mes=mes_training_sampleself.lvg=lvg_training_sampleself.ses=ses_training_sampleself.mes_firm=mes_firmself.lvg_firm=lvg_firm
[docs]defestimate(self,version="BFLV2012")->float:"""estimate Args: version (str, optional): version of methods. Any of ["BFVL2012", "APPR2017"]. Defaults to "BFLV2012". Returns: float: The systemic risk that firm :math:`i` poses to the system at a future time. """assertversionin["BFLV2012","APPR2017",]ifversion=="BFLV2012":returnself._bflv2012()ifversion=="APPR2017":raiseNotImplementedError