| Title: | Graph Theoretic Randomness Tests |
|---|---|
| Description: | A collection of functions for testing randomness (or mutual independence) in linear and circular data as proposed in Gehlot and Laha (2025a) <doi:10.48550/arXiv.2506.21157> and Gehlot and Laha (2025b) <doi:10.48550/arXiv.2506.23522>, respectively. |
| Authors: | Shriya Gehlot [aut, cre], Arnab Kumar Laha [aut] |
| Maintainer: | Shriya Gehlot <[email protected]> |
| License: | GPL-3 |
| Version: | 0.1.0 |
| Built: | 2026-06-01 08:02:26 UTC |
| Source: | https://github.com/cran/GTRT |
Computes the theoretical CDF for an RCAG with for a given number of vertices.
cdf.rcag(m)cdf.rcag(m)
m |
Number of observations. |
A vector representing the theoretical CDF of an RCAG with m/2 vertices.
cdf.rcag(1000)cdf.rcag(1000)
Computes the theoretical CDF for RIG with for a given number of vertices.
cdf.rig(m)cdf.rig(m)
m |
Number of observations. |
A vector representing the theoretical CDF of RIG with m/2 vertices.
cdf.rig(1000)cdf.rig(1000)
Computes the degree of each vertex in a Random Circular Graph based on input arcs.
deg.rcag(theta)deg.rcag(theta)
theta |
A numeric vector of length m=2*nv. |
A vector of degrees for each vertex of RCAG obtained using theta.
x <- arima.sim(model = list(ar=0.9), 1000) ## AR(1) model theta <- ((2*atan(x))%%(2*pi))*(180/pi) ##LAR(1) model deg.rcag(theta)x <- arima.sim(model = list(ar=0.9), 1000) ## AR(1) model theta <- ((2*atan(x))%%(2*pi))*(180/pi) ##LAR(1) model deg.rcag(theta)
Computes the degree of each vertex in a Random Interval Graph based on the input intervals.
deg.rig(x)deg.rig(x)
x |
A numeric vector of length m=2*nv. |
A vector of degrees for each vertex of RIG obtained using x.
x <- arima.sim(model = list(ar=0.7), 1000) ## AR(1) model deg.rig(x)x <- arima.sim(model = list(ar=0.7), 1000) ## AR(1) model deg.rig(x)
Calculates the Hellinger distance between two probability distributions.
hellinger.dist(p, q)hellinger.dist(p, q)
p |
A probability vector. |
q |
Another probability vector of same length as p. |
Hellinger distance between p and q.
Computes the proportion of non-intersecting pairs of arcs in the RCAG obtained using data.
nip.rcag(s, t, e1, e2)nip.rcag(s, t, e1, e2)
s |
Start points of arcs. |
t |
End points of arcs. |
e1 |
Vector of indices for the first interval in each pair. |
e2 |
Vector of indices for the second interval in each pair. |
Mean proportion of non-intersecting pairs.
s <- circular::rcircularuniform(10) t <- circular::rcircularuniform(10) e1 <- c(2,10,6,1,5) e2 <- c(4,3,8,7,9) nip.rcag(s,t,e1,e2)s <- circular::rcircularuniform(10) t <- circular::rcircularuniform(10) e1 <- c(2,10,6,1,5) e2 <- c(4,3,8,7,9) nip.rcag(s,t,e1,e2)
Computes the proportion of non-intersecting pairs of interval in the RIG obtained using data.
nip.rig(s, t, e1, e2)nip.rig(s, t, e1, e2)
s |
Start points of intervals. |
t |
End points of intervals. |
e1 |
Vector of indices for the first interval in each pair. |
e2 |
Vector of indices for the second interval in each pair. |
Mean proportion of non-intersecting pairs.
s <- runif(10,0,1) t <- runif(10,0,1) e1 <- c(2,10,6,1,5) e2 <- c(4,3,8,7,9) nip.rig(s,t,e1,e2)s <- runif(10,0,1) t <- runif(10,0,1) e1 <- c(2,10,6,1,5) e2 <- c(4,3,8,7,9) nip.rig(s,t,e1,e2)
Performs the RCAG-DD RIG-DD test of randomness for circular data.
rcagdd.test(theta)rcagdd.test(theta)
theta |
A numeric vector representing endpoints of arcs. |
Vector of test statistics of RCAG-DD Test.
x <- arima.sim(model = list(ar=c(0.6,0.3)), 1000) ## AR(2) model theta <- ((2*atan(x))%%(2*pi))*(180/pi) ##LAR(2) model rcagdd.test(theta)x <- arima.sim(model = list(ar=c(0.6,0.3)), 1000) ## AR(2) model theta <- ((2*atan(x))%%(2*pi))*(180/pi) ##LAR(2) model rcagdd.test(theta)
Performs the RCAG-EP test of randomness for circular data.
rcagep.test(theta, alpha)rcagep.test(theta, alpha)
theta |
A numeric vector. |
alpha |
The level of significance |
Probability of non-intersection of edges, cutoff for RCAG-EP test and adjusted p-values for the RCAG-EP test.
x <- arima.sim(model = list(ar=0.9), 1000) ## AR(1) model theta <- ((2*atan(x))%%(2*pi))*(180/pi) ##LAR(1) model rcagep.test(theta,0.05)x <- arima.sim(model = list(ar=0.9), 1000) ## AR(1) model theta <- ((2*atan(x))%%(2*pi))*(180/pi) ##LAR(1) model rcagep.test(theta,0.05)
Performs the RIG-DD test of randomness.
rigdd.test(x)rigdd.test(x)
x |
A numeric vector corresponding to interval of an RIG. |
Vector of test statistics of RIG-DD Test.
x <- arima.sim(model = list(ar=c(0.7,0.2)), 1000) ## AR(2) model rigdd.test(x)x <- arima.sim(model = list(ar=c(0.7,0.2)), 1000) ## AR(2) model rigdd.test(x)
Performs the RIG-EP test of randomness.
rigep.test(x, alpha)rigep.test(x, alpha)
x |
A numeric vector |
alpha |
The level of significance |
Probability of non-intersection of edges, cutoff for RIG-EP test and adjusted p-values for the RIG-EP test.
x <- arima.sim(model = list(ar=0.9), 1000) ## AR(1) model rigep.test(x,0.05)x <- arima.sim(model = list(ar=0.9), 1000) ## AR(1) model rigep.test(x,0.05)
Calculates a threshold for RCAG-DD test using simulated data.
thrsd.rcagdd(m, n_iter, alpha)thrsd.rcagdd(m, n_iter, alpha)
m |
Number of observations. |
n_iter |
Number of simulations. |
alpha |
Level of significance. |
Threshold value for RCAG-DD test. thrsd.rcagdd(500,1000,0.05)
Calculates a threshold for RIG-DD test using simulated data.
thrsd.rigdd(m, n_iter, alpha)thrsd.rigdd(m, n_iter, alpha)
m |
Number of observations. |
n_iter |
Number of simulation iterations. |
alpha |
Level of significance. |
Threshold value for RIG-DD test.
thrsd.rigdd(250,1000,0.05)thrsd.rigdd(250,1000,0.05)