plusGamma.Sequence: Sample the rate multiplier parameters of a Process from a...

Description Usage Arguments Value Author(s) References See Also Examples

Description

Sample the rate multiplier parameters of a Process from a Gamma distribution for a collection of Site objects aggregated by a Sequence object.

The gamma distribution is discretized by calculating the means of the portions corresponding to the categories having equal probabilities. If the ncat argument is not numeric, the rates are sampled from the continuous gamma distribution.

Usage

1
2
## S3 method for class 'Sequence'
plusGamma(this, process, shape, index, ncat=4, ...)

Arguments

this

A Sequence object.

process

A Process object.

shape

The shape parameter of the gamma distribution.

index

A vector of positions.

ncat

Numer of categories in the discretized gamma distribution (4 by default).

...

Not used.

Value

The Sequence object (invisible);

Author(s)

Botond Sipos, Gregory Jordan

References

Yang, Z. (1994) Maximum likelihood phylogenetic estimation from DNA sequences with variable rates over sites: approximate methods - Journal of Molecular Evolution 39:306-314 http://dx.doi.org/10.1007/BF00160154

See Also

For more information see Sequence.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
	# create a sequence
	s<-NucleotideSequence(length=20)
	# attach a process
	p<-JC69()
	attachProcess(s,p)
	# get rate multipliers
	getRateMultipliers(s,p)	# the default value is 1.0
	# sample rate multipliers in range 1:5 from a discrete
	#gamma distribution with shape parameter 0.5
	plusGamma(s,p,0.5,1:5)
	# get rate multipliers
	getRateMultipliers(s,p)	# the default value is 1.0
	# sample rates from a continuous gamma distribution
	# with shape parameter 0.5
	plusGamma(s,p,0.5,ncat="cont")
	# get rate multipliers
	getRateMultipliers(s,p)
 

phylosim documentation built on Nov. 22, 2019, 1:07 a.m.