cholesky: Cholesky Decomposition

Exercise template for computing the Cholesky decomposition of a simple randomly-generated 3x3 or 4x4 matrix (by hand).

Name:
cholesky
Type:
Preview:

For the matrix \[ \begin{aligned} A &= \left( \begin{array}{rrrr} 16 & 4 & 16 & -4 \\ 4 & 5 & 6 & -9 \\ 16 & 6 & 33 & -28 \\ -4 & -9 & -28 & 58 \end{array} \right). \end{aligned} \] compute the matrix \(L = (\ell_{ij})_{1 \leq i,j \leq 4}\) from the Cholesky decomposition \(A = L L^\top\).

Which of the following statements are true?

The decomposition yields \[ \begin{aligned} L &= \left( \begin{array}{rrrr} 4 & 0 & 0 & 0 \\ 1 & 2 & 0 & 0 \\ 4 & 1 & 4 & 0 \\ -1 & -4 & -5 & 4 \end{array} \right) \end{aligned} \] and hence:

  • True. \(\ell_{41} = -1\)
  • False. \(\ell_{44} = 4 \nless 4\)
  • False. \(\ell_{22} = 2 \neq -1\)
  • True. \(\ell_{11} = 4\)
  • True. \(\ell_{32} = 1\)

For the matrix \[ \begin{aligned} A &= \left( \begin{array}{rrrr} 1 & -2 & 1 & 0 \\ -2 & 8 & -8 & 8 \\ 1 & -8 & 35 & -2 \\ 0 & 8 & -2 & 21 \end{array} \right). \end{aligned} \] compute the matrix \(L = (\ell_{ij})_{1 \leq i,j \leq 4}\) from the Cholesky decomposition \(A = L L^\top\).

Which of the following statements are true?

The decomposition yields \[ \begin{aligned} L &= \left( \begin{array}{rrrr} 1 & 0 & 0 & 0 \\ -2 & 2 & 0 & 0 \\ 1 & -3 & 5 & 0 \\ 0 & 4 & 2 & 1 \end{array} \right) \end{aligned} \] and hence:

  • False. \(\ell_{43} = 2 \nless 2\)
  • False. \(\ell_{41} = 0 \nleq -7\)
  • False. \(\ell_{11} = 1 \ngtr 4\)
  • True. \(\ell_{32} = -3\)
  • True. \(\ell_{21} = -2\)

For the matrix \[ \begin{aligned} A &= \left( \begin{array}{rrrr} 9 & 12 & 15 & 15 \\ 12 & 32 & 8 & 28 \\ 15 & 8 & 50 & 19 \\ 15 & 28 & 19 & 45 \end{array} \right). \end{aligned} \] compute the matrix \(L = (\ell_{ij})_{1 \leq i,j \leq 4}\) from the Cholesky decomposition \(A = L L^\top\).

Which of the following statements are true?

The decomposition yields \[ \begin{aligned} L &= \left( \begin{array}{rrrr} 3 & 0 & 0 & 0 \\ 4 & 4 & 0 & 0 \\ 5 & -3 & 4 & 0 \\ 5 & 2 & 0 & 4 \end{array} \right) \end{aligned} \] and hence:

  • False. \(\ell_{33} = 4 \nleq -4\)
  • True. \(\ell_{21} = 4\)
  • False. \(\ell_{31} = 5 \nless 5\)
  • False. \(\ell_{44} = 4 \ngeq 5\)
  • True. \(\ell_{42} = 2\)
Description:
Computing the Cholesky decomposition of a randomly-generated symmetric positive-definite matrix (3x3 or 4x4) whose Cholesky factor has only integer elements between -5 and 5. The exercise can be solved by computing the Cholesky decomposition and then checking five corresponding multiple-choice items, generated randomly with matrix_to_mchoice().
Solution feedback:
Yes
Randomization:
Random numbers and text blocks
Mathematical notation:
Yes
Verbatim R input/output:
No
Images:
No
Other supplements:
No
Raw: (1 random version)
PDF:
cholesky-Rmd-pdf
cholesky-Rnw-pdf
HTML:
cholesky-Rmd-html
cholesky-Rnw-html

(Note that the HTML output contains mathematical equations in MathML, rendered by MathJax using ‘mathjax = TRUE’. Instead it is also possible to use ‘converter = “pandoc-mathjax”’ so that LaTeX equations are rendered by MathJax directly.)

Demo code:

library("exams")

set.seed(403)
exams2html("cholesky.Rmd", mathjax = TRUE)
set.seed(403)
exams2pdf("cholesky.Rmd")

set.seed(403)
exams2html("cholesky.Rnw", mathjax = TRUE)
set.seed(403)
exams2pdf("cholesky.Rnw")