Skip to contents

Calculate correlation for separable model

Usage

cor_sep(
  spatial = c("exp", "cauchy"),
  temporal = c("exp", "cauchy"),
  par_s,
  par_t,
  h,
  u
)

Arguments

spatial

Pure spatial model, exp or cauchy for now.

temporal

Pure temporal model, exp or cauchy for now.

par_s

Parameters for the pure spatial model. Nugget effect supported.

par_t

Parameters for the pure temporal model.

h

Euclidean distance matrix or array.

u

Time lag, same dimension as h.

Value

Correlations of the same dimension as h and u.

Details

The separable model is the product of a pure temporal model, \(C_T(u)\), and a pure spatial model, \(C_S(\mathbf{h})\). It is of the form $$C(\mathbf{h}, u)=C_{T}(u) \left[(1-\text{nugget})C_{S}(\mathbf{h})+\text{nugget} \delta_{\mathbf{h}=0}\right],$$ where \(\delta_{x=0}\) is 1 when \(x=0\) and 0 otherwise. Here \(\mathbf{h}\in\mathbb{R}^2\) and \(u\in\mathbb{R}\). Now only exponential and Cauchy correlation models are available.

References

Gneiting, T. (2002). Nonseparable, Stationary Covariance Functions for Space–Time Data, Journal of the American Statistical Association, 97:458, 590-600.

See also

Other correlation functions: cor_cauchy(), cor_exp(), cor_fs(), cor_lagr_askey(), cor_lagr_exp(), cor_lagr_tri(), cor_stat(), cor_stat_rs()

Examples

h <- matrix(c(0, 5, 5, 0), nrow = 2)
par_s <- list(nugget = 0.5, c = 0.01, gamma = 0.5)
u <- matrix(0, nrow = 2, ncol = 2)
par_t <- list(a = 1, alpha = 0.5)
cor_sep(
    spatial = "exp", temporal = "cauchy", par_s = par_s, par_t = par_t,
    h = h, u = u
)
#>           [,1]      [,2]
#> [1,] 1.0000000 0.4756147
#> [2,] 0.4756147 1.0000000

h <- array(c(0, 5, 5, 0), dim = c(2, 2, 3))
par_s <- list(nugget = 0.5, c = 0.01, gamma = 0.5)
u <- array(rep(0:2, each = 4), dim = c(2, 2, 3))
par_t <- list(a = 1, alpha = 0.5)
cor_sep(
    spatial = "exp", temporal = "cauchy", par_s = par_s, par_t = par_t,
    h = h, u = u
)
#> , , 1
#> 
#>           [,1]      [,2]
#> [1,] 1.0000000 0.4756147
#> [2,] 0.4756147 1.0000000
#> 
#> , , 2
#> 
#>           [,1]      [,2]
#> [1,] 0.5000000 0.2378074
#> [2,] 0.2378074 0.5000000
#> 
#> , , 3
#> 
#>           [,1]      [,2]
#> [1,] 0.3333333 0.1585382
#> [2,] 0.1585382 0.3333333
#>