Combining the `type`

and `parallel`

options of
`alphaci`

yields a total of \(6\) different asymptotic variance
estimates. In this file we informally verify the computations of these
estimates.

Distribution | Parallel |
---|---|

Normal | Yes |

Normal | No |

Elliptical | Yes |

Elliptical | No |

Arbitrary | Yes |

Arbitrary | No |

In our setup we have \(n = 1,000,000\), which should suffice. We use \(k = 5\) across the board.

```
library("future.apply")
plan(multisession)
<- alphaci:::avar
avar <- alphaci:::avar_std
avar_std set.seed(313)
<- 5
k <- 10 ** 6
n <- function(x) {
print_table <- rbind(
table c("normal" = avar(x, sigma_mat, type = "normal", parallel = FALSE),
"adf" = avar(x, sigma_mat, type = "adf", parallel = FALSE),
"elliptical" = avar(x, sigma_mat, type = "elliptical", parallel = FALSE),
"normal_par" = avar(x, sigma_mat, type = "normal", parallel = TRUE),
"adf_par" = avar(x, sigma_mat, type = "adf", parallel = TRUE),
"elliptical_par" = avar(x, sigma_mat, type = "elliptical", parallel = TRUE)),
c("normal" = avar_std(x, sigma_mat, type = "normal", parallel = FALSE),
"adf" = avar_std(x, sigma_mat, type = "adf", parallel = FALSE),
"elliptical" = avar_std(x, sigma_mat, type = "elliptical", parallel = FALSE),
"normal_par" = avar_std(x, sigma_mat, type = "normal", parallel = TRUE),
"adf_par" = avar_std(x, sigma_mat, type = "adf", parallel = TRUE),
"elliptical_par" = avar_std(x, sigma_mat, type = "elliptical", parallel = TRUE))
)rownames(table) <- c("alpha", "alpha_std")
::kable(round(table, 3))
knitr }
```

First we simulate from a normal model that isnâ€™t parallel. Then the normal model should not be equal to the normal parallel method. Moreover, the adf method should be approximately equal to the normal method, but the adpf paralell model should not be equal to the adf model. The table below confirms these points.

```
<- 1/(5:1)^2
lambda <- 1/(1:5)^2
sigma <- alphaci:::simulate_congeneric(n, k, sigma, lambda)
x <- cov(x)
sigma_mat print_table(x)
```

normal | adf | elliptical | normal_par | adf_par | elliptical_par | |
---|---|---|---|---|---|---|

alpha | 0.666 | 0.665 | 0.665 | 0.865 | 0.019 | 0.865 |

alpha_std | 0.187 | 0.187 | 0.187 | 0.233 | 0.153 | 0.233 |

If the normal parallel model is true, all of the methods should yield approximately the same result. Again, this is the case.

```
<- 1
lambda <- 2
sigma <- alphaci:::simulate_congeneric(n, k, sigma, lambda)
x <- cov(x)
sigma_mat print_table(x)
```

normal | adf | elliptical | normal_par | adf_par | elliptical_par | |
---|---|---|---|---|---|---|

alpha | 0.495 | 0.494 | 0.495 | 0.495 | 0.494 | 0.495 |

alpha_std | 0.495 | 0.494 | 0.495 | 0.495 | 0.494 | 0.495 |

We simulate from an elliptical model, the multivariate Laplace, that is neither parallel nor normal. Then the elliptical model should not be equal to the elliptical parallel method, the normal models should not equal the elliptical models. Moreover, the adf method should be approximately equal to the elliptical method, but the adpf paralell model should not be equal to the adf model. The table below confirms these points.

```
<- 1/(5:1)^2
lambda <- 1/(1:5)^2
sigma <- lambda %*% t(lambda) + diag(sigma)
mat <- LaplacesDemon::rmvl(n, mu = 0, Sigma = mat)
x <- cov(x)
sigma_mat print_table(x)
```

normal | adf | elliptical | normal_par | adf_par | elliptical_par | |
---|---|---|---|---|---|---|

alpha | 0.851 | 1.700 | 1.696 | 1.005 | 0.335 | 2.002 |

alpha_std | 0.611 | 1.219 | 1.218 | 0.679 | 0.983 | 1.352 |

Finally, we check the eliptical parallel model. The adfs and elliptical should be equal, but not equal to the normal. The table below confirms this.

```
<- 1
lambda <- 2
sigma <- rep(1, k) %*% t(rep(1, k)) * lambda^2 + diag(sigma, nrow = k)
mat <- LaplacesDemon::rmvl(n, mu = 0, Sigma = mat)
x <- cov(x)
sigma_mat print_table(x)
```

normal | adf | elliptical | normal_par | adf_par | elliptical_par | |
---|---|---|---|---|---|---|

alpha | 0.205 | 0.405 | 0.408 | 0.205 | 0.405 | 0.408 |

alpha_std | 0.205 | 0.405 | 0.408 | 0.205 | 0.405 | 0.408 |