params_OU: Create an object 'params_process' for an OU

View source: R/init_EM.R

params_OUR Documentation

Create an object params_process for an OU

Description

params_OU creates a coherent object params_process from user provided values of the parameters. Non specified parameters are set to default values.

Usage

params_OU(
  p = 1,
  variance = diag(1, p, p),
  selection.strength = diag(1, p, p),
  optimal.value = rep(0, p),
  random = TRUE,
  stationary.root = TRUE,
  value.root = rep(0, p),
  exp.root = rep(0, p),
  var.root = diag(1, p, p),
  edges = NULL,
  values = matrix(0, p, length(edges)),
  relativeTimes = NULL,
  nbr_of_shifts = length(edges),
  phylo = NULL,
  trait_names = NULL,
  ...
)

Arguments

p

the dimension (number of traits) of the parameters. Default to 1.

variance

the variance (rate matrix) of the BM. Default to diag(1, p, p).

selection.strength

the selection strength matrix. Default to diag(1, p, p).

optimal.value

the vector of the optimal values at the root. Default to rep(0, p).

random

whether the root of the OU is random (TRUE) or fixed (FALSE). Default to TRUE.

stationary.root

whether the root of the OU is stationary (TRUE) or not. Default to TRUE.

value.root

if random=FALSE, the root value. Default to 0.

exp.root

if random=TRUE, the root expectation. Default to 0. If stationary.root=TRUE, default to optimal.value.

var.root

if random=TRUE, the root variance. Default to diag(1, p, p). If stationary.root=TRUE, default to the stationary variance computed from variance and selection.strength, see function compute_stationary_variance.

edges

a vector of edges where the shifts occur. Default to NULL (no shift).

values

a matrix of shift values, with p lines and as many columns as the number of shifts. Each column is the p values for one shift. Default to matrix(0, p, length(edges)).

relativeTimes

(unused) the relative position of the shift on the branch, between 0 (beginning of the branch) and 1 (end of the branch). Default to 0.

nbr_of_shifts

the number of shifts to use (randomly drawn). Use only if edges is not specified. In that case, a phylogenetic tree must be provided (to allow a random sampling of its edges).

phylo

a phylogenetic tree of class phylo. Needed only if the shifts edges are not specified.

trait_names

vector of trait names values. Must be of length p.

...

unused.

Value

an object of class params_process.

See Also

params_process, params_BM


pbastide/PhylogeneticEM documentation built on Feb. 12, 2024, 1:27 a.m.