Bayesian Learning#
Bayesian Learning#
Exercise 4.1 (Reservation Wage)#
Prove that
Solution
We start by simplifying the left-hand side. Let \(F(w) = w - w_r\), the integration by parts formula implies that
Since \(\left. (w - w_r)H(w) \right|_{w_r}^{\infty}=\int_{w_r}^{\infty} dw\), the expression above is indeed equal to \(\int_{w_r}^{\infty} [1-H(w)] dw\).
Exercise 4.2 (Normal-Normal conjugacy)#
Let \(y\) be a random variable that is drawn from a normal distribution with mean \(\mu\) and standard deviation \(\sigma\).
Consider a dataset \(Y=(y_1,y_2,...,y_n)\) containing \(n\) realizations of \(y\). Write down the likelihood of \(Y\) as a function of \(\mu\) and \(\sigma\)
Assume that \(\mu\) itself is Normally distributed around some mean \(\theta\) with standard deviation \(\tau\). Show that upon observing \(Y\), the posterior belief about \(\mu\) remains normally distributed. Derive the posterior mean and standard deviation of \(\mu\). What do you notice about the standard deviation? Comment your finding.
Solution
The likelihood of \(Y\) can be written as
By Bayes’ rule, we find the posterior distribution of \(\mu\) given the data \(Y\):
Let \(\overline{y} = \frac{1}{n}\sum_{i=1}^{n}y_{i}\), by the Law of Total Variance, we have
Thus the posterior simplifies to:
The exponent can be written as:
From this, we can conclude that the posterior mean \(\mu_{post}\) and the posterior variance \(\sigma^{2}_{post}\) read
Note that the posterior variance is smaller than the prior variance, reflecting the fact that, after observing the data, we have more precise information about \(\mu\).
Exercise 4.3 (Bernouilli)#
Let \(y\) be a random variable that is drawn from a Bernouilli distribution with probability of success \(p\).
Consider a dataset \(Y=(y_1,y_2,...,y_n)\) containing \(n\) realizations of \(y\). Write down the likelihood of \(Y\) as a function of \(p\).
Assume that \(p\) itself is drawn from the following distribution
The variable \(\mu_0\) denotes the prior in period \(0\). Use Bayes rule to express the agent’s posterior \(μ_1(0)\) at the beginning of period \(2\) after having observed a failure in period \(1\), i.e. \(y_1=0\). Iterate the computation to derive the posterior after \(n\) failures in a row.
Solution
The likelihood of \(Y\) reads
By Baye’s rule, we can express \(μ_1(0)\) as:
The posterior after \(n\) failures could be expressed as:
Note that \(μ_n\) can be expressed recursively
Exercise 4.4 (Job Search)#
We consider a labor market where workers are either employed or searching for a job. Time is discrete and agents discount the future at rate \(r\), so that their discount factor \(\beta =1/(1+r).\) When a firm meets a job seeker, it offers her a constant wage contract and the firm-employee relationship lasts forever.
At the end of each period:
(i). Employed workers receive their wages.
(ii). Unemployed workers receive their benefits \(z=-1\) along with a job offer whose wage is sampled from the following distribution
Write down the Bellman equation for an unemployed worker and for a worker employed at wage \(w\). Reinsert the value function \(E(w)\) of employed workers into that of unemployed workers \(U\) to express the latter as a function of \(w\).
Consider the following two job searching strategies. One where the worker accepts all job offers, which we denote by \(U^{A}\); and one where the worker rejects low-wage offers (\(w=0\)), which we denote by \(U^{R}.\) Compute the values of \(U^{A}\) and \(U^{R}.\)
Under which condition on \(p\) is it optimal for workers to reject low-wage offers? Provide an economic intuition for your result. (Hint: Remember that \(z=-1.\))
We now assume that the worker search for only two periods. What is the value function \(U_{2}\) of an unemployed worker in the second and last search period?
Consider now the value of being unemployed in the first search period \(U_{1}\). Again, compare two job searching strategies: one where the worker accepts all job offers (\(U_{1}^{A}\)); and one where the worker rejects low-wage offers (\(U_{1}^{R}\)). Compute the two value functions.
Under which condition is it optimal to reject low-wage offers in the first period? Compare your answer to the solution in 3. Provide an interpretation for your finding.
We now assume that workers are uncertain about the probability \(p\) at which they receive high-wage offers. Their initial belief at the beginning of period 1 is given by
where \(p_{h}>p_{l}.\) Use Bayes’ rule to express the agent’s posterior \(\mu _{2}(0)\) at the beginning of period \(2\) after she has received a low wage-offer. Show that \(\mu _{2}(0)<\mu _{1}.\) In particular, what is the value of \(\mu_{2}(0)\) when \(p_{h}=1?\)
We assume that \(p_{h}=1\). Use Bayes’ rule to compute \(U_{1}^{R}\) and \(U_{1}^{A}\). Under which condition is it optimal to reject a low-wage offer in period 1?
Solution
The Bellman equation for an unemployed worker can be written as:
where \(\overline{w} = 1\) and \(\underline{w} = 0\). Reinserting the value function \(E(w) = \frac{w}{r}\) into \(U\), we find that
The value of the job search srategy that accepts all job offer is given by:
where the equality follows reinserting \(\overline{w}=1\), \(\underline{w}=0\), and \(z=-1\). Similarly, the value of the job search strategy that rejects low-wage offers is given by:
Since the denominator of \(U^R\) is smaller than the denominator of \(U^A\), \(U^R\) is greater than \(UÂ\) whenever their numerators are positive, that is when \(p>r\). Intuitively, the probability of receiving a high-wage offer must be high enough to compensate for the opportunity cost \(r\) of remaining unemployed.
In the second period, if the worker rejects the offer, she will stay unemployed forever and receive \(\frac{z}{r}<0=\frac{\underline{w}}{r}\). Therefore, workers will accept all offers in the second period so that \(U_2 = U^A = \frac{p-r}{(1 +r)r}\).
\(U_1^A\) and \(U_1^R\) can be expressed as:
For \(U_1^R\) to be greater than \(U_1^A\), the value of searching in the second and last period \(U_2>0\) must be positive, which holds true whenever \(p>r\). This is the same condition as in the infinite horizon problem derived in 3.
According to Bayes’ rule, \(\mu _{2}(0)\) can be expressed as:
The condition \(\mu _{2}(0)<\mu _{1}\) is equivalent to \(1/\mu _1<1/\mu _{2}(0)\). The second condition holds true whenever
which holds true by definition. As expected, workers put less weight on the optimistic prior \(p=p_h\) after having received a low-wage offer. In particular, when \(p_h=1\), \(\mu _{2}(0) = 0\) because workers can exclude the belief that they will always receive a high-wage offer.
With \(p_h=1\), \( U_1^A\) and \(U_1^R\) can be expressed as:
where, according to the answer to question 4, \(U_2(0) = U^A(0)=\frac{1}{1+r}(z + \frac{\mu_2(0)}{r} + (1-\mu_2(0))\frac{p_l}{r})\). Since, \(\mu_2(0)=0\) when \(p_h=1\), we have \(U_2(0)=\frac{p_l-r}{(1+r)r}\). Therefore, we find that
The worker find it profitable to reject all low-wage offers in the first period when \(p_l>r\). This condition is similar to the one in the environment without learning except that now the pessimistic belief has replaced the average one.