Environmental Engineering Reference
In-Depth Information
elseif Index_Copula = = 4
display('The best-fit copula using BIC is No.16 copula');
end
(2) Simulation of copulas and bivariate distribution
% Simulation of copulas and bivariate distribution
% Filename: CopulaSim.m
% © (2013) Dian-Qing Li and Xiao-Song Tang
clc;
format short;
% Read observed cohesions and friction angles stored in XLS-files, data
data = xlsread('data.xls');
% Number of realizations, N
N = 300;
% Type of Copula, Type_Copula
% Options: Gaussian,Plackett,Frank,No.16
Type_Copula = 'No.16';
% Marginal distributions of data, distri
% Options: TruncNormal,Lognormal,TruncGumbel,Weibull
distri(1,1) = {'TruncNormal'}; distri(1,2) = {'TruncNormal'};
% Seeds fixed at 1
randn('state',1);
%
% Rows,columns,mean,standard deviation of data, rows,cols,mu,sigma
[rows cols] = size(data);
mu = mean(data);
sigma = std(data);
%
% Pearson's linear correlation coefficient of data, Pearson_data
Pearson_data = corr(data);
display(Pearson_data);
%
% Kendall's tau of data, Kendall_data
Kendall_data = corr(data,'type','Kendall');
display(Kendall_data);
%
% Estimation of copula parameters
switch Type_Copula
case 'Gaussian'
rho = sin(pi/2*Kendall_data);
display(rho);
case 'Plackett'
theta = theta_estimationPlackett_Kendall(Kendall_data(1,2));
display(theta);
case 'Frank'
theta = copulaparam('Frank',Kendall_data(1,2),'type','Kendall');
display(theta);
case 'No.16'
theta = theta_estimation16_Kendall(Kendall_data(1,2));
display(theta);
end
%
% Simulation of correlated uniformly distributed variables from copulas,
% U
z = randn(N,2);
Search WWH ::




Custom Search