Questions tagged [gamlss]

Collection of R functions to fit Generalized Additive Models for Location Scale and Shape (GAMLSS)

Generalized Additive Models for Location Scale and Shape (GAMLSS) is a general framework for univariate regression type statistical problems using new ways of dealing with overdispersion, skewness and kurtosis in the response variable.

Reference
Stasinopoulos D. M. Rigby R.A. (2007) Generalized additive models for location scale and shape (GAMLSS) in R. Journal of Statistical Software, Vol. 23, Issue 7, Dec 2007

76 questions
3
votes
1 answer

r gamlss: prediction of z-scores using regression with multiple explanatory variables

The function centiles.pred is a great option to extract z-scores based on a gamlss model like in the following code: library(gamlss) FIT = gamlss(mpg ~ disp, data = mtcars, family = BCPE) NEWDATA = data.frame(disp = 300, mpg =…
ehi
  • 409
  • 8
  • 23
3
votes
2 answers

How to do an inverse orderNorm transformation (bestNormalize package) from a GAMLSS object?

My y variable (n=30,000) is distributed with very heavy tails (both positive and negative), for which the fitDist GAMLSS function selects the ST4 family. I tried to assess a GAMLSS-based regression with an explanatory variable x (pb smoothing), but…
denis
  • 199
  • 1
  • 8
3
votes
2 answers

gamlss Error in while (abs(G.dev.old - G.dev) > c.crit && iter < n.cyc)

I'v been working with this data year rango_edad Sexo zona_2016 conteo siniestros expuestos upc_millon valor_millon freq 1 2010 01. < 1 F Alejada 180 87 75 121 111 0.48 2 2010 01. < 1 F Ciudades 103453…
bubleskmy
  • 131
  • 1
  • 9
3
votes
2 answers

dplyr: Evaluation error: object '.' not found with gamlss but all good with lm, gam, glm methods

Context: tidyverse and dplyr environment/work-flow. I'd appreciate insights into how to resolve the following issue, which I have encountered while trying to work with collections of regression results. This minimal reproducible shows the…
Hedgehog
  • 5,487
  • 4
  • 36
  • 43
3
votes
1 answer

Predicting binary response probabilities from gamlss R object

I want to predict binary class probabilities/class labels from gamlss R function, how can the predict function be used to get them? I have the following sample code library(gamlss) X1 <- rnorm(500) X2 <- sample(c("A","C","D","E"),500, replace =…
Khan
  • 107
  • 1
  • 9
3
votes
1 answer

Getting percentile values from gamlss centile curves

This question is related to: Selecting Percentile curves using gamlss::lms in R I can get centile curve from following data and code: age = sample(5:15, 500, replace=T) yvar = rnorm(500, age, 20) mydata = data.frame(age, yvar) head(mydata) age …
rnso
  • 23,686
  • 25
  • 112
  • 234
2
votes
1 answer

Error when predicting partial effects using new data for gamlss model

I'm here re-raising the issue of predicting CI's for gamlss models using the newdata argument. A further complication is that I'm interested in partial effects as well. A closely related issue (without partial effects) was un-resolved in 2018: Error…
WiggyStardust
  • 182
  • 1
  • 10
2
votes
0 answers

Predict new-values/z-score in gamlss non-linear model

Being a relatively newby on gamlss I am likely missing something. I'm trying to model some growth charts and have evaluated different options and find (by plotting, GAIC evaluation and hyper paramater optimisation) that the following model provides…
Richard
  • 21
  • 2
2
votes
0 answers

GAMLSS error: Predicting fitted values from new dataset

I have built a GAMLSS model to investigate population drivers for a fish species based on an existing dataset, but a problem has arisen when trying to predict response values for a new dataset. To create a dummy dataset: Site <- c("Angle…
Monjon
  • 31
  • 4
2
votes
0 answers

GAMLSS with cross-classified random effects

I would like to estimate the effect of a candidate's name on the proportion of negative preference votes she receives. My dependent variable "negative preference votes" measures the percentage of occasions a candidate is crossed off from a party…
Lea
  • 21
  • 2
2
votes
1 answer

Selecting Percentile curves using gamlss::lms in R

I am using example code from gamlss package to draw percentile curves: library(gamlss) data(abdom) lms(y,x , data=abdom, n.cyc=30) It is drawing its own set of percentile curves. How can I choose to draw only 10th, 50th and 90th percentile…
rnso
  • 23,686
  • 25
  • 112
  • 234
1
vote
0 answers

R: unexpected behaviour of function (probably due to environmental scope of formula object within function)

Although a long time user of R, I have little experience to write complex programs in R. During one of my first tries, I experience a unexpected behavior of my code. Namely, if I try to run a function which I have defined my self, a wrapper around a…
1
vote
1 answer

How to generate random numbers from the best fitted distribution with gamlss?

Objective Find the best fitted distribution for data and then generate random numbers from this distribution. Example Using the gamlss package in R, I found that the best fit distribution is "Skew exponential power (Azzalini type…
umair durrani
  • 5,597
  • 8
  • 45
  • 85
1
vote
2 answers

r gamlss: predicting standard deviation and calculating z-scores

I want to estimate predicted values for the mean (mu) and standard deviation (sigma) based on a gamlss model. However, it is not clear to me how to extract a standard deviation for given values of x The data frame I am using looks like this: #>…
ehi
  • 409
  • 8
  • 23
1
vote
1 answer

R gamlss.dist exGAUS versus scipy.stats exponnorm-- how to get same answer

I'm trying to replicate the answer from R's gamlss.dist exGAUS in Python's scipy.stats.exponnorm. The following in R returns -0.4003516: library(gamlss) qexGAUS(0.5, mu = -1., sigma = .6, nu = .7, lower.tail = TRUE, log.p = FALSE) However, the…
a11
  • 3,122
  • 4
  • 27
  • 66
1
2 3 4 5 6