I'm a newbie in Matlab seeking to develop my programming skills. I have the following code to compute Systemic Expected Shortfall (SES), as in the paper of Acharya et al. (2010). So, the SES is based on Marginal Expected Shortfall. This code is just for one company, but I have n companies (banks, more precisely) in my sample, everyone having its mes_training_sample, lvg_training_sample, ses_training_sample, mes and lvg. I need a for loop for computing ses for all companies at once, but it's hard at this stage to figure it out. Any info will be useful.
Thanks in advance.
num_firms = length(mes_training_sample); % Regressors X = [ones(num_firms,1) mes_training_sample lvg_training_sample]; % Regress systemic expected shortfall on marginal expected shortfall and % leverage betas = regress(ses_training_sample, X); b = betas(2); c = betas(3); ses = (b*mes_firm + c*lvg_firm)/(b+c);
I'm not sure how your question relates to ThingSpeak.
Since your question is about MATLAB programming, I would encourage you to post your question to the MATLAB Community: https://www.mathworks.com/matlabcentral/answers/
You may also want to look up the MATLAB syntax for loops: https://www.mathworks.com/help/matlab/matlab_prog/loop-control-statements.html
Most Users Ever Online: 114
Currently Online: cstapels
Currently Browsing this Page:
Guest Posters: 1
Administrators: Hans, lee