plotgpdpot.m
来自「极值理论中各种函数及图像的程序。matlab实现。」· M 代码 · 共 62 行
M
62 行
function c=plotgpdpot(resgpd),
data=resgpd.data(:,2);
threshold=resgpd.threshold;
xi=resgpd.par_ests(1);
beta=resgpd.par_ests(4);
r=1;
while r~=0,
clc
r=input('\n\n\n\n\n\n\n\n Enter your choice for plotting !!! \n\n Enter (1) for excess distribution \n Enter (2) for tail of underlying distrbution \n Enter (3) for scatterplot of residuals \n Enter (4) for QQ plot of residuals \n Enter (0) to exit \n >');
while (r~=1) & (r~=2) &(r~=3) & (r~=4) & (r~=0),
r=input('!!!Enter either 0,1,2,3,4 >');
end
if r>=3,
excess=data-threshold;
res=log(1+(xi*excess)/beta)/xi;
end
if r==3,
plot(res,'.')
out=res;
sm=csaps(1:length(res),res(1:end),0.0005,1:length(res));
hold on
plot(1:length(res),sm,'k');
xlabel('Ordering');
ylabel('Residuals')
hold off
end
if r==4
out=qplot(res,0);
end
if (r==1)|(r==2),
x=qgpd(linspace(0,1,1000),xi,threshold,beta);
ypoints=ppoints(sort(data));
y=pgpd(x,xi,threshold,beta);
if r==1,
semilogx(sort(data),ypoints,'.');
out=[sort(data) ypoints'];
hold on
plot(x,y,'k');
xlabel('x (on log scale)');
ylabel('Fu(x-u)');
hold off
end
if r==2,
prob = resgpd.p_less_thresh;
ypoints = (1 - prob) * (1 - ypoints);
y = (1 - prob) * (1 - y);
loglog(sort(data),ypoints,'.');
hold on
plot(x,y,'k');
xlabel('x (on log scale)');
ylabel('1-F(x) (on log scale)');
hold off
out=[sort(data) ypoints'];
end
end
end
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?