Learn R Programming

spaMM (version 1.4.1)

make.scaled.dist: Scaled Euclidian distances between unique locations

Description

This fonction computes scaled Euclidian distances from whichever relevant argument it can use (see Details). The result can directly by used as input for computation of the Matérn correlation matrix. It is usually called internally by HLCor, so that users may ignore it, except if they wish to control the parametrizaion of the scaling through the rho.mapping argument.

Usage

make.scaled.dist(distMatrix,uniqueGeo,rho,rho.mapping=seq_len(length(rho)))

Arguments

distMatrix
A distance matrix.
uniqueGeo
A matrix of geographical coordinates (e.g. 2 columns for latitude and longitude), without replicates o the same location.
rho
A scalar or vector of positive values. Scaled distance is computed as * rho, unless a non-trivial rho.mapping is used.
rho.mapping
A set of indices controlling which elements of the rho scale vector scales which dimension(s) of the space in which (spatial) correlation matrices of random effects are computed. Scaled distance is generally computed as

Value

  • A matrix or dist object.

Details

The function uses the distMatrix argument if provided, in which case rho must be a scalar. Vectorial rho (i.e., different scaling of different dimensions) is feasible only by providing uniqueGeo.

Examples

Run this code
## a biologically not very meaningful, but syntactically correct example of rho.mapping
data(blackcap)
corrHLfit(migStatus ~ 1 + Matern(1|latitude+longitude+means),data=blackcap,
          objective="p_v",HLmethod="ML",ranFix=list(nu=0.5),init.corrHLfit=list(rho=c(1,1)),
          rho.mapping=c(1,1,2))

Run the code above in your browser using DataLab