generalized linear model: ¿'distribution' and 'link function'?

General help and assistance with jamovi. Bug reports can be made at our issues page: https://github.com/jamovi/jamovi/issues . (If you're unsure feel free to discuss it here)
Post Reply
vliborio
Posts: 4
Joined: Fri May 12, 2023 10:49 am

generalized linear model: ¿'distribution' and 'link function'?

Post by vliborio »

Good morning everyone, this is my first question in the forum and maybe quite simple but I'm trying to launch a generalized linear model in Jamovi and I was wondering when you choose 'custom model', what's the difference between 'distribution' and 'link function'?
Also, I'd like to know when you've launched a GLM and in the AIC or BIC appears 'Inf', what does it mean?

Thanks in advance and congratulations on the software, it's amazing!
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: generalized linear model: ¿'distribution' and 'link function'?

Post by mcfanda@gmail.com »

A generalized linear model is a linear model in which the dependent variable is not a continuous normally distributed variate, but a variable of different types, such as a dichotomous or politomous variable, or a count variable, an ordinal variable, etc. depending on the specific application. To accommodate that, the linear function does not assume a normal distribution, but allows for different types of distribution. So, that is the meaning of "distribution": you can pick different distributions depending to the type of variable you have. "Binomial", for instance, works for dichotomous dependent variables, whereas "Poisson" works with count data (in theory).

To accommodate for the fact that the dependent variable is not continuous, the predicted values should be expressed in a different scale than the original variable scale, because the linear model can fit only continuous predicted values, ranging from -Inf to Inf (any real number should be make sense in the scale of the predicted values). Thus, the model predicts a "transformation" of the fitted values: The transformation is the link function. In logistic, for instance, the original scale is the probability of being in one group rather than the other. The link function is the logit function, which transform a measure ranging from 0 to 1 into a scale from -Inf to Inf, so it does the work.
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: generalized linear model: ¿'distribution' and 'link function'?

Post by mcfanda@gmail.com »

Here is some material you may read about it https://gamlj.github.io/book/gzlm.html
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: generalized linear model: ¿'distribution' and 'link function'?

Post by mcfanda@gmail.com »

What do you mean exactly by "the exact requirements of the algorithms to bring the best efficiency to the final result."?
User avatar
jonathon
Posts: 2613
Joined: Fri Jan 27, 2017 10:04 am

Re: generalized linear model: ¿'distribution' and 'link function'?

Post by jonathon »

that was spam, mc ... i've deleted it
vliborio
Posts: 4
Joined: Fri May 12, 2023 10:49 am

Re: generalized linear model: ¿'distribution' and 'link function'?

Post by vliborio »

Hi mcfanda! First of all thank you a lot for the answer, it's been really helpful. Nevertheless, I have still some points that I didn't get about the 'link function'.
This function is for data that does not follow that available distributions in Jamovi (Gaussian, Poisson, etc.) and with this function you transform this data into one of the distributions aforementioned? Taking the example you gave, in logistic we apply a 'Logit' and then this will follow one of those distributions?.

Thank you again for your anwser!
Bests,
vliborio
Posts: 4
Joined: Fri May 12, 2023 10:49 am

Re: generalized linear model: ¿'distribution' and 'link function'?

Post by vliborio »

mcfanda@gmail.com wrote: Wed May 24, 2023 1:08 pm What do you mean exactly by "the exact requirements of the algorithms to bring the best efficiency to the final result."?
Hi mcfanda! First of all thank you a lot for the answer, it's been really helpful. Nevertheless, I have still some points that I didn't get about the 'link function'.
This function is for data that does not follow that available distributions in Jamovi (Gaussian, Poisson, etc.) and with this function you transform this data into one of the distributions aforementioned? Taking the example you gave, in logistic we apply a 'Logit' and then this will follow one of those distributions?.

Thank you again for your anwser!
Bests,
User avatar
mcfanda@gmail.com
Posts: 457
Joined: Thu Mar 23, 2017 9:24 pm

Re: generalized linear model: ¿'distribution' and 'link function'?

Post by mcfanda@gmail.com »

The link function is the function a generalized linear model uses to scale the predicted values, not the actual data. It is not a jamovi or any other software thing. It's the mathematics of the generalized linear model that requires a function to express the predicted values in a way that is compatible with the linear model.

You can find details in Agresti (2015) Foundations of Linear and Generalized Linear Models, in the links mentioned in the previous posts, or any source that explains the generalized linear model. To get the meaning of the link function you need to have very clear how the generalized linear model works (independently of the software you use)
Post Reply