R : Copyright 2003, The R Development Core Team Version 1.6.2 (2003-01-10) R is free software and comes with ABSOLUTELY NO WARRANTY. You are welcome to redistribute it under certain conditions. Type `license()' or `licence()' for distribution details. R is a collaborative project with many contributors. Type `contributors()' for more information. Type `demo()' for some demos, `help()' for on-line help, or `help.start()' for a HTML browser interface to help. Type `q()' to quit R. > invisible(options(echo = TRUE)) > set.seed(100); > nobs <- 250; > sdm <- 1.0; > sde <- 0.3; > > mx1 <- rnorm(n=nobs,mean=0.0,sd=sdm); > mx2 <- (mx1+rnorm(n=nobs,mean=0.0,sd=sdm))/sqrt(2.0); > > ex1 <- rnorm(n=nobs,mean=0.0,sd=sde); > ex2 <- rnorm(n=nobs,mean=0.0,sd=sde); > > bad <- 1.2*(1.0-mx1) + 0.2*(mx2-0.5)^2; > > x1 <- plogis(mx1+ex1); > x2 <- plogis(mx2+ex2); > y <- (bad>2.0); > > FICO <- x1 > Pidx <- x2 > dflt <- y > > mx1 <- rnorm(n=nobs,mean=0.0,sd=sdm); > mx2 <- (mx1+rnorm(n=nobs,mean=0.0,sd=sdm))/sqrt(2.0); > > ex1 <- rnorm(n=nobs,mean=0.0,sd=sde); > ex2 <- rnorm(n=nobs,mean=0.0,sd=sde); > > bad <- 1.2*(1.0-mx1) + 0.2*(mx2-0.5)^2; > > x1 <- plogis(mx1+ex1); > x2 <- plogis(mx2+ex2); > y <- (bad>2.0); > > FICO <- c(FICO,x1) > Pidx <- c(Pidx,x2) > dflt <- c(dflt,y) > > model <- data.frame(cbind(FICO,Pidx,dflt)) > idx <- seq(1,nobs,2) > score <- model[idx,1:2] > > write.table(model,file="model.csv",quote=F,sep=",",row.names=F) > write.table(score,file="score.csv",quote=F,sep=",",row.names=F) > > size <- 40; > > grid <- mat.or.vec((size+1)*(size+1),2); > for (j in 0:size) { + for (i in 0:size) { + ij <- (size+1)*j+i+1 + grid[ij,1] <- i; + grid[ij,2] <- j; + } + } > grid <- grid/(size+1); > > gx1 <- grid[,1]; > gx2 <- grid[,2]; > > FICO <- gx1 > Pidx <- gx2 > > FICO <- c(FICO,gx1) > Pidx <- c(Pidx,gx2) > > grid <- data.frame(cbind(FICO,Pidx)) > > write.table(grid,file="grid.csv",quote=F,sep=",",row.names=F) > > proc.time() [1] 0.37 0.03 0.39 0.00 0.00 >