Skip to content
All library documents

Generate Discrete Asset Outcomes with Inverse Transform Sampling

Article Quant Q&A · Author: M00000001

Summary

The document explains how to simulate a discrete asset outcome with known possible values and probabilities using a uniform random draw. First, accumulate the probabilities to form intervals spanning the unit interval. Then assign each uniform draw to the outcome whose interval contains it, giving each outcome the required chance of being selected.

It also describes the general inverse transform method: construct the cumulative distribution function and map a uniform draw through its inverse to obtain a sample from the target distribution. A four-outcome example illustrates the interval allocation. The method assumes the target probabilities or distribution are known; the text does not discuss numerical edge cases, alternative sampling methods, or how to generate the initial uniform variate.

Key ideas

  • Cumulative probabilities partition the unit interval into outcome-specific regions.
  • Mapping a uniform draw to its region generates a discrete outcome with the specified probability.
  • Inverse transform sampling extends this idea using the inverse cumulative distribution function.
  • The target distribution must be specified before the sampling procedure can be applied.

Tags

Full text
# Produce the random variable for an asset from a uniformly distributed random varible


# Produce the random variable for an asset from a uniformly distributed random varible












I'm working on a quant interview question from the book called Quant Job Interview Questions And Answers (by Mark Joshi and other authors). I cannot understand the following question(not the answer, but the question itself):

> Question 5.2: Suppose an asset takes values from a discrete set $v(j)$ and the probability of $v(j)$ is $p(j)$. Write an algorithm that produces the random variable for this asset from a uniformly distributed random variable.

What is the meaning of "produces the random variable for this asset from a uniformly distributed random variable", can any expert give an example to show what it means? Really appreciate your help!

## Answer by Oskar (score 6, accepted)

https://quant.stackexchange.com/a/49675

The question requires you to provide a method which uses uniform random variables and transforms them to generate realizations of the described asset values.

To give a bit more general answer: this is solved by the inverse transform sampling method. The main idea is to obtain realizations of a random variable $x$ with any given distribution function $F(x)$, by using random numbers $u$ ~ $U(0,1)$ and transforming them.

To do this, you need first need to obtain the distribution function $F(x)$ (in your case you have a probability mass function to begin with), and calculate the inverse cdf $F^{-1}(x)$. Finally, for $u$ ~ $U(0,1)$, the values $x = F^{-1}(u)$ have a distribution $F(x)$.

## Answer by Attack68 (score 3)

https://quant.stackexchange.com/a/49674

Say your asset can take the discrete values {1,2,3,4} with probabilities {0.4, 0.1, 0.2, 0.3}.

The question is to derive a sampling procedure that returns either {1,2,3,4} with the right probabilities according to the underlying distribution.

The solution is to use a random uniform variable ($u \sim U(0,1)$)and allocate it based on the following:

if $u < 0.4 \implies 1$ if $u \geq 0.4, u < 0.5 \implies 2$ if $u \geq 0.5, u < 0.7 \implies 3$ if $u > 0.7\implies 4$

Shown in full with attribution under the source's licence. Licence: CC BY-SA 4.0 (Stack Exchange)

This summary was written by Stratmill's research agent from the original; it is not a copy of the source.