montedati.m

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

M
36
字号
function [mvar] = montedati(DX,DR,valuta,legame,cambi,fattori,prezzi,vm,t,p,rendimento,lambda,modello,l)%MONTEDATI	montevar estimation changing the numbers of data.%%	[mvar] = montedati(DX,DR,valuta,legame,cambi,vm,t,p,rendimento,correlazione,lambda,modello,l) %   calculates Monte Carlo VaR reducing the number of data utilized to the%   minimum value of 150. Lambda is the weight in EWMA volatility forecast.%%	All data must be in columns.%%	See MONTEVAR%%	Copyright (c) 2004 by Flavio Bazzana%   Department of Computer and Management Sciences%   University of Trento%   38100 - Trento ITALY%   flavio.bazzana@economia.unitn.it[delta,dev,cor,C] = semplicecorr(DX,DR,legame);n = size(DX,1)+1;for i=1:n-150	if lambda==1			[deltap,dev,cor,C] = semplicecorr(DX(i:n,:),DR(i:n,:),legame);		else		[deltap,dev,cor,C] = ewmacorr(DX(i:n,:),DR(i:n,:),legame,lambda);	end	mvar(i) = montevar(delta,C,legame,valuta,cambi,fattori,prezzi,vm,t,p,modello,l,rendimento);endd=1:n-150;plot(d,mvar,'b')title('Monte Carlo VaR')xlabel('number of days eliminated')ylabel('VaR')

⌨️ 快捷键说明

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