Kadarsah

Meteorologi dan Sains Atmosfer

Membuat Kurva ROC,Discrimination Dengan Program R

Posted by kadarsah pada Juli 27, 2009

####  Membandingkan Performance EPS antara  low vs high presipitation di salah satu stasiun di Kanada

### Membaca Data

library(verification)
dat.dir <- “D:/R”
setwd(dat.dir)
DAT <- read.table(“HIsct-pop24-00_024”,fill = TRUE)

A <- DAT[seq(1,nrow(DAT),2), ]
B <- DAT[seq(2,nrow(DAT),2), ]
C <- cbind(A,B)

DAT <- C[, 1:5]

names(DAT) <- c(“obs”, “bom”,”ecmwf”, “ukmo”, “msc” )

### obs on 0,1

DAT <- DAT/100

###Brier score dan komponennya

mod1 <- verify(obs = DAT$obs, pred = DAT$ecmwf)

summary(mod1)
The forecasts are probabilistic, the observations are binary.
Sample baseline calculated from observations.
Brier Score (BS)           =  0.09348
Brier Score – Baseline     =  0.09379
Skill Score                =  0.003228
Reliability                =  0.03627
Resolution                 =  0.03658
Uncertainty              =  0.09379

### Lakukan pada data yang lain dan analisis
### Membuat reliability diagram

plot(mod1, main = names(DAT)[3], CI = TRUE )

fprob

### Membuat discrimination plot

discrimination.plot(DAT$obs, DAT$ecmwf, leg.txt= c(“No”, “Yes”), legend = TRUE, main = names(DAT)[3])

discrimination

### Membuat Kurva ROC:

roc.area(DAT$obs,  DAT$msc) ###atau $ecmwf

### Then, proceed to the roc plot,

roc.plot.default(DAT$obs,  DAT$ecmwf, binormal = TRUE, legend = TRUE, leg.text = “ecmwf”, plot = “both”, CI = TRUE)

roc_curve

Satu Tanggapan to “Membuat Kurva ROC,Discrimination Dengan Program R”

  1. This is very interesting and helpful..ROC Software

Tinggalkan Balasan

Isikan data di bawah atau klik salah satu ikon untuk log in:

Logo WordPress.com

You are commenting using your WordPress.com account. Logout / Ubah )

Gambar Twitter

You are commenting using your Twitter account. Logout / Ubah )

Foto Facebook

You are commenting using your Facebook account. Logout / Ubah )

Foto Google+

You are commenting using your Google+ account. Logout / Ubah )

Connecting to %s

 
%d blogger menyukai ini: