def value_at_risk(self, cutoff=0.05): """Value at risk (VaR) of a returns stream. Args: cutoff (float or array_like): Decimal representing the percentage cutoff for the bottom percentile of returns.""" cutoff = np.broadcast_to(cutoff, (len(self.columns),)) return self.wrap_reduced(nb.value_at_risk_nb(self.to_2d_array(), cutoff))
def value_at_risk(self, cutoff=0.05, wrap_kwargs=None): """Value at risk (VaR) of a returns stream. Args: cutoff (float or array_like): Decimal representing the percentage cutoff for the bottom percentile of returns.""" wrap_kwargs = merge_dicts(dict(name_or_index='value_at_risk'), wrap_kwargs) return self.wrapper.wrap_reduced(nb.value_at_risk_nb( self.to_2d_array(), cutoff ), **wrap_kwargs)
def value_at_risk(self, cutoff: float = 0.05, wrap_kwargs: tp.KwargsLike = None) -> tp.MaybeSeries: """Value at risk (VaR) of a returns stream. Args: cutoff (float): Decimal representing the percentage cutoff for the bottom percentile of returns.""" result = nb.value_at_risk_nb(self.to_2d_array(), cutoff) wrap_kwargs = merge_dicts(dict(name_or_index='value_at_risk'), wrap_kwargs) return self.wrapper.wrap_reduced(result, **wrap_kwargs)