Mathematica 5.2 for Linux x86 (64 bit)
Copyright 1988-2005 Wolfram Research, Inc.
 -- Motif graphics initialized -- 

In[1]:= 
In[2]:= 
In[2]:= 
Out[2]= {stdout}

In[3]:= 
In[3]:= frankGenFun[x_] := -Log[(Exp[-alpha*x] - 1)/(Exp[-alpha] - 1)]

In[4]:= frankGenInv[s_] := -1/alpha*Log[1 + Exp[-s]*(Exp[-alpha] - 1)]

In[5]:= claytonGenFun[x_] := x^(-alpha) - 1

In[6]:= claytonGenInv[s_] := (1 + s)^(-1/alpha)

In[7]:= gumbelGenFun[x_] := ( - Log[x] )^alpha

In[8]:= gumbelGenInv[s_] := Exp[-s ^(1 / alpha)]

In[9]:= myD[f_, x_, n_] := Module[{df, i},
    df[0] = f; 
    For[i = 1, i <= n, i++,
      df[i] = Simplify[D[df[i - 1], x]];
      ];
    Table[df[i], {i, 1, n}]
    ]

In[10]:= uu = List[u1, u2, u3, u4, u5, u6, u7, u8, u9, u10]

Out[10]= {u1, u2, u3, u4, u5, u6, u7, u8, u9, u10}

In[11]:= 
In[11]:= mypdf[gfun_, ginv_, n_] := Module[
    {di, df, ss, part1, part2, val},
    di[s_] = Simplify[D[ginv[s], {s, n}]];
    df[u_] = Simplify[D[gfun[u], u]];
    ss = Sum[gfun[uu[[i]]], {i, 1, n}];
    part1 = Simplify[di[ss]];
    part2 = Simplify[Product[df[uu[[i]]], {i, 1, n}]];
    val = Simplify[part1 * part2];
    val
    ]

In[12]:= mycdf[gfun_, ginv_, n_] := Module[
    {ss},
    ss = Sum[gfun[uu[[i]]], {i, 1, n}];
    Simplify[ginv[ss]]
    ]

In[13]:= 
In[13]:= Export["frankCopula.pdf.expr", 
  FortranForm[Table[mypdf[frankGenFun, frankGenInv, i], {i, 1, 6}]], "Table"]

Out[13]= frankCopula.pdf.expr

In[14]:= 
In[14]:= Export["claytonCopula.pdf.expr", 
  FortranForm[
    Table[mypdf[claytonGenFun, claytonGenInv, i], {i, 1, 10}]], "Table"]

Out[14]= claytonCopula.pdf.expr

In[15]:= 
In[15]:= Export["gumbelCopula.pdf.expr", 
  FortranForm[
    Table[mypdf[gumbelGenFun, gumbelGenInv, i], {i, 1, 10}]], "Table"]

Out[15]= gumbelCopula.pdf.expr

In[16]:= 
In[16]:= 
In[16]:= 
827.87user 5.09system 13:53.83elapsed 99%CPU (0avgtext+0avgdata 0maxresident)k
0inputs+0outputs (0major+358223minor)pagefaults 0swaps
