www.gusucode.com > stats 源码程序 matlab案例代码 > stats/ArchimedeanCopulasExample.m
%% Archimedean Copulas %% Find the rank correlation for a Gaussian or t copula with linear correlation parameter of 0.8 % Copyright 2015 The MathWorks, Inc. tau = copulastat('Gaussian',.8 ,'type','kendall') %% Find the Clayton copula parameter that corresponds to that rank correlation alpha = copulaparam('Clayton',tau,'type','kendall') %% plot a random sample from the Clayton, Frank and Gumbel copulas n = 500; U = copularnd('Clayton',alpha,n); subplot(3,1,1) plot(U(:,1),U(:,2),'.'); title(['Clayton Copula, {\it\alpha} = ',sprintf('%0.2f',alpha)]) xlabel('U1') ylabel('U2') alpha = copulaparam('Frank',tau,'type','kendall'); U = copularnd('Frank',alpha,n); subplot(3,1,2) plot(U(:,1),U(:,2),'.') title(['Frank Copula, {\it\alpha} = ',sprintf('%0.2f',alpha)]) xlabel('U1') ylabel('U2') alpha = copulaparam('Gumbel',tau,'type','kendall'); U = copularnd('Gumbel',alpha,n); subplot(3,1,3) plot(U(:,1),U(:,2),'.') title(['Gumbel Copula, {\it\alpha} = ',sprintf('%0.2f',alpha)]) xlabel('U1') ylabel('U2')