[R] gamlss question

2016-12-22 Thread George Trojan - NOAA Federal
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]]

__
R-help@r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


Re: [R] GAMLSS Question

2011-03-19 Thread Tóth Dénes

Hi,

predictAll should do what you want. See ?predict.gamlss.

HTH,
  Denes





> Dear All:
>
> I have succeeded in fitting a GAMLSS.dist model to growth data I am
> working
> with it.
>
> My aim is to create a matrix of  predicted percentiles and the
> corresponding
> the fitted model's sigma mu nu by agebins.
>
> Q:
> How do it generate these parameters as in L M S per Cole and Green 1992?
>
> Here are my working codes.
>
>   Name of fitted model is gamlssfit
>
>> Agebin<-seq(6,36,6)
>>centmatx
> <-centiles.pred(gamlssfit,xname="agemos",xvalues=Agebin,cent=c(10,25,50,75,90))
>
> Although I got matrix of the percentiles by agebins, I want to obtain the
> L
> M S/sigma mu nu corresponding to the same agebins.
>
>
> Any help here will be appreciated.
>
> Thanks,
>
> Y Addo
>
>
>
>
> --
> View this message in context:
> http://r.789695.n4.nabble.com/GAMLSS-Question-tp3389986p3389986.html
> Sent from the R help mailing list archive at Nabble.com.
>
> __
> R-help@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-help
> PLEASE do read the posting guide
> http://www.R-project.org/posting-guide.html
> and provide commented, minimal, self-contained, reproducible code.
>

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.


[R] GAMLSS Question

2011-03-19 Thread YAddo
Dear All:

I have succeeded in fitting a GAMLSS.dist model to growth data I am working
with it.

My aim is to create a matrix of  predicted percentiles and the corresponding 
the fitted model's sigma mu nu by agebins.

Q:
How do it generate these parameters as in L M S per Cole and Green 1992?

Here are my working codes. 

  Name of fitted model is gamlssfit

> Agebin<-seq(6,36,6)
>centmatx
<-centiles.pred(gamlssfit,xname="agemos",xvalues=Agebin,cent=c(10,25,50,75,90))

Although I got matrix of the percentiles by agebins, I want to obtain the L
M S/sigma mu nu corresponding to the same agebins.


Any help here will be appreciated.

Thanks,

Y Addo




--
View this message in context: 
http://r.789695.n4.nabble.com/GAMLSS-Question-tp3389986p3389986.html
Sent from the R help mailing list archive at Nabble.com.

__
R-help@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.