This vignette lists the case studies included in the package. They all create data sets with \(n=250\) observations and power studies are done with a type I error probability \(\alpha=0.05\). The discrete data cases are the same as for continuous data, with the data binned in 5x5 grids.
To visualize a case study MDgof includes the routine draw_case. Let’s say we want to have a look at the first case study discussed below, called uniform.diagonal.n, for continuous data without parameter estimation in two dimensions:
MDgof::draw_case("uniform.uniform-diagonal-n",
Continuous=TRUE,
WithEstimation=FALSE,
Dim=2)
#> Using 0.3 for alternativeUnder the null hypothesis this is just independent uniform data. If we wish to see better what the data under the alternative is, we can draw that case alone and also use a larger value for the parameter:
MDgof::draw_case("uniform.uniform-diagonal-n",
Continuous=TRUE,
WithEstimation=FALSE,
Dim=2, AltOnly=TRUE,
palt=0.6)In the case studies for 5 dimensional data there are \({{5}\choose{2}}=10\) pairwise plots. To select any two of them use the Dms argument. As an example, let’s say we wish to visualize the second and fourth dimensions of the alternative of the third case study:
These studies are designed in such a way that the marginals are the same under the null and the alternative hypothesis, so that running any 1-D goodness-of-fit tests on the marginals would not detect any differences.
The text in italics is the name of the study.
Null Hypothesis: \(X,Y\sim U[0,1]\), independent
Alternative: a diagonal stripe is added to uniform
Null Hypothesis: \(X,Y\sim U[0,1]\),
independent
Alternative: a diagonal stripe of differing width is added.
Null Hypothesis: \(X,Y\sim N(0,1)\), independent
Alternative: \(X,Y\sim N(0,1)\)\(cor(X,Y)=\sigma\).
Null Hypothesis: \(X,Y\sim t(df=5)\), independent
Alternative: \(X,Y\sim t(df=5)\)\(cor(X,Y)=\sigma\).
Studies 5 - 10: Uniform vs various copulas
Null Hypothesis: \(X,Y\sim U[0,1]\), independent Alternative: a copula.
Frank Copula (uniform.Frank)
Clayton Copula (uniform.Clayton)
Gumbel Copula (uniform.Gumbel)
Galambos Copula (uniform.Galambos)
HuslerReiss Copula (uniform.HuslerReiss)
Joe Copula (uniform.Joe)
11 - 15: Mixtures of two Copulas
Null Hypothesis: 50-50 mixture of two copulas
Alternative: \((\alpha, 1-\alpha)100\) mixture of the same two copulas.
Clayton and Gumbel Copulas (mix.Clayton.Gumbel)
Uniform and Frank Copulas (mix.uniform.Frank)
Clayton and Frank Copulas (mix.Clayton.Frank)
Frank and Gumbel Copulas (mix.Frank.Clayton)
Frank and Joe Copulas (mix.Frank.Joe)
In these case studies one dimensional goodness-of-fit tests on the marginal distributions would also detect differences.
Null Hypothesis: \(X,Y\sim N(0,1)\), independent.
Alternative: \(X\sim N(0,1),Y\sim N(s,1)\), independent.
Null Hypothesis: \(X,Y\sim N(0,1)\), independent.
Alternative: \(X,Y\sim N(s,1)\), independent.
Null Hypothesis: \(X,Y\sim N(0,1)\), independent.
Alternative: \(X\sim N(0,1),Y\sim N(0,s)\), independent.
Null Hypothesis: \(X,Y\sim N(0,1)\), independent.
Alternative: \(X,Y\sim N(0,s)\), independent.
Null Hypothesis: \(X,Y\sim N(0,1)\), independent.
Alternative: \(X\sim N(s,s+1),Y\sim N(0,1)\), independent.
Null Hypothesis: \(X,Y\sim N(0,1)\), independent.
Alternative: \(X,Y\sim N(s,s+1)\), independent.
Null Hypothesis: \(X,Y\sim U(0,1)\), independent.
Alternative: \(X,Y\sim U(0,1)\), rotated.
Null Hypothesis: \(X,Y\sim U[0,1]\), independent.
Alternative: \(X,Y\sim Beta(1,a)\), independent.
Null Hypothesis: \(X,Y\sim U[0,1]\), independent.
Alternative: \(X,Y\sim Beta(a,a)\), independent.
Null Hypothesis: \(X\sim U[0,1], Y|X=x\sim Exp(x+1)\).
Alternative: \(X\sim U[0,1], Y|X=x\sim Exp(a(x+1))\)
Null Hypothesis: \(X\sim Exp(1), Y|X=x\sim Exp(x+1)\).
Alternative: \(X\sim Exp(1), Y|X=x\sim Exp(a(x+1))\).
Null Hypothesis: \(X\sim Beta(2,2), Y|X=x\sim N(x, 1)\).
Alternative: \(X\sim Beta(a,a), Y|X=x\sim N(x,1)\).
Null Hypothesis: \(X\sim Beta(2,2), Y|X=x\sim N(0, x)\).
Alternative: \(X\sim Beta(a,a), Y|X=x\sim N(0, x)\).
Null Hypothesis: \(X\sim Beta(2,2), Y|X=x\sim Beta(x+1, x+1)\).
Alternative: \(X\sim Beta(a,a), Y|X=x\sim Beta(x+1, x+1)\).
Null Hypothesis: \(X\sim Beta(1/2,1/2), Y|X=x\sim N(2x, 1)\).
Alternative: \(X\sim Beta(1/2,1/2), Y|X=x\sim N(2x, s)\).
Null Hypothesis: \(X,Y\sim N(0, 1), cor(X,Y)=s\), s estimated.
Alternative: \(X\sim t(8)\), independent.
32-37: Copulas with parameter estimated, alternative has an added diagonal stripe.
Frank copula (Frank.Frank)
Clayton copula (Clayton.Clayton)
Gumbel copula (Gumbel.Gumbel)
Galambos copula (Galambos.Galambos)
HuslerReiss copula (HuslerReiss.HuslerReiss)
Joe copula (Joe.Joe)
38-42: Mixtures of copulas, with mixture ratio estimated, alternative uses a different parameter for copula.
Uniform and Frank copulas (mix.uniform.Frank)
Clayton and Frank copulas (mix.Clayton.Frank)
Clayton and Clayton (with different parameters) copulas (mix.Clayton.Clayton)
Uniform and Joe copulas (mix.uniform.Joe)
Uniform and Plakett copulas (mix.uniform.Plakett)
43-45: Copulas with the marginal(s) transformed, with the parameter of the transformation estimated.
Clayton copula with y marginal transformed by a normal distribution with variance estimated. (Clayton.marginal.normal-sigma)
Gumbel copula with both marginals transformed by a normal distribution with variance estimated. (Gumbel.marginal.normal-sigma)
Joe copula with both marginals transformed by an exponential distribution with rates estimated. (Joe.marginal.exponential)
47-54: Copulas with marginals transformed by various distributions. Parameter of distribution is estimated.
Clayton copula with marginals transformed by normal distributions with different variances. (Clayton.marginal.normal.marginal)
Joe copula with marginals transformed by exponential distributions with different rates. (Joe.marginal.exponential.marginal)
Plakett copula with marginals transformed by Beta(a,a) distributions. (Plakett.marginal.beta22.marginal)
Frank copula with marginals transformed by double exponential distributions with different rates. (Frank.marginal.dblexp.marginal)
Frank copula with marginals transformed by linear distributions with different slopes. (Frank.marginal.linear.marginal)
Joe copula with marginals transformed by truncated exponential distributions with different rates. (Joe.marginal.truncexp.marginal)
Clayton copula with marginals transformed by Beta(a,1) distribution with different a. (Clayton.marginal.betaa1.marginal)
54-60: Distributions of the form \(X\sim F, Y|X=x\sim G(y|x)\)
\(X\sim Beta(2, 2), Y|X=x\sim N(\mu, x)\)\(\mu\) estimated (beta22.marginal.normal-mean.marginal)
\(X\sim Beta(2, 2), Y|X=x\sim N(x, \sigma)\)\(\sigma\) estimated (beta22.marginal.normal-sd.marginal)
\(X\sim Beta(2, 2), Y|X=x\sim LN(\mu,x)\)\(\sigma\) estimated (beta22.marginal.lognormal-mean.marginal)
\(X\sim Beta(2, 2), Y|X=x\sim LN(x, \sigma)\)\(\sigma\) estimated (beta22.marginal.lognormal-sd.marginal)
\(X\sim Beta(2, 2), Y|X=x\sim Exp((x+1)\lambda)\)\(\lambda\) estimated (beta22.marginal.exponential.marginal)
\(X\sim Exp(1), Y|X=x\sim N(x,\sigma)\)\(\sigma\) estimated (exp1.marginal.normal-sd.marginal)
\(X\sim Beta(1/2, 1/2), Y|X=x\sim \Gamma(x+1,\beta)\)\(\beta\) estimated (beta05.marginal.gamma.marginal)
Null Hypothesis: \(X_1,..,X_5\sim U(0, 1)\).
Alternative: \(X_1,..,X_5\sim N(0,1)\) all with a diagonal stripe added.
Null Hypothesis: \(X_1,..,X_5\sim U(0, 1)\).
Alternative: \(X_1,..,X_5\sim U(0, 1)\), all with a different diagonal stripe added.
Alternative: \(X_1,..,X_5\sim N(0,1), cor(X_i,X_j)=s\) for all i and j.
Null Hypothesis: \(X_1,..,X_5\sim N(0, 1)\).
Alternative: \(X_1,..,X_5\sim N(0,1), cor(X_i,X_j)=s\) for some (not all) i and j.
Null Hypothesis: \(X_1,..,X_5\sim t(df=5)\).
Alternative: \(X_1,..,X_5\sim t(df=5), cor(X_i,X_j)=s\) for all i and j.
66-69: Uniform vs copula
Frank copula (uniform.Frank)
Clayton copula (uniform.Clayton)
Gumbel copula (uniform.Gumbel)
Joe copula (uniform.Joe)
70-75 Mixtures of different copulas, with 50-50 mixture under the null hypothesis and \((\lambda, 1-\lambda)\) mixture under alternative.
Uniform and Clayton (mix.uniform.Clayton)
Clayton and Gumbel (mix.Clayton.Gumbel)
Uniform and Frank (mix.uniform.Frank)
Clayton and Frank (mix.Clayton.Frank)
Frank and Gumbel (mix.Frank.Gumbel)
Frank and Joe (mix.Frank.Joe)
Null Hypothesis: \(X_1,..,X_5\sim N(0, 1)\).
Alternative: \(X_1\sim(\mu, 1), X_2,..,X_5\sim N(0,1)\).
Null Hypothesis: \(X_1,..,X_5\sim N(0, 1)\).
Alternative: \(X_1,..,X_5\sim N(\mu,1)\).
Null Hypothesis: \(X_1,..,X_5\sim N(0, 1)\).
Alternative: \(X_1\sim(0, \sigma), X_2,..,X_5\sim N(0,1)\).
Null Hypothesis: \(X_1,..,X_5\sim N(0, 1)\).
Alternative: \(X_1,..,X_5\sim N(0,\sigma)\).
Null Hypothesis: \(X_1,..,X_5\sim N(0, 1)\).
Alternative: \(X_1\sim(\mu, \sigma), X_2,..,X_5\sim N(0,1)\).
Null Hypothesis: \(X_1,..,X_5\sim N(0, 1)\).
Alternative: \(X_1,..,X_5\sim N(\mu,\sigma)\).
Rotated Uniforms (uniform.rotate.marginal)
Uniform vs Beta (uniform.beta-one.marginal)
Null Hypothesis: \(X_1,..,X_5\sim U(0, 1)\).
Alternative: \(X_1,..,X_5\sim Beta(1,\beta)\).
Null Hypothesis: \(X_1,..,X_5\sim U(0, 1)\).
Alternative: \(X_1,..,X_5\sim Beta(\alpha,\alpha)\).
85-90: In these 6 case studies data is generated in five dimensions from some distribution independently, and then transformed with each dimensions independently.
Base Uniform, all dimensions transformed by normal distributions with different mean and standard deviations (uniform.all-normal.marginal).
Base Beta(2,2), all dimensions transformed by normal distributions with different mean and standard deviations (beta22.all-normal.marginal).
Base Uniform, all dimensions transformed by beta distributions with different parameters (uniform.all-beta.marginal).
Base Uniform, all dimensions transformed by exponential distributions with different rates (uniform.all-exp.marginal)
Base Uniform, all dimensions transformed by gamma distributions with different parameters (uniform.all-gamma.marginal)
Base Uniform, all dimensions transformed by different distributions (normal, gamma and beta) (uniform.different.marginal).
The discrete data cases are the same as the continuous ones with dim=2, and the data is then binned into a 5x5 grid. For example, for the case study for uniform.diagonal.n (#1) a data set might look like this:
tmp=MDgof::case.studies(1, F, F)
x=tmp$rnull()
x
#> [,1] [,2] [,3]
#> [1,] 0.2 0.2 8
#> [2,] 0.4 0.2 11
#> [3,] 0.6 0.2 9
#> [4,] 0.8 0.2 15
#> [5,] 1.0 0.2 16
#> [6,] 0.2 0.4 9
#> [7,] 0.4 0.4 11
#> [8,] 0.6 0.4 20
#> [9,] 0.8 0.4 10
#> [10,] 1.0 0.4 10
#> [11,] 0.2 0.6 11
#> [12,] 0.4 0.6 11
#> [13,] 0.6 0.6 5
#> [14,] 0.8 0.6 2
#> [15,] 1.0 0.6 10
#> [16,] 0.2 0.8 13
#> [17,] 0.4 0.8 7
#> [18,] 0.6 0.8 10
#> [19,] 0.8 0.8 12
#> [20,] 1.0 0.8 13
#> [21,] 0.2 1.0 5
#> [22,] 0.4 1.0 8
#> [23,] 0.6 1.0 7
#> [24,] 0.8 1.0 7
#> [25,] 1.0 1.0 10The bins and their counts are shown here:
plot(x, xlim=c(0,1), ylim=c(0, 1), xlab="x", ylab="y", type="n")
for(i in 0:6) {
segments(i/5,0,i/5,1)
segments(0/5,i/5,1,i/5)
}
for(i in 0:4) {
for(j in 0:4)
text(j/5+1/10, i/5+1/10, x[5*i+j+1,3])
}