File: unscaleDesign.R

package info (click to toggle)
r-cran-dicedesign 1.10-1
  • links: PTS, VCS
  • area: main
  • in suites: sid, trixie
  • size: 516 kB
  • sloc: ansic: 237; makefile: 2
file content (10 lines) | stat: -rw-r--r-- 490 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10

unscaleDesign <- function(design, min=NULL, max=NULL, uniformize=FALSE, InitialDesign=NULL){
  d <- dim(design)[[2]] ; n <- dim(design)[[1]]
  
  if (uniformize & !is.null(InitialDesign)){ # Inverse Rosenblatt transformation from U[0,1]^d
    for (i in 1:d) x[,i] <- quantile(InitialDesign[,i],design[,i])
  }else x <- design * matrix((max - min), ncol=d,nrow=n, byrow=T) + matrix(min, ncol=d, nrow=n,byrow=T)
  
  return(list(design = x, min = min, max = max, uniformize = uniformize))
}