GppDxy.UncertainModel: GppDxy.UncertainModel: function to simulate posterior...

Description Usage Arguments Examples

View source: R/GppDxy.UncertainModel.R

Description

This function returns a vector of dxy values simulated from a posterior distribution

Usage

1
2
GppDxy.UncertainModel(posterior.samples, loci.per.step, sample.vec.0,
  sample.vec.1, sequence.length.vec)

Arguments

posterior.samples

List of posterior samples with columns for single column for each parameter and a row for each step of the MCMC chain [see read.posterior]

loci.per.step

Number of genealogies to simulate for each joint parameter combination of the posterior MCMC chain

sample.vec.0

List of number of sampled individuals for population 0 for each locus in the empirical distribution

sample.vec.1

List of number of sampled individuals for population 1 for each locus in the empirical distribution

sequence.length.vec

List of the locus length for each locus in the empirical dataset; can be set to c(190,190) to simulate all loci with length of 190 nucleotides

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
## Not run: 
library(GppFst)
library(phybase)

east.samples <- read.csv('~/Desktop/GppFST_Tutorial/eastsamples.txt') # csv file: each row is a locus, column = # number of samples for population 0
west.samples <- read.csv('~/Desktop/GppFST_Tutorial/westsamples.txt') # csv file: each row is a locus, column = # number of samples for population 1
MCMC.samples <- read.posterior(posterior.file = '~/Desktop/GppFST_Tutorial/atrox_snap_gamma.log', format = "tab", burnin = .25) # Read in posterior file (east = pop0, west = pop1)

PPS.results <- GppDxy.UncertainModel(posterior.samples = MCMC.samples, loci.per.step = 1, sample.vec.0 = east.samples[,1], sample.vec.1 = west.samples[,1], sequence.length.vec = c(190,190))
mean(as.numeric(PPS.results) # get mean
hist(as.numeric(PPS.results) # plot distribution

## End(Not run)

radamsRHA/GppFst documentation built on Nov. 9, 2019, 7:08 p.m.