registered_adjacency_covariance_function: Construct a registered covariance matrix from the adjaency...

Description Usage Arguments Value Examples

View source: R/registered.covariance.function.R

Description

This function constructs a covariance function from the graph's adjacency matrix. The covairance function may be suqred exponential, rational quadratic or Matern

Usage

1
2
3
4
5
6
7
8
registered_adjacency_covariance_function(
  adj.matrix,
  type,
  hyperparameters,
  linear.combination,
  linear.constraint = 0,
  tol = 1e-05
)

Arguments

adj.matrix

The graph adjacency matrix

type

The type of covariance function used. One of "sqexp", "ratquad" or "matern". Note: only matern with nu = 5/2 is supported.

hyperparameters

A vector containing the covariance function hyperparameters. For the squared exponential and matern, the vector should contain the variance and length scale, for the rational quadratic, the vector should contain the variance, lenght scale and scaling parameters

linear.combination

A matrix which defines the linear combination of (lambda_1, ..., lambda_N)^T.

linear.constraint

The value the linear constraint takes. Defaults to 0.

tol

The tolerance for the Cholesky decomposition

Value

The mean vector and covariance matrix

Examples

1
2
3
4
5
6
7
#Construct covariance matrix of Dar es Salaam, Tanzania, using network metric
data(dar.adj.matrix, package = "BTUN") #load dar es salaam adjacency matrix
k <- registered_adjacency_covariance_function(dar.adj.matrix, type = "sqexp",
       hyperparameters = c(1, 0.5), rep(1, dim(dar.adj.matrix)[1]), 0)
       #Covariance registetred by sum of subwards is 0 using rational quadratic function
k <- registered_adjacency_covariance_function(dar.adj.matrix, type = "ratquad",
       hyperparameters = c(1, 0.5, 2), rep(1, dim(dar.adj.matrix)[1]), 0)

jasa-btun-anon/BTUN documentation built on Sept. 12, 2020, 12:54 a.m.