Given that, the two normally distributed asset returns, R1 and R2 hve the same mean, \(\mu\) and the same variance, \(\sigma^2\), but they are independent.
Given that, \(P(R_1<0.05)=0.2\\ \implies P(\frac{R_1 - \mu}{\sigma} < \frac{0.05 - \mu}{\sigma} ) = 0.2\\ \implies \Phi(\frac{0.05 - \mu}{\sigma}) = 0.2\\ \implies 0.05 = \mu + \tau_{0.2} \sigma\)
Now, here
sigma = qnorm(0.2)
sigma
## [1] -0.8416212
So, the equation becomes, \(0.05 = \mu - 0.842 \sigma \dots (1)\)
If we have \(\mu\) and \(\sigma\) from solution, Then, for \(R = \alpha R_1 + \beta R_2\), the mean is, \[E(R) = E(\alpha R_1 + \beta R_2) = \alpha E(R_1) + \beta E(R_2) = \alpha \mu + \beta \mu = (\alpha + \beta) \mu = \mu\]
as \(\alpha + \beta = 1\).
Similarly, the variance is \(Var(R) = ( {\alpha}^2 + {\beta}^2) {\sigma}^2\)
For the given distribution, \[ f(x_1, x_2) = \begin{cases} a x_1 x_2 & \, x_1, x_2 \in (0,1 )\\ 0 & \, elsewhere \end{cases}\]
So, the value of a is,
library(cubature)
f_x1_x2 = function(x){
x[1]*x[2]
}
a = 1/(adaptIntegrate(f_x1_x2,
lowerLimit = c(0,0), upperLimit = c(1,1))$integral)
a
## [1] 4
Now let us take \(b = 2\) by our choice.
Then, for \(b = 2\), \[P(b\ X_1 + b\ X_2 \leq 1) = \int_{X_1 + X_2 \leq \frac{1}{2}} f(x_1, x_2) dx_1 dx_2 = \int_{X_1 + X_2 \leq \frac{1}{2}} 4 x_1 x_2 dx_1 dx_2 = \int_0^1 4x_1( \int_0^{0.5 - x_1} x_2 dx_2 ) dx_1 \]
So, the probability is,
InnerFunc = function(x) { x }
InnerIntegral = Vectorize(function(y) {
4*y*integrate(InnerFunc, 0,0.5-y)$value})
integrate(InnerIntegral , 0,1)
## 0.08333333 with absolute error < 9.3e-16
So, the \(P(b\ X_1 + b\ X_2 \leq 1) = 0.08333333\).
Now, to calculate \[E(X_1 | X_2 = 1) - E(X_1 | X_2 = 0.5)\],
First note that, \[ E(X_1 | X_2 = a) = \int_0^1 x_1 f(x_1 | x_2 =a) dx_1 \]
and,
\[ f(x_1 =x | x_2 =a) = \frac{f(x_1 = x, x_2 =a)}{f(x_2 =a)} = \frac{4xa}{\int_0^1 (4xa)dx} = \frac{x}{\int_0^1 (x)dx} \]
Which is independent of \(a\), so \(X_1\) and \(X_2\) are independent of each other. So, \(E(X_1 | X_2 = a) = E(X_1)\; \forall X_2 = a\).
So, \[ E(X_1 | X_2 = 1) - E(X_1 | X_2 = 0.5) = 0 \]
Now, let us calculate this in “R” as follows,
For, \(x_2 = 1\),
f = function(x) {
4*x*1
}
condition1 = Vectorize(function(x) {
f(x)/integrate(f,0,1)$value })
E1 = integrate(condition1, 0,1)
E1
## 1 with absolute error < 1.1e-14
For \(x_2 = 0.5\),
f = function(x) {
4*x*0.5
}
condition1 = Vectorize(function(x) {
f(x)/integrate(f,0,1)$value })
E2 = integrate(condition1, 0,1)
E2
## 1 with absolute error < 1.1e-14
So, \(E(X_1 | X_2 = 1) - E(X_1 | X_2 = 0.5)\) is,
E1$value - E2$value
## [1] 0