# Get a seed in dimension 2
X <- matrix(rnorm(2), nrow = 2)
X <- generateK(X, N = 1000)
library(ggplot2)
ggplot(as.data.frame(t(X)), aes(x_1,x_2)) + geom_point()
# One can also specify a limit-state function
lsf <- function(X){
sqrt(colSums(X^2)) > 2
}
X <- matrix(c(2, 2), nrow = 2)
X <- generateK(X, N = 1000, lsf = lsf)
ggplot(as.data.frame(t(X)), aes(x_1,x_2)) + geom_point()
Run the code above in your browser using DataLab