Excel LAMBDA · Free to use, free to modify
Time Series and Statistical LAMBDAs
Simulated paths and fits to history, SARIMA and Holt-Winters forecasts with a band, multivariate VAR and VECM models, regression and series tests, bootstrapping and portfolio optimization, as native Excel LAMBDA functions.
- LAMBDA
- Time series
- Forecasting
- Statistics
- Regression

Detail
A single number for next year's revenue hides the question that matters: how wide is the range around it, and how does that range grow month by month? Answering it in Excel has usually meant an add-in or a second language, and the same is true of the statistical checks that should come before any model is trusted: are these inputs correlated, are they normal, is one of them an outlier, does the regression hold up?
This is a library of 137 LAMBDA functions that does that work natively. Seven simulators — geometric Brownian motion, jump-diffusion, two mean-reverting processes, ARMA, ARIMA and GARCH — each spill a block of paths, one row per trial and one column per period, and each has a Fit function that estimates its parameters from a history. Seasonal ARIMA and Holt-Winters fit a monthly or quarterly series, forecast it with a band, simulate it and backtest it. A vector autoregression does the same for several series that move together, with impulse responses and their confidence bands, Granger causality and, for levels tied in the long run, the Johansen test and a VECM. Correlograms, unit-root and trend tests say what a series needs before it is modelled. A fan chart turns any block of paths into its P10 to P90 band over time. Around the forecasting sit the checks — correlation, normality, multicollinearity, outliers, a full linear regression with its residual tests, Box-Cox, Benford and the confidence ellipse — and two tools of their own: the bootstrap, and mean-variance portfolios up to the efficient frontier.
The results do not move. Randomness comes from the same HDR generator as the Monte Carlo library: each number is a fixed function of the trial, the period, the series' VarID and a seed. Nothing is volatile, so a model recalculates only when its inputs change, and the same model gives the same answer on every machine. Give every simulated series its own VarID and change the seed for a fresh, equally repeatable draw.
The library is published as a public gist (https://gist.github.com/wfphillips128/96171c91caba82aa708b12b9f8f575ce (opens in a new tab)) that can be imported with any LAMBDA manager that reads gists. It is self-contained: the few building blocks it shares with the Monte Carlo library are included, character for character identical, so the two gists install safely into one workbook in either order. The functions become defined names inside the workbook and travel with the file. It needs Microsoft 365 or Excel 2024.
XL Edge needs no gist at all: it carries its own copy and installs only the functions each action uses. Four fly-outs on its Stat Tools menu write the formulas. Insert Time Series — 57 commands — prompts for a simulator's parameters, a fit's history, a SARIMA, Holt-Winters or VAR step, or a test, and checks there is room for the spill before writing. Insert Statistical Diagnostics writes any of fifteen checks for a selected table or regression, and draws the confidence ellipse as a chart. Insert Bootstrap and Insert Portfolio cover the last two sections below, the portfolio one down to a chart of the efficient frontier. The Chart fly-out adds a Fan Chart that draws a native Excel chart from any block of paths, with an optional plan line against the band.

Nine XL Edge Guides walk through these tools on worked examples — SARIMA, Correlogram, Multivariate Time Series, a two-part VAR series (a business forecast, then real US macro data), Outliers and Leverage, Confidence Ellipse, Bootstrap and Portfolio — each a PDF with an example workbook whose numbers it quotes. The workbooks carry their own functions, so they calculate without the add-in.
Simulating paths
Every simulator spills Trials rows by Periods columns. Summarise any period like any other column of trials — =fx.RiskStatsλ(TAKE(B2#, , -1)) for the last one — or hand the whole block to the fan chart.
dt is the length of one period in the units of the rates: annual drift and volatility with monthly steps is dt = 1/12. DegFree swaps the normal shocks for Student t shocks scaled to the same variance — fat tails without changing the volatility. Start for ARMA is the values before period 1, oldest first; for ARIMA it is the last observed level. An ARMA whose AR part is not stationary returns #NUM!: use ARIMA for a series that trends.
Trials may also be a Trials × Periods block of uniforms — bootstrapped or correlated — which is then used as the shocks. And =100 * EXP(fx.RiskCumulateλ(D2#)) turns a block of log returns into prices.
| Function | Arguments | What it models |
|---|---|---|
| fx.RiskGBMλ=fx.RiskGBMλ(100, 0.08, 0.25, 12, 1/12, [Trials], [VarID], [Seed]) | Start, Drift, Volatility, Periods, [dt], [Trials], [VarID], [Seed] | Geometric Brownian motion: prices whose log changes are normal, growing at a steady rate with proportional noise. E[S(t)] = Start · e^(Drift · t). Returns periods 1 onwards; Start itself is not included. |
| fx.RiskJumpDiffusionλ=fx.RiskJumpDiffusionλ(100, 0.08, 0.2, 1, -0.1, 0.05, 12, 1/12, [Trials], [VarID], [Seed]) | Start, Drift, Volatility, JumpRate, JumpMean, JumpStDev, Periods, [dt], [Trials], [VarID], [Seed] | Merton's jump-diffusion: GBM plus sudden jumps arriving at JumpRate, each multiplying the price by e^N(JumpMean, JumpStDev). The drift is compensated, so jumps add risk without changing the expected path. A negative JumpMean models crashes. |
| fx.RiskOUλ=fx.RiskOUλ(0.04, 0.05, 0.8, 0.01, 60, 1/12, [DegFree], [Trials], [VarID], [Seed]) | Start, LongRunMean, Speed, Volatility, Periods, [dt], [DegFree], [Trials], [VarID], [Seed] | Ornstein–Uhlenbeck mean reversion: a value pulled back towards its long-run mean, such as a rate, a spread or a loss ratio. Exact discretisation; half-life = LN(2) / Speed. |
| fx.RiskCIRλ=fx.RiskCIRλ(0.04, 0.05, 0.8, 0.05, 60, 1/12, [Trials], [VarID], [Seed]) | Start, LongRunMean, Speed, Volatility, Periods, [dt], [Trials], [VarID], [Seed] | Cox–Ingersoll–Ross square-root mean reversion: like Ornstein–Uhlenbeck, but the noise shrinks towards zero, so the value never goes negative. Simulated with Andersen's quadratic-exponential scheme, which reproduces the exact mean and variance of every step. |
| fx.RiskARMAλ=fx.RiskARMAλ({0.6;0.2}, 0, 50, 4, 36, [Start], [DegFree], [Trials], [VarID], [Seed]) | AR, MA, Mean, StDev, Periods, [Start], [DegFree], [Trials], [VarID], [Seed] | ARMA(p, q) around a mean: each value leans on the ones before it (AR) and on recent shocks (MA). AR(p) alone is MA = 0. |
| fx.RiskARIMAλ=fx.RiskARIMAλ(0.3, 0, 0.5, 2, 24, 100, [DegFree], [Trials], [VarID], [Seed]) | AR, MA, Drift, StDev, Periods, [Start], [DegFree], [Trials], [VarID], [Seed] | ARIMA(p, 1, q): the period-to-period changes follow an ARMA with mean Drift, so the level wanders rather than returning to a mean. |
| fx.RiskGARCHλ=fx.RiskGARCHλ(0, 0.00001, 0.08, 0.9, 250, 0.05, [StartVariance], [DegFree], [Trials], [VarID], [Seed]) | Mean, Omega, Alpha, Beta, Periods, [Gamma], [StartVariance], [DegFree], [Trials], [VarID], [Seed] | GARCH(1,1) returns with volatility clusters: calm and turbulent stretches. ARCH(1) is Beta = 0; a Gamma adds the GJR extra reaction to bad news. Needs Alpha + Beta + Gamma / 2 < 1. |
Every simulator ends with [Trials] (default 10,000, or a block of uniforms to use as the shocks), [VarID] (default 1) and [Seed] (default 0). An argument still in [brackets] is optional and can be left out. Speed, at 10,000 trials: 60 periods take 0.5 to 1.8 seconds per model, 250 periods 3.4 to 7 seconds.
Fitting to a history
Each fit returns a Parameter / Estimate block. Point the simulator's arguments at its cells and the paths are calibrated to the history, and recalibrate themselves when the history is extended.
For ARIMA, fit the changes: =fx.RiskFitARMAλ(DROP(A2:A500, 1) - DROP(A2:A500, -1), 1, 1), and its Mean is the Drift. On simulated histories every fit recovers the true parameters. The ARMA fit lands within 0.05 of an independent maximum-likelihood implementation and the GARCH fit within 0.01. The jump-diffusion fit leans on sixth moments, which need thousands of observations: treat it as a first guess.
| Function | Arguments | Block | Method |
|---|---|---|---|
| fx.RiskFitGBMλ=fx.RiskFitGBMλ(B2:B61, 1/12) | Prices, [dt] | 3 × 2 | The mean and standard deviation of the log returns. Exact. |
| fx.RiskFitJumpDiffusionλ=fx.RiskFitJumpDiffusionλ(B2:B2501, 1/252) | Prices, [dt] | 6 × 2 | The 2nd, 4th and 6th cumulants of the log returns, assuming symmetric jumps (after Press, 1967). A rough starting point. |
| fx.RiskFitOUλ=fx.RiskFitOUλ(C2:C121, 1/12) | Series, [dt] | 5 × 2 | Least squares of each value on the one before. Exact for the exact discretisation; adds the half-life. |
| fx.RiskFitCIRλ=fx.RiskFitCIRλ(C2:C121, 1/12) | Series, [dt] | 4 × 2 | Least squares on square-root-scaled changes. The Euler form, so approximate. |
| fx.RiskFitARMAλ=fx.RiskFitARMAλ(D2:D200, 2, [MALags]) | Series, ARLags, [MALags] | (3 + p + q) × 2 | Conditional least squares for AR terms; Hannan–Rissanen when there are MA terms. |
| fx.RiskFitGARCHλ=fx.RiskFitGARCHλ(E2:E1001, TRUE) | Returns, [Asymmetric] | 7 × 2, or 8 with Gamma | Quasi maximum likelihood with variance targeting, on a grid refined twice (about ±0.001 fine). Asymmetric = TRUE fits GJR. |
Seasonal ARIMA (SARIMA)
For monthly, weekly or quarterly series with a repeating seasonal pattern: sales, policy counts, call volumes, claims. Five functions are built around a Model block. Fit writes it; Forecast and the simulator read it; Backtest and Rank refit by themselves. A worked sequence on 108 months of history in C4:C111: =fx.RiskSARIMAFitλ(C4:C111) in F2, then =fx.RiskSARIMAForecastλ(C4:C111, F2#, 24) for the next 24 months with a P10 to P90 band, =fx.RiskSARIMABacktestλ(C4:C111, 12) to ask how well last year would have been forecast, =fx.RiskSARIMARankλ(C4:C111) to compare candidate models, and =fx.RiskSARIMAλ(C4:C111, F2#, 24) for 10,000 simulated continuations to feed the fan chart.
Order is {p, d, q, P, D, Q}, up to p, q = 2, P, Q = 1 and d, D = 1. The default is the classic airline model {0,1,1,0,1,1}, a good first choice for business series. Log = TRUE models the logarithm: seasonal swings that grow with the level, a forecast that cannot go negative, and a band wider above than below. The Model block can also be typed by hand, with parameters estimated elsewhere.
The forecast band is exact for the model — the forecast ± z × StDev × √Σψ² — so the percentiles of the simulated paths match the table. Backtest Coverage is how often the actuals fell inside the band: near 80% is right for P10 to P90. Rank fits 12 common orders with the same differencing and compares their AIC on the same residual window; it is a guide, not a verdict, so backtest the leaders. On short series the coefficients are loosely determined by any method while the forecasts agree closely: judge a model by its forecasts and backtests, not by a single coefficient.

| Function | Arguments | Returns |
|---|---|---|
| fx.RiskSARIMAFitλ=fx.RiskSARIMAFitλ(C4:C111, [Order], [Season], [Log]) | History, [Order], [Season], [Log] | The Model block, 19 × 2: p, d, q, P, D, Q, Season, Log, Constant, AR1, AR2, MA1, MA2, SAR1, SMA1, StDev, AIC and Observations. Conditional sum of squares, minimised from a coarse grid by Levenberg–Marquardt. |
| fx.RiskSARIMAForecastλ=fx.RiskSARIMAForecastλ(C4:C111, F2#, 24, [Lower], [Upper], [Labels]) | History, Model, Horizon, [Lower], [Upper], [Labels] | (Horizon + 1) × 4: Period, Forecast and the band, P10 and P90 by default. |
| fx.RiskSARIMAλ=fx.RiskSARIMAλ(C4:C111, F2#, 24, [DegFree], [Trials], [VarID], [Seed]) | History, Model, Periods, [DegFree], [Trials], [VarID], [Seed] | Trials × Periods simulated continuations of the history, ready for the fan chart. |
| fx.RiskSARIMABacktestλ=fx.RiskSARIMABacktestλ(C4:C111, 12, [Order], [Season], [Log], [Lower], [Upper]) | History, Holdout, [Order], [Season], [Log], [Lower], [Upper] | (Holdout + 6) × 6: MAPE, RMSE, MAE, Bias and Coverage, then Period, Actual, Forecast, Error and the band for each held-out period. Refits without the last Holdout values. |
| fx.RiskSARIMARankλ=fx.RiskSARIMARankλ(C4:C111, [Diff], [SeasonalDiff], [Season], [Log]) | History, [Diff], [SeasonalDiff], [Season], [Log] | 13 × 3: twelve common orders ranked by AIC. |
A fit on 108 months takes well under a second, and Rank about a second. The fitted optimum matches an independent optimiser of the same objective to within 0.0001, and on 600 simulated months it agrees with an exact maximum-likelihood fit to 0.01.
Holt-Winters exponential smoothing
The other classic way to forecast a seasonal series: a level, a trend and a seasonal pattern, each updated a little every period as new values arrive. Four functions mirror the SARIMA ones, so the two can be compared side by side on the same history. Fit writes a Model block; Forecast and the simulator read it; Backtest refits by itself.
Seasonal is "Add" (the pattern is a fixed amount), "Mul" (the pattern grows with the level; positive data only) or "None". Trend is "Add" or "None" — with both "None" it is simple exponential smoothing. Damped = TRUE bends the trend flat over a long horizon, often the safer forecast. The forecast band comes from 10,000 simulated paths with a fixed seed, so it is the same on every recalculation.
| Function | Arguments | Returns |
|---|---|---|
| fx.RiskHoltWintersFitλ=fx.RiskHoltWintersFitλ(C4:C111, 12, "Mul", "Add", TRUE) | History, [Season], [Seasonal], [Trend], [Damped] | The Model block, 15 × 2: Season, Seasonal, Trend, Damped, Alpha, Beta, Gamma, Phi, the starting Level and Trend, StDev of the one-step errors, SSE, AIC and Observations. |
| fx.RiskHoltWintersForecastλ=fx.RiskHoltWintersForecastλ(C4:C111, F2#, 24) | History, Model, Horizon, [Lower], [Upper], [Labels] | (Horizon + 1) × 4, the layout of the SARIMA forecast: Period, Forecast and the band, P10 and P90 by default. |
| fx.RiskHoltWintersλ | History, Model, Periods, [DegFree], [Trials], [VarID], [Seed] | Trials × Periods simulated continuations, ready for the fan chart. |
| fx.RiskHoltWintersBacktestλ=fx.RiskHoltWintersBacktestλ(C4:C111, 12) | History, Holdout, [Season], [Seasonal], [Trend], [Damped], [Lower], [Upper] | (Holdout + 6) × 6, the layout of the SARIMA backtest: MAPE, RMSE, MAE, Bias and Coverage, then each held-out period. |
Fan chart
fx.RiskChartFanλ reads any block of paths — from a simulator, from SARIMA, or from a model built on them — and returns everything a fan chart needs in one spill: a title row, a header row, then one row per period with the lower percentile, P50, the upper percentile, the band's width, the plan and the mean. The band defaults to P10 to P90 and can be any pair; the headers are formulas, so a chart legend linked to them follows any change.
Plan is the single-number forecast the business already has, drawn as a line against the band — the picture of how likely the plan is. Start opens the fan from a point at period 0, and Labels puts dates on the axis. XL Edge's Insert Monte Carlo Chart → Fan Chart writes the data and draws the chart, and it redraws when the model changes.


| Function | Arguments | Returns |
|---|---|---|
| fx.RiskChartFanλ=fx.RiskChartFanλ(H2#, [Lower], [Upper], A1, [Start], C2:C13, B2:B13) | Paths, [Lower], [Upper], [Name], [Start], [Plan], [Labels] | (Periods + 2) × 7, one more row with Start: the title, the headers, then Period, Lower, P50, Upper, band width, Plan and Mean for each period. |
Testing a series
Before choosing a model, ask the series what it needs. The correlogram shows its memory: how much each value resembles the one before, or the same month last year, with Bartlett bands that widen with the lag and a Ljung-Box test of whether anything is left at all. Pass ModelDF = p + q to test the residuals of a fitted ARMA. ARCH-LM asks whether volatility clusters, which is the cue for GARCH.
The unit-root tests answer whether a series wanders or returns to a level, which decides whether to model it in levels or in changes. Read the three together: Augmented Dickey-Fuller and Phillips-Perron assume a unit root until the data reject it, KPSS assumes the opposite. All three agreeing is clear evidence; a split means the data cannot tell, often the case for a short series. The trend test asks whether a slope is real when the noise around it is autocorrelated, where a plain regression t-test finds trends far too often; its bootstrap version corrects what is left of that bias on short series.
| Function | Arguments | Returns |
|---|---|---|
| fx.RiskACFλ=fx.RiskACFλ(C4:C111, 24) | X, [Lags], [Alpha], [ModelDF], [Name] | The correlogram, (Lags + 3) × 10: ACF and PACF, each with its band, then the Ljung-Box Q, its p-value and "White noise?" for every lag. |
| fx.RiskARCHTestλ | X, [Lags], [Alpha], [Demean], [Name] | Engle's ARCH-LM test for each lag order: the LM and F statistics, their p-values and a verdict. |
| fx.RiskUnitRootλ=fx.RiskUnitRootλ(C4:C111, "ct") | X, [Trend], [Lags], [Alpha], [Name] | 5 × 9: the ADF, Phillips-Perron and KPSS tests side by side, each with its statistic, lags, p-value, 1%, 5% and 10% critical values, null hypothesis and verdict. Trend is "c" (around a level) or "ct" (around a trend). |
| fx.RiskADFλ | X, [Trend], [Lags], [Alpha] | One row of 9. Lags chosen by AIC when omitted; p-values from MacKinnon's response surfaces. |
| fx.RiskPhillipsPerronλ | X, [Trend], [Lags], [Alpha] | One row of 9: the Z-tau statistic, corrected with a Newey-West long-run variance. |
| fx.RiskKPSSλ | X, [Trend], [Lags], [Alpha] | One row of 9, with stationarity as the null. Lags chosen from the data when omitted. |
| fx.RiskAutoCovλ | X, [Lags], [Divisor], [Name], [Labels] | The autocovariance matrix: (Lags + 1) square, labelled or bare. |
| fx.RiskTrendTestλ | X, [MaxP], [Alpha], [Name] | 10 × 2: the slope, its standard error, t, df and p-value after filtering out an AR fitted to the residuals (Cochrane-Orcutt), with a verdict. |
| fx.RiskTrendBootstrapλ=fx.RiskTrendBootstrapλ(C4:C111, 500) | X, [Trials], [MaxP], [Alpha], [VarID], [Seed], [Name] | 9 × 2: the Woodward-Bottone-Gray bootstrap p-value of the same test, from series simulated with no trend. Slow: about Trials trend tests. |
Several series: VAR and cointegration
Sales, prices and volumes, or GDP, consumption and investment, do not move independently: each responds to its own past and to the others'. A vector autoregression models that web. Select the lag order, fit the model to a table of series (one column each, oldest first), then read it: which series lead (Granger causality), how a shock to one travels through the others (impulse responses, with a confidence band that shows where a response cannot be told from none), and how much of each series' uncertainty each shock explains (variance decomposition). The forecast table gives every series its own band, and the simulator draws correlated paths for all of them, so a sum or a ratio across series is valid trial by trial.
When the series are levels that drift but stay tied in the long run — a price and its cost, two rates — differencing them throws the tie away. The Johansen test counts the ties, a vector error-correction model (VECM) fits them, and fx.RiskVECMToVARλ rewrites the VECM as a VAR so every VAR function can forecast and simulate it. Cross-correlation shows which of two series leads the other, and by how many periods.
The impulse responses and variance decomposition depend on the order of the series: earlier series move later ones within the same period, not the reverse. Treat the order as an assumption, and vary it.
| Function | Arguments | Returns |
|---|---|---|
| fx.RiskVARSelectλ=fx.RiskVARSelectλ(B2:D204, 8) | Data, [MaxLags], [Type], [Season], [Exog] | AIC, HQ, SC and FPE for 1 to MaxLags lags on the same observations, and the order each prefers. |
| fx.RiskVARFitλ=fx.RiskVARFitλ(B2:D204, 2) | Data, [Lags], [Type], [Season], [Exog], [Names] | The Model block the other functions read: the settings, log-likelihood and information criteria, one column of coefficients per equation, and the residual covariance. Type is "const", "trend", "both" or "none"; Season adds seasonal dummies; Exog adds outside variables. |
| fx.RiskVARSummaryλ | Data, Model, [Exog] | Each equation's coefficients with standard errors, t and p-values, R², then the residual covariance and correlation. |
| fx.RiskVARResidsλ | Data, Model, [Exog] | The residuals, one column per series, ready for the normality, correlogram and ARCH tests. |
| fx.RiskVARStabilityλ | Model | The eigenvalues of the companion matrix and a verdict: stable when every modulus is below 1. |
| fx.RiskVARIRFλ=fx.RiskVARIRFλ(G2#, 12) | Model, [Horizon], [Impulse], [Orthogonal], [Cumulative], [Order] | Impulse responses, one column per shock-response pair, periods 0 to Horizon. |
| fx.RiskVARIRFBandsλ | Data, Model, Impulse, Response, [Horizon], [Level], [Orthogonal], [Cumulative], [Order], [Exog] | One shock-response pair with its asymptotic standard error and a confidence band, period by period. Where the band contains zero, the data cannot tell the response from none. |
| fx.RiskVARFEVDλ | Model, [Horizon], [Response], [Order] | The forecast-error variance decomposition: each series' share of every other's uncertainty, by horizon. |
| fx.RiskGrangerλ | Data, Model, Cause, [Effect], [Alpha], [Exog] | Granger causality in F and Wald forms, and the test of instantaneous causality. |
| fx.RiskVARPortmanteauλ | Data, Model, [Lags], [Alpha], [Exog] | Whether the residuals are white noise: Box-Pierce and the small-sample adjusted form. |
| fx.RiskVARForecastλ=fx.RiskVARForecastλ(B2:D204, G2#, 8) | Data, Model, Horizon, [Variable], [Lower], [Upper], [FutureExog], [Labels] | A forecast with a P10 to P90 band for every series, or for one with Variable. |
| fx.RiskVARSimλ | Data, Model, Periods, [Variable], [DegFree], [Trials], [VarID], [Seed], [FutureExog] | Trials × Periods paths of one series, with correlated shocks running through all of them. Same VarID and Seed for every series and the paths belong together. |
| fx.RiskVARBacktestλ | Data, Holdout, [Lags], [Type], [Variable], [Lower], [Upper], [Season], [Names], [Exog] | Refits without the last Holdout rows and scores one series, in the layout of the other backtests. With Exog, the held-out rows of the outside variables serve as their future values. |
| fx.RiskJohansenλ=fx.RiskJohansenλ(B2:D204) | Data, [DetOrder], [LagDiff], [Alpha] | The trace and maximum-eigenvalue tests for each rank, with 90%, 95% and 99% critical values, and the rank each suggests. |
| fx.RiskVECMFitλ | Data, Rank, [LagDiff], [Deterministic], [Names] | The VECM Model block: Alpha (how fast each series is pulled back), Beta (the long-run ties), Gamma and Sigma, by Johansen's maximum likelihood. |
| fx.RiskVECMToVARλ | Model | The same model as a VAR in levels, in the layout of fx.RiskVARFitλ. |
| fx.RiskVECMForecastλ | Data, Model, Horizon, [Variable], [Lower], [Upper], [Labels] | A forecast of the levels with a band, in one step. |
| fx.RiskCCFλ | X, Y, [Lags], [Alpha], [Names] | The cross-correlation at each lead and lag, with its band. A spike at a negative lag means X leads Y. |
Smoothing, spectra and forecast accuracy
The groundwork and the scorecard. Fill the gaps in a series first — linear interpolation, last value forward or next value back. Moving averages smooth it, and classical decomposition splits it into trend, seasonal and random parts with a seasonally adjusted line. Yule-Walker and Burg fit an autoregression quickly, choosing the order by AIC; the factor table breaks its polynomial into the cycles it contains, and the periodogram and smoothed spectrum show where the series' variance sits by frequency.
Then score the forecasts. The accuracy block gives ME, MAE, RMSE, MPE, MAPE, sMAPE, MASE and Theil's U for any forecasts against what happened; MASE and Theil's U below 1 beat a naive forecast. The rolling RMSE forecasts from every origin in the history with the coefficients held fixed, which is a fairer test than one holdout.
| Function | Arguments | Returns |
|---|---|---|
| fx.RiskFillGapsλ | X, [Method], [Times] | The series with blanks, text and errors filled: "linear" (default), "locf" or "nocb". Same shape. |
| fx.RiskMovingAverageλ | X, Order, [Type] | A centred or trailing moving average, same length; an even centred order is the 2 × m average that removes a season. |
| fx.RiskMAForecastλ | History, Order, [Horizon] | The trailing moving-average forecast, with the fitted values beside the actuals. |
| fx.RiskDecomposeλ=fx.RiskDecomposeλ(C4:C111, 12, "multiplicative") | X, Season, [Type], [Labels] | Observed, Trend, Seasonal, Random and seasonally Adjusted, additive or multiplicative. |
| fx.RiskYuleWalkerλ | X, [Order], [MaxP], [Name] | An AR(p) fit by the Yule-Walker equations: Mean, the AR terms, StDev and AIC. |
| fx.RiskBurgλ | X, [Order], [MaxP], [Name] | The same by Burg's method, less biased on short series and near a unit root. |
| fx.RiskARMAForecastλ | History, Model, Horizon, [Lower], [Upper], [Labels] | A forecast table with a band from any ARMA parameter block: the ARMA fit, Yule-Walker or Burg. |
| fx.RiskFactorTableλ | AR, [Name] | The AR polynomial's factors, each with its root, how close it is to a unit root, and its cycle frequency. |
| fx.RiskPeriodogramλ | X, [Name] | The raw periodogram: frequency, power, dB and the cycle length. |
| fx.RiskSpectrumλ | X, [Truncation], [Window], [Points], [Name] | The smoothed spectral density, Parzen, Bartlett or Tukey window. |
| fx.RiskAccuracyλ=fx.RiskAccuracyλ(D100:D111, E100:E111, C4:C99, 12) | Actual, Forecast, [Training], [Season], [Name] | 10 × 2: ME, MAE, RMSE, MPE, MAPE, sMAPE, MASE and Theil's U. |
| fx.RiskRollingRMSEλ | History, Model, [Horizon], [Window], [Name] | The RMSE from every forecast origin, with its mean, minimum, quartiles and maximum. |
Statistical diagnostics
Checks on a table of history, one variable per column, or on simulated inputs side by side with HSTACK(B2#, C2#, D2#). Each returns one labelled spill whose size is known in advance, so XL Edge can check there is room before writing it.
Correlation is Pearson, or Spearman on ranks. The upper triangle always shows R; LowerTriangle puts something else below it: 0 only the strong pairs (|R| > 0.90), 1 R squared, 2 p-values, 3 Yes / No for significance at Alpha. Labels = FALSE returns the bare matrix, ready for fx.RiskCopulaGaussλ on the Monte Carlo LAMBDAs page — a copula fitted from history in two formulas.
Normality runs Shapiro–Wilk, Anderson–Darling and Jarque–Bera, each with its p-value and a verdict at Alpha (default 0.05). Be careful with thousands of values: every test then rejects even trivial departures from normality. These tests earn their keep on histories and on model residuals. Multicollinearity reports the VIF — how much a variable's variance is inflated because the others explain it — with Tolerance and R²; above 10 is a warning sign. The eigenvalues come with the condition number, where above 30 signals serious multicollinearity. Outliers gives every row its Mahalanobis distance from the centre and its leverage, each with a flag.

| Function | Arguments | Returns |
|---|---|---|
| fx.RiskCorrelMatrixλ=fx.RiskCorrelMatrixλ(B2:F200, 2, [Method], [Alpha], [Names], [Labels]) | Data, [LowerTriangle], [Method], [Alpha], [Names], [Labels] | (k + 2) × (k + 1): the correlation matrix with names, and the chosen measure below the diagonal. k × k with Labels = FALSE. |
| fx.RiskCovMatrixλ=fx.RiskCovMatrixλ(B2:F200, [Sample], [Names], [Labels]) | Data, [Sample], [Names], [Labels] | (k + 2) × (k + 1): the covariance matrix, sample or population. k × k with Labels = FALSE. |
| fx.RiskNormalityλ=fx.RiskNormalityλ(B2:F200, [Tests], [ADVariant], [Alpha], [Names]) | Data, [Tests], [ADVariant], [Alpha], [Names] | 14 × (k + 1): each test's statistic, p-value and verdict for every variable. ADVariant is "Normal" (the usual), "Unmodified", "LogNormal" or "Generic" for data already standardised, such as residuals. |
| fx.RiskCollinearityλ=fx.RiskCollinearityλ(B2:F200, "All", [Names]) | Data, [Measure], [Names] | (k + 2) × 2, or × 4 with "All": VIF, Tolerance (1 / VIF) and R² for each variable. |
| fx.RiskEigenλ=fx.RiskEigenλ(B2:F200) | Data | (k + 2) × 5: the eigenvalues of the correlation matrix, largest first, with the condition number. Data may also be a correlation matrix. |
| fx.RiskOutliersλ=fx.RiskOutliersλ(B2:F200) | Data | (n + 2) × 5: each row's Mahalanobis distance, flagged above the mean distance plus one standard deviation, and its leverage, flagged above 2(k + 1) / n. |
k is the number of variables (columns) and n the number of rows. Excel has no eigenvalue function, so the eigenvalues come from a Jacobi solver, fx.RiskJacobiλ, exact for up to about 30 variables. Shapiro–Wilk uses Royston's algorithm and accepts 3 to 5,000 values.
Regression and its checks
A full linear regression in one spill: each coefficient with its standard error, t, p-value and confidence interval; R², adjusted R², F, Durbin-Watson, AIC and BIC; and the ANOVA table. The residuals block adds, for every observation, the fitted value, standardised and studentised residuals, leverage and Cook's distance, with a flag naming any outlier, influential point or high-leverage row.
Three tests then ask whether the regression can be trusted. Breusch-Pagan and White: does the residual variance change with X? Breusch-Godfrey: are the residuals serially correlated, at several lags, which Durbin-Watson cannot check? Ramsey's RESET: do powers of the fitted values add anything, a sign the linear form misses a curve? When the errors are autocorrelated, the Cochrane-Orcutt regression filters them out and refits, with Prais-Winsten for short series.
| Function | Arguments | Returns |
|---|---|---|
| fx.RiskRegressλ=fx.RiskRegressλ(B2:B41, C2:E41) | Y, X, [Intercept], [Alpha], [Names] | (m + 17) × 7: the coefficient table, the fit statistics and the ANOVA table. m is the number of coefficients. |
| fx.RiskRegressResidsλ | Y, X, [Intercept], [Names] | (n + 2) × 9: Actual, Fitted, Residual, Standardized, Studentized, Leverage, Cook's distance and a Flag for each observation. |
| fx.RiskHeteroskedλ=fx.RiskHeteroskedλ(B2:B41, C2:E41) | Y, X, [Robust], [Alpha], [Intercept] | 4 × 7: Breusch-Pagan (Koenker's robust form by default) and White, each with its LM and F statistics, p-values and a verdict. |
| fx.RiskBreuschGodfreyλ | Y, X, [Lags], [Alpha], [Intercept] | One row per lag order: the LM and F statistics, p-values and a verdict. |
| fx.RiskRESETλ | Y, X, [Power], [Alpha], [Intercept] | 3 × 7: the RESET test of functional form, with a verdict. |
| fx.RiskCochraneOrcuttλ | Y, X, [Method], [AROrder], [Alpha], [Names] | A regression with AR errors, laid out like fx.RiskRegressλ, with the AR terms, iterations and the filtered Durbin-Watson. |
Distribution checks
Box-Cox finds the power transform that makes skewed, positive data most nearly normal and steadies a variance that grows with the level: the maximum-likelihood lambda with its confidence interval, and the simplest familiar transform inside it — none, log, square root or reciprocal. Model the transformed series, then turn its forecasts or paths back with the inverse.
Benford's law tests a set of amounts for forensic accounting and data quality: first digit, first two digits (the sharpest test — a spike at 49 under a 5,000 approval limit) or last two digits, with Nigrini's conformity verdict. It needs amounts that arise naturally across several orders of magnitude, and about 500 of them.
The confidence ellipse is an interval for two variables at once, traced as points ready to chart over the scatter: where a new observation will fall, where the true mean lies, or the contour holding a share of the data. XL Edge's Confidence Ellipse command draws the chart.
| Function | Arguments | Returns |
|---|---|---|
| fx.RiskBoxCoxFitλ | X, [Alpha], [Name] | 9 × 2: lambda, its confidence interval, the log-likelihood at lambda and at 1, the simplest lambda in the interval, and n. |
| fx.RiskBoxCoxλ | X, [Lambda] | The transformed data; the maximum-likelihood lambda when Lambda is omitted. |
| fx.RiskBoxCoxInvλ | Y, Lambda | The inverse transform, for forecasts and paths in the original units. |
| fx.RiskBenfordTestλ=fx.RiskBenfordTestλ(D2:D5001, 2) | Data, [Test], [MinValue], [Name] | Per digit: Count, Actual %, Expected %, Difference, Z and a Flag, under a title carrying MAD and the conformity verdict. Test is 1, 2 or "L2". |
| fx.RiskEllipseλ=fx.RiskEllipseλ(B2:B61, C2:C61, 0.95) | X, Y, [Level], [Type], [Points], [Names] | The ellipse as Point, X, Y, with its centre, axes, angle, correlation and radius. Type is "Prediction" (default), "Mean" or "Normal". |
Bootstrapping
Every average, ratio or regression slope would have come out differently with a different sample. The bootstrap measures how differently, using nothing but the data you have: resample the rows with replacement, recompute the statistic, and repeat. Statistic is any LAMBDA of a sample — LAMBDA(s, AVERAGE(s)), a median, a ratio of two columns — so anything Excel can calculate can be bootstrapped.
The confidence interval defaults to BCa (bias-corrected and accelerated), the most accurate of the three methods offered; percentile and basic are there too. BlockSize resamples runs of consecutive rows, which keeps a time series' order intact. Replace = FALSE shuffles instead, for permutation tests. The regression bootstrap resamples whole rows (Pairs) or the residuals.
| Function | Arguments | Returns |
|---|---|---|
| fx.RiskBootstrapλ=fx.RiskBootstrapλ(B2:C61, LAMBDA(s, AVERAGE(TAKE(s, , 1)) / AVERAGE(TAKE(s, , -1)))) | Data, Statistic, [Trials], [BlockSize], [Replace], [Columns], [VarID], [Seed] | Trials × 1: the statistic on every resample, ready for the statistics blocks, VaR or the histogram chart. |
| fx.RiskBootstrapCIλ=fx.RiskBootstrapCIλ(B2:B61, LAMBDA(s, MEDIAN(s))) | Data, Statistic, [Level], [Method], [Trials], [BlockSize], [VarID], [Seed], [Name] | 12 × 2: the estimate, bootstrap mean, bias, standard error, the interval and its method. |
| fx.RiskBootstrapRegressλ | Y, X, [Method], [Level], [Trials], [VarID], [Seed], [Intercept] | Each coefficient's OLS estimate, bootstrap standard error and percentile interval. |
| fx.RiskBootstrapIndexλ | N, [Trials], [BlockSize], [Replace], [VarID], [Seed] | Trials × N row numbers, one resample per row, for building a bootstrap by hand. |
Portfolio optimization
Given what each asset is expected to return and how the assets move together, which mixes give the most return for each level of risk? Four live formulas answer it: a covariance estimate, the two portfolios that define the efficient frontier — the global minimum-variance portfolio and, given a risk-free rate, the tangency portfolio with the highest Sharpe ratio — the frontier itself with the capital market line, ready to chart, and the mean and standard deviation of any mix you type.
The sample covariance is noisy, and the frontier magnifies the noise. The single-index, constant-correlation and shrinkage estimators trade a little bias for a lot of stability. Short sales are allowed: the closed-form frontier has no constraints, so a weight can come out negative.
| Function | Arguments | Returns |
|---|---|---|
| fx.RiskCovEstimateλ=fx.RiskCovEstimateλ(B2:F61, "Shrink", , 0.5) | Returns, [Method], [Market], [Shrinkage], [Names], [Labels] | The covariance matrix, labelled or bare. Method is "Sample" (default), "SingleIndex" (needs Market), "ConstantCorr" or "Shrink". |
| fx.RiskEfficientPortfoliosλ | Means, Cov, [Rf], [Names] | 4 × (k + 4): the GMVP and the tangency portfolio, each with its mean, SD, Sharpe ratio and weights. |
| fx.RiskFrontierλ=fx.RiskFrontierλ(B64:F64, H2#, 0.03) | Means, Cov, [Rf], [Points], [Names] | (Points + 2) × 7: SD and mean along the frontier, beside each asset, both portfolios and the capital market line. |
| fx.RiskPortfolioλ | Weights, Means, Cov, [Labels] | The mean, variance and standard deviation of one portfolio. |
Building blocks
The functions above are built on these. They are ordinary functions and can be called from a sheet, but most models will never need to.
| Function | Arguments | Returns |
|---|---|---|
| fx.RiskTSUλ | Trials, Periods, VarID, Seed, [Stream] | The Trials × Periods block of uniforms behind every simulator, on its own HDR stream so a path never shares one with a distribution or a copula. |
| fx.RiskTSShocksλ | U, [DegFree] | Standardised shocks from those uniforms: normal, or Student t scaled to unit variance. |
| fx.RiskTSRecurseλ | Inputs, Start, NextValue | A one-number recursion run along every row with a single SCAN — the engine of the ARMA, ARIMA and GARCH paths. |
| fx.RiskCumulateλ | Increments, [Start] | Running totals along each row: levels from changes, or log prices from log returns. |
| fx.RiskARStationaryλ | AR | TRUE when the AR coefficients are stationary, by the Durbin–Levinson step-down to partial autocorrelations. |
| fx.RiskTSImpulseλ | AR, MA, Periods | The ARMA impulse-response (ψ-weight) matrix. |
| fx.RiskLagMatrixλ | X, Lags | A matrix of lagged copies of a series, for the ARMA fit. |
| fx.RiskGARCHLogLikλ | Resid, TargetVar, Alpha, Beta, Gamma | The GARCH log-likelihood the fit maximises. |
| fx.RiskDifferenceλ | X, Diff, SeasonalDiff, Season | Differences a series, ordinarily and seasonally. |
| fx.RiskPolyMulλ | A, B | Multiplies two lag polynomials. |
| fx.RiskSARIMAPolyλ | Coefs, Season, Side | The multiplicative seasonal AR or MA polynomial. |
| fx.RiskSARIMASSEλ | W, Coefs, Season, Start | The conditional sum of squares SARIMA minimises, vectorised over sets of coefficients. |
| fx.RiskSARIMAResidλ | W, Coefs, Season, Start | The residuals for one set of coefficients; fx.RiskSARIMAResidsλ, with the same arguments, for many at once. |
| fx.RiskSARIMAMeanλ | History, Model, Periods | The SARIMA point forecast. |
| fx.RiskSARIMAImpulseλ | Model, Periods | The SARIMA impulse-response matrix behind the band and the paths. |
| fx.RiskCorrelλ | Data, [Method] | The bare correlation matrix, Pearson or Spearman. |
| fx.RiskShapiroWilkλ | X | One column's Shapiro–Wilk statistic and p-value. |
| fx.RiskAndersonDarlingλ | X, [Variant] | One column's Anderson–Darling statistic and p-value. |
| fx.RiskJarqueBeraλ | X | One column's Jarque–Bera statistic and p-value. |
| fx.RiskJacobiλ | Matrix, [Sweeps] | The eigenvalues of a symmetric matrix, largest first, by Jacobi rotations. |
| fx.RiskJacobiVectorsλ | Matrix, [Sweeps] | Eigenvalues and eigenvectors of a symmetric matrix, for the cointegration functions. |
| fx.RiskCharPolyλ | Matrix | The characteristic polynomial of a square matrix, by the Faddeev–LeVerrier recursion. |
| fx.RiskPolyRootsλ | Coefficients, [Iterations] | Every root of a polynomial, real and complex, by Aberth–Ehrlich iteration. |
| fx.RiskEigenvaluesλ | Matrix | The eigenvalues of any real square matrix, symmetric or not, with their moduli: the VAR stability check. |
| fx.RiskOLSλ | Y, X, [Intercept] | Fitted values and residuals of a least-squares fit, by LINEST. |
| fx.RiskResidualizeλ | Y, X | What is left of each column of Y after regressing it on X. |
| fx.RiskBootIdxλ | U, BlockSize, Replace | Bootstrap row numbers from a block of uniforms. |
| fx.RiskEnvelopeλ | Means, Cov, C | An envelope portfolio: every frontier portfolio has this form, and C = Rf gives the tangency portfolio. |
| fx.RiskUndifferenceλ | Changes, History, [Diff], [SeasonalDiff], [Season] | Rebuilds levels from differences — the inverse of fx.RiskDifferenceλ — for forecasts and paths of a differenced series. |
| fx.RiskBoxCoxLLFλ | X, Lambdas | The Box-Cox profile log-likelihood at each lambda. |
| fx.RiskBoxCoxMLEλ | X | The maximum-likelihood Box-Cox lambda, by golden-section search and two Newton steps. |
| fx.RiskMacKinnonλ | Stat, Trend, N | MacKinnon's p-value and critical values for a Dickey-Fuller statistic. |
| fx.RiskHWInitλ | History, Season, Seasonal, Trend | Holt-Winters starting states. |
| fx.RiskHWStepλ | St, Yt, Params, Mul | One Holt-Winters update for many parameter sets at once. |
| fx.RiskHWRunλ | History, Params, Init, Mul, What | Holt-Winters run through a history: the squared errors the fit minimises, the one-step errors or the final states. |
| fx.RiskARMAMeanλ | History, Model, Periods | The ARMA point forecast from any ARMA parameter block. |
| fx.RiskVARDesignλ | Data, Lags, Type, Season, Exog, Skip, Names | The regression behind a VAR: the series and their lags, constants, trends, dummies and outside variables. |
| fx.RiskVARPsiλ | Model, Horizon, [Orthogonal], [Order] | The VAR's moving-average form, behind the impulse responses, the decomposition and the forecast band. |
| fx.RiskVARMeanλ | Data, Model, Horizon, [FutureExog] | The VAR point forecasts. |
| fx.RiskJohansenCVλ | Test, DetOrder, N | Critical values of the Johansen tests, for up to 12 series. |
Nine more come from the Monte Carlo library and are included so this gist installs on its own: fx.RiskHDRλ, fx.RiskUλ, fx.RiskPoissonλ (the jump counts), fx.RiskDiscreteInvλ, fx.RiskHalfTInvλ, fx.RiskVarNameλ, fx.RiskVarNamesλ, fx.RiskRankλ and fx.RiskCholeskyλ (the correlated VAR shocks). They are documented on the Monte Carlo LAMBDAs page.
Conventions worth checking
These get a wrong answer rather than an error, so they are stated plainly.
- dt is in the units of the rates. Annual drift and volatility with monthly periods is dt = 1/12. Leave it out and every period is one whole unit — a year of growth per month.
- ARMA and ARIMA read Start differently. For ARMA it is the values before period 1, oldest first, and defaults to the mean. For ARIMA it is the last observed level, and defaults to 0.
- GARCH needs Alpha + Beta + Gamma / 2 < 1. Otherwise the variance has no long-run level. The fit enforces it; a hand-typed set of parameters should be checked.
- Give every series its own VarID. Two series sharing a VarID draw identical shocks and move in lockstep. XL Edge's selector assigns a fresh one each time.
- Normality tests on thousands of values reject everything. With enough data any departure from normality is significant. Test histories and residuals, not 10,000 simulated trials.
- Judge SARIMA by its forecasts, not its coefficients. On a few years of monthly data different methods give different coefficients and nearly the same forecast. Backtest before choosing.
- The order of the series is an assumption in a VAR. Orthogonal impulse responses and the variance decomposition let earlier series move later ones within a period, not the reverse. Try another Order before reading much into a response.
- Read the unit-root tests together. ADF and Phillips-Perron assume a unit root, KPSS assumes none. A split verdict means the data cannot tell, not that one test is right.
- Benford needs the right kind of data. Amounts that arise naturally and span several orders of magnitude, about 500 or more. Assigned numbers, set prices and capped amounts do not follow it.
- The frontier allows short sales. The closed-form frontier has no constraints, so weights can be negative or above 100%. Read the weights, not just the curve.
How it is checked
538 of the 956 automated checks that drive Excel directly cover this library, and all pass. The 398 added since v0.8 compare each new function with an independent reference implementation: regression, its residuals and every residual test; the correlogram, ARCH-LM and the three unit-root tests with their p-values and critical values; Holt-Winters, Benford, Box-Cox, the confidence ellipse, the bootstrap and the portfolio functions; the VAR fit, lag selection, stability, impulse responses and their bands, decomposition, Granger tests, forecasts, simulated paths and backtests; the Johansen test and the VECM; and the smoothing, spectral, AR and accuracy functions. The original 140 are described next.
Every simulator matches an independent step-by-step recursion cell for cell, to about 10⁻¹⁵, with normal and with Student t shocks; simulated means and variances match their closed forms; and a block of uniforms passed as Trials is used as the shocks exactly. Every fit equals an independent replica of its own method, and lands close to an independent maximum-likelihood fit — within 0.011 for ARMA and 0.008 for GARCH and GJR on the test histories.
SARIMA's fit, forecast, simulated paths, backtest and rank each match an independent replica, the forecast exactly; the percentiles of the simulated paths match the forecast table's band; and the fitted optimum matches an independent optimiser of the same objective to within 0.0001. Every diagnostic matches independent references: correlation, covariance, eigenvalues and distances, Pearson and Spearman p-values, Shapiro–Wilk, Anderson–Darling, Jarque–Bera and VIF. The fan chart's percentiles and means match to 10⁻¹⁶.
The rest cover invalid arguments, each of which must return an error rather than a plausible wrong number; timing at 10,000 trials by 60 and by 250 periods; and a call counter showing that nothing recalculates unless its own inputs change. A separate round-trip test installs both public gists into blank workbooks, saves, reopens and recalculates, and confirms that a function the two share gives the same trials whichever gist goes in second.
Attribution
Every method here is implemented independently from its original publication; no code was taken. The sources are credited here and inside the library itself.
- ProbabilityManagement.org and Hubbard Decision Research (opens in a new tab) The HDR counter-based generator, published openly as part of the SIPmath standard; ChanceCalc Plus and PM_Lambda_functions, MIT licence, Copyright 2012–2026 Probability Management, Inc.
- ARMA, ARIMA and seasonal ARIMA Box, Jenkins and Reinsel, Time Series Analysis: Forecasting and Control (the multiplicative seasonal and airline models, ψ-weights); Hamilton, Time Series Analysis (1994); Hannan and Rissanen (Biometrika 69(1), 1982) for estimation with MA terms; Levenberg (1944) and Marquardt (1963) for the SARIMA minimisation.
- Continuous-time processes Glasserman, Monte Carlo Methods in Financial Engineering (2003); Merton (Journal of Financial Economics 3, 1976) for jump-diffusion and Press (Journal of Business 40(3), 1967) for its cumulant fit; Vasicek (1977); Cox, Ingersoll and Ross (Econometrica 53(2), 1985), simulated with Andersen's quadratic-exponential scheme (Journal of Computational Finance 11(3), 2008).
- GARCH and GJR Engle (1982); Bollerslev (Journal of Econometrics 31, 1986, and the scaled Student t shocks of 1987); Glosten, Jagannathan and Runkle (Journal of Finance 48(5), 1993); variance targeting after Engle and Mezrich (1996).
- Diagnostics Shapiro–Wilk by Royston's algorithm (Applied Statistics 44(4), 1995); Anderson–Darling after D'Agostino and Stephens, Goodness-of-Fit Techniques (1986), and Marsaglia and Marsaglia (Journal of Statistical Software 9(2), 2004); Jarque and Bera (International Statistical Review 55(2), 1987); VIF, condition number and leverage after Belsley, Kuh and Welsch, Regression Diagnostics (1980); Mahalanobis (1936); the Jacobi eigenvalue method after Golub and Van Loan, Matrix Computations.
- Regression and its tests Durbin and Watson (Biometrika 37, 1950); Cook (Technometrics 19(1), 1977); Breusch and Pagan (Econometrica 47(5), 1979) with Koenker's robust form (Journal of Econometrics 17(1), 1981); White (Econometrica 48(4), 1980); Breusch (1978) and Godfrey (Econometrica 46(6), 1978); Ramsey (JRSS B 31(2), 1969); Cochrane and Orcutt (JASA 44(245), 1949) and Prais and Winsten (1954).
- Testing and smoothing a series Bartlett (1946), Durbin (1960) and Ljung and Box (Biometrika 65(2), 1978) for the correlogram; Engle (Econometrica 50(4), 1982) for ARCH-LM; Dickey and Fuller (JASA 74(366), 1979), Said and Dickey (1984), Phillips and Perron (Biometrika 75(2), 1988), Newey and West (1987), Kwiatkowski, Phillips, Schmidt and Shin (Journal of Econometrics 54, 1992), with MacKinnon's p-values and critical values (1994, 2010); Holt (1957), Winters (Management Science 6(3), 1960) and Gardner and McKenzie (1985) for exponential smoothing; Yule (1927), Walker (1931), Levinson (1947) and Burg (1967) for AR fits; Parzen (Technometrics 3(2), 1961) for the smoothed spectrum; Hyndman and Koehler (International Journal of Forecasting 22(4), 2006) and Theil (1966) for accuracy; and Woodward, Sadler and Robertson, Time Series for Data Science (2022), for the factor table, trend tests (with Woodward, Bottone and Gray, 1997), rolling RMSE and gap filling.
- VAR, cointegration and VECM Lütkepohl, New Introduction to Multiple Time Series Analysis (2005); Sims (Econometrica 48(1), 1980) for impulse responses; Granger (Econometrica 37(3), 1969); Hosking (JASA 75(371), 1980) for the portmanteau test; Johansen (Journal of Economic Dynamics and Control 12, 1988; Econometrica 59(6), 1991) with critical values from MacKinnon, Haug and Michelis (Journal of Applied Econometrics 14(5), 1999); Pfaff (2008); the Faddeev–LeVerrier recursion and Aberth–Ehrlich iteration for the roots.
- Bootstrap, Box-Cox, Benford, ellipses and portfolios Efron (Annals of Statistics 7(1), 1979; JASA 82(397), 1987), Efron and Tibshirani, An Introduction to the Bootstrap (1993), Davison and Hinkley, Bootstrap Methods (1997) and Künsch (1989) for block resampling; Box and Cox (JRSS B 26(2), 1964); Newcomb (1881), Benford (1938) and Nigrini, Benford's Law (2012); Hotelling (1931) and Johnson and Wichern, Applied Multivariate Statistical Analysis, for the ellipse; Markowitz (Journal of Finance 7(1), 1952), Merton (JFQA 7(4), 1972), Black (1972), Sharpe (1963), Elton and Gruber (1973) and Benninga, Financial Modeling (4th ed.) for the portfolio functions.