# NOT RUN {
x <- rbind(seq(0.000002, 1.0, (1.0 - 0.000002) / 1000),
seq(0.001, 1.0, (1.0 - 0.001) / 1000),
seq(0.0004, 1.0, (1.0 - 0.0004) / 1000))
y <- rbind(seq(0.000002, 1.0, (1.0 - 0.000002) / 15),
seq(0.001, 1.0, (1.0 - 0.001) / 15),
seq(0.0004, 1.0, (1.0 - 0.0004) / 15))
compute_measures(x, y, ndx = 10, deg = 6)
# x_finegrid, coeff, ndx, deg are always there to be used
# The function should have additional unknown arguments (...) if the given parameters are not used
risk_arrow_pratt <- function(x_finegrid, coeff, ndx, deg){
dy_rd <- derivative(x_finegrid, coeff, 1, ndx, deg)
ddy_rd <- derivative(x_finegrid, coeff, 2, ndx, deg)
return (-mean(ddy_rd, na.rm = TRUE) / mean(dy_rd, na.rm = TRUE))
}
measures = c("crainich-eeckhoudt", "denuit-eeckhoudt", risk_arrow_pratt)
compute_measures(x, y, ndx = 10, deg = 6, measures=measures)
# }
Run the code above in your browser using DataLab