Learn R Programming

deeptrafo (version 1.0-0)

coef.deeptrafo: S3 methods for deep conditional transformation models

Description

S3 methods for deep conditional transformation models

Usage

# S3 method for deeptrafo
coef(
  object,
  which_param = c("shifting", "interacting", "autoregressive"),
  type = NULL,
  ...
)

# S3 method for deeptrafo predict( object, newdata = NULL, type = c("trafo", "pdf", "cdf", "interaction", "shift", "terms"), batch_size = NULL, K = 100, q = NULL, pred_grid = FALSE, ... )

# S3 method for deeptrafo fitted( object, newdata = NULL, batch_size = NULL, convert_fun = as.matrix, call_create_lags = TRUE, ... )

# S3 method for deeptrafo logLik( object, newdata = NULL, convert_fun = function(x, ...) -sum(x, ...), ... )

# S3 method for deeptrafo residuals(object, newdata = NULL, return_gradients = FALSE, ...)

# S3 method for deeptrafo simulate(object, nsim = 1, seed = NULL, newdata = NULL, ...)

# S3 method for deeptrafo print(x, print_model = FALSE, print_coefs = TRUE, with_baseline = FALSE, ...)

# S3 method for deeptrafo summary(object, ...)

Value

Returns vector or matrix of predictions, depending on the supplied

type.

Returns matrix of fitted values.

Arguments

object

Object of class "deeptrafo".

which_param

Character; either "shifting", "interacting", or "autoregressive" (only for autoregressive transformation models).

type

Either NULL (all types of coefficients are returned), "linear" for linear coefficients or "smooth" for coefficients of; Note that type is currently not used for "interacting".

...

Further arguments supplied to print.deeptrafo

newdata

Named list or data.frame; optional new data.

batch_size

Integer; optional, useful if data is too large.

K

Integer; grid length for the response to evaluate predictions at, if newdata does not contain the response.

q

Numeric or factor; user-supplied grid of response values to evaluate the predictions. Defaults to NULL. If overwritten, K is ignored.

pred_grid

Logical; set TRUE, if user provides a predefined grid for an atp/atm model through newdata which holds two attributes. The first attribute, rname, should hold the column name (string) of the response variable while the second attribute, y, should hold the grid name.

convert_fun

Function; applied to the log-likelihood values of all observations.

call_create_lags

Logical; lags may already be computed by a different method (e.g. plot)

return_gradients

Return individual gradients instead of the summed gradients; the residuals are 0.5 * rowSums(gradients)

nsim

Integer; number of simulations; defaults to 1.

seed

Seed for generating samples; defaults to NULL.

x

Object of class "deeptrafo".

print_model

Logical; print keras model.

print_coefs

Logical; print coefficients.

with_baseline

Logical; print baseline coefs.

Details

If no new data is supplied, predictions are computed on the training data (i.e. in-sample). If new data is supplied without a response, predictions are evaluated on a grid of length K.