Chapter 6 Integration
This chapter deals with abstract and Monte Carlo integration.
The students are expected to acquire the following knowledge:
Theoretical
- How to calculate Lebesgue integrals for non-simple functions.
R
- Monte Carlo integration.
6.1 Monte Carlo integration
Exercise 6.1 Let \(X\) and \(Y\) be continuous random variables on the unit interval and \(p(x,y) = 6(x - y)^2\). Use Monte Carlo integration to estimate the probability \(P(0.2 \leq X \leq 0.5, \: 0.1 \leq Y \leq 0.2)\). Can you find the exact value?
set.seed(1)
nsamps <- 1000
V <- (0.5 - 0.2) * (0.2 - 0.1)
x1 <- runif(nsamps, 0.2, 0.5)
x2 <- runif(nsamps, 0.1, 0.2)
f_1 <- function (x, y) {
return (6 * (x - y)^2)
}
mcint <- V * (1 / nsamps) * sum(f_1(x1, x2))
sdm <- sqrt((V^2 / nsamps) * var(f_1(x1, x2)))
mcint
## [1] 0.008793445
## [1] 0.0002197686
F_1 <- function (x, y) {
return (2 * x^3 * y - 3 * x^2 * y^2 + 2 * x * y^3)
}
F_1(0.5, 0.2) - F_1(0.2, 0.2) - F_1(0.5, 0.1) + F_1(0.2, 0.1)
## [1] 0.0087
6.2 Lebesgue integrals
Exercise 6.2 (borrowed from Jagannathan) Find the Lebesgue integral of the following functions on (\(\mathbb{R}\), \(\mathcal{B}(\mathbb{R})\), \(\lambda\)).
\[\begin{align} f(\omega) = \begin{cases} \omega, & \text{for } \omega = 0,1,...,n \\ 0, & \text{elsewhere} \end{cases} \end{align}\]
\[\begin{align} f(\omega) = \begin{cases} 1, & \text{for } \omega = \mathbb{Q}^c \cap [0,1] \\ 0, & \text{elsewhere} \end{cases} \end{align}\]
\[\begin{align} f(\omega) = \begin{cases} n, & \text{for } \omega = \mathbb{Q}^c \cap [0,n] \\ 0, & \text{elsewhere} \end{cases} \end{align}\]
Solution.
\[\begin{align} \int f(\omega) d\lambda = \sum_{\omega = 0}^n \omega \lambda(\omega) = 0. \end{align}\]
\[\begin{align} \int f(\omega) d\lambda = 1 \times \lambda(\mathbb{Q}^c \cap [0,1]) = 1. \end{align}\]
\[\begin{align} \int f(\omega) d\lambda = n \times \lambda(\mathbb{Q}^c \cap [0,n]) = n^2. \end{align}\]
Exercise 6.3 (borrowed from Jagannathan) Let \(c \in \mathbb{R}\) be fixed and (\(\mathbb{R}\), \(\mathcal{B}(\mathbb{R})\)) a measurable space. If for any Borel set \(A\), \(\delta_c (A) = 1\) if \(c \in A\), and \(\delta_c (A) = 0\) otherwise, then \(\delta_c\) is called a Dirac measure. Let \(g\) be a non-negative, measurable function. Show that \(\int g d \delta_c = g(c)\).
Solution. \[\begin{align} \int g d \delta_c &= \sup_{q \in S(g)} \int q d \delta_c \\ &= \sup_{q \in S(g)} \sum_{i = 1}^n a_i \delta_c(A_i) \\ &= \sup_{q \in S(g)} \sum_{i = 1}^n a_i \text{I}_{A_i}(c) \\ &= \sup_{q \in S(g)} q(c) \\ &= g(c) \end{align}\]