PEpoisnorm: Probability functions of trait change under pulsed evolution...

dPEpoisnormR Documentation

Probability functions of trait change under pulsed evolution with 1 compound Poisson process

Description

Density function, cumulative distribution function and random generation for the trait change under Pulsed evolution with 1 compound Poisson process

Usage

dPEpoisnorm(x, t, lambda, size, sigma, epsilon = 0, margin = 1e-06)

pPEpoisnorm(
  q,
  t,
  lambda,
  size,
  sigma,
  epsilon = 0,
  margin = 1e-06,
  lower.tail = TRUE
)

rPEpoisnorm(n, t, lambda, size, sigma, epsilon = 0)

Arguments

x

the trait change between two nodes

t

the branch length between two nodes

lambda

the rate at which jumps happen

size

the variance of trait change introduced per jump

sigma

the rate of BM (variance of gradual trait change per unit branch length)

epsilon

the variance of time-independent variation

margin

the total probability mass of the number of jumps not covered, defaults to 1e-6

q

the trait change between two nodes

lower.tail

logical, if TRUE (default), probability of trait change smaller or equal to q is returned. If false, the probability of being greater is returned.

n

the number of random values to return

Value

dPEpoisnorm returns the probability density

pPEpoisnorm returns the cumulative distribution

rPEpoisnorm returns a vector of random numbers following the specified distribution

Examples

# generate some random trait changes under pulsed evolution
dtrait = rPEpoisnorm(n=1e3,t=1,lambda=1,size=1,sigma=1,epsilon=0.1)

# test the empirical distribution against the theoretical one
ks.test(dtrait,pPEpoisnorm,t=1,lambda=1,size=1,sigma=1,epsilon=0.1)

wu-lab-uva/RasperGade documentation built on June 24, 2022, 2:47 p.m.