rglinv: Simulate random trait values from models.

rglinvR Documentation

Simulate random trait values from models.

Description

Simulate random trait values from the Gaussian branching process specified by mod.

Usage

rglinv(mod, par, Nsamp, simplify)

## S3 method for class 'glinv'
rglinv(mod, par, Nsamp = 1, simplify = TRUE)

## S3 method for class 'glinv_gauss'
rglinv(mod, par, Nsamp = 1, simplify = TRUE)

Arguments

mod

Either a glinv_gauss or glinv object.

par

Parameters underlying the simulation, in the same format as lik.glinv_gauss or lik.glinv.

Nsamp

Number of sample point to simulate.

simplify

If TRUE, rglinv.glinv returns an Nsamp-element list with each element being a tip-trait matrix; otherwise, rglinv.glinv returns an Nsamp-element list with each element being an n-element list of k-element trait vectors, where n is the number of tips and k is the dimension of each trait vector.

Value

A list containing Nsamp elements, each of which represents a sample point from the model mod. The format of each elements depends on the simplify argument.


glinvci documentation built on May 29, 2024, 9:49 a.m.