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)
#> $logL
#> [1] -30.77206
#> 
#> $AICc
#> [1] 70.2714
#> 
#> $parameters
#> anc/theta.0 vstep.trait       alpha   vstep.opt 
#>  0.05344138  0.03463096  0.37500331  0.27608876 
#> 
#> $modelName
#> [1] "OU model with moving optimum (ancestral state at optimum)"
#> 
#> $method
#> [1] "Joint"
#> 
#> $K
#> [1] 4
#> 
#> $n
#> [1] 60
#> 
#> $iter
#> [1] NA
#> 
#> $se
#> NULL
#> 
#> attr(,"class")
#> [1] "paleoTSfit"