Risk · Commodities · ETRM

Historical VaR for Two Commodity Assets

How to calculate and visualize Value at Risk for a Gas & Power portfolio using historical data and the variance-covariance method.

1 What is Historical VaR for Two Assets?

Value at Risk (VaR) answers: “Over a given horizon, what is the maximum loss we might expect at a given confidence level?” For two commodity assets (e.g. Gas and Power), we use historical price data to estimate volatility and correlation, then combine them into a single portfolio VaR. Energy and commodity trading firms use VaR to set position limits, allocate capital, and report risk to regulators and management.

Two common approaches:

In practice, commodity firms combine both: historical simulation for stress views and regulatory capital, and variance-covariance for quick daily VaR and limit checks. Correlation between commodities (e.g. gas and power) is estimated from data and drives how much diversification benefit the portfolio gets.

Important Formulas

Log return
Return = natural log of (price today / price yesterday)

Daily vol (per asset)
Step 1: For each day, compute the log return = ln(price today ÷ price yesterday).
Step 2: Take the standard deviation of those daily returns (spread around their average). That number is the daily volatility.

Variance & covariance
Variance (per asset) = (daily vol)².
Covariance = correlation × (vol Gas × vol Power).

Portfolio variance
Variance = (weight Gas² × variance Gas) + (weight Power² × variance Power) + 2 × (weight Gas × weight Power × covariance).

Portfolio volatility
Volatility = square root of (Portfolio variance).

VaR
VaR = Z × (Portfolio volatility) × (√ holding days) × Portfolio value.

Z = number of standard deviations for your chosen confidence level (lookup table). 99% confidence → 1% of outcomes worse than VaR loss; Z ≈ 2.33. Higher confidence → larger Z → higher VaR.

2 Calculation Steps

1Historical prices (Gas & Power)
2Log returns
3Daily vol & correlation
4Variance-covariance matrix
5Individual VaR (per asset)
6Portfolio VaR (diversified)

Historical price data feeds log returns; from these we derive daily volatilities and correlation. Those feed the variance-covariance matrix and portfolio VaR (individual and diversified).

3 VaR Calculator — Visual Summary

Edit the inputs below; calculated fields update automatically. Volatility and correlation are from price data (see sample table below).

1. Portfolio inputs
Position — Gas (€)
Position — Power (€)
Total portfolio value (€)8,000,000Position Gas + Position Power
Confidence level (%) %99% confidence means 1% of outcomes are worse than the VaR loss
Holding period (days)Number of days over which the potential loss is measured; VaR scales with √(days)
Z-Score2.3263From confidence level (lookup table)
Weight — Gas0.625Position Gas / Total
Weight — Power0.375Position Power / Total
2. Volatility and correlation
Daily vol — Gas (from data)0.01337Std dev of daily log returns (see Important Formulas above)
Daily vol — Power (from data)0.01862Std dev of daily log returns (see Important Formulas above)
Correlation (from data)0.4747From price data only (not editable)
3. Variance-covariance matrix
GasPowerFormula
Gas0.0001790.000118Variance Gas = (vol Gas) x (vol Gas). Covariance = correlation x (vol Gas x vol Power).
Power0.0001180.000347Same covariance; Variance Power = (vol Power) x (vol Power).
4. Individual VaR (€)
Gas155,503Z x (vol Gas) x (sqrt of holding days) x Position Gas
Power129,953Z x (vol Power) x (sqrt of holding days) x Position Power
5. Portfolio VaR
Undiversified VaR (sum, €)285,456VaR Gas + VaR Power
Portfolio daily volatility0.01319Square root of (Portfolio variance). Variance = (w Gas x w Gas x var Gas) + (w Power x w Power x var Power) + 2 x (w Gas x w Power x cov).
Diversified portfolio VaR (€)245,465Z x (Portfolio vol) x (sqrt of holding days) x Total value

4 VaR and confidence interval

Distribution of portfolio P&L (€). The shaded tail is the probability of loss exceeding VaR; the vertical line shows VaR at your chosen confidence level.

Portfolio P&L distribution · VaR and confidence

5 VaR in practice: purpose, flow & limits

The core purpose is straightforward: VaR gives traders and risk managers a single number that answers "what's the worst we could lose on a normal day?" It's the common language between the front office, risk desk, and board level.

How it flows through an energy trading firm

At the desk level, each trading desk — power, gas, oil, LNG, emissions — has a VaR limit set by the risk committee. A gas trader with a €5M VaR limit knows they can't build positions that push their 1-day 95% or 99% VaR above that threshold. When they're approaching the limit, they either reduce positions or need explicit approval to exceed it. The spreadsheet you just built mirrors exactly this: changing position sizes and seeing VaR react in real time is what risk systems like Allegro or Endur do on an intraday basis.

At the portfolio level, the firm aggregates desk-level VaR into an enterprise VaR. This is where correlation and diversification benefit become critical. A firm that's long gas and short power in a correlated market gets a lower portfolio VaR than the sum of individual VaRs. Risk managers spend significant time debating whether historical correlations will hold — they often break down precisely when you need them most (2021 Texas freeze, 2022 European gas crisis).

Practical applications include:

Where VaR falls short in energy is important to teach:

Regulatory angle (EMIR and MiFID II):

6 Historical Price Data (30 trading days)

Returns are ln(P_t / P_{t-1}).

Day Gas (€/MWh) Power (€/MWh) Gas log return Power log return
128.5065.00
228.4464.74−0.00210−0.00403
328.4065.45−0.001510.01093
428.3563.75−0.00180−0.02632
528.5363.750.00646−0.00003
628.4363.74−0.00341−0.00005
728.5765.190.004670.02247
828.9265.850.012240.01003
928.5564.20−0.01287−0.02537
1028.6965.830.004920.02504
1128.7265.780.00125−0.00074
1229.0164.630.01002−0.01768
1328.8764.96−0.005130.00508
1429.3365.400.016090.00673
1529.5565.990.007250.00907
1629.9865.400.01448−0.00895
1730.3064.220.01067−0.01829
1828.8961.63−0.04778−0.04108
1928.4261.91−0.016110.00447
2028.7861.160.01238−0.01213
2129.2360.780.01563−0.00631
2229.2060.45−0.00105−0.00538
2329.2861.390.002550.01546
2429.6362.250.011920.01378
2529.9963.250.012120.01603
2629.6662.06−0.01084−0.01895
2729.4362.28−0.007990.00340
2829.3164.56−0.004010.03602
2928.8962.79−0.01435−0.02779
3029.3164.880.014230.03277