Problem 1, IID Normal Returns

We have monthly returns on a portfolio of Canadian assets.

rd = read.csv("http://www.rob-mcculloch.org/data/monthly_returns.csv")
summary(rd)
##        x            
##  Min.   :-0.083569  
##  1st Qu.:-0.019211  
##  Median : 0.009718  
##  Mean   : 0.009704  
##  3rd Qu.: 0.038851  
##  Max.   : 0.111846

Do the histogram and time-series (sequence) plot of the return values.
Do they “look iid normal”?

Let’s go a head and model the data as iid normal,

\[ r_i \sim N(\mu,\sigma^2), \;\; iid \] Let’s assume that we know that \(\sigma = .04\) and seek to estimate the mean \(\mu\).

Let’s use the conjugate (given we know \(\sigma\)) normal prior for the unknown \(\mu\).

\[ \mu \sim N(\bar{\mu},\tau^2). \] Suppose you believe \(\bar{\mu} = .01\) and \(\tau = .1\) represent your prior beliefs.

What is the posterior distribution of \(\mu\). Plot the prior and the posterior together.
Is the data informative about \(\mu\)?

Problem 2, Normal Mean Continued

Now suppose an analyst says they are very bullish on the Canadian returns and believe that \(\mu > .15\).

Use rejection sampling to obtain draws from the posterior in Question 1, truncated to be > .15.

Is the truncated posterior the same as the posterior from the truncated prior \[ p(\mu) \propto p(\mu) \, I(\mu > .15) \] where \(I_A(x)\) is 1 if \(x \in A\) and 0 otherwise.

Problem 3, log normal prior with importance sampling and SIR

Suppose we want to impose the prior prior believe that \(\mu\) is positive by putting all our prior mass on positive \(\mu\).

Let’s use the log normal distribution for our prior.

\[ log(\mu) \sim N(\lambda,w^2) \]

Let’s use \(\lambda = \log(\bar{\mu}) = \log(.01)\) and \(w = 1.3\).

Plot this prior.

Use importance sampling to compute the posterior mean for the non-conjugate log normal prior distribution by reweighting draws from the normal posterior obtained from the conjugate normal prior.

How do the weight look??

Use SIR to obtain approximate IID draw from the posterior and check that the mean is close to the importance sampling result.

What are the importance weights if we use \(w=13\) instead of 1.3 ??

Problem 4, log normal prior with discretization

Discretize \(\mu\) and obtain approximate IID draws from the posterior using the log normal prior.

Check that the mean is not too different form what you got in the previous problem.