## Simple definition of the function:
pobs
## Draw from a multivariate normal distribution
d <- 10
set.seed(1)
P <- Matrix::nearPD(matrix(pmin(pmax(runif(d*d), 0.3), 0.99), ncol=d))$mat
diag(P) <- rep(1, d)
n <- 500
x <- MASS::mvrnorm(n, mu = rep(0, d), Sigma = P)
## Compute pseudo-observations (should roughly follow a Gauss
## copula with correlation matrix P)
u <- pobs(x)
plot(u[,5],u[,10], xlab=expression(italic(U)[1]), ylab=expression(italic(U)[2]))
## All components: pairwise plot
pairs(u, gap=0, pch=".", labels=as.expression( sapply(1:d, function(j) bquote(italic(U[.(j)]))) ))
Run the code above in your browser using DataLab