Warning when using non-normal link function for generalized linear models with fitglme

9 visualizzazioni (ultimi 30 giorni)
When I fit my data to a generalized linear model using the function fitglme, I get the following warning:
Warning: The 'Reciprocal' and 'Power' links require the linear predictor to be non-negative. However, the model
assumes that the linear predictor is unconstrained.
This happens although the data are non-negative, and I do not see any option to tell the fitting function that it should not worry. Question: How do I avoid this warning? (I mean "avoid" not "suppress". A warning usually indicates that something is wrong, so how do I correct it?)

Risposte (1)

Ayush
Ayush il 20 Giu 2024
Hey Kim,
I understand that you are encountering a warning when fitting a generalized linear model using fitglme in MATLAB, specifically when employing 'Reciprocal' or 'Power' link functions. This warning is due to the requirement for the linear predictor to be non-negative, and you're looking for a way to address this issue.
To avoid the warning about the linear predictor being non-negative when using 'Reciprocal' or 'Power' links in "fitglme", consider the following approaches:
  1. Transform Predictors: Adjust your predictor variables through transformations (e.g., logarithmic) to ensure the linear predictor remains positive.
  2. Change Link Function: If possible, switch to a different link function that doesn't require a strictly positive linear predictor, such as the log link or the identity link.
  3. Initial Values: Check and adjust the initial values for the model fitting process to guide it towards a solution that maintains a positive linear predictor.
For more information on the link functions , you can refer to the following MathWorks documentation: https://in.mathworks.com/help/stats/fitglme.html
Hope this helps!
Regards
  1 Commento
Kim Bostroem
Kim Bostroem il 20 Giu 2024
Hi Ayush, thank you so much for your response!
However, I do not understand what I would have to do, really.
Transform Predictors: What do you mean by transforming the predictor? I thought, Generalized linear models are superior to standard linear models of transformed variables, which is why I use them in the first place. Sure, I could transform my dependent variable by log function and then perform a standard linear model fit on the transformed data, but then I would not need special distribution and link functions in the first place. Also, this is not really equivalent to using a Generalized linear model (with the appropriate distribution and link function). Or did I misunderstand you here?
Change Link Function: the log as a link function throws the same warning, as it also requires non-negative data. The identity link is not appropriate for Gamma and InverseGaussian distribution. I would rather stick to their corresponding canonical link functions or at least a best-fit alternative, which is in most cases not the identity function.
Initial Values: This sounds interesting, but how can I accomplish this, using fitglme?
Sorry for being stupid, but may I ask you for some clarification on these issues? I would be very thankful!

Accedi per commentare.

Prodotti


Release

R2023a

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by