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} 4 & 6 & -4 & 6 \\ 6 & 25 & -22 & 1 \\ -4 & -22 & 36 & -18 \\ 6 & 1 & -18 & 63 \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} 2 & 0 & 0 & 0 \\ 3 & 4 & 0 & 0 \\ -2 & -4 & 4 & 0 \\ 3 & -2 & -5 & 5 \end{array} \right) \end{aligned} \] and hence:

  • False. \(\ell_{11} = 2 \ngtr 2\)
  • True. \(\ell_{22} = 4\)
  • False. \(\ell_{33} = 4 \ngtr 7\)
  • True. \(\ell_{31} = -2\)
  • True. \(\ell_{41} = 3\)

For the matrix \[ \begin{aligned} A &= \left( \begin{array}{rrrr} 1 & -4 & 3 & 4 \\ -4 & 20 & -10 & -24 \\ 3 & -10 & 35 & -12 \\ 4 & -24 & -12 & 73 \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 \\ -4 & 2 & 0 & 0 \\ 3 & 1 & 5 & 0 \\ 4 & -4 & -4 & 5 \end{array} \right) \end{aligned} \] and hence:

  • True. \(\ell_{44} = 5\)
  • False. \(\ell_{11} = 1 \nless 1\)
  • True. \(\ell_{43} = -4\)
  • True. \(\ell_{22} = 2\)
  • True. \(\ell_{33} = 5\)
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")