dr_init: Initializing a Distributional Regression Model

View source: R/deepregression.R

dr_initR Documentation

Initializing a Distributional Regression Model

Description

Initializing a Distributional Regression Model

Usage

dr_init(
  n_obs,
  ncol_structured,
  list_structured,
  nr_params = 2,
  family,
  dist_fun = NULL,
  weights = NULL,
  monitor_metric = list(),
  output_dim = 1,
  mixture_dist = FALSE,
  ind_fun = function(x) x,
  extend_output_dim = 0,
  offset = NULL,
  additional_penalty = NULL,
  fsbatch_options = fsbatch_control(),
  optimizer = tf$keras$optimizers$SGD()
)

Arguments

n_obs

number of observations

ncol_structured

a vector of length #parameters defining the number of variables used for each of the parameters. If any of the parameters is not modelled using a structured part the corresponding entry must be zero.

list_structured

list of (non-linear) structured layers (list length between 0 and number of parameters)

nr_params

number of distribution parameters

family

family specifying the distribution that is modelled

dist_fun

a custom distribution applied to the last layer, see make_tfd_dist for more details on how to construct a custom distribution function.

weights

observation weights used in the likelihood

monitor_metric

see ?deepregression

output_dim

dimension of the output (> 1 for multivariate outcomes)

mixture_dist

see ?deepregression

ind_fun

see ?deepregression

extend_output_dim

see ?deepregression

offset

list of logicals corresponding to the paramters; defines per parameter if an offset should be added to the predictor

additional_penalty

to specify any additional penalty, provide a function that takes the model$trainable_weights as input and applies the additional penalty. In order to get the correct index for the trainable weights, you can run the model once and check its structure.

fsbatch_options

options for Fellner-Schall algorithm, see ?deepregression

optimizer

see ?deepregression


davidruegamer/deepregression documentation built on May 30, 2022, 6:21 p.m.