# NOT RUN {
# Example with an adjacency matrix (autoregressive model):
# see 'adjacency' documentation page
#### Matern correlation using only the Matern() syntax
data("blackcap")
(fitM <- HLCor(migStatus ~ means+ Matern(1|latitude+longitude),data=blackcap,
method="ML", ranPars=list(nu=0.6285603,rho=0.0544659)))
#### Using the 'distMatrix' argument
data("blackcap")
#
# Build distance matrix (here equivalent to the default one for a Matern() term)
MLdistMat <- as.matrix(proxy::dist(blackcap[,c("latitude","longitude")]))
#
(fitD <- HLCor(migStatus ~ means+ Matern(1|latitude+longitude),data=blackcap,
distMatrix=MLdistMat, method="ML", ranPars=list(nu=0.6285603,rho=0.0544659)))
# : result here must be equivalent to the one without the distMatrix.
diff(c(logLik(fitM),logLik(fitD)))
# }
Run the code above in your browser using DataLab