Code covered by the BSD License
-
[p mlv]=cmlstat(family,x)
CMLSTAT Estimates copula parameter(s), given sample X.
-
bernsteincop(x,g)
BERNSTEINCOP Bernstrein Empirical copula based on sample X.
-
claytoncml(alpha,u,v)
FRANKCML Maximum Likelihood Function for Clayton copula.
-
copulaparam(type,tau)
COPULAPARAM Copula parameter, given Kendall's rank correlation.
-
corrtest(R)
CORRTEST tests if R is correlation matrix.
-
debye1(x)
DEBYE1 First order Debye function.
-
ecopula(x)
ECOPULA Empirical copula based on sample X.
-
frankcml(alpha,u,v)
FRANKCML Maximum Likelihood Function for Frank copula.
-
gausscml(alpha,u,v)
GAUSSCML Maximum Likelihood Function for Gauss copula.
-
gumbelcml(alpha,u,v)
FRANKCML Maximum Likelihood Function for Gumbel copula.
-
kfun(family,x,alpha)
KFUN Goodness-of-fit test for Archimedean copulas.
-
mvcoprnd(family,theta,m,n,nu)
MVCOPRND Random numbers from multivariate copula.
-
tcml(theta,u,v)
TCML Maximum Likelihood Function for t copula.
-
View all files
from
Copula generation and estimation
by Robert Kopocinski
Copula functions written for Master Thesis.
|
| bernsteincop(x,g)
|
function b = bernsteincop(x,g)
%BERNSTEINCOP Bernstrein Empirical copula based on sample X.
% B = BERNSTEINCOP(X,G) returns bivariate bernstein empirical copula
% for GxG points grid. Extension to n dimensional bernstein empirical
% copula is straightforward.
%
% Written by Robert Kopocinski, Wroclaw University of Technology,
% for Master Thesis: "Simulating dependent random variables using copulas.
% Applications to Finance and Insurance".
% Date: 2007/05/12
%
% Reference:
% [1] Durrleman, V. and Nikeghbali, A. and Roncalli, T. (2000) Copulas approximation and
% new families, Groupe de Recherche Operationnelle Credit Lyonnais
c = ecopula(x);
[m n] = size(c);
b=zeros(g);
for i=1:g
for j=1:g
b(i,j)=sum(sum( bernstein(i/g,1:m,m)'*(bernstein(j/g,1:m,m)).*c ));
end
end
%------------------------------------------------------------
function y = bernstein(u,i,n)
% BERNSTEIN calculates values of Bernstein polynomials.
y = factorial(n)./factorial(i)./factorial(n-i).*u.^i.*(1-u).^(n-i);
|
|
Contact us at files@mathworks.com