Sample from aggregate portfolio distribution versus individual asset distributions
up vote
1
down vote
favorite
Suppose I have three assets $x_1,x_2,x_3$ in a portfolio with weights $W=begin{bmatrix} w_1 \ w_2 \ w_3 end{bmatrix} $, expected returns $R=begin{bmatrix} mu_1 \ mu_2 \ mu_3 end{bmatrix}$, and a covariance matrix $V$.
The expected return of my portfolio is $mu_p=W^TR$ and the variance of my portfolio is $sigma^2_p=W^TVW$.
I would like to run Monte Carlo simulations on my portfolio using a normal distribution.
I can do this either by:
- Sampling from the distribution of portfolio returns $N(mu_p,sigma^2_p)$.
- Sample from the three individual asset returns and use those three returns to compute my overall portfolio return.
First, how would I accomplish the second approach (would I be sampling from a multivariate normal distribution)?
Second, are these two approaches equivalent as long as I assume that the weights $W$ of my portfolio remain the same?
monte-carlo statistics modern-portfolio-theory
add a comment |
up vote
1
down vote
favorite
Suppose I have three assets $x_1,x_2,x_3$ in a portfolio with weights $W=begin{bmatrix} w_1 \ w_2 \ w_3 end{bmatrix} $, expected returns $R=begin{bmatrix} mu_1 \ mu_2 \ mu_3 end{bmatrix}$, and a covariance matrix $V$.
The expected return of my portfolio is $mu_p=W^TR$ and the variance of my portfolio is $sigma^2_p=W^TVW$.
I would like to run Monte Carlo simulations on my portfolio using a normal distribution.
I can do this either by:
- Sampling from the distribution of portfolio returns $N(mu_p,sigma^2_p)$.
- Sample from the three individual asset returns and use those three returns to compute my overall portfolio return.
First, how would I accomplish the second approach (would I be sampling from a multivariate normal distribution)?
Second, are these two approaches equivalent as long as I assume that the weights $W$ of my portfolio remain the same?
monte-carlo statistics modern-portfolio-theory
add a comment |
up vote
1
down vote
favorite
up vote
1
down vote
favorite
Suppose I have three assets $x_1,x_2,x_3$ in a portfolio with weights $W=begin{bmatrix} w_1 \ w_2 \ w_3 end{bmatrix} $, expected returns $R=begin{bmatrix} mu_1 \ mu_2 \ mu_3 end{bmatrix}$, and a covariance matrix $V$.
The expected return of my portfolio is $mu_p=W^TR$ and the variance of my portfolio is $sigma^2_p=W^TVW$.
I would like to run Monte Carlo simulations on my portfolio using a normal distribution.
I can do this either by:
- Sampling from the distribution of portfolio returns $N(mu_p,sigma^2_p)$.
- Sample from the three individual asset returns and use those three returns to compute my overall portfolio return.
First, how would I accomplish the second approach (would I be sampling from a multivariate normal distribution)?
Second, are these two approaches equivalent as long as I assume that the weights $W$ of my portfolio remain the same?
monte-carlo statistics modern-portfolio-theory
Suppose I have three assets $x_1,x_2,x_3$ in a portfolio with weights $W=begin{bmatrix} w_1 \ w_2 \ w_3 end{bmatrix} $, expected returns $R=begin{bmatrix} mu_1 \ mu_2 \ mu_3 end{bmatrix}$, and a covariance matrix $V$.
The expected return of my portfolio is $mu_p=W^TR$ and the variance of my portfolio is $sigma^2_p=W^TVW$.
I would like to run Monte Carlo simulations on my portfolio using a normal distribution.
I can do this either by:
- Sampling from the distribution of portfolio returns $N(mu_p,sigma^2_p)$.
- Sample from the three individual asset returns and use those three returns to compute my overall portfolio return.
First, how would I accomplish the second approach (would I be sampling from a multivariate normal distribution)?
Second, are these two approaches equivalent as long as I assume that the weights $W$ of my portfolio remain the same?
monte-carlo statistics modern-portfolio-theory
monte-carlo statistics modern-portfolio-theory
asked yesterday
cpage
428
428
add a comment |
add a comment |
2 Answers
2
active
oldest
votes
up vote
2
down vote
For the first case, you would directly sample $n$ random normals $x$ and compute:
$$R^p_i = mu_p + sigma_p x_i, i in [1,n]$$
For the second case, you can sample $n$ x $3$ independent normals, compute the Cholesky decomposition matrix $C$ of $V$, which is the matrix $C$ such that $V=C^t C$, and get $n$ samples of vectors $X$ of size 3.
The return $R_i$ for random draw $i$ is given by:
$$R_i = mu_p + C . X_i, i in [1,n]$$
You can check for high values of $n$ the convergence towards the limit values:
$$E(R_i) = R$$
$$Cov(R_i) = V$$
The portfolio return is then computed as:
$$R^p_i = W.T R_i$$
and you can check it converges towards the same mean and variance $mu_p$, $sigma_p^2$ for a large enough $n$.
The two approaches are mathematically equivalent as a linear combination of independent normals is normally distributed. This works so long as the random normal variables generated are iid gaussian normals.
With numpy, iid normals can be generated with np.random.normal. As pointed out below, np.random.multivariate_normal can be used to generate the multivariate gaussian vector.
New contributor
1
How does this compare to using docs.scipy.org/doc/numpy-1.15.1/reference/generated/…?
– cpage
yesterday
good question from @cpage on a 5x5 historical covariance matrix, I get 0.27s for 1e6 samples from np.random.multivariate_normal and 5.3s using np.random.normal with a loop in python. The samples have similar statistics but different values.
– Sebapi
17 hours ago
add a comment |
up vote
0
down vote
Basically what @sebapi said.
"The two approaches are equivalent so long as the random normal variables generated are iid gaussian normals."
Q: How does this compare to using docs.scipy.org/doc/numpy-1.15.1/reference/generated/…?
A: You might use scipy.stats.multivariate_normal (rv = multivariate_normal(mean=None, cov=1, allow_singular=False))
add a comment |
2 Answers
2
active
oldest
votes
2 Answers
2
active
oldest
votes
active
oldest
votes
active
oldest
votes
up vote
2
down vote
For the first case, you would directly sample $n$ random normals $x$ and compute:
$$R^p_i = mu_p + sigma_p x_i, i in [1,n]$$
For the second case, you can sample $n$ x $3$ independent normals, compute the Cholesky decomposition matrix $C$ of $V$, which is the matrix $C$ such that $V=C^t C$, and get $n$ samples of vectors $X$ of size 3.
The return $R_i$ for random draw $i$ is given by:
$$R_i = mu_p + C . X_i, i in [1,n]$$
You can check for high values of $n$ the convergence towards the limit values:
$$E(R_i) = R$$
$$Cov(R_i) = V$$
The portfolio return is then computed as:
$$R^p_i = W.T R_i$$
and you can check it converges towards the same mean and variance $mu_p$, $sigma_p^2$ for a large enough $n$.
The two approaches are mathematically equivalent as a linear combination of independent normals is normally distributed. This works so long as the random normal variables generated are iid gaussian normals.
With numpy, iid normals can be generated with np.random.normal. As pointed out below, np.random.multivariate_normal can be used to generate the multivariate gaussian vector.
New contributor
1
How does this compare to using docs.scipy.org/doc/numpy-1.15.1/reference/generated/…?
– cpage
yesterday
good question from @cpage on a 5x5 historical covariance matrix, I get 0.27s for 1e6 samples from np.random.multivariate_normal and 5.3s using np.random.normal with a loop in python. The samples have similar statistics but different values.
– Sebapi
17 hours ago
add a comment |
up vote
2
down vote
For the first case, you would directly sample $n$ random normals $x$ and compute:
$$R^p_i = mu_p + sigma_p x_i, i in [1,n]$$
For the second case, you can sample $n$ x $3$ independent normals, compute the Cholesky decomposition matrix $C$ of $V$, which is the matrix $C$ such that $V=C^t C$, and get $n$ samples of vectors $X$ of size 3.
The return $R_i$ for random draw $i$ is given by:
$$R_i = mu_p + C . X_i, i in [1,n]$$
You can check for high values of $n$ the convergence towards the limit values:
$$E(R_i) = R$$
$$Cov(R_i) = V$$
The portfolio return is then computed as:
$$R^p_i = W.T R_i$$
and you can check it converges towards the same mean and variance $mu_p$, $sigma_p^2$ for a large enough $n$.
The two approaches are mathematically equivalent as a linear combination of independent normals is normally distributed. This works so long as the random normal variables generated are iid gaussian normals.
With numpy, iid normals can be generated with np.random.normal. As pointed out below, np.random.multivariate_normal can be used to generate the multivariate gaussian vector.
New contributor
1
How does this compare to using docs.scipy.org/doc/numpy-1.15.1/reference/generated/…?
– cpage
yesterday
good question from @cpage on a 5x5 historical covariance matrix, I get 0.27s for 1e6 samples from np.random.multivariate_normal and 5.3s using np.random.normal with a loop in python. The samples have similar statistics but different values.
– Sebapi
17 hours ago
add a comment |
up vote
2
down vote
up vote
2
down vote
For the first case, you would directly sample $n$ random normals $x$ and compute:
$$R^p_i = mu_p + sigma_p x_i, i in [1,n]$$
For the second case, you can sample $n$ x $3$ independent normals, compute the Cholesky decomposition matrix $C$ of $V$, which is the matrix $C$ such that $V=C^t C$, and get $n$ samples of vectors $X$ of size 3.
The return $R_i$ for random draw $i$ is given by:
$$R_i = mu_p + C . X_i, i in [1,n]$$
You can check for high values of $n$ the convergence towards the limit values:
$$E(R_i) = R$$
$$Cov(R_i) = V$$
The portfolio return is then computed as:
$$R^p_i = W.T R_i$$
and you can check it converges towards the same mean and variance $mu_p$, $sigma_p^2$ for a large enough $n$.
The two approaches are mathematically equivalent as a linear combination of independent normals is normally distributed. This works so long as the random normal variables generated are iid gaussian normals.
With numpy, iid normals can be generated with np.random.normal. As pointed out below, np.random.multivariate_normal can be used to generate the multivariate gaussian vector.
New contributor
For the first case, you would directly sample $n$ random normals $x$ and compute:
$$R^p_i = mu_p + sigma_p x_i, i in [1,n]$$
For the second case, you can sample $n$ x $3$ independent normals, compute the Cholesky decomposition matrix $C$ of $V$, which is the matrix $C$ such that $V=C^t C$, and get $n$ samples of vectors $X$ of size 3.
The return $R_i$ for random draw $i$ is given by:
$$R_i = mu_p + C . X_i, i in [1,n]$$
You can check for high values of $n$ the convergence towards the limit values:
$$E(R_i) = R$$
$$Cov(R_i) = V$$
The portfolio return is then computed as:
$$R^p_i = W.T R_i$$
and you can check it converges towards the same mean and variance $mu_p$, $sigma_p^2$ for a large enough $n$.
The two approaches are mathematically equivalent as a linear combination of independent normals is normally distributed. This works so long as the random normal variables generated are iid gaussian normals.
With numpy, iid normals can be generated with np.random.normal. As pointed out below, np.random.multivariate_normal can be used to generate the multivariate gaussian vector.
New contributor
edited 17 hours ago
New contributor
answered yesterday
Sebapi
212
212
New contributor
New contributor
1
How does this compare to using docs.scipy.org/doc/numpy-1.15.1/reference/generated/…?
– cpage
yesterday
good question from @cpage on a 5x5 historical covariance matrix, I get 0.27s for 1e6 samples from np.random.multivariate_normal and 5.3s using np.random.normal with a loop in python. The samples have similar statistics but different values.
– Sebapi
17 hours ago
add a comment |
1
How does this compare to using docs.scipy.org/doc/numpy-1.15.1/reference/generated/…?
– cpage
yesterday
good question from @cpage on a 5x5 historical covariance matrix, I get 0.27s for 1e6 samples from np.random.multivariate_normal and 5.3s using np.random.normal with a loop in python. The samples have similar statistics but different values.
– Sebapi
17 hours ago
1
1
How does this compare to using docs.scipy.org/doc/numpy-1.15.1/reference/generated/…?
– cpage
yesterday
How does this compare to using docs.scipy.org/doc/numpy-1.15.1/reference/generated/…?
– cpage
yesterday
good question from @cpage on a 5x5 historical covariance matrix, I get 0.27s for 1e6 samples from np.random.multivariate_normal and 5.3s using np.random.normal with a loop in python. The samples have similar statistics but different values.
– Sebapi
17 hours ago
good question from @cpage on a 5x5 historical covariance matrix, I get 0.27s for 1e6 samples from np.random.multivariate_normal and 5.3s using np.random.normal with a loop in python. The samples have similar statistics but different values.
– Sebapi
17 hours ago
add a comment |
up vote
0
down vote
Basically what @sebapi said.
"The two approaches are equivalent so long as the random normal variables generated are iid gaussian normals."
Q: How does this compare to using docs.scipy.org/doc/numpy-1.15.1/reference/generated/…?
A: You might use scipy.stats.multivariate_normal (rv = multivariate_normal(mean=None, cov=1, allow_singular=False))
add a comment |
up vote
0
down vote
Basically what @sebapi said.
"The two approaches are equivalent so long as the random normal variables generated are iid gaussian normals."
Q: How does this compare to using docs.scipy.org/doc/numpy-1.15.1/reference/generated/…?
A: You might use scipy.stats.multivariate_normal (rv = multivariate_normal(mean=None, cov=1, allow_singular=False))
add a comment |
up vote
0
down vote
up vote
0
down vote
Basically what @sebapi said.
"The two approaches are equivalent so long as the random normal variables generated are iid gaussian normals."
Q: How does this compare to using docs.scipy.org/doc/numpy-1.15.1/reference/generated/…?
A: You might use scipy.stats.multivariate_normal (rv = multivariate_normal(mean=None, cov=1, allow_singular=False))
Basically what @sebapi said.
"The two approaches are equivalent so long as the random normal variables generated are iid gaussian normals."
Q: How does this compare to using docs.scipy.org/doc/numpy-1.15.1/reference/generated/…?
A: You might use scipy.stats.multivariate_normal (rv = multivariate_normal(mean=None, cov=1, allow_singular=False))
answered yesterday
TomDecimus
514
514
add a comment |
add a comment |
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fquant.stackexchange.com%2fquestions%2f42750%2fsample-from-aggregate-portfolio-distribution-versus-individual-asset-distributio%23new-answer', 'question_page');
}
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function () {
StackExchange.helpers.onClickDraftSave('#login-link');
});
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown