Skip to contents

Function to find maximum likelihood solutions to an Ornstein-Uhlenbeck model with an optimum that evolves according to a Unbiased Random Walk.

Usage

opt.joint.OUBM(
  y,
  pool = TRUE,
  meth = "L-BFGS-B",
  hess = FALSE,
  iterations = NULL,
  iter.sd = NULL,
  opt.anc = TRUE
)

Arguments

y

an univariate paleoTS object.

pool

logical indicating whether to pool variances across samples

meth

optimization method, passed to function optim. Default is "L-BFGS-B".

hess

logical, indicating whether to calculate standard errors from the Hessian matrix.

iterations

the number of times the optimization method is run from different starting points. Default is NULL, meaning the optimization is run once.

iter.sd

defines the standard deviation of the Gaussian distribution from which starting values for the optimization routine is run. Default is 1.

opt.anc

logical, indicating whether the the ancestral trait state is at the optimum.

Value

logL

the log-likelihood of the optimal solution

AICc

AIC with a correction for small sample sizes

parameters

parameter estimates

modelName

abbreviated model name

method

Joint consideration of all samples

K

number of parameters in the model

n

the number of observations/samples

Note

The models have been implemented to be compatible with the joint parameterization routine in the package paleoTS. The optimization is therefore fit using the actual sample values, with the autocorrelation among samples accounted for in the log-likelihood function. The joint distribution of sample means is multivariate normal, with means and variance-covariances determined by evolutionary parameters and sampling errors.

References

Hansen, T. F., Pienaar, J. & Orzack, S. H. 2008. A Comparative Method for Studying Adaptation to a Randomly Evolving Environment. Evolution 62:1965–1977.

Author

Kjetil Lysne Voje

Examples

## Generate a paleoTS object by simulating a univariate evolutionary sequence
x <- paleoTS::sim.GRW(60)

## Fit the model
opt.joint.OUBM(x)
#> 
#> paleoTSfit object [n = 60 , K = 4 ]
#> 
#> Model:  OU model with moving optimum (ancestral state at optimum) 
#> Method:  Joint 
#> log-likelihood =  -33.19234 
#> AICc =  75.11196 
#> 
#> Parameter estimates: 
#> anc/theta.0 vstep.trait       alpha   vstep.opt 
#> -0.05575231  0.10640754  0.08879523  0.00000001