PCMOptions.Rd
Global options for the PCMBase package
PCMOptions()
a named list with the currently set values of the following global options:
PCMBase.Value.NA
NA value for the likelihood; used in GaussianPCM to
return this value in case of an error occurring
during likelihood calculation. By default, this is set to as.double(NA)
.
PCMBase.Errors.As.Warnings
a logical flag indicating if errors
(occuring, e.g. during likelihood calculation) should be treated as warnings
and added as an attribute "error" to attach to the likelihood values. Default TRUE.
PCMBase.Raise.Lik.Errors Should numerical and other sort of
errors occurring during likelihood calculation be raised either as errors or
as warnings, depending on the option PCMBase.Errors.As.Warnings
.
Default TRUE. This option can be useful if too frequent warnings get raised
during a model fit procedure.
PCMBase.Threshold.Lambda_ij
a 0-threshold for abs(Lambda_i + Lambda_j),
where Lambda_i and Lambda_j are eigenvalues of the parameter matrix H of an OU or
other model. Default 1e-8. See PCMPExpxMeanExp
.
PCMBase.Threshold.EV
A 0-threshold for the eigenvalues of the
matrix V for a given branch. The V matrix is considered singular if it has
eigenvalues smaller than PCMBase.Threshold.EV
or when the ratio
min(svdV)/max(svdV) is below PCMBase.Threshold.SV
. Default is 1e-5.
Treatment of branches with singular V matrix is defined by the option
PCMBase.Skip.Singular
.
PCMBase.Threshold.SV
A 0-threshold for min(svdV)/max(svdV), where
svdV is the vector of singular values of the matrix V for a given branch.
The V matrix is considered singular if it has eigenvalues smaller than
PCMBase.Threshold.EV
or when the ratio min(svdV)/max(svdV) is below
PCMBase.Threshold.SV. Default is 1e-6. Treatment
of branches with singular V matrix is defined by the option PCMBase.Skip.Singular
.
PCMBase.Threshold.Skip.Singular
A double indicating if an internal branch of shorter
length with singular matrix V should be skipped during likelihood calculation. Setting this
option to a higher value, together with a TRUE value for the option PCMBase.Skip.Singular
will result in tolerating some parameter values resulting in singular variance covariance
matrix of the transition distribution. Default 1e-4.
PCMBase.Skip.Singular
A logical value indicating whether internal branches with
singular matrix V and shorter than getOption("PCMBase.Threshold.Skip.Singular")
should be skipped during likelihood calculation, adding their children
L,m,r values to their parent node. Default TRUE. Note, that setting this option to FALSE
may cause some models to stop working, e.g. the White model. Setting this option to FALSE
will also cause errors or NA likelihood values in the case of trees with very short or
0-length branches.
PCMBase.Tolerance.Symmetric
A double specifying the tolerance in tests
for symmetric matrices. Default 1e-8; see also isSymmetric
.
PCMBase.Lmr.mode
An integer code specifying the parallel likelihood calculation mode.
PCMBase.ParamValue.LowerLimit
Default lower limit value for parameters, default setting is -10.0.
PCMBase.ParamValue.LowerLimit.NonNegativeDiagonal
Default lower limit value for parameters corresponding to non-negative diagonal elements of matrices, default setting is 0.0.
PCMBase.ParamValue.UpperLimit
Default upper limit value for parameters, default setting is 10.0.
PCMBase.Transpose.Sigma_x
Should upper diagonal factors for variance-covariance rate matrices be transposed, e.g. should Sigma = t(Sigma_x) Sigma_x or, rather Sigma = Sigma_x t(Sigma_x)? Note that the two variants are not equal. The default is FALSE, meaning Sigma = Sigma_x t(Sigma_x). In this case, Sigma_x is not the actual upper Cholesky factor of Sigma, i.e. chol(Sigma) != Sigma_x. See also chol
and UpperTriFactor
. This option applies to parameters Sigma_x, Sigmae_x, Sigmaj_x and the measurement errors SE[,,i]
for each measurement i when the argument SE
is specified as a cube.
PCMBase.MaxLengthListCladePartitions
Maximum number of tree partitions returned by PCMTreeListCladePartitions
. This option has the goal to interrupt the recursive search for new partitions in the case of calling PCMTreeListCladePartitions on a big tree with a small value of the maxCladeSize argument. By default this is set to Inf.
PCMBase.PCMPresentCoordinatesFun
A function with the same synopsis as PCMPresentCoordinates
that can be specified in case of custom setting for the present coordinates for specific nodes of the tree. See PCMPresentCoordinates
, and PCMInfo
.
PCMBase.Use1DClasses
Logical indicating if 1D arithmetic operations
should be used instead of multi-dimensional ones. This can speed-up computations
in the case of a single trait. Currently, this feature is implemented only in
the PCMBaseCpp R-package and only for some model types, such as OU and BM.
Default: FALSE
PCMBase.PrintSubscript_u
Logical indicating if a subscript 'u'
should be printed instead of a subscript 'x'. Used in PCMTable
. Default: FALSE.
PCMBase.MaxNForGuessSigma_x
A real fraction number in the
interval (0, 1) or an integer bigger than 1 controlling the
number of tips to use for analytical calculation of the evolutionary rate
matrix under a BM assumption. This option is used in the suggested PCMFit
R-package. Default: 0.25.
PCMBase.UsePCMVarForVCV
Logical (default: FALSE) indicating
if the function PCMTreeVCV
should use PCMVar
instead of ape's function vcv
to calculate the phylogenetic
variance covariance matrix under BM assumption. Note that setting this option
to TRUE would slow down the function PCMTreeVCV considerably but may be more
stable, particularly in the case of very big and deep trees, where previous
ape's versions of the vcv
function have thrown stack-overflow
errors.
PCMOptions()#> $PCMBase.Value.NA #> [1] NA #> #> $PCMBase.Errors.As.Warnings #> [1] TRUE #> #> $PCMBase.Threshold.Lambda_ij #> [1] 1e-08 #> #> $PCMBase.Threshold.EV #> [1] 1e-05 #> #> $PCMBase.Threshold.SV #> [1] 1e-06 #> #> $PCMBase.Threshold.Skip.Singular #> [1] 1e-04 #> #> $PCMBase.Skip.Singular #> [1] TRUE #> #> $PCMBase.Tolerance.Symmetric #> [1] 1e-08 #> #> $PCMBase.Lmr.mode #> [1] 11 #> #> $PCMBase.ParamValue.LowerLimit.NonNegativeDiagonal #> [1] 0 #> #> $PCMBase.ParamValue.LowerLimit #> [1] -10 #> #> $PCMBase.ParamValue.UpperLimit #> [1] 10 #> #> $PCMBase.Transpose.Sigma_x #> [1] FALSE #> #> $PCMBase.MaxLengthListCladePartitions #> [1] Inf #> #> $PCMBase.PCMPresentCoordinatesFun #> function (X, tree, metaI) #> { #> if (is.null(metaI)) { #> N <- PCMTreeNumTips(tree) #> M <- PCMTreeNumNodes(tree) #> k <- nrow(X) #> postorder <- PCMTreePostorder(tree) #> } #> else { #> N <- metaI$N #> M <- metaI$M #> k <- metaI$k #> postorder <- rev(metaI$preorder) #> } #> edge <- tree$edge #> if (is.null(X)) { #> pc <- matrix(TRUE, k, M) #> } #> else { #> pc <- matrix(FALSE, k, M) #> for (ei in postorder) { #> i <- edge[ei, 2] #> j <- edge[ei, 1] #> if (i <= N) { #> pc[, i] <- !is.nan(X[, i]) #> } #> else { #> } #> pc[, j] <- pc[, j] | pc[, i] #> } #> pc[, seq_len(N)] <- !is.na(X[, seq_len(N)]) #> if (any(rowSums(pc) == 0)) { #> stop("PCMPresentCoordinates:: Some tips have 0 present coordinates.\n Consider removing these tips.") #> } #> } #> pc #> } #> <bytecode: 0x000000002e51e358> #> <environment: namespace:PCMBase> #> #> $PCMBase.Use1DClasses #> [1] FALSE #> #> $PCMBase.Raise.Lik.Errors #> [1] TRUE #> #> $PCMBase.PrintSuffix_u #> [1] FALSE #> #> $PCMBase.MaxNForGuessSigma_x #> [1] 0.25 #> #> $PCMBase.UsePCMVarForVCV #> [1] FALSE #>