PCMCreateLikelihood {PCMBase} | R Documentation |
Create a likelihood function of a numerical vector parameter
Description
Create a likelihood function of a numerical vector parameter
Usage
PCMCreateLikelihood(
X,
tree,
model,
SE = matrix(0, PCMNumTraits(model), PCMTreeNumTips(tree)),
metaI = PCMInfo(X, tree, model, SE),
positiveValueGuard = Inf
)
Arguments
X |
a |
tree |
a phylo object with N tips. |
model |
an S3 object specifying both, the model type (class, e.g. "OU") as well as the concrete model parameter values at which the likelihood is to be calculated (see also Details). |
SE |
a k x N matrix specifying the standard error for each measurement in
X. Alternatively, a k x k x N cube specifying an upper triangular k x k
factor of the variance covariance matrix for the measurement error
for each tip
Note that the above behavior is consistent with the treatment of the model
parameters |
metaI |
a list returned from a call to |
positiveValueGuard |
positive numerical value (default Inf), which serves as a guard for numerical error. Values exceeding this positiveGuard are most likely due to numerical error and PCMOptions()$PCMBase.Value.NA is returned instead. |
Details
It is possible to specify a function for the argument metaI. This
function should have three parameters (X, tree, model) and should return a
metaInfo object. (see PCMInfo
).
Value
a function of a numerical vector parameter called p returning the likelihood of X given the tree and the model with parameter values specified by p.