opt_auto {cylcop} | R Documentation |
Automatically Find the Best Fitting Copula
Description
The parameters of 15 different circular-linear copulas are fitted to data
and sorted
according to AIC. For each copula, first, a starting value for the maximum
likelihood estimation (MLE) is found using fit_cylcop_cor()
.
Then, MLE is carried out with a "reasonable" setup using fit_cylcop_ml()
.
If MLE fails, parameters obtained with fit_cylcop_cor()
are reported.
Usage
opt_auto(theta, x)
Arguments
theta |
numeric vector of angles (measurements of a circular variable). |
x |
numeric vector of step lengths (measurements of a linear variable). |
Value
A list containing 3 lists: Descriptions of the copulas, the
'cyl_copula
' objects with fitted parameters, and the AIC.
The lists are sorted by ascending AIC.
If fit_cylcop_ml()
has failed, the reported parameters are the ones obtained
with fit_cylcop_cor()
and the AIC is set to NA
.
References
Hodel FH, Fieberg JR (2022). “Circular-Linear Copulae for Animal Movement Data.” Methods in Ecology and Evolution. doi:10.1111/2041-210X.13821.
Hodel FH, Fieberg JR (2021). “Cylcop: An R Package for Circular-Linear Copulae with Angular Symmetry.” bioRxiv. doi:10.1101/2021.07.14.452253, https://www.biorxiv.org/content/10.1101/2021.07.14.452253v3/.
See Also
fit_cylcop_cor()
, fit_cylcop_ml()
Examples
set.seed(123)
#Optimal copula is independent of marginals.
data <- rcylcop(100,cyl_quadsec(0.1))
#This takes a few seconds to run.
copula_lst <- opt_auto(theta = data[,1], x = data[,2])