%-—-—--———————---—---——-—---—--——-—-——-—----——-—-———-—--—————--—-—-—--—-——-% Copula 理论及其在 matlab 中的实现程序应用实例%-—————--—-——-——------———-—-—-—------——————-----—--——-————---—--—————--—---%******************************读取数据*************************************% 从文件 hushi
xls 中读取数据hushi = xlsread('hushi
xls’);% 提取矩阵 hushi 的第 5 列数据,即沪市的日收益率数据X = hushi(:,5);% 从文件 shenshi
xls 中读取数据shenshi = xlsread('shenshi
xls’);% 提取矩阵 shenshi 的第 5 列数据,即深市的日收益率数据Y = shenshi(:,5);%****************************绘制频率直方图*********************************% 调用 ecdf 函数和 ecdfhist 函数绘制沪、深两市日收益率的频率直方图[fx, xc] = ecdf(X);figure;ecdfhist(fx, xc, 30);xlabel('沪市日收益率'); % 为 X 轴加标签ylabel(’f(x)'); % 为 Y 轴加标签[fy, yc] = ecdf(Y);figure;ecdfhist(fy, yc, 30);xlabel(’深市日收益率’); % 为 X 轴加标签ylabel('f(y)’); % 为 Y 轴加标