library("gamlss2")
data("abdom", package = "gamlss.data")
## distributional model
f <- y ~ s(x) | s(x) | 1 | 1
## scalar starting values for the distribution parameters
m1 <- gamlss2(f, data = abdom, family = BCT,
start = c(mu = 200, sigma = 0.1, nu = 0, tau = 10))
## fix shape parameters during estimation
m2 <- gamlss2(f, data = abdom, family = BCT,
start = c(mu = 200, sigma = 0.1, nu = 0, tau = 10),
fixed = c(nu = TRUE, tau = TRUE))
## coefficient estimates of the fitted model
coef(m2)
## use fitted additive predictors as starting values
m3 <- gamlss2(f, data = abdom, family = BCT,
start = fitted(m2))
## same using the fitted model object directly
m4 <- gamlss2(f, data = abdom, family = BCT,
start = m2)
## coefficient-wise initialization
m5 <- gamlss2(f, data = abdom, family = BCT,
start = coef(m2))Model Initialization and Parameter Constraints
Description
Guidance on supplying starting values through argument start in gamlss2 and on fixing distribution parameters via fixed in gamlss2_control.
Details
The start argument can be used to initialize estimation in several ways. Supported inputs include:
-
a named numeric vector or list giving one starting value per distribution parameter, such as
mu,sigma,nu, ortau; -
a data frame or matrix with one column per distribution parameter and one row per observation, providing starting values for the full additive predictors;
-
a fitted
“gamlss2”object, in which casefitted()values are used as starting values for all distribution parameters; -
a
coef.gamlss2object, allowing coefficient-wise initialization of linear and smooth terms.
Parameters can be fixed during estimation using the fixed control argument. This is useful, for example, when shape parameters should remain constant while the remaining parameters are estimated.
See Also
gamlss2, gamlss2_control, RS