Part 1

In class, we analyzed the “climate change data edited.csv” data set assuming the following model:

\[p(\mu,\sigma^2|...)\propto [\prod_i N(x_i|\mu,\sigma^2)]\times N(\mu|m_0,v_0^2)\times Gamma(\frac{1}{\sigma^2}|a,b)\] Notice that we assumed that all observations have the same variability (given by \(\sigma^2\)). In this exercise, the goal is to create a Gibbs sampler to estimate \(\mu\) and \(\sigma^2\). Here are the steps to estimate these two parameters:

  1. Determine what would be reasonable values for the prior parameters: \(m_0\), \(v^2_0\), \(a\), and \(b\).
  2. Determine the FCD’s for \(\mu\) and \(\sigma^2\). This has already been done for you and these FCD’s are described here.
  3. Create a function in R to sample \(\mu\) from its FCD.
  4. Create a function in R to sample \(\sigma^2\) from its FCD.
  5. Using the functions in (3) and (4), develop your Gibbs sampler and fit the model.
  6. What can you conclude regarding climate change based on your results?

Part 2

How can we take into account the fact that we have different levels of uncertainty associated with each climate change proxy? In this problem, we will assume that the column “sdev” indicates how much more variable one proxy is in relation to other proxies. What would be a reasonable model under this assumption?

For this assignment, we will create a model that takes into account the information from the column “sdev”. More specifically, I will represent \(sdev^2\) for the i-th observation in my model as \(\sigma_i^2\). My new model is given by:

\[p(\mu,\tau^2|...)\propto [\prod_i N(x_i|\mu,\sigma^2_i\tau^2)]\times N(\mu|m_0,v_0^2)Gamma(\frac{1}{\tau^2}|a,b)\]

To develop a Gibbs sampler for this model, I will need to derive the FCD’s for each parameter. Here they are:

  • FCD for \(\mu\):

\[p(\mu|...)\propto [\prod_i N(x_i|\mu,\sigma^2_i\tau^2)]\times N(\mu|m_0,v_0^2)= N(m_1,v_1^2)\] where \[v_1^2 = [\frac{1}{\tau^2} (\sum_i \frac{1}{\sigma^2_i}) + \frac{1}{v_0^2}]^{-1}\] \[m_1=v_1^2(\frac{m_0}{v_0^2}+\frac{1}{\tau^2} \sum_i \frac{x_i}{\sigma^2_i})\]

  • FCD for \(\frac{1}{\tau^2}\):

\[p(\frac{1}{\tau^2}|...)\propto [\prod_i N(x_i|\mu,\sigma^2_i\tau^2)]\times Gamma(\frac{1}{\tau^2}|a,b)\] \[=Gamma(\frac{n}{2}+a,b+\sum_i \frac{(x_i-\mu)^2}{2\sigma^2_i})\]

I would like you to:

  1. Develop your Gibbs sampler for this model and fit the model.
  2. What can you conclude regarding climate change based on your results?
  3. How do the results from part 1 differ from those in part 2?

Back to main menu

Comments?

Send me an email at