Learn R Programming

deepspat (version 0.3.1)

deepspat_rPP: Deep compositional spatial model for r-Pareto processes

Description

Constructs an extended deep compositional spatial model that supports different estimation methods ("GSM" or "WLS") and spatial dependence families (stationary or non-stationary). This function extends the basic deepspat model by incorporating additional dependence modeling and pre-training steps for the warping layers.

Usage

deepspat_rPP(
  f,
  data,
  layers = NULL,
  method = c("WLS", "GSM"),
  par_init = initvars(),
  learn_rates = init_learn_rates(),
  family = c("power_stat", "power_nonstat"),
  dtype = "float32",
  nsteps = 100L,
  nsteps_pre = 100L,
  edm_emp = NULL,
  risk = NULL,
  thre = NULL,
  weight_fun = NULL,
  dWeight_fun = NULL,
  pen_coef = 0,
  show = TRUE,
  ...
)

Value

deepspat_rPP returns an object of class deepspat_rPP which is a list containing the following components:

layers

The list of warping layers used in the model.

Cost

The final cost value after training (e.g., negative log-likelihood, least squares, or gradient score).

transeta_tf

TensorFlow objects for the transformed dependence parameters in the warping layers.

eta_tf

TensorFlow objects for the warped dependence parameters.

a_tf

TensorFlow object for the parameters of the LFT layers (if applicable).

logphi_tf

TensorFlow variable representing the logarithm of the spatial range parameter.

logitkappa_tf

TensorFlow variable representing the logit-transformed degrees of freedom.

scalings

A list of scaling limits (minima and maxima) for the input and warped spatial coordinates.

s_tf

TensorFlow object for the scaled spatial coordinates.

z_tf

TensorFlow object for the observed response values.

u_tf

TensorFlow object for the threshold used in the GS method (if applicable).

swarped_tf

List of TensorFlow objects representing the warped spatial coordinates at each layer.

swarped

Matrix of final warped spatial coordinates.

method

The estimation method used ("WLS" or "GSM").

risk

The risk parameter used in the GS method (if applicable).

family

The spatial dependence family ("power_stat" or "power_nonstat").

dtype

The data type used in TensorFlow computations.

nlayers

Number of warping layers (for non-stationary models).

weight_fun

The weighting function used in the GS method.

dWeight_fun

The derivative of the weighting function used in the GS method.

f

The model formula.

data

The data frame used for model fitting.

negcost

Vector of cost values recorded during training.

pairs_tf

TensorFlow variable representing the spatial location pairs (and, for MRPL, the replicate indices) used in the pairwise / randomized pairwise likelihood or WLS objective..

pairs_t_tf

Tranposed pairs_tf.

time

Elapsed time for model fitting.

Arguments

f

A formula identifying the dependent variable(s) and the spatial inputs. Use get_depvars_multivar3 to extract the dependent variable names.

data

A data frame containing the required data.

layers

A list containing the warping layers; required for non-stationary models (i.e., when family = "power_nonstat").

method

A character string specifying the estimation method. Must be one of "GSM", or "WLS" for r-Pareto processes

par_init

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

learn_rates

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

family

A character string specifying the spatial dependence model. Use "power_nonstat" for non-stationary models and "sta" for stationary models.

dtype

A character string indicating the data type for TensorFlow computations ("float32" or "float64"). Default is "float32"

nsteps

An integer specifying the number of training steps for dependence parameter learning.

nsteps_pre

An integer specifying the number of pre-training steps for warping layer parameters.

edm_emp

For the LS method, a numeric vector or matrix providing an empirical conditional exceedance probabilities.

risk

For the GS method, a numeric value indicating the risk parameter.

thre

A numeric threshold used in the GS method.

weight_fun

A function used to weight pairwise differences in the GS method.

dWeight_fun

A function representing the derivative of weight_fun (used in the GS method).

pen_coef

A penalty parameter for weights of SR-RBF(2) to relieve overfitting.

show

Logical; if TRUE progress information is printed during training.

...

Currently unused.