Family objects provide a convenient way to specify the details of the models used by netReg. See also stats::family for more details.

family(object, ...)

gaussian(link = c("identity"))

binomial(link = c("logit", "probit", "log"))

poisson(link = c("log"))

gamma(link = c("inverse"))

beta(link = c("logit", "probit", "log"))

inverse.gaussian(link = c("1/mu^2"))

Arguments

object

a object for which the family shoulr be retured (e.g. edgenet)

...

further arguments passed to methods

link

name of a link function

Value

An object of class netReg.family

family

name of the family

link

name of the link function

linkinv

inverse link function

loss

loss function

Examples

gaussian()
#> family: gaussian #> link: identity
binomial("probit")$link
#> [1] "probit"
poisson()$linkinv
#> function (x) #> tf$maximum(tf$exp(x), tf$float32$min) #> <bytecode: 0x5578c5d265e0> #> <environment: namespace:netReg>
gamma()$linkinv
#> Warning: family gamma is still experimental. enjoy with care.
#> function (x) #> 1/x #> <bytecode: 0x5578c5d938d8> #> <environment: namespace:netReg>
beta()$loss
#> Warning: family beta is still experimental. enjoy with care.
#> function (y, mu.hat, ...) #> { #> obj <- 0 #> eps <- .Machine$double.eps * 1e+09 #> for (j in seq(ncol(y))) { #> mu <- mu.hat[, j] #> phi <- 1 #> p <- mu * phi #> q <- (1 - mu) * phi #> p.trans <- tf$math$maximum(p, eps) #> q.trans <- tf$math$maximum(q, eps) #> prob <- tfprobability::tfd_beta(concentration1 = p.trans, #> concentration0 = q.trans) #> obj <- obj + tf$reduce_sum(prob$log_prob(y[, j])) #> } #> -obj #> } #> <bytecode: 0x5578c5dff240> #> <environment: namespace:netReg>
inverse.gaussian()$loss
#> Warning: family inverse.gaussian is still experimental. enjoy with care.
#> function (y, mu.hat, ...) #> { #> obj <- 0 #> for (j in seq(ncol(y))) { #> prob <- tfprobability::tfd_inverse_gaussian(loc = mu.hat[, #> j], concentration = 1) #> obj <- obj + tf$reduce_sum(prob$log_prob(y[, j])) #> } #> -obj #> } #> <bytecode: 0x5578c5e68170> #> <environment: namespace:netReg>