[R] gamlss question

George Trojan - NOAA Federal george.trojan at noaa.gov
Thu Dec 22 19:24:03 CET 2016


What is the recommended way of accessing distribution parameters (mu,
sigma, ...) from the model fit? The indention is to use those values in
d/p/q/r calls. I came out with a wrapper

gamlss_fit <- function(x, family) {
    fit <- gamlssML(x, family = family)
    mu <- fitted(fit, "mu")[1]
    sigma <- fitted(fit, "sigma")[1]
    nu <- ifelse("nu" %in% fit$parameters, fitted(fit, "nu")[1], NA)
    tau <- ifelse("tau" %in% fit$parameters, fitted(fit, "tau")[1], NA)
    list(mu = mu, sigma = sigma, nu = nu, tau = tau)
}

Alternatively, I could write functions to emulate logspline calls to
density estimation.

I suspect I must be missing something obvious. I am relatively new to R.

George

	[[alternative HTML version deleted]]



More information about the R-help mailing list