Apple Revenue Risk: 3 Powerful Steps to Estimate PD

Written by

in

In this post, part of my revenue risk series, I use SEC EDGAR data to build an Apple revenue risk framework based on historical revenue impairment events. The objective is to estimate a 4-quarter realized impairment frequency, which I refer to as PD₁ by analogy with Probability of Default (PD).

In the previous post, Revenue Risk: 3 Models for Measuring Downside, I defined a revenue impairment as a quarter in which seasonally adjusted revenue growth falls below -10% QoQ.

This post covers the implementation in Python:

  • Adjusting Apple revenue for seasonality
  • Defining revenue impairment events
  • Estimating a 4-quarter realized impairment frequency (PD₁)

Adjusting Apple revenue for seasonality

Seasonality is an important part of the Apple revenue risk calculation because quarterly revenue follows a strong recurring pattern. I use a sample of SEC EDGAR data spanning 2008-Q2 through 2026-Q1. Across the full sample, Q4 has the highest average seasonal ratio, while Q2 has the lowest.

Using pandas, we can confirm this:

revenue.groupby("quarter")["seasonal_ratio"].mean()

Output:

quarter
1    0.995295
2    0.894631
3    0.965097
4    1.356130
Name: seasonal_ratio, dtype: float64

So, how do I infer this seasonal ratio and adjust revenue?

I use a simple lagged seasonal normalization inspired by seasonal-adjustment methods:

  1. Take the rolling 4-quarter mean of nominal revenue at each point in time.
  2. Divide each quarter’s revenue by this trailing 4-quarter average to estimate a seasonal ratio.
  3. To avoid look-ahead bias, use the median of up to five seasonal ratios observed for the same quarter in previous years, requiring at least three. Dividing current revenue by this lagged factor produces the seasonally normalized revenue series.

This is deliberately a simple normalization rather than an estimate of a pure statistical seasonal component. The median limits the influence of an isolated impairment on later seasonal factors. Because the denominator is a moving average, the ratio can also reflect trend and business-cycle effects.

For comparison, the chart below shows nominal and seasonally adjusted revenue. The adjusted series forms the basis for identifying Apple revenue risk events.

Show full seasonality-adjustment code
revenue["quarter"] = revenue["period"].dt.quarter
revenue["quarter_id"] = revenue["period"].dt.year * 4 + revenue["quarter"]

# Require four consecutive quarters for the trailing trend correction.
consecutive_4q = (
    revenue["quarter_id"]
    .diff()
    .eq(1)
    .rolling(3, min_periods=3)
    .sum()
    .eq(3)
)

# Trailing four-quarter average.
revenue["trailing_4q_average"] = (
    revenue["revenue"]
    .rolling(4, min_periods=4)
    .mean()
    .where(consecutive_4q)
)

# Revenue relative to its trailing average.
revenue["seasonal_ratio"] = (
    revenue["revenue"] / revenue["trailing_4q_average"]
)

# Use the median of up to five prior same-quarter ratios, requiring
# at least three. The shift excludes the current quarter.
previous_same_quarter = (
    revenue.groupby("quarter")["quarter_id"].shift(1)
)

revenue["seasonal_factor"] = (
    revenue.groupby("quarter")["seasonal_ratio"]
    .transform(
        lambda x: x.shift(1)
        .rolling(window=5, min_periods=3)
        .median()
    )
    .where(
        revenue["quarter_id"]
        .sub(previous_same_quarter)
        .eq(4)
    )
)

# Seasonally normalized revenue.
revenue["revenue_sa"] = (
    revenue["revenue"] / revenue["seasonal_factor"]
)

# Plot nominal versus seasonally adjusted revenue.
fig, ax = plt.subplots(figsize=(13, 5))

ax.plot(
    revenue["quarter_end"],
    revenue["revenue"],
    color="#0756b1",
    label="Nominal quarterly revenue",
)

ax.plot(
    revenue["quarter_end"],
    revenue["revenue_sa"],
    color="#d8781e",
    label="Seasonally adjusted quarterly revenue",
)

ax.set_title("AAPL Quarterly Revenue: Nominal vs Seasonally Adjusted")
ax.set_xlabel("Quarter end")
ax.set_ylabel("Revenue (M USD)")
ax.grid(alpha=0.25)
ax.legend()

fig.tight_layout()

fig.savefig(
    "aapl_nominal_vs_seasonally_adjusted_revenue.png",
    dpi=180,
    bbox_inches="tight",
)

plt.show()

Defining Apple revenue impairment events

The next step in measuring Apple revenue risk is to identify revenue impairment events. The definition itself is simple: an impairment occurs when seasonally adjusted quarter-on-quarter revenue growth falls below -10%.

The impairment event is determined only by seasonally adjusted revenue growth. Expected revenue and Exposure at Default (EAD) do not determine whether an impairment occurs or enter the PD₁ calculation.

Show impairment-event code
# Calculate QoQ growth after adjusting the revenue level for seasonality.
revenue["revenue_growth_sa"] = (
    revenue["revenue_sa"]
    .pct_change(fill_method=None)
    .where(revenue["quarter_id"].diff().eq(1))
)

# Revenue impairment:
# seasonally adjusted QoQ revenue growth below -10%.
revenue["impairment_threshold"] = -0.10

valid = revenue["revenue_growth_sa"].notna()

revenue["impairment"] = (
    revenue["revenue_growth_sa"]
    < revenue["impairment_threshold"]
).where(valid)

I nevertheless calculate expected revenue here because it provides the EAD measure that will be used later when modeling the severity and recovery of an impairment. It also lets me describe the identified impairment events in more detail.

I set the counterfactual expected revenue, used as Exposure At Default (EAD), as the seasonally adjusted revenue level of the preceding quarter. This is the same base used to calculate seasonally adjusted quarter-on-quarter growth, so the initial relative shortfall matches the revenue decline at impairment.

Show EAD code

# Fix EAD at the preceding quarter's seasonally adjusted revenue. Use the
# same consecutive-quarter requirement as the QoQ impairment-growth measure.
revenue["expected_revenue"] = (
    revenue["revenue_sa"].shift(1)
    .where(revenue["quarter_id"].diff().eq(1))
)

adjusted = (
    revenue.loc[revenue["revenue_sa"].notna()]
    .sort_values("quarter_id", kind="stable")
    .reset_index(drop=True)
)

The plot below shows the historical seasonally adjusted revenue trajectory and the identified impairment events.

Show plot seasonally adjusted revenue and impairments code

# Mark observed impairment quarters on seasonally adjusted revenue.
# The event test uses growth inferred from this same adjusted level series.
impairment_dates = adjusted.loc[adjusted["impairment"].eq(True)].copy()
fig, ax = plt.subplots(figsize=(13, 5))
ax.plot(revenue["quarter_end"], revenue["revenue_sa"], color="#0756b1", lw=1.8,
        label="Seasonally adjusted quarterly revenue")
ax.scatter(
    impairment_dates["quarter_end"], impairment_dates["revenue_sa"],
    color="#c92626", s=65, zorder=3,
    label=f"Impairment event (SA QoQ growth < -10%; {len(impairment_dates)} quarters)",
)
ax.set_title("AAPL Seasonally Adjusted Revenue and Impairment Events")
ax.set_xlabel("Quarter end")
ax.set_ylabel("Seasonally adjusted revenue (M USD)")
ax.grid(alpha=0.25)
ax.legend()
fig.tight_layout()
fig.savefig("aapl_seasonally_adjusted_revenue_impairments.png", dpi=180,
            bbox_inches="tight")
plt.show()

To make the impairment events easier to inspect, I also summarize the event quarter, seasonally adjusted QoQ growth, nominal revenue, and counterfactual expected revenue.

Show summary code

impairment_summary = (
    impairment_dates[
        [
            "period",
            "revenue_growth_sa",
            "revenue",
            "revenue_sa",
            "expected_revenue",
        ]
    ]
    .rename(
        columns={
            "period": "quarter",
            "revenue_growth_sa": "sa_qoq_growth",
            "revenue": "nominal_revenue",
            "revenue_sa": "observed_revenue_sa",
            "expected_revenue": "expected_revenue_sa",
        }
    )
    .reset_index(drop=True)
)

print(
    impairment_summary.to_string(
        index=False,
        formatters={
            "sa_qoq_growth": lambda x: f"{x:.1%}",
            "nominal_revenue": lambda x: f"{x:,.0f}",
            "observed_revenue_sa": lambda x: f"{x:,.0f}",
            "expected_revenue_sa": lambda x: (
                f"{x:,.0f}" if pd.notna(x) else "N/A"
            ),
        },
    )
)

quarter sa_qoq_growth nominal_revenue observed_revenue_sa expected_revenue_sa
 2012Q2        -14.2%          35,023              31,838              37,101
 2013Q2        -14.4%          35,323              34,606              40,425
 2016Q1        -14.6%          50,557              46,226              54,109
 2017Q1        -13.8%          52,896              50,999              59,175
 2018Q1        -11.1%          61,137              59,276              66,683
 2018Q4        -17.8%          84,310              58,677              71,361
 2022Q4        -10.7%         117,154              85,386              95,623

Estimating the 4-quarter realized impairment frequency (PD₁)

The final step is to translate the impairment events into a 4-quarter realized impairment frequency (PD₁). For each historical quarter, I ask whether at least one impairment occurred in any of the next 4 consecutive quarters. If so, the realized outcome is True (1); otherwise it is False (0).

I use the historical share of complete four-quarter windows containing at least one impairment as the PD₁ estimate. This is a descriptive historical incidence rate, not a predictive probability model.

For the PD₁ calculation I use a separate dataframe that requires only a valid impairment observation and consecutive quarter IDs. Expected revenue is intentionally not part of this filter because EAD is not required to determine whether an impairment occurred.

Show 4-quarter PD₁ calculation

# PD₁ uses only observations required to determine impairment.
# expected_revenue is deliberately excluded from this filter.
pd_data = (
    adjusted.loc[
        adjusted["impairment"].notna(),
        ["period", "quarter_id", "revenue_growth_sa", "impairment"],
    ]
    .sort_values("quarter_id", kind="stable")
    .reset_index(drop=True)
)

# Did an impairment occur in each of the next four observations?
future_impairments = pd.concat(
    [pd_data["impairment"].shift(-offset) for offset in range(1, 5)],
    axis=1,
)

# Check that those observations are actually the next
# four consecutive calendar quarters.
future_quarter_ids = pd.concat(
    [pd_data["quarter_id"].shift(-offset) for offset in range(1, 5)],
    axis=1,
)
expected_quarter_ids = pd.concat(
    [pd_data["quarter_id"] + offset for offset in range(1, 5)],
    axis=1,
)
expected_quarter_ids.columns = future_quarter_ids.columns
complete_windows = (
    future_impairments.notna().all(axis=1)
    & future_quarter_ids.eq(expected_quarter_ids).all(axis=1)
)
pd1_history = pd_data.loc[
    complete_windows, ["period", "revenue_growth_sa"]
].copy().rename(columns={"period": "origin_quarter"})
pd1_history["impaired_next_4q"] = (
    future_impairments.loc[complete_windows].any(axis=1).to_numpy()
)
pd1_history = pd1_history.reset_index(drop=True)

# Historical 4-quarter realized impairment frequency.
pd1 = (
    pd1_history["impaired_next_4q"].mean()
    if not pd1_history.empty else float("nan")
)
print(
    f"AAPL 4-quarter realized impairment frequency (PD₁): "
    f"{pd1:.1%} over {len(pd1_history)} complete overlapping windows"
)

Because the four-quarter windows overlap, these observations are not independent trials. Adjacent origin quarters can share three of the same four future quarters. The resulting PD₁ should therefore be interpreted as a historical incidence rate rather than as an independently sampled default frequency.

The chart below shows the most recent historical origin for which an impairment occurred within the following four-quarter window.

Show PD₁ chart code

# Use the most recent real AAPL window in which the next four quarters
# contained an impairment.
impaired_origins = pd1_history.loc[
    pd1_history["impaired_next_4q"], "origin_quarter"
]
if impaired_origins.empty:
    raise ValueError("No observed AAPL impairment window is available.")

origin = impaired_origins.iloc[-1]
origin_quarter_id = pd_data.loc[
    pd_data["period"].eq(origin), "quarter_id"
].iloc[0]
window = pd_data.loc[
    pd_data["quarter_id"].between(
        origin_quarter_id - 8, origin_quarter_id + 4),
    ["period", "quarter_id", "revenue_growth_sa", "impairment"],
].reset_index(drop=True)

fig, ax = plt.subplots(figsize=(15, 7.5))
x = range(len(window))
origin_position = window.index[window["quarter_id"].eq(origin_quarter_id)][0]

# Historical context before the origin quarter.
ax.axvspan(-0.5, origin_position - 0.5,
           color="#e9f3fc", alpha=0.75, zorder=0,
           label="Historical context")
# The four quarters following the origin.
ax.axvspan(origin_position + 0.5, origin_position + 4.5,
           color="#fce8e6", alpha=0.45, zorder=0,
           label="Four-quarter PD₁ horizon")
ax.plot(x, window["revenue_growth_sa"], color="#0756b1", marker="o", lw=2.5,
        label="Observed SA QoQ growth")
ax.axhline(
    -0.10, color="#d52b24", ls="--", lw=1.8,
    label="Impairment threshold: -10% QoQ growth",
)
breaches = window["impairment"].eq(True)
ax.scatter(
    window.index[breaches], window.loc[breaches, "revenue_growth_sa"],
    color="#d52b24", s=90, zorder=3, label="Observed impairment",
)
ax.set_xticks(list(x))
ax.set_xticklabels([str(period) for period in window["period"]])
ax.yaxis.set_major_formatter(PercentFormatter(1))
ax.set_ylabel("Seasonally adjusted revenue growth (QoQ)")
ax.set_title(
    f"AAPL: observed 4-quarter impairment window starting {origin}",
    loc="left", fontsize=15, fontweight="bold",
)
ax.grid(axis="y", alpha=0.3)
ax.spines[["top", "right"]].set_visible(False)
ax.legend(frameon=False)
fig.tight_layout()
fig.savefig("aapl_revenue_pd1.png", dpi=180, bbox_inches="tight")
plt.show()

This historical frequency provides a first empirical measure of Apple revenue risk. I use the PD₁ terminology to maintain the analogy with credit risk, but at this stage it remains a realized historical impairment frequency rather than a forward-looking probability estimate.

What comes next?

The next step in the Apple revenue risk framework is to model the recovery path conditional on a revenue impairment having occurred. This will introduce Loss Given Default (LGD) and make use of the counterfactual expected-revenue measure prepared above.

Comments

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.