STA 250 :: Advanced Statistical Computing (UCD, Fall 2013)

Code + goodies used in Prof. Baines' STA 250 Course (UC Davis, Fall 2013)


Project maintained by STA250 Hosted on GitHub Pages — Theme by mattgraham

STA 250 :: Practice Questions

NOTE: These are practice questions, they are not due in class, and there is no credit for completing the questions (other than your own sense of satisfaction). These questions are intended to be slightly easier than the homework questions, to allow you to get started on the topics at a comfortable pace.


Boot Camp

The Bootstrap:

  1. Let \(x_{ij}\sim{}N(0,1)\) for \(i=1,\ldots,n\) and \(j=1,2\), and \(x_{i0}=1\) for \(i=1,\ldots,n\). Define \(x_{ij}^{T}=(x_{i0},x_{i1},x_{i2})^{T}\) and \(\beta=(1.2,0.3,-0.9)^{T}\) and let \(\epsilon_{i}\sim{}N(0,1)\) for \(i=1,\ldots,n\).

    Simulate from the linear regression model:

    \[ y_{i} = x_{i}^{T}\beta + \epsilon_{i} , \quad i=1,\ldots,n , \]

    with n=100. Use the bootstrap procedure to estimate \(\textrm{SD}(\hat{\beta})\) based on \(B=1000\) bootstrap resamples. Compare to the asymptotic results reported by lm or computed using the square root of the diagonal elements of \(\hat{\sigma^{2}}(X^{T}X)^{-1}\).

Bayesian Statistics Module

The Basics:

  1. Let \(Y_{i}|\lambda\sim\textrm{Pois}(\lambda)\) for \(i=1,\ldots,n\), with the \(Y_{i}\) being independent.

    a. Derive the Jeffreys prior for \(\lambda\).

    b. Is the Jeffreys prior a proper prior?

    c. Find the family of conjugate priors for \(\lambda\).

    d. Derive the posterior distribution for \(\lambda\) under both the Jeffreys and conjugate prior.

    e. Does the Jeffreys prior lead to a proper posterior distribution for \(\lambda\)?

    f. Let \(n=20\) and \(\sum_{i=1}^{n}y_{i}=97\). Provide a central \(95\%\) credible interval for \(\lambda\).

  2. Let \(Y_{i}|\mu,\sigma^{2}\sim\textrm{N}(\mu,\sigma^{2})\) for \(i=1,\ldots,n\), with the \(Y_{i}\) being independent. Let \(\theta=(\mu,\sigma^{2})\).

    a. Derive the (joint) Jeffreys prior for \(\theta\).

    b. Is the Jeffreys prior a proper prior?

    c. Find the family of conjugate priors for \(\theta\).

    d. Derive the posterior distribution for \(\theta\) under both the Jeffreys and conjugate prior.

    e. Does the Jeffreys prior lead to a proper posterior distribution for \(\theta\)?

    f. What is the conditional posterior distribution \(\mu|\sigma^{2},y\)?

    g. What is the conditional posterior distribution \(\sigma^{2}|\mu,y\)?

    h. Are you able to derive the marginal posterior distribution for \(\mu\) i.e., \(p(\mu|y)\)?

(: Happy Coding! :)