rTraitCauchy function

Cauchy Trait Simulation

Cauchy Trait Simulation

Simulate a continuous trait using the Cauchy Process

rTraitCauchy( n = 1, phy, model = c("cauchy", "lambda", "kappa", "delta"), parameters = NULL )

Arguments

  • n: number of independent replicates
  • phy: a phylogeny in ape phylo format.
  • model: a phylogenetic model. Default is "cauchy", for the Cauchy process. Alternative are "lambda", "kappa", and "delta".
  • parameters: list of parameters for the model (see Details).

Returns

If n=1, a numeric vector with names from the tip labels in the tree. For more than 1 replicate, a matrix with the tip labels as row names, and one column per replicate.

Details

The default choice of parameters is as follow:

  • model = cauchy: root.value = 0, disp = 1
  • model = lambda: root.value = 0, disp = 1, lambda = 1
  • model = kappa: root.value = 0, disp = 1, kappa = 1
  • model = delta: root.value = 0, disp = 1, delta = 1

Examples

set.seed(1289) phy <- ape::rphylo(40, 0.01, 0) # One trait y <- rTraitCauchy(n = 1, phy = phy, model = "cauchy", parameters = list(root.value = 0, disp = 0.1)) y plot(phy, x.lim = c(0, 750)) phydataplot(y, phy, offset = 150) # Many trait y <- rTraitCauchy(n = 10, phy = phy, model = "cauchy", parameters = list(root.value = 0, disp = 0.1)) head(y)

See Also

rTrait, rTraitCont

  • Maintainer: Paul Bastide
  • License: GPL (>= 3)
  • Last published: 2024-10-01