plot.deeptrafo {deeptrafo}R Documentation

Generic methods for neural network transformation models

Description

Generic methods for neural network transformation models

Usage

## S3 method for class 'deeptrafo'
plot(
  x,
  which = NULL,
  type = c("smooth", "trafo", "pdf", "cdf"),
  newdata = NULL,
  which_param = c("shifting", "interacting"),
  only_data = FALSE,
  K = 40,
  q = NULL,
  ...
)

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

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

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

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

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

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

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

Arguments

x

Object of class "deeptrafo".

which

Which effect to plot, default selects all smooth effects in the shift term.

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".

newdata

Named list or data.frame; optional new data.

which_param

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

only_data

Logical, if TRUE, only the data for plotting is returned.

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.

...

Further arguments supplied to print.deeptrafo

object

Object of class "deeptrafo".

batch_size

Integer; optional, useful if data is too large.

convert_fun

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

nsim

Integer; number of simulations; defaults to 1.

seed

Seed for generating samples; defaults to NULL.

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.

Value

Returns vector or matrix of predictions, depending on the supplied type.

Returns matrix of fitted values.


[Package deeptrafo version 0.1-1 Index]