ThetaMater.M3: ThetaMater.M3: (Bayesian Model 2) MCMC function that uses the...

View source: R/ThetaMater.M3.R

ThetaMater.M3R Documentation

ThetaMater.M3: (Bayesian Model 2) MCMC function that uses the MCMCmetrop1R function from MCMCpack with a discrete gamma rate variation model

Description

This function returns a list of each step in the MCMC sampling chain

Usage

ThetaMater.M3(k.vec, l.vec, n.vec, c.vec, K, ngens, burnin, thin, theta.shape,
  theta.scale, alpha.shape, alpha.scale)

Arguments

k.vec

Vector of mutation counts

l.vec

Vector of locus lengths

n.vec

Vector of sample numbers

c.vec

Vector of data pattern counts

ngens

Number of generations to run the MCMC

burnin

Number of generations to discard from MCMC chain

thin

Number of generations to thin in the MCMC chain

theta.shape

Shape parameter of the gamma distribution for setting the prior on theta

theta.scale

Scale parameter of the gamma distribution for setting the prior on theta

alpha.shape

Shape parameter of the gamma distribution for setting the prior on alpha

alpha.shape

Scale parameter of the gamma distribution for setting the prior on alpha

Examples

library(Rcpp)
library(ThetaMater)
library(MCMCpack)
sim.results <- Coal.Theta.Sim.File.G(theta = 0.001, n.vec = c(10,10), l.vec = c(2000,2000), num.loci = 1000, out.file = '~/Desktop/example.alleles', alpha.param = 0.5)
example.data <- Read.AllelesFile.NoThreshold(alleles.file = '~/Desktop/example.alleles', log.file = '~/Desktop/log.txt')
Theta.Posterior.G <- MCMC.Theta.M3(k.vec = example.data$k.vec, l.vec = example.data$l.vec, n.vec = example.data$n.vec, c.vec = example.data$c.vec, 
ngens = 10000, thin = 10, burnin = 10000, K = 4, alpha.param = 0.5)





radamsRHA/ThetaMater documentation built on April 25, 2024, 10:11 a.m.