SPASIBA.sim: Simulate data from the prior/likelihood model assumed in...

Description Usage Arguments Value Author(s) Examples

Description

Simulate data from the prior/likelihood model assumed in SPASIBA

Usage

 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
)

Arguments

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

Value

A list with components

Author(s)

Gilles Guillot

Examples

 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)

gilles-guillot/SPASIBA documentation built on Jan. 25, 2020, 3 a.m.