R Under development (unstable) (2024-01-07 r85787 ucrt) -- "Unsuffered Consequences" Copyright (C) 2024 The R Foundation for Statistical Computing Platform: x86_64-w64-mingw32/x64 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 and 'citation()' on how to cite R or R packages in publications. Type 'demo()' for some demos, 'help()' for on-line help, or 'help.start()' for an HTML browser interface to help. Type 'q()' to quit R. > # test -- defineMUM() > > library(spup) > library(gstat) > library(sp) > > # test with data from gstat > data(meuse) > # make spatial > coordinates(meuse) = ~x+y > # make separate spatial grid data frames for mean and sd > m1 <- meuse["zinc"] > m1.sd <- m1 > m1.sd[[1]] <- m1.sd[[1]] * rnorm(n = 155, mean = 1, sd = 0.5) > m2 <- meuse["lead"] > m2.sd <- m2 > m2.sd[[1]] <- m2.sd[[1]] * rnorm(n = 155, mean = 1, sd = 0.5) > # define srm and UM and sample > crm1 <- makeCRM(acf0 = 0.6, range = 200, model = "Exp") > crm2 <- makeCRM(acf0 = 0.7, range = 200, model = "Exp") > UM1 <- defineUM(uncertain = TRUE, distribution = "norm", + distr_param = c(m1, m1.sd), crm = crm1, id = "zinc") > UM2 <- defineUM(uncertain = TRUE, distribution = "norm", + distr_param = c(m2, m2.sd), crm = crm2, id = "lead") > cormat <- matrix(c(1,0.7,0.7,1), nrow = 2, ncol = 2) > JointUM <- defineMUM(list(UM1,UM2), cormatrix = cormat) > a <- genSample(UMobject = JointUM, n = 4, "ugs", asList = FALSE) Linear Model of Coregionalization found. Good. [using unconditional Gaussian cosimulation] > spplot(a) > > > > > proc.time() user system elapsed 8.64 0.45 9.07