Exact Solutions¶
dicex.analytical.linear.linear_directional_functional(beta, perturbation, alpha, c) ¶
Compute the exact CVaR for a linear model under Gaussian directional noise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
beta | ndarray | Model coefficients. | required |
perturbation | BasePerturbation | Gaussian directional perturbation with additive noise. | required |
alpha | float | Risk level of the lower-tail CVaR. | required |
c | ndarray | Direction vector (unit norm). | required |
Returns:
| Name | Type | Description |
|---|---|---|
float | float | The exact robust directional value. |
Raises:
| Type | Description |
|---|---|
UnsupportedPerturbationError | If perturbation is not Gaussian. |
Source code in src/dicex/analytical/linear.py
dicex.analytical.linear.linear_optimal_direction(beta, perturbation, alpha, **kwargs) ¶
Return an optimal direction for the exact linear objective on the sphere.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
beta | ndarray | Model coefficients. | required |
perturbation | BasePerturbation | Gaussian directional perturbation. | required |
alpha | float | Risk level of the lower-tail CVaR. | required |
**kwargs | Any | Tuning options forwarded to the grid search. Supported keys:
| {} |
Returns:
| Type | Description |
|---|---|
ndarray | np.ndarray: The optimal unit direction vector. |
Raises:
| Type | Description |
|---|---|
UnsupportedPerturbationError | If perturbation is not isotropic Gaussian. |
Source code in src/dicex/analytical/linear.py
dicex.analytical.logistic.logistic_directional_functional(beta, b, x0, perturbation, alpha, c) ¶
Compute the exact CVaR for a logistic model improvement.
Exact lower-tail functional under multidimensional Gaussian directional noise.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
beta | ndarray | Model coefficients. | required |
b | float | Model intercept. | required |
x0 | ndarray | Baseline point. | required |
perturbation | BasePerturbation | Directional perturbation distribution. | required |
alpha | float | Risk level of the lower-tail CVaR. | required |
c | ndarray | Direction vector. | required |
Returns:
| Name | Type | Description |
|---|---|---|
float | float | The exact CVaR_alpha relative to the baseline |
Raises:
| Type | Description |
|---|---|
UnsupportedPerturbationError | If perturbation is not Gaussian. |
Source code in src/dicex/analytical/logistic.py
dicex.analytical.logistic.logistic_optimal_direction(beta, b, x0, perturbation, alpha, **kwargs) ¶
Compute the optimal direction c* using the exact logistic objective.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
beta | ndarray | Model coefficients. | required |
b | float | Model intercept. | required |
x0 | ndarray | Baseline point. | required |
perturbation | BasePerturbation | Gaussian directional perturbation. | required |
alpha | float | Risk level of the lower-tail CVaR. | required |
**kwargs | Any | Grid-search tuning options forwarded to the base optimizer ( | {} |
Returns:
| Type | Description |
|---|---|
ndarray | np.ndarray: The optimal unit direction vector. |
Raises:
| Type | Description |
|---|---|
UnsupportedPerturbationError | If perturbation is not Gaussian. |