Skip to content

Indicator function

An indicator turns an event into 0 or 1. See how it encodes default losses, counts and payoffs, why its mean is a probability, and when the boundary matters.

An indicator function turns a condition into a number: 1 when the condition holds, 0 otherwise. For an event AA and an outcome ω\omega,
1A(ω)={1,ω∈A,0,ω∉A.\mathbf{1}_A(\omega)= \begin{cases} 1,&\omega\in A,\\ 0,&\omega\notin A. \end{cases}
In probability, this is an indicator random variable. It lets a model turn “the borrower defaults” into a loss formula, “the stock finishes above the strike” into a payoff, and many yes/no outcomes into a count. MIT's probability lectures introduce indicators through this event-to-number construction.

An outcome is not its probability

Suppose AA means a specified borrower defaults by the end of one year, under a stated definition of default. Write I=1AI=\mathbf{1}_A and stipulate a default probability of p=0.2p=0.2. This is a hypothetical model input, not an estimate for an actual borrower.
ObjectWhat it says in this model
Event AAWhich outcomes count as default by the horizon
Indicator II1 in a default outcome; 0 in a non-default outcome
Probability p=P(A)p=\mathbb{P}(A)A model weight of 0.2 assigned to the event
The indicator never takes the value 0.2. Its expected value does:
E[I]=1p+0(1−p)=p.\mathbb{E}[I]=1p+0(1-p)=p.
Because I2=II^2=I, its variance is
Var(I)=E[I2]−E[I]2=p−p2=p(1−p).\text{Var}(I)=\mathbb{E}[I^2]-\mathbb{E}[I]^2=p-p^2=p(1-p).
Here the mean is 0.2 and the variance is 0.16, both dimensionless. At p=0p=0 or p=1p=1, variance is zero: the indicator is constant almost surely.
The indicator's distribution is Bernoulli with parameter pp. The terms describe different things: indicator specifies a function attached to an event; Bernoulli specifies the probabilities of its two values. Two event indicators can have the same Bernoulli distribution while recording different events and having different dependence on other variables.

Turning the switch into a loss

Assume the loss is a fixed USD 100 if default occurs and zero otherwise, measured at the one-year horizon. This deliberately simplified loss model has no variable recovery or exposure:
L=100I(USD).L=100I\quad\text{(USD)}.

It has only two outcomes: USD 0 with probability 0.8 and USD 100 with probability 0.2. Therefore

E[L]=100(0.2)=20USD,Var(L)=1002(0.16)=1600USD2,σL=1600=40USD.\begin{aligned} \mathbb{E}[L]&=100(0.2)=20\quad\text{USD},\\ \text{Var}(L)&=100^2(0.16)=1600\quad\text{USD}^2,\\ \sigma_L&=\sqrt{1600}=40\quad\text{USD}. \end{aligned}
The expected loss of USD 20 is a weighted average; the modelled credit loss is USD 0 or USD 100, rather than USD 20. Variance scales by the square of the USD 100 loss amount. These are horizon loss statistics, not a discounted price or a promised realized loss.

With a random loss severity ZZ, the corresponding expression is L=Z1AL=Z\mathbf{1}_A. Provided ZZ is integrable and P(A)>0\mathbb{P}(A)>0,

E[Z1A]=P(A)E[Z∣A].\mathbb{E}[Z\mathbf{1}_A]=\mathbb{P}(A)\mathbb{E}[Z\mid A].
Use the severity conditional on default. Replacing it with unconditional E[Z]\mathbb{E}[Z] needs an additional condition, such as independence; it is especially questionable when exposure or recovery worsens in the same scenarios that trigger default.

The boundary belongs in the condition

Consider an illustrative terminal stock model: STS_T is USD 90, USD 100 or USD 110 with respective probabilities 0.4, 0.1 and 0.5. The indicators 1{ST>100}\mathbf{1}_{\{S_T>100\}} and 1{ST≥100}\mathbf{1}_{\{S_T\ge100\}} differ exactly at USD 100. Their expectations are 0.5 and 0.6.
Two step plots compare stock-price indicators. The strict event S_T greater than USD 100 has value 0 at 100 and probability 0.5. The inclusive event S_T at least USD 100 has value 1 at 100 and probability 0.6. The difference is the stipulated 0.1 probability of exactly USD 100.
Two step plots compare stock-price indicators. The strict event S_T greater than USD 100 has value 0 at 100 and probability 0.5. The inclusive event S_T at least USD 100 has value 1 at 100 and probability 0.6. The difference is the stipulated 0.1 probability of exactly USD 100.
Original synthetic three-state model. Filled dots show the actual boundary value; hollow dots exclude it. Horizontal axis: terminal stock in USD. Vertical axis: unitless indicator.

For a fixed-cash digital option, that equality convention determines whether the cash is paid at the threshold. If the model assigns zero probability to equality, changing the convention leaves the expectation unchanged, but the functions still differ at that point. A discrete model or rounded observation can give equality positive probability. Specify the trigger, observation time and equality rule before computing.

For comparison, a call payoff can be written
(ST−K)+=(ST−K)1{ST>K}.(S_T-K)^+=(S_T-K)\mathbf{1}_{\{S_T>K\}}.
Here changing >> to ≥\ge changes nothing, even at ST=KS_T=K, because the multiplier is zero there. Whether a boundary matters depends on the full payoff, not just the indicator.

Counts, overlaps and weighted sums

For three loans, let IiI_i indicate default of loan ii by a common horizon. The number of defaults is N=I1+I2+I3N=I_1+I_2+I_3. A realized vector (1,0,1)(1,0,1) means two defaults. If each default probability is 0.2, then

E[N]=∑i=13P(Ai)=0.6.\mathbb{E}[N]=\sum_{i=1}^{3}\mathbb{P}(A_i)=0.6.
Linearity needs no independence. If every default causes a fixed USD 100 loss, the expected total loss is USD 60 whether the loans default independently or together. Their loss variance does depend on the joint behavior: a sum of individual variances omits covariance terms.

Indicators also translate event logic into algebra:

1Ac=1−1A,1A∩B=1A1B,1A∪B=1A+1B−1A1B.\begin{aligned} \mathbf{1}_{A^c}&=1-\mathbf{1}_A,\\ \mathbf{1}_{A\cap B}&=\mathbf{1}_A\mathbf{1}_B,\\ \mathbf{1}_{A\cup B}&=\mathbf{1}_A+\mathbf{1}_B-\mathbf{1}_A\mathbf{1}_B. \end{aligned}

Adding two indicators counts how many of the two events occur. It is an indicator of “at least one” only if the events are disjoint; otherwise it takes the value 2 when both occur. The subtraction in the union formula removes that double count.

For the weighted-average and spread calculations behind these examples, the Mathematics Primer's Expectation, Variance and Covariance lesson is available in full with a free signed-in account.

Sources

  • Dimitri P. Bertsekas and John N. Tsitsiklis, Introduction to Probability, 2nd ed. (2008), §2.4, Example 2.5: Bernoulli moments; §2.5: joint distributions and linearity of expectation; §2.7, Example 2.20: indicator sums and binomial variance.
  • Scott Sheffield, MIT 18.440, Lecture 16 (Spring 2014), slides 18 and 22–28: event indicators, additivity of expectation and counts. Examples and figure here are original.
Last updated
  • indicators
  • events
  • bernoulli
  • default loss
  • payoffs
  • probability
← Back to the glossaryBack to top ↑