set.seed(1)
# IID samples
x <- rnorm(50)
symmetry_test(x, "MOI", bootstrap = FALSE, k = 3, mu = 0)
symmetry_test(x, "MOI", bootstrap = TRUE, k = 3, mu = 0)
symmetry_test(x, "MOI", bootstrap = TRUE, k = 3)
x <- rsl(50, alpha = 1.5)
symmetry_test(x, "MOI", bootstrap = FALSE, k = 3, mu = 0)
symmetry_test(x, "MOI", bootstrap = TRUE, k = 3, mu = 0)
symmetry_test(x, "MOI", bootstrap = TRUE, k = 3)
# Linear models
lin_model <- lm(dist ~ speed, cars)
symmetry_test(lin_model, "B1")
# Garch models
library(fGarch)
specskew19 = fGarch::garchSpec(model = list(omega = 0.1,
alpha = 0.3,
beta = 0.3,
skew = 1.9),
cond.dist = "snorm")
x <- fGarch::garchSim(specskew19, n = 500)
g <- fGarch::garchFit(~garch(1,1), x, cond.dist = "QMLE",
include.mean = FALSE, trace = FALSE)
symmetry_test(g, "FM", B=400, burn = 100) # slower
symmetry_test(g, "FM", B=400, burn = 100, approximate = TRUE)
Run the code above in your browser using DataLab