Skip to content

Instantly share code, notes, and snippets.

@zmaril
Created March 27, 2012 15:41
Show Gist options
  • Select an option

  • Save zmaril/2217191 to your computer and use it in GitHub Desktop.

Select an option

Save zmaril/2217191 to your computer and use it in GitHub Desktop.
R code for verifying TCE
eZ <- function(u){x=rnorm(1000000);mean(x[x>u])}
eP <- function(u){dnorm(u)/(1-pnorm(u))}
ep = eP((-400:400)/100)
ez = sapply((-400:400)/100,eZ)
png("qqplot.png")
qqplot(ez,ep)
dev.off()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment