Let X,Y,Z be random variables from F1,F2,F3 cdf,respectively. I want to write the manuel code for the ROC surface plot. How can I do it? By using R studio or Python. Thank you for your helps.
x<-rW(100,7,2)
y<-rW(100,9,4)
z<-rW(100,18,8)
n <- 50
x <- seq(0, 1, length.out = n)
y <- seq(0, 1, length.out = n)
z <- outer(x, y, function(x, y) ifelse(x <= y, x, y))
# Multiplying z values to increase the surface volume
z <- z * 2 # For example, we multiply z values by 2
# Create a 3D surface graph
plot_ly(x = x, y = y, z = z, type = "surface") %>%
layout(scene = list(
xaxis = list(title = "False Positive Rate (FPR)", range = c(0, 1)),
yaxis = list(title = "True Positive Rate (TPR)", range = c(0, 1)),
zaxis = list(title = "Threshold")
))
I tried this code. But, I don,t like it. I need to VUS value on plot and each axes must be between 0 and 1. Let see "Statistics in Medicine - 2004 - Nakas - Ordered multiple‐class ROC analysis with continuous measurements" article. I need to plot like in Figure 2 or something like that.
To create a ROC surface similar to the one you described, you can use libraries such as
MatplotlibandNumPyYou can adjust the sample data generation and threshold parameters however you want.