[][src]Function loan_ec::variance_liquidity

pub fn variance_liquidity(
    lambda: f64,
    q: f64,
    expectation: f64,
    variance: f64
) -> f64

Returns the variance of a portfolio with liquidity risk.

Arguments

  • lambda - Sum of lambda0 (base loss in liquidity event) and the lambda element from the Loan struct.
  • q - Probability of liquidity event scaled by the total portfolio loss.
  • expectation - Base expectation for the portfolio without liquidity risk. Can be computed using the get_portfolio_expectation method.
  • variance - Base variance for the portfolio without liquidity risk. Can be computed using the get_portfolio_variance method.

Examples

extern crate loan_ec;
let lambda=1.0;
let q=0.01;
let expectation=500.0;
let variance= 5000.0;
let liq_var=loan_ec::variance_liquidity(lambda, q, expectation, variance);