Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

gofOtherTstat

Various Goodness-of-fit Test Statistics


Description

gofBTstat() computes supposedly Beta distributed test statistics for checking uniformity of u on the unit sphere.

Usage

gofBTstat(u)

Arguments

u

(n,d)-matrix of values whose rows supposedly follow a uniform distribution on the unit sphere in IR^d.

Value

An (n,d-1)-matrix where the (i,k)th entry is

B[ik] = (u[i,1]^2+..+u[i,k]^2) / (u[i,1]^2+..+u[i,d]^2).

References

Li, R.-Z., Fang, K.-T., and Zhu, L.-X. (1997). Some Q-Q probability plots to test spherical and elliptical symmetry. Journal of Computational and Graphical Statistics 6(4), 435–450.

Examples

## generate data on the unit sphere
n <- 360
d <- 5
set.seed(1)
x <- matrix(rnorm(n*d), ncol=d)
U <- x/sqrt(rowSums(x^2))

## compute the test statistics B_k, k in {1,..,d-1}
Bmat <- gofBTstat(U)

## (graphically) check if Bmat[,k] follows a Beta(k/2, (d-k)/2) distribution
qqp <- function(k, Bmat) {
    d <- ncol(Bmat)+1L
    tit <- substitute(plain("Beta")(.A.,.B.)~~ bold("Q-Q Plot"),
                      list(.A. = k/2, .B. = (d-k)/2))
    qqplot2(Bmat[,k], qF=function(p) qbeta(p, shape1=k/2, shape2=(d-k)/2),
            main.args=list(text=tit, side=3, cex=1.3, line=1.1, xpd=NA))
}
qqp(1, Bmat=Bmat) # k=1
qqp(3, Bmat=Bmat) # k=3

copula

Multivariate Dependence with Copulas

v1.0-1
GPL (>= 3) | file LICENCE
Authors
Marius Hofert [aut] (<https://orcid.org/0000-0001-8009-4665>), Ivan Kojadinovic [aut] (<https://orcid.org/0000-0002-2903-1543>), Martin Maechler [aut, cre] (<https://orcid.org/0000-0002-8685-9910>), Jun Yan [aut] (<https://orcid.org/0000-0003-4401-7296>), Johanna G. Nešlehová [ctb] (evTestK(), <https://orcid.org/0000-0001-9634-4796>), Rebecca Morger [ctb] (fitCopula.ml(): code for free mixCopula weight parameters)
Initial release
2020-12-07

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.