# Generate simulation data
# \donttest{
n <- 100
q <- 10
d <- q * (q - 1) / 2
xOut <- seq(0.1, 0.9, length.out = 9)
x <- runif(n, min = 0, max = 1)
y <- list()
for (i in 1:n) {
yVec <- rbeta(d, shape1 = sin(pi * x[i]), shape2 = 1 - sin(pi * x[i]))
y[[i]] <- matrix(0, nrow = q, ncol = q)
y[[i]][lower.tri(y[[i]])] <- yVec
y[[i]] <- y[[i]] + t(y[[i]])
diag(y[[i]]) <- 1
}
# Frobenius metric
fit1 <- LocCorReg(x, y, xOut,
optns = list(metric = "frobenius", digits = 2)
)
# Euclidean power metric
fit2 <- LocCorReg(x, y, xOut,
optns = list(
metric = "power", alpha = .5,
kernel = "epan", bw = 0.08
)
)
# }
Run the code above in your browser using DataLab