/usr/lib/R/site-library/TH.data/PSGLMM_MEE/simulationStudy/simModel13.R is in r-cran-th.data 1.0-8-1build1.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 | # See 'simModel11.R' for a short explanation
id <- "13"
mod <- paste("simModel", id, sep= "")
library("lme4")
library("mvtnorm")
library("fields")
source("../R/psglmm.R")
source("../R/psglmmSim.R")
source("../R/makeData.R")
source("../R/makeEnvir.R")
nsim= 100
formula= y ~ spp - 1 + (spp - 1 | plot) + (spp - 1 | plot) + (spp - 1 | plot)
VCVtmp= list("phylogenetic"= kron("I_p", "S"), "spatial"= kron("P", "I_s"),
"spatio-phylogenetic"= kron("P", "S"))
gf= c("plot", "plot", "plot")
px= 10
py= 10
s= 4
spp.fe= seq(-2, 2, length.out= s)
rho= seq(0, 0.98, 0.02)
var.spp= 2
var.plot= 2
var.ind= 0
var.error= 0.01
x= FALSE
msel= "DSS"
family= gaussian()
P.lim= 0.1
seeds <- 1:length(rho)
for(i in 1:length(rho)) {
set.seed(seeds[i])
cat(paste("seed:", seeds[i], "\n"))
sims <- psglmmSim(nsim, formula, VCVtmp, px, py, s, spp.fe, rho12= rho[i],
var.spp, var.plot, var.ind, var.error, x, family, gf, msel, envir, P.lim)
save(sims, file= paste("sims/", mod, "_", i, ".Rdata", sep=""))
cat("Data saved\n")
rm(sims)
}
|