pymer4 icon indicating copy to clipboard operation
pymer4 copied to clipboard

Is there a may to run in Lmer a log-gaussian link function?

Open PuddleJumper2018 opened this issue 3 years ago • 3 comments

I'm currently using pymer4 for quite a big dataset with over 4000 samples and (obviously) have distribution issues. Is there a way to specify model link function as log-gaussian? I believe in R glmer() takes it as gaussian(link = "log")

PuddleJumper2018 avatar Mar 15 '22 12:03 PuddleJumper2018

Unfortunately currently not. We only support the following families with their default link functions:

implemented_fams = [
            "gaussian",
            "binomial",
            "gamma",
            "inverse_gaussian",
            "poisson",
        ]

I can look into adding an update that supports using a non-default link function.

ejolly avatar Mar 15 '22 17:03 ejolly

@ejolly where can I change the code to implement this? My idea is use the families like the control, it's possible?

DaviYokogawa avatar Mar 22 '23 23:03 DaviYokogawa

@DaviYokogawa Sorry for the delay. If you're interested in those changes I would check out lines 424 and 440 of Lmer.py. Those are the lines that run the model similar to calling lmer or glmer in R and should be able to handle the same arguments. Though you'll want to check out the rpy2 docs for how to structure those arguments.

ejolly avatar Mar 29 '23 19:03 ejolly