actual_correlation: Actual correlation

Description Usage Arguments Value Examples

View source: R/actual_correlation.R

Description

Actual correlation

Usage

1
actual_correlation(M, a_vector, scale = 1, vect_dir = T)

Arguments

M

a matrix

a_vector

2 coordinates vector which give a direction. The correlation and covariance according to the distance are calculated for this direction.

scale

1 km/pixel by default. This number of km by pixels can eventually be changed.

vect_dir

true by default. It reshapes the direction Ex: direction c(4,6) is reshaped as c(2,3). c(1,0) is reshaped as c(0,1) because of symetry considerations.

Value

a dataframe, giving the distance between points, in km and in pixels, and the empirical values of correlation and covariance according to these distances. Warning : the more the distance between points increases, the less the calculus of correlation and covariance is accurate. That's because, on a grid, there are less points far away from each other than points close to each other. That's to say, there are less and less couples of points to do the calculation as the distance between them increases.

Examples

1
actual_correlation(matrix(rnorm(1:50), nrow = 10), c(1,2))

C-Juliette/Geostatistic documentation built on Dec. 17, 2021, 11:58 a.m.