Conditional volatility estimate for a portfolio

3 次查看(过去 30 天)
Hello,
On MATLAB, I did a PCA analysis on 4 stocks and used an univariate GARCH(1,1) for each PC to create the conditional variance covariance matrix. So now I have multiple 4x4 matrices with the variance/covariance of the stocks for each trading day. And I am now trying to use these matrices to estimate the conditional volatility of an equally weighted portoflio containing those 4 stocks. Do you have an idea on how I can proceed?
Thanks in advance,

回答(1 个)

Akanksha
Akanksha 2025-6-22
Hey Rol ,
To calculate the daily conditional volatility of an equally weighted portfolio using your 4×4 conditional variance-covariance matrices, here’s how you can achieve it:
1.Set the Portfolio Weights - Since the portfolio has 4 stocks and is equally weighted, each stock will get 25%:
w = [0.25; 0.25; 0.25; 0.25];
2. Construct Daily Covariance Matrices - Construct a 3D matrix called Sigma, where each Sigma(:,:,t) is the 4×4 covariance matrix for day t.
3. Calculate Portfolio Volatility for Each Day - Now you can loop through each day and compute the portfolio’s conditional volatility like this:
T = size(Sigma, 3); % Number of trading days
w = ones(4,1) / 4; % Equal weights
portfolio_volatility = zeros(T,1); % Preallocate result
for t = 1:T
Sigma_t = Sigma(:,:,t); % Covariance matrix for day t
portfolio_volatility(t) = sqrt(w' * Sigma_t * w); % Volatility
end
This will give a vector of daily volatilities for your portfolio.
PFA the documentation links along with the subsection to refer for any further queries :
Hope this helps!

类别

Help CenterFile Exchange 中查找有关 Conditional Variance Models 的更多信息

产品


版本

R2021b

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by