# absdpsiMC: Absolute Value of Generator Derivatives via Monte Carlo In copula: Multivariate Dependence with Copulas

## Description

Computes the absolute values of the dth generator derivative psi^{(d)} via Monte Carlo simulation.

## Usage

 ```1 2 3``` ```absdPsiMC(t, family, theta, degree = 1, n.MC, method = c("log", "direct", "pois.direct", "pois"), log = FALSE, is.log.t = FALSE) ```

## Arguments

 `t` `numeric` vector of evaluation points. `family` Archimedean family (name or object). `theta` parameter value. `degree` order d of the derivative. `n.MC` Monte Carlo sample size. `method` different methods: `"log"`:evaluates the logarithm of the sum involved in the Monte Carlo approximation in a numerically stable way; `"direct"`:directly evaluates the sum; `"pois.direct"`:interprets the sum in terms of the density of a Poisson distribution and evaluates this density directly; `"pois"`:as for `method="pois"` but evaluates the logarithm of the Poisson density in a numerically stable way. `log` if TRUE the logarithm of absdPsi is returned. `is.log.t` if TRUE the argument `t` contains the logarithm of the “mathematical” t, i.e., conceptually, `psi(t, *) == psi(log(t), *, is.log.t=TRUE)`, where the latter may potentially be numerically accurate, e.g., for t = 10^{500}, where as the former would just return psi(Inf, *) = 0.

## Details

The absolute value of the dth derivative of the Laplace-Stieltjes transform psi=LS[F] can be approximated via

(-1)^d psi^{(d)}(t) = int_0^Inf x^d exp(-tx) dF(x) ~= (1/N) sum(k=1..N)V_k^d exp(-V_k t), t > 0,

where V_k ~ F, k in {1,...,N}. This approximation is used where d=`degree` and N=`n.MC`. Note that this is comparably fast even if `t` contains many evaluation points, since the random variates V_k ~ F, k in {1,...,N} only have to be generated once, not depending on `t`.

## Value

`numeric` vector of the same length as `t` containing the absolute values of the generator derivatives.

## References

Hofert, M., M<c3><a4>chler, M., and McNeil, A. J. (2013). Archimedean Copulas in High Dimensions: Estimators and Numerical Challenges Motivated by Financial Applications. Journal de la Soci<c3><a9>t<c3><a9> Fran<c3><a7>aise de Statistique 154(1), 25–63.

`acopula-families`.

## Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13 14``` ```t <- c(0:100,Inf) set.seed(1) (ps <- absdPsiMC(t, family="Gumbel", theta=2, degree=10, n.MC=10000, log=TRUE)) ## Note: The absolute value of the derivative at 0 should be Inf for ## Gumbel, however, it is always finite for the Monte Carlo approximation set.seed(1) ps2 <- absdPsiMC(log(t), family="Gumbel", theta=2, degree=10, n.MC=10000, log=TRUE, is.log.t = TRUE) stopifnot(all.equal(ps[-1], ps2[-1], tolerance=1e-14)) ## Now is there an advantage of using "is.log.t" ? sapply(eval(formals(absdPsiMC)\$method), function(MM) absdPsiMC(780, family="Gumbel", method = MM, theta=2, degree=10, n.MC=10000, log=TRUE, is.log.t = TRUE)) ## not really better, yet... ```

### Example output

```  [1] 188.3079628  10.4191237   3.7746908  -0.1262891  -2.9031914  -5.0525167
[7]  -6.8066541  -8.2909968  -9.5805917 -10.7225566 -11.7480764 -12.6791493
[13] -13.5320726 -14.3192715 -15.0503945 -15.7330612 -16.3733990 -16.9764259
[19] -17.5463206 -18.0866122 -18.6003145 -19.0900230 -19.5579867 -20.0061634
[25] -20.4362640 -20.8497874 -21.2480515 -21.6322189 -22.0033191 -22.3622678
[31] -22.7098839 -23.0469035 -23.3739920 -23.6917539 -24.0007416 -24.3014616
[37] -24.5943805 -24.8799295 -25.1585075 -25.4304848 -25.6962054 -25.9559889
[43] -26.2101325 -26.4589128 -26.7025867 -26.9413935 -27.1755553 -27.4052791
[49] -27.6307569 -27.8521675 -28.0696773 -28.2834411 -28.4936030 -28.7002975
[55] -28.9036500 -29.1037776 -29.3007900 -29.4947899 -29.6858736 -29.8741319
[61] -30.0596500 -30.2425087 -30.4227840 -30.6005483 -30.7758701 -30.9488149
[67] -31.1194448 -31.2878194 -31.4539958 -31.6180288 -31.7799710 -31.9398732
[73] -32.0977842 -32.2537514 -32.4078207 -32.5600364 -32.7104417 -32.8590786
[79] -33.0059877 -33.1512088 -33.2947806 -33.4367408 -33.5771264 -33.7159732
[85] -33.8533164 -33.9891904 -34.1236287 -34.2566640 -34.3883286 -34.5186536
[91] -34.6476698 -34.7754070 -34.9018946 -35.0271610 -35.1512343 -35.2741416
[97] -35.3959096 -35.5165642 -35.6361308 -35.7546339 -35.8720977        -Inf
log      direct pois.direct        pois
-Inf        -Inf        -Inf        -Inf
```

copula documentation built on Sept. 2, 2017, 1:05 a.m.