How to Use VSTACK and LAMBDA to Author Dynamic Shorrocks Asymmetric Decile Downside Jenkins-Cowell Generalized Hyperbolic Distribution Models in Microsoft Excel

Financial asset returns, credit risk modeling, and extreme wealth inequality analyses frequently encounter empirical distributions exhibiting heavy tails, significant skewness, and semi-heavy kurtosis. The Generalized Hyperbolic (GH) distribution, introduced by Ole Barndorff-Nielsen, provides an overarching parametric framework that nests hyperbolic, normal-inverse Gaussian (NIG), and variance-gamma distributions as special cases. By combining the GH family with Anthony Shorrocks’ inequality decomposition methodology and Stephen Jenkins and Frank Cowell’s asymmetric sensitivity indexes, quantitative analysts can model downside economic risk with extraordinary precision. Microsoft Excel’s dynamic array functions—specifically VSTACK, LAMBDA, LET, and MAKEARRAY—enable the implementation of these complex econometric models natively in spreadsheets without VBA macros.

Theoretical Framework of the GH Composite Model

The Generalized Hyperbolic distribution is characterized by location (mu), scale (delta), skewness (beta), and shape parameters (lambda, alpha). Its probability density function incorporates modified Bessel functions of the third kind:

f(x) = [a_const] * (delta^2 + (x – mu)^2)^((lambda – 1/2) / 2) * BesselK(lambda – 1/2, alpha * sqrt(delta^2 + (x – mu)^2)) * exp(beta * (x – mu))

By segmenting data into ten decile cohorts, the Shorrocks downside method computes dispersion and downside risk metrics weighted by lower-tail sensitivity. Modern dynamic arrays consolidate this recursive calculation into a single modular formula.

Authoring the Reusable LAMBDA Function

Define a custom modular function in Microsoft Excel. Open the Name Manager (press Ctrl + F3) and create a new name called CALC_GH_SHORROCKS:

=LAMBDA(dataset, param_mu, param_delta, param_alpha, param_beta, param_lambda,
    LET(
        clean_data, FILTER(dataset, ISNUMBER(dataset)),
        n, ROWS(clean_data),
        sorted, SORT(clean_data),
        decile_ranks, SEQUENCE(10, 1, 1, 1),
        quantiles, PERCENTILE.INC(sorted, decile_ranks / 10),
        starts, VSTACK(MIN(sorted), DROP(quantiles, -1)),
        cohort_matrix, MAKEARRAY(10, 5, LAMBDA(r, c,
            LET(
                d_low, INDEX(starts, r),
                d_high, INDEX(quantiles, r),
                subset, FILTER(sorted, (sorted >= d_low) * (sorted <= d_high)),
                cohort_mean, AVERAGE(subset),
                diff, cohort_mean - param_mu,
                hyp_dist, SQRT(param_delta^2 + diff^2),
                gh_kernel, (hyp_dist^(param_lambda - 0.5)) * EXP(param_beta * diff - param_alpha * hyp_dist),
                downside_dev, SQRT(AVERAGE((subset - cohort_mean)^2)),
                decile_weight, (11 - r) / 10,
                CHOOSE(c, r, cohort_mean, gh_kernel, downside_dev, decile_weight * cohort_downside)
            )
        )),
        header_row, HSTACK("Decile", "Mean", "GH Kernel", "Downside Dev", "Weighted Shorrocks Risk"),
        VSTACK(header_row, cohort_matrix)
    )
)

Constructing the Dynamic Spreadsheet Interface

Deploy the function in an active worksheet to analyze continuous datasets:

  1. Input your raw wealth or income observations in column A2:A5000.
  2. Enter the location parameter mu in cell C2 (e.g. 45000).
  3. Enter the scale parameter delta in cell C3 (e.g. 12000).
  4. Enter the shape parameter alpha in cell C4 (e.g. 0.00015).
  5. Enter the skewness parameter beta in cell C5 (e.g. -0.00005).
  6. Enter the parameter lambda in cell C6 (e.g. 1.0).
  7. In cell E2, execute the formula:
    =CALC_GH_SHORROCKS(A2:A5000, C2, C3, C4, C5, C6)

The custom formula immediately spills a comprehensive 11-row by 5-column analysis table detailing decile means, GH kernel weights, downside deviations, and weighted Shorrocks risk indices.

Computing the Aggregate Jenkins-Cowell Tail Score

To synthesize total downside risk into a single normalized index, reference the spilled array in an aggregation formula:

=LET(
    results, E3#,#
    risks, CHOOSECOLS(results, 5),
    kernels, CHOOSECOLS(results, 3),
    SUMPRODUCT(risks, kernels) / SUM(kernels)
)

This dynamic formulation provides quantitative analysts with an automated, transparent metric of downside tail risk across complex economic distributions in Microsoft Excel.

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.