gamma_to_theta: Transform raw intercept function to constrained one

View source: R/mod_baseline.R

gamma_to_thetaR Documentation

Transform raw intercept function to constrained one

Description

Converts raw intercept function, which is the output of mod_baseline, to the valid intercept function, which is used to evaluate the likelihood and it's gradient. Namely, theta_1 = gamma_1, theta_k = theta_1 + sum_i = 1^k-1 exp(gamma_i) and by convention theta_0 = -Inf, theta_K = Inf.

Usage

gamma_to_theta(gammas)

Value

Returns a tf.tensor containing theta_0 to theta_K

Examples

gammas <- tf$constant(c(0, -1, -1, -1), shape = c(1L, 4L), dtype = "float32")
gamma_to_theta(gammas)

LucasKookUZH/ontram-pkg documentation built on March 27, 2023, 6:05 p.m.