# Compute the realised quantile score.
set.seed(12345)
x <- qnorm(p = 0.7, mean = 0, sd = 1, lower.tail = TRUE, log.p = FALSE)
y <- rnorm(n = 1000, mean = 0, sd = 1)
print(quantile_rs(x = x, y = y, p = 0.7))
print(quantile_rs(x = rep(x = x, times = 1000), y = y, p = 0.7))
print(quantile_rs(x = rep(x = x, times = 1000) - 0.1, y = y, p = 0.7))
Run the code above in your browser using DataLab