风险函数

该模块具有计算几个风险指标的功能,这些指标被资产管理行业和学术界广泛使用。
模块函数
- RiskFunctions.MAD(X)[源代码]
Calculate the Mean Absolute Deviation (MAD) of a returns series.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
- 返回:
value – MAD of a returns series.
- 返回类型:
- RiskFunctions.SemiDeviation(X)[源代码]
Calculate the Semi Deviation of a returns series.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Semi Deviation of a returns series.
- 返回类型:
- RiskFunctions.Kurtosis(X)[源代码]
Calculate the Square Root Kurtosis of a returns series.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Square Root Kurtosis of a returns series.
- 返回类型:
- RiskFunctions.SemiKurtosis(X)[源代码]
Calculate the Semi Square Root Kurtosis of a returns series.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Semi Square Root Kurtosis of a returns series.
- 返回类型:
- RiskFunctions.VaR_Hist(X, alpha=0.05)[源代码]
Calculate the Value at Risk (VaR) of a returns series.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
alpha (float, optional) – Significance level of VaR. The default is 0.05.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – VaR of a returns series.
- 返回类型:
- RiskFunctions.CVaR_Hist(X, alpha=0.05)[源代码]
Calculate the Conditional Value at Risk (CVaR) of a returns series.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
alpha (float, optional) – Significance level of CVaR. The default is 0.05.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – CVaR of a returns series.
- 返回类型:
- RiskFunctions.WR(X)[源代码]
Calculate the Worst Realization (WR) or Worst Scenario of a returns series.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – WR of a returns series.
- 返回类型:
- RiskFunctions.LPM(X, MAR=0, p=1)[源代码]
Calculate the First or Second Lower Partial Moment of a returns series.
Where:
is the minimum acceptable return. is the order of the .- 参数:
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – p-th Lower Partial Moment of a returns series.
- 返回类型:
- RiskFunctions.Entropic_RM(X, z=1, alpha=0.05)[源代码]
Calculate the Entropic Risk Measure (ERM) of a returns series.
Where:
is the moment generating function of X.- 参数:
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – ERM of a returns series.
- 返回类型:
- RiskFunctions.EVaR_Hist(X, alpha=0.05)[源代码]
Calculate the Entropic Value at Risk (EVaR) of a returns series.
Where:
is the moment generating function of X.- 参数:
X (1d-array) – Returns series, must have Tx1 size.
alpha (float, optional) – Significance level of EVaR. The default is 0.05.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
(value, z) – EVaR of a returns series and value of z that minimize EVaR.
- 返回类型:
- RiskFunctions.RLVaR_Hist(X, alpha=0.05, kappa=0.01, solver=None)[源代码]
Calculate the Relativistic Value at Risk (RLVaR) of a returns series. I recommend only use this function with MOSEK solver.
Where:
is the power cone 3D. is the deformation parameter.- 参数:
X (1d-array) – Returns series, must have Tx1 size.
alpha (float, optional) – Significance level of EVaR. The default is 0.05.
kappa (float, optional) – Deformation parameter of RLVaR, must be between 0 and 1. The default is 0.01.
solver (str, optional) – Solver available for CVXPY that supports power cone programming. Used to calculate RLVaR and RLDaR. The default value is None.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – RLVaR of a returns series.
- 返回类型:
- RiskFunctions.MDD_Abs(X)[源代码]
Calculate the Maximum Drawdown (MDD) of a returns series using uncompounded cumulative returns.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – MDD of an uncompounded cumulative returns.
- 返回类型:
- RiskFunctions.ADD_Abs(X)[源代码]
Calculate the Average Drawdown (ADD) of a returns series using uncompounded cumulative returns.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – ADD of an uncompounded cumulative returns.
- 返回类型:
- RiskFunctions.DaR_Abs(X, alpha=0.05)[源代码]
Calculate the Drawdown at Risk (DaR) of a returns series using uncompounded cumulative returns.
- 参数:
X (1d-array) – Returns series, must have Tx1 size..
alpha (float, optional) – Significance level of DaR. The default is 0.05.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – DaR of an uncompounded cumulative returns series.
- 返回类型:
- RiskFunctions.CDaR_Abs(X, alpha=0.05)[源代码]
Calculate the Conditional Drawdown at Risk (CDaR) of a returns series using uncompounded cumulative returns.
Where:
is the Drawdown at Risk of an uncompounded cumulated return series .- 参数:
X (1d-array) – Returns series, must have Tx1 size..
alpha (float, optional) – Significance level of CDaR. The default is 0.05.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – CDaR of an uncompounded cumulative returns series.
- 返回类型:
- RiskFunctions.EDaR_Abs(X, alpha=0.05)[源代码]
Calculate the Entropic Drawdown at Risk (EDaR) of a returns series using uncompounded cumulative returns.
- 参数:
X (1d-array) – Returns series, must have Tx1 size..
alpha (float, optional) – Significance level of EDaR. The default is 0.05.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
(value, z) – EDaR of an uncompounded cumulative returns series and value of z that minimize EDaR.
- 返回类型:
- RiskFunctions.RLDaR_Abs(X, alpha=0.05, kappa=0.01, solver=None)[源代码]
Calculate the Relativistic Drawdown at Risk (RLDaR) of a returns series using uncompounded cumulative returns. I recommend only use this function with MOSEK solver.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
alpha (float, optional) – Significance level of EVaR. The default is 0.05.
kappa (float, optional) – Deformation parameter of RLDaR, must be between 0 and 1. The default is 0.01.
solver (str, optional) – Solver available for CVXPY that supports power cone programming. Used to calculate RLVaR and RLDaR. The default value is None.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – RLDaR of an uncompounded cumulative returns series.
- 返回类型:
- RiskFunctions.UCI_Abs(X)[源代码]
Calculate the Ulcer Index (UCI) of a returns series using uncompounded cumulative returns.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Ulcer Index of an uncompounded cumulative returns.
- 返回类型:
- RiskFunctions.MDD_Rel(X)[源代码]
Calculate the Maximum Drawdown (MDD) of a returns series using cumpounded cumulative returns.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – MDD of a cumpounded cumulative returns.
- 返回类型:
- RiskFunctions.ADD_Rel(X)[源代码]
Calculate the Average Drawdown (ADD) of a returns series using cumpounded cumulative returns.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – ADD of a cumpounded cumulative returns.
- 返回类型:
- RiskFunctions.DaR_Rel(X, alpha=0.05)[源代码]
Calculate the Drawdown at Risk (DaR) of a returns series using cumpounded cumulative returns.
- 参数:
X (1d-array) – Returns series, must have Tx1 size..
alpha (float, optional) – Significance level of DaR. The default is 0.05.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – DaR of a cumpounded cumulative returns series.
- 返回类型:
- RiskFunctions.CDaR_Rel(X, alpha=0.05)[源代码]
Calculate the Conditional Drawdown at Risk (CDaR) of a returns series using cumpounded cumulative returns.
Where:
is the Drawdown at Risk of a cumpound cumulated return series .- 参数:
X (1d-array) – Returns series, must have Tx1 size..
alpha (float, optional) – Significance level of CDaR. The default is 0.05.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – CDaR of a cumpounded cumulative returns series.
- 返回类型:
- RiskFunctions.EDaR_Rel(X, alpha=0.05)[源代码]
Calculate the Entropic Drawdown at Risk (EDaR) of a returns series using cumpounded cumulative returns.
- 参数:
X (1d-array) – Returns series, must have Tx1 size..
alpha (float, optional) – Significance level of EDaR. The default is 0.05.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
(value, z) – EDaR of a cumpounded cumulative returns series and value of z that minimize EDaR.
- 返回类型:
- RiskFunctions.RLDaR_Rel(X, alpha=0.05, kappa=0.01, solver=None)[源代码]
Calculate the Relativistic Drawdown at Risk (RLDaR) of a returns series using compounded cumulative returns. I recommend only use this function with MOSEK solver.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
alpha (float, optional) – Significance level of RLDaR. The default is 0.05.
kappa (float, optional) – Deformation parameter of RLDaR, must be between 0 and 1. The default is 0.01.
solver (str, optional) – Solver available for CVXPY that supports power cone programming. Used to calculate RLVaR and RLDaR. The default value is None.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – RLDaR of a compounded cumulative returns series.
- 返回类型:
- RiskFunctions.UCI_Rel(X)[源代码]
Calculate the Ulcer Index (UCI) of a returns series using cumpounded cumulative returns.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Ulcer Index of a cumpounded cumulative returns.
- 返回类型:
- RiskFunctions.GMD(X)[源代码]
Calculate the Gini Mean Difference (GMD) of a returns series.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Gini Mean Difference of a returns series.
- 返回类型:
- RiskFunctions.TG(X, alpha=0.05, a_sim=100)[源代码]
Calculate the Tail Gini of a returns series.
- 参数:
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Ulcer Index of a cumpounded cumulative returns.
- 返回类型:
- RiskFunctions.RG(X)[源代码]
Calculate the range of a returns series.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Ulcer Index of a cumpounded cumulative returns.
- 返回类型:
- RiskFunctions.CVRG(X, alpha=0.05, beta=None)[源代码]
Calculate the CVaR range of a returns series.
- 参数:
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Ulcer Index of a cumpounded cumulative returns.
- 返回类型:
- RiskFunctions.TGRG(X, alpha=0.05, a_sim=100, beta=None, b_sim=None)[源代码]
Calculate the Tail Gini range of a returns series.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
alpha (float, optional) – Significance level of Tail Gini of losses. The default is 0.05.
a_sim (float, optional) – Number of CVaRs used to approximate Tail Gini of losses. The default is 100.
beta (float, optional) – Significance level of Tail Gini of gains. If None it duplicates alpha value. The default is None.
b_sim (float, optional) – Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. The default is None.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Ulcer Index of a cumpounded cumulative returns.
- 返回类型:
- RiskFunctions.L_Moment(X, k=2)[源代码]
Calculate the kth l-moment of a returns series.
Where $y_{[i]}$ is the ith-ordered statistic.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
k (int) – Order of the l-moment. Must be an integer higher or equal than 1.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Kth l-moment of a returns series.
- 返回类型:
- RiskFunctions.L_Moment_CRM(X, k=4, method='MSD', g=0.5, max_phi=0.5, solver=None)[源代码]
Calculate a custom convex risk measure that is a weighted average of first k-th l-moments.
- 参数:
X (1d-array) – Returns series, must have Tx1 size.
k (int) – Order of the l-moment. Must be an integer higher or equal than 2.
method (str, optional) –
Method to calculate the weights used to combine the l-moments with order higher than 2. The default value is ‘MSD’. Possible values are:
’CRRA’: Normalized Constant Relative Risk Aversion coefficients.
’ME’: Maximum Entropy.
’MSS’: Minimum Sum Squares.
’MSD’: Minimum Square Distance.
g (float, optional) – Risk aversion coefficient of CRRA utility function. The default is 0.5.
max_phi (float, optional) – Maximum weight constraint of L-moments. The default is 0.5.
solver (str, optional) – Solver available for CVXPY. Used to calculate ‘ME’, ‘MSS’ and ‘MSD’ weights. The default value is None.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Custom convex risk measure that is a weighted average of first k-th l-moments of a returns series.
- 返回类型:
- RiskFunctions.Sharpe_Risk(w, cov=None, returns=None, rm='MV', rf=0, alpha=0.05, a_sim=100, beta=None, b_sim=None, kappa=0.01, solver=None)[源代码]
Calculate the risk measure available on the Sharpe function.
- 参数:
w (DataFrame or 1d-array of shape (n_assets, 1)) – Weights matrix, where n_assets is the number of assets.
cov (DataFrame or nd-array of shape (n_features, n_features)) – Covariance matrix, where n_features is the number of features.
returns (DataFrame or nd-array of shape (n_samples, n_features)) – Features matrix, where n_samples is the number of samples and n_features is the number of features.
rm (str, optional) –
Risk measure used in the denominator of the ratio. The default is ‘MV’. Possible values are:
’MV’: Standard Deviation.
’KT’: Square Root Kurtosis.
’MAD’: Mean Absolute Deviation.
’GMD’: Gini Mean Difference.
’MSV’: Semi Standard Deviation.
’SKT’: Square Root Semi Kurtosis.
’FLPM’: First Lower Partial Moment (Omega Ratio).
’SLPM’: Second Lower Partial Moment (Sortino Ratio).
’VaR’: Value at Risk.
’CVaR’: Conditional Value at Risk.
’TG’: Tail Gini.
’EVaR’: Entropic Value at Risk.
’RLVaR’: Relativistic Value at Risk. I recommend only use this function with MOSEK solver.
’WR’: Worst Realization (Minimax).
’RG’: Range of returns.
’CVRG’: CVaR range of returns.
’TGRG’: Tail Gini range of returns.
’MDD’: Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio).
’ADD’: Average Drawdown of uncompounded cumulative returns.
’DaR’: Drawdown at Risk of uncompounded cumulative returns.
’CDaR’: Conditional Drawdown at Risk of uncompounded cumulative returns.
’EDaR’: Entropic Drawdown at Risk of uncompounded cumulative returns.
’RLDaR’: Relativistic Drawdown at Risk of uncompounded cumulative returns. I recommend only use this risk measure with MOSEK solver.
’UCI’: Ulcer Index of uncompounded cumulative returns.
’MDD_Rel’: Maximum Drawdown of compounded cumulative returns (Calmar Ratio).
’ADD_Rel’: Average Drawdown of compounded cumulative returns.
’CDaR_Rel’: Conditional Drawdown at Risk of compounded cumulative returns.
’EDaR_Rel’: Entropic Drawdown at Risk of compounded cumulative returns.
’RLDaR_Rel’: Relativistic Drawdown at Risk of compounded cumulative returns. I recommend only use this risk measure with MOSEK solver.
’UCI_Rel’: Ulcer Index of compounded cumulative returns.
rf (float, optional) – Risk free rate. The default is 0.
alpha (float, optional) – Significance level of VaR, CVaR, EVaR, RLVaR, DaR, CDaR, EDaR, RLDaR and Tail Gini of losses. The default is 0.05.
a_sim (float, optional) – Number of CVaRs used to approximate Tail Gini of losses. The default is 100.
beta (float, optional) – Significance level of CVaR and Tail Gini of gains. If None it duplicates alpha value. The default is None.
b_sim (float, optional) – Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. The default is None.
kappa (float, optional) – Deformation parameter of RLVaR, must be between 0 and 1. The default is 0.01.
solver (str, optional) – Solver available for CVXPY that supports power cone programming. Used to calculate RLVaR and RLDaR. The default value is None.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Risk measure of the portfolio.
- 返回类型:
- RiskFunctions.Sharpe(w, mu, cov=None, returns=None, rm='MV', rf=0, alpha=0.05, a_sim=100, beta=None, b_sim=None, kappa=0.01, solver=None)[源代码]
Calculate the Risk Adjusted Return Ratio from a portfolio returns series.
Where:
is the vector of portfolio returns. is the risk free rate, when the risk measure is uses instead of the . is a convex risk measure. The risk measures availabe are:- 参数:
w (DataFrame or 1d-array of shape (n_assets, 1)) – Weights matrix, where n_assets is the number of assets.
mu (DataFrame or nd-array of shape (1, n_assets)) – Vector of expected returns, where n_assets is the number of assets.
cov (DataFrame or nd-array of shape (n_features, n_features)) – Covariance matrix, where n_features is the number of features.
returns (DataFrame or nd-array of shape (n_samples, n_features)) – Features matrix, where n_samples is the number of samples and n_features is the number of features.
rm (str, optional) –
Risk measure used in the denominator of the ratio. The default is ‘MV’. Possible values are:
’MV’: Standard Deviation.
’KT’: Square Root Kurtosis.
’MAD’: Mean Absolute Deviation.
’GMD’: Gini Mean Difference.
’MSV’: Semi Standard Deviation.
’SKT’: Square Root Semi Kurtosis.
’FLPM’: First Lower Partial Moment (Omega Ratio).
’SLPM’: Second Lower Partial Moment (Sortino Ratio).
’VaR’: Value at Risk.
’CVaR’: Conditional Value at Risk.
’TG’: Tail Gini.
’EVaR’: Entropic Value at Risk.
’RLVaR’: Relativistic Value at Risk. I recommend only use this function with MOSEK solver.
’WR’: Worst Realization (Minimax).
’RG’: Range of returns.
’CVRG’: CVaR range of returns.
’TGRG’: Tail Gini range of returns.
’MDD’: Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio).
’ADD’: Average Drawdown of uncompounded cumulative returns.
’DaR’: Drawdown at Risk of uncompounded cumulative returns.
’CDaR’: Conditional Drawdown at Risk of uncompounded cumulative returns.
’EDaR’: Entropic Drawdown at Risk of uncompounded cumulative returns.
’RLDaR’: Relativistic Drawdown at Risk of uncompounded cumulative returns. I recommend only use this function with MOSEK solver.
’UCI’: Ulcer Index of uncompounded cumulative returns.
’MDD_Rel’: Maximum Drawdown of compounded cumulative returns (Calmar Ratio).
’ADD_Rel’: Average Drawdown of compounded cumulative returns.
’CDaR_Rel’: Conditional Drawdown at Risk of compounded cumulative returns.
’EDaR_Rel’: Entropic Drawdown at Risk of compounded cumulative returns.
’RLDaR_Rel’: Relativistic Drawdown at Risk of compounded cumulative returns. I recommend only use this function with MOSEK solver.
’UCI_Rel’: Ulcer Index of compounded cumulative returns.
rf (float, optional) – Risk free rate. The default is 0.
alpha (float, optional) – Significance level of VaR, CVaR, EVaR, RLVaR, DaR, CDaR, EDaR, RLDaR and Tail Gini of losses. The default is 0.05.
a_sim (float, optional) – Number of CVaRs used to approximate Tail Gini of losses. The default is 100.
beta (float, optional) – Significance level of CVaR and Tail Gini of gains. If None it duplicates alpha value. The default is None.
b_sim (float, optional) – Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. The default is None.
kappa (float, optional) – Deformation parameter of RLVaR, must be between 0 and 1. The default is 0.01.
solver (str, optional) – Solver available for CVXPY that supports power cone programming. Used to calculate RLVaR and RLDaR. The default value is None.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Risk adjusted return ratio of
.- 返回类型:
- RiskFunctions.Risk_Contribution(w, cov=None, returns=None, rm='MV', rf=0, alpha=0.05, a_sim=100, beta=None, b_sim=None, kappa=0.01, solver=None)[源代码]
Calculate the risk contribution for each asset based on the risk measure selected.
- 参数:
w (DataFrame or 1d-array of shape (n_assets, 1)) – Weights matrix, where n_assets is the number of assets.
cov (DataFrame or nd-array of shape (n_features, n_features)) – Covariance matrix, where n_features is the number of features.
returns (DataFrame or nd-array of shape (n_samples, n_features)) – Features matrix, where n_samples is the number of samples and n_features is the number of features.
rm (str, optional) –
Risk measure used in the denominator of the ratio. The default is ‘MV’. Possible values are:
’MV’: Standard Deviation.
’KT’: Square Root Kurtosis.
’MAD’: Mean Absolute Deviation.
’GMD’: Gini Mean Difference.
’MSV’: Semi Standard Deviation.
’SKT’: Square Root Semi Kurtosis.
’FLPM’: First Lower Partial Moment (Omega Ratio).
’SLPM’: Second Lower Partial Moment (Sortino Ratio).
’VaR’: Value at Risk.
’CVaR’: Conditional Value at Risk.
’TG’: Tail Gini.
’EVaR’: Entropic Value at Risk.
’RLVaR’: Relativistic Value at Risk. I recommend only use this function with MOSEK solver.
’WR’: Worst Realization (Minimax).
’RG’: Range of returns.
’CVRG’: CVaR range of returns.
’TGRG’: Tail Gini range of returns.
’MDD’: Maximum Drawdown of uncompounded cumulative returns (Calmar Ratio).
’ADD’: Average Drawdown of uncompounded cumulative returns.
’DaR’: Drawdown at Risk of uncompounded cumulative returns.
’CDaR’: Conditional Drawdown at Risk of uncompounded cumulative returns.
’EDaR’: Entropic Drawdown at Risk of uncompounded cumulative returns.
’RLDaR’: Relativistic Drawdown at Risk of uncompounded cumulative returns. I recommend only use this function with MOSEK solver.
’UCI’: Ulcer Index of uncompounded cumulative returns.
’MDD_Rel’: Maximum Drawdown of compounded cumulative returns (Calmar Ratio).
’ADD_Rel’: Average Drawdown of compounded cumulative returns.
’CDaR_Rel’: Conditional Drawdown at Risk of compounded cumulative returns.
’EDaR_Rel’: Entropic Drawdown at Risk of compounded cumulative returns.
’RLDaR_Rel’: Relativistic Drawdown at Risk of compounded cumulative returns. I recommend only use this function with MOSEK solver.
’UCI_Rel’: Ulcer Index of compounded cumulative returns.
rf (float, optional) – Risk free rate. The default is 0.
alpha (float, optional) – Significance level of VaR, CVaR, EVaR, RLVaR, DaR, CDaR, EDaR, RLDaR and Tail Gini of losses. The default is 0.05.
a_sim (float, optional) – Number of CVaRs used to approximate Tail Gini of losses. The default is 100.
beta (float, optional) – Significance level of CVaR and Tail Gini of gains. If None it duplicates alpha value. The default is None.
b_sim (float, optional) – Number of CVaRs used to approximate Tail Gini of gains. If None it duplicates a_sim value. The default is None.
kappa (float, optional) – Deformation parameter of RLVaR, must be between 0 and 1. The default is 0.01.
solver (str, optional) – Solver available for CVXPY that supports power cone programming. Used to calculate RLVaR and RLDaR. The default value is None.
- 抛出:
ValueError – When the value cannot be calculated.
- 返回:
value – Risk measure of the portfolio.
- 返回类型: