plot_pot.m

来自「极值理论中各种函数及图像的程序。matlab实现。」· M 代码 · 共 101 行

M
101
字号
function c=plot_pot(potres),
%Menu dirven plotting facility for POT fit
%
% USAGE: c=plot_pot(potres)
%
%respot: Structure obtained from a former GPD fit i.e. resgpd=gpd(...)

clf;
rawdata=potres.data;
times=rawdata(:,1);
data=rawdata(:,2);
gaps=diff(times)*potres.intensity;
threshold=potres.threshold;
par_ests=potres.par_ests;
xi=par_ests(1); beta=par_ests(4);
residuals=log(1+(xi*(data-threshold))/beta)/xi;
r=1;
while r~=0, 
clc
r=input('\n\n\n\n\n\n\n\n Enter your choice for plotting !!! \n\n (1) Point Processes of Residuals \n (2) Scatterplot of Gaps \n (3) Qplot of Gaps \n (4) ACF of Gaps \n (5) Scatterplot of Residuals \n (6) Qplot of Residuals \n (7) ACF of Residuals \n (8) Go to GPD plots \n (0) EXIT \n\n              >');
while (r~=1) & (r~=2) & (r~=3) &(r~=4) & (r~=5) & (r~=6) & (r~=7) & (r~=8) & (r~=0),
    r=input('!!!Enter either 0,1,2,3,4,5,6,7,8 >');
end
if r==1,
    plot(times,data,'.');
    xlabel(['Point processes of ' num2str(potres.n_exceed) ' exceedances of threshold ' num2str(threshold)]);
end

if r==2,
   plot(gaps,'.');
   sm=csaps(1:length(gaps),gaps(1:end),0.0005,1:length(gaps));    
   hold on
   plot(1:length(gaps),sm,'k');
   xlabel('Ordering');
   ylabel('Gaps');
   hold off
end

if r==3,
   qplot(gaps,0);
   xlabel('Ordered Data');
   ylabel('Exponential Quantiles');
end

if r==4,
   lags=20;
   acf=xcov(gaps,lags,'coeff');
   acf=acf(lags+2:end);
   u=2/sqrt(length(gaps))
   u=repmat(u,1,lags);
   l=-u;
   t=1:lags;
   bar(t,acf);
   hold on
   plot(t,u,'*',t,l,'*');
   xlabel('Lag');
   ylabel('ACF');
	hold off   
end

if r==5,
   plot(residuals,'.');
   sm=csaps(1:length(residuals),residuals(1:end),0.0005,1:length(residuals));    
   hold on
   plot(1:length(residuals),sm,'k');
   xlabel('Ordering');
   ylabel('Residuals');
	hold off   
end

if r==6,
   qplot(residuals,0);
   xlabel('Ordered Data');
   ylabel('Exponential Quantiles');
end

if r==7,
   lags=20;
   acf=xcov(residuals,lags,'coeff');
   acf=acf(lags+2:end);
   u=2/sqrt(length(residuals));
   u=repmat(u,1,lags);
   l=-u;
   t=1:lags;
   bar(t,acf)
   hold on
   plot(t,u,'*',t,l,'*');
   xlabel('Lag');
   ylabel('ACF');
	hold off   
end

if r==8,
   c=plotgpdpot(potres);
end
end

      
   

⌨️ 快捷键说明

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