Learning Objectives for Quiz 4

Random Number Generation

Extracting Random Numbers from Nature

  1. State two natural sources of random numbers.
  2. State what devices are used to “extract” the random numbers from the two sources in the previous learning objective.

Pseudorandom Number Generators (PRNG)

  1. Explain how pseudorandom numbers differ from truly random numbers.

Linear Congruential Generators

  1. State the algorithm for generating pseudorandom numbers using a linear congruential generator (LCG).
  2. Given the modulus, multiplier, and increment for a LCG and a seed, generate variates from the LCG.
  3. Evaluate expressions \(a \operatorname{mod} m\) involving the modulo operation by-hand.
  4. Compute expressions \(a \operatorname{mod} m\) using R.
  5. State the possible values that a LCG with a given modulus could generate.
  6. Given iterates from a LCG with a relatively small period, identify the period of the LCG.

Desirable Properties of Variates from a PRNG

  1. State three desirable properties of iterates from a PRNG.

Generating Non-uniform Variates from Uniform Variates

  1. Convert variates uniform on \(\{0, 1, 2, \ldots, m - 1\}\) to variates approximately uniform on \((0, 1)\).
  2. Compute the quantile function of a given distribution using R.
  3. Given the quantile function \(q_{F_{X}}\) of a distribution \(F_{X}\) and variates uniform on \((0, 1)\), generate non-uniform variates following \(F_{X}\).

R’s PRNGs

  1. Use R to generate pseudorandom numbers following a given distribution.
  2. Set the seed of the PRNG in R, and explain what setting the seed does.
  3. Explain why it may or may not be appropriate to set the seed in R.

Empirical Distributions from Data

Quantiles

  1. Define the sample quantile function \(\widehat{q}(p)\) from a data set \(X_{1}, X_{2}, \ldots, X_{n}\).
  2. Use R to compute the quantiles of a data set.
  3. Given the graph of a sample quantile function, identify the first, second, and third quartiles of the data set.

Empirical Cumulative Distribution Function

  1. Define the empirical cumulative distribution function \(\widehat{F}(x)\) from a data set \(X_{1}, X_{2}, \ldots, X_{n}\).
  2. Given a (small) data set, evaluate \(\widehat{F}\) at a given argument \(x\) by-hand.
  3. Use R to generate and evaluate the empirical cumulative distribution function from a data set.
  4. Explain how the sample quantile function and the empirical cumulative distribution function are related.

Histograms

  1. Explain the difference between frequency and density histograms and use hist() to plot both.
  2. Set the number of bins for a histogram generated by hist().
  3. Set the bin selection algorithm used by hist().

Kernel Density Estimates

  1. State the form of a kernel density estimate from a data set \(X_{1}, X_{2}, \ldots, X_{n}\).
  2. Draw a rough sketch of a kernel density estimate from a data set.
  3. State the properties that the kernel function used in a kernel density estimate must have.
  4. State the expression for the Gaussian kernel function.
  5. Explain how the bandwidth of the kernel function affects the kernel density estimate.
  6. Set the bandwidth used by density() to a specific value.
  7. Set the bandwidth selection method used by density().