Learn R Programming

deepspat (version 0.3.1)

deepspat_bivar_GP: Deep bivariate compositional spatial model for Gaussian processes

Description

Constructs a deep bivariate compositional spatial model

Usage

deepspat_bivar_GP(
  f,
  data,
  g = ~1,
  layers_asym = NULL,
  layers = NULL,
  method = "REML",
  family = c("exp_stat_symm", "exp_stat_asymm", "exp_nonstat_symm", "exp_nonstat_asymm",
    "matern_stat_symm", "matern_stat_asymm", "matern_nonstat_symm",
    "matern_nonstat_asymm"),
  par_init = initvars(),
  learn_rates = init_learn_rates(),
  nsteps = 150L
)

Value

deepspat_bivar_GP returns an object of class deepspat_bivar_GP with the following items

"f"

The formula used to construct the covariance model

"g"

The formula used to construct the linear trend model

"data"

The data used to construct the deepspat model

"X"

The model matrix of the linear trend

"layers"

The warping function layers in the model

"layers_asym"

The aligning function layers in the model

"Cost"

The final value of the cost

"eta_tf"

Estimated weights in the warping layers as a list of TensorFlow objects

"eta_tf_asym"

Estimated weights in the aligning layers as a list of TensorFlow objects

"a_tf"

Estimated parameters in the LFT layers

"a_tf_asym"

Estimated parameters in the AFF layers of the aligning function

"beta"

Estimated coefficients of the linear trend

"precy_tf1"

Precision of measurement error of the first process, as a TensorFlow object

"precy_tf2"

Precision of measurement error of the second process, as a TensorFlow object

"sigma2_tf_1"

Variance parameter (first process) in the covariance matrix, as a TensorFlow object

"sigma2_tf_2"

Variance parameter (second process) in the covariance matrix, as a TensorFlow object

"sigma2_tf_12"

Covariance parameter in the covariance matrix, as a TensorFlow object

"l_tf1"

Length scale parameter (first process) in the covariance matrix, as a TensorFlow object

"l_tf2"

Length scale parameter (second process) in the covariance matrix, as a TensorFlow object

"l_tf12"

Length scale parameter (cross-covariance) in the covariance matrix, as a TensorFlow object

"nu_tf1"

Smoothness parameter (first process) in the covariance matrix, as a TensorFlow object

"nu_tf2"

Smoothness parameter (second process) in the covariance matrix, as a TensorFlow object

"nu_tf12"

Smoothness parameter (cross-covariance) in the covariance matrix, as a TensorFlow object

"scalings"

Minima and maxima used to scale the unscaled unit outputs for each warping layer, as a list of TensorFlow objects

"scalings_asym"

Minima and maxima used to scale the unscaled unit outputs for each aligning layer, as a list of TensorFlow objects

"method"

Method used for inference

"nlayers"

Number of warping layers in the model

"nlayers_asym"

Number of aligning layers in the model

"swarped_tf1"

Spatial locations of the first process on the warped domain

"swarped_tf2"

Spatial locations of the second process on the warped domain

"negcost"

Vector of costs after each gradient-descent evaluation

"z_tf_1"

Data of the first process

"z_tf_2"

Data of the second process

"family"

Family of the model

Arguments

f

formula identifying the dependent variables and the spatial inputs in the covariance

data

data frame containing the required data

g

formula identifying the independent variables in the linear trend

layers_asym

list containing the aligning function layers

layers

list containing the nonstationary warping layers

method

identifying the method for finding the estimates

family

identifying the family of the model constructed

par_init

list of initial parameter values. Call the function initvars() to see the structure of the list

learn_rates

learning rates for the various quantities in the model. Call the function init_learn_rates() to see the structure of the list

nsteps

number of steps when doing gradient descent times two, three or five (depending on the family of model)

Examples

Run this code
# \donttest{
if (reticulate::py_module_available("tensorflow")) {
df <- data.frame(s1 = rnorm(100), s2 = rnorm(100), z1 = rnorm(100), z2 = rnorm(100))
layers <- c(AWU(r = 50L, dim = 1L, grad = 200, lims = c(-0.5, 0.5)),
            AWU(r = 50L, dim = 2L, grad = 200, lims = c(-0.5, 0.5)))
d <- deepspat_bivar_GP(f = z1 + z2 ~ s1 + s2 - 1,
                       data = df, g = ~ 1,
                       layers = layers, method = "REML",
                       family = "matern_nonstat_symm",
                       nsteps = 10L)
 }
# }

Run the code above in your browser using DataLab