S3 methods for deep conditional transformation models
# 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, ...)
Returns vector or matrix of predictions, depending on the supplied
type
.
Returns matrix of fitted values.
Object of class "deeptrafo"
.
Character; either "shifting"
, "interacting"
,
or "autoregressive"
(only for autoregressive transformation models).
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
Named list
or data.frame
; optional new data.
Integer; optional, useful if data is too large.
Integer; grid length for the response to evaluate predictions at,
if newdata
does not contain the response.
Numeric or factor; user-supplied grid of response values to evaluate
the predictions. Defaults to NULL
. If overwritten, K
is
ignored.
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.
Function; applied to the log-likelihood values of all observations.
Logical; lags may already be computed by a different method (e.g. plot)
Return individual gradients instead of the summed
gradients; the residuals are 0.5 * rowSums(gradients)
Integer; number of simulations; defaults to 1.
Seed for generating samples; defaults to NULL
.
Object of class "deeptrafo"
.
Logical; print keras model.
Logical; print coefficients.
Logical; print baseline coefs.
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
.