deltadati.m

来自「计算VaR的」· M 代码 · 共 44 行

M
44
字号
function [dvar] = deltadati(X,RF,RC,rendimento,legame,valuta,lambda,vm,t,p)%DELTADATI	deltavar estimation changing the numbers of data.%%	[dvar] = deltadati(X,RF,RC,rendimento,legame,valuta,lambda,vm,t,p)%   VaR of a portfolio with the delta-normal methods, reducing the%   number of data used to the limit of 150.%	Lambda is the weight in EWMA volatility forecast.%%	All the data must be in columns.%%	See DELTAVAR%%	Copyright (c) 2004 by Flavio Bazzana%   Department of Computer and Management Sciences%   University of Trento%   38100 - Trento ITALY%   flavio.bazzana@economia.unitn.itn = size(X,1);% calculation of mapping factors[DX,DR,cambi,fattori,prezzi] = rendimenti(X,RF,RC,rendimento);[deltav,dev,cor] = semplicecorr(DX,DR,legame);% calculation of VaR reducing the number of datafor i=1:n-150	[DX,DR,cambi,fattori,prezzi] = rendimenti(X(i:n,:),RF(i:n,:),RC(i:n,:),rendimento);	if lambda == 1			[delta,dev,cor] = semplicecorr(DX,DR,legame);		else			[delta,dev,cor,C] = ewmacorr(DX,DR,legame,lambda);	end	[dvar(i),dvarp] = deltavar(deltav,dev,cor,legame,valuta,cambi,vm,t,p);endd=1:n-150;plot(d,dvar,'b')title('Delta-normal VaR')xlabel('Number of days eliminated')ylabel('VaR')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?