Description Usage Arguments Value Author(s) Examples
Simulate data from the prior/likelihood model assumed in SPASIBA
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 | SPASIBA.sim(
ploidy = 2,
n.loc = 10,
n.quant = 0,
sphere = FALSE,
size.pop.ref,
coloc.ref = FALSE,
n.unknown,
nx.grid,
ny.grid,
win,
kappa.geno = NULL,
nu.geno = 1,
sigma2.geno = NULL,
kappa.quant = NULL,
nu.quant = 1,
sigma2.gf.quant = NULL,
marginal.quant = "lnorm",
tau.noise.quant = NULL,
store.gf = FALSE,
obsolete = FALSE
)
|
ploidy |
1 or 2 |
n.loc |
integer nuber of loci |
n.quant |
number of quantitative covariates |
size.pop.ref |
Matrix with one row per population and one column per locus giving haploid population sample size |
coloc.ref |
TRUE / FALSE indicating whether colocated samples are allowed |
n.unknown |
Number of individuls with unknown spatial coordinates |
nx.grid |
Number of pixels horizontally |
ny.grid |
Number of pixels vertically |
win |
c(x.min,x.max,y.min,y.max) |
kappa.geno |
spatial scale parameter, hidden Gaussian RF, genotypes |
nu.geno |
spatial smoothing parameter, hidden Gaussian RF, genotypes |
sigma2.geno |
marginal variance, hidden Gaussian RF, genotypes |
kappa.quant |
spatial scale parameter, quant variables |
nu.quant |
spatial smoothing parameter, quant variables |
sigma2.gf.quant |
marginal variance, quant variables |
marginal.quant |
distribution of quantitative variables ('norm' or 'lnorm') |
tau.noise.quant |
precision of distribution of quantitative variables |
store.gf |
TRUE / FALSE indicating whether Gaussian random field values used to simulated allele frequencies should be stored |
obsolete |
TRUE / FALSE indicating whether random field simulations should be done with the obsolete function GaussRF or the more recent function RFsimulate |
flat |
domai |
A list with components
sim.method: The simulation method. The function currently implements the "geostat" model
sphere: A logical indicating whether coordinates are handled as (Lat,Lon) on the sphere or Euclidean coordinates in a 2D flat domain
geno.ref: A matrix containing the genetic data (individual or
population allele counts) of the reference samples. This matrix has one line per population (or individual) and one column per locus
coord.ref: A matrix containing the geographic coordinates of
reference populations. This matrix has one line per population (or individual) and two columns
size.pop.ref: A matrix containing the haploid population size of reference populations. This matrix has one line per population (or individual) and one column per locus
geno.unknown: Indivudual genotypes of individuals of unknown geographic origin
true.coord.unknown: True geographic coordinates of individuals assumed here to be of unknown geographic origin
ploidy: 1 or 2
kappa.geno: Scale parameter used in the simulation of the underlying Matern field
nu.geno: Smoothing parameter used in the simulation of the underlying Matern field
sigma2.geno: Variance parameter used in the simulation of the underlying Matern field
coord.grid=coord: Coordinates of the regular grid at which simulation of Gaussian fields and allele frequencies is performed
Gilles Guillot
1 2 3 4 5 6 7 8 9 10 11 12 13 | dat <- SPASIBA.sim(ploidy=2,
n.loc=3, # nb of loci
sphere=FALSE,
size.pop.ref=rep(2,30), # haploid pop size at each site
n.unknown=20, # nb indiv with unknown origin
nx.grid=100, # nb hor. pixels on grid
ny.grid=100, # nb vert. pixels on grid
win=c(0,10,40,50),
kappa.geno=1/10,# spatial scale parameter
nu.geno=1,# spatial smoothing parameter
sigma2.geno=1# marginal variance of hidden Gaussian RF
)
summary(dat)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.