Home | Command Reference | Run Example

Hist Command

The HIST command creates a histogram for a time series and summarizes the historical distribution of the values. It is useful for seeing where the latest observation sits relative to the past, whether the series is symmetric or skewed, and whether the distribution has a long right or left tail.

For positive-valued series, RainbowStats may also overlay a fitted distribution curve, such as a gamma distribution. This is especially helpful for variables like volatility, spreads, interest rates, and other economic or financial series that are bounded below and skewed to the right.

Example

HIST(VIXCLS)

This example creates a histogram of the CBOE Volatility Index. The chart shows the historical distribution of VIX values, the fitted distribution curve, and reference lines for summary levels such as the latest value, mean, median, and adaptive mean.

Syntax

HIST(series)

The input should be a single time series.

Output

The command produces a histogram chart with a statistical summary. Depending on the data, the panel may include:

Interpreting the Chart

The bars show how frequently the series has appeared in each value range. A tall cluster of bars means the series spends a lot of time near those values. A long tail means extreme observations occur, but less frequently.

For financial and economic data, the shape of the distribution is often as important as the average. A series like the VIX usually has a right-skewed distribution: it spends much of its time at moderate levels, but occasionally jumps sharply during market stress.

Interpretation tip: When the latest value is below the historical mean or median, current conditions are mild relative to history. When it is far above the historical range, the chart may be showing stress, inflation pressure, volatility, or another unusual regime depending on the series being analyzed.

Additional Examples

HIST(UNRATE)

Shows the historical distribution of the unemployment rate.

HIST(DGS10)

Shows the historical distribution of the 10-year Treasury yield.

HIST(LOGDIFF(SP500))

Shows the distribution of log returns for the S&P 500 index.

When to Use

Use HIST when you want a quick distributional view of a series. It is a good first step before building a model because it shows whether the data is centered, skewed, volatile, or dominated by rare extreme events.

The command is also useful for blog posts and exploratory analysis because it gives readers an immediate visual answer to a simple question: is the latest observation normal, unusual, or extreme compared with history?

Note: A histogram describes the historical distribution of a series. It does not imply that the future distribution must follow the same pattern, especially during structural breaks, recessions, crises, or major policy changes.