资源描述:
《金融MATLAB实验报告三.doc》由会员上传分享,免费在线阅读,更多相关内容在教育资源-天天文库。
1、安徽财经大学金融证券实验室实验报告实验课程名称《金融MATLAB》开课系部 金融学院班级学号姓名指导教师2015年**月**日实验名称MATLAB金融数量分析学院学号姓名实验准备实验目的Ø学会使用MATLAB金融工具箱进行金融数量分析,如:期权定价分析、投资组合绩效分析、收益和风险的计算、有效前沿的计算、固定收益证券的久期和凸度计算、利率的期限结构、技术指标计算等。实验设计方案使用MATLAB金融工具箱对下述6个主题进行数量分析,数据来源自行在网上搜寻,要求是2014年之后的数据。(可参照各章的例题)1.期权定价分析(第10章)2.收益、风险和有效前沿的计算(第12章)3.投资组合绩效分
2、析(第13章)4.固定收益证券的久期和凸度计算(第17章)5.利率的期限结构(第18章)6.技术指标分析(第22章)本实验报告不指定具体的题目,请大家自行设定,同学相互之间不要出现雷同。实验分析过程一、收益、风险和有效前沿的计算从Wind咨询金融终端分别下载三只股票(美好集团、石油化服和首开股份)从2013年年初至今的日收盘价价格,经过相关处理得出三只股票的收益率均值、标准差以及协方差矩阵等数据,如下表。现根据表格数据进行关于收益、风险和有效前沿计算。1.收益率和风险计算函数例1.假设等权重配置美好集团、石油化服、首开股份,计算资产组合的风险和收益。解:>>>ExpReturn=[0.0
3、018,0.0016,0.0006];ExpCovariiance=[0.0010,0.0004,0.0005;0.0004,0.0017,0.0003;0.0005,0.0003,0.0013];PortWts=1/3*ones(1,3);[PortRisk,PortReturn]=portstats(ExpReturn,ExpCovariance,PortWts)PortRisk=0.0170PortReturn=0.00132.有效前沿计算函数例2.(1)怎样配置美好集团、石油化服和首开股份,则资产组合为最优组合?解:>>ExpReturn=[0.0018,0.0016,0.000
4、6];>>ExpCovariiance=[0.0010,0.0004,0.0005;0.0004,0.0017,0.0003;0.0005,0.0003,0.0013];>>NumPorts=10;>>[PortRisk,PortReturn,PortWts]=frontcon(ExpReturn,ExpCovariance,NumPorts)PortRisk=0.01370.01390.01440.01510.01580.01660.01750.01840.01940.0229PortReturn=0.00060.00080.00090.00100.00120.00130.00140.
5、00150.00170.0018PortWts=00.04390.956100.17240.82760.02750.26780.70470.10320.30540.59140.17890.34300.47810.25460.38060.36470.33030.41830.25140.40600.45590.13810.48170.49350.02481.000000画图:frontcon(ExpReturn,ExpCovariance,NumPorts)(2)例2中如果各个资产投资上限为50%,求解有效前沿?>>ExpReturn=[0.0018,0.0016,0.0006];ExpCo
6、variiance=[0.0010,0.0004,0.0005;0.0004,0.0017,0.0003;0.0005,0.0003,0.0013];NumPorts=10;AssetBounds=[0,0,0;0.5,0.5,0.5];[PortRisk,PortReturn,PortWts]=frontcon(ExpReturn,ExpCovariance,NumPorts,[],AssetBounds)PortRisk=0.01560.01600.01640.01680.01730.01770.01820.01870.01920.0197PortReturn=0.00110.001
7、20.00130.00130.00140.00140.00150.00160.00160.0017PortWts=0.11960.38040.50000.19670.35190.45140.23440.37060.39490.27220.38940.33850.30990.40810.28200.34760.42680.22560.38530.44560.16910.42300.46430.11260.46080.48310.056