如何从glmmTMB Conway-Maxwell Poisson回归模型中提取Lambda和Nu参数

问题描述 投票:0回答:1

我正在尝试使用

glmmTMB
包和模型的
family = "compois"
构建康威麦克斯韦泊松模型。该模型工作正常,但我无法从模型中找到任何表示 Conway-Maxwell 的
Lambda
Nu
参数的输出,这阻碍了我运行 Conway-Maxwell 随机数生成器进行模拟

一些简单的代码来说明这一点

install.packages("COMPoissonReg")
install.packages("glmmTMB")
library(COMPoissonReg)
library(glmmTMB)

#Create artificial COM poisson count data as response variable
data <- data.frame(Response = rcmp(5000, lambda = 3, nu = 2))
#Create artificial poisson count data as explanatory variable
data$Covariate <- rpois(5000, lambda = 1)*data$Response

#Run ConwayMaxwellPois glmmTMB regression model
Mod <- glmmTMB(Response ~ Covariate, 
               family = "compois",
               data = data)
summary(Mod)

#Check Models structure
str(Mod)

#Predict mu
predict(Mod, type = "response")
#Predict dispersion parameters
predict(Mod, type = "disp")

predict(Mod, type = "response")
返回实际平均值,而不是lambda,
predict(Mod, type = "disp")
返回小十进制值,我认为这些值不是Nu(我从一些来源读到实际的Nu是
1/predict(Mod, type = "disp")
,但我不确定这是否属实)。

r model poisson glmmtmb
1个回答
0
投票

如果您没有色散参数的模型,则

1/predict(Mod, type = "disp")
为 nu。您的模拟数据没有 nu=2 因为这
data$Covariate <- rpois(5000, lambda = 1)*data$Response
不遵循带有对数链接的 GLM 方程。

您是否考虑过使用

simulate()
内置的
glmmTMB
功能?它可以根据您的拟合模型进行模拟。第392页有一个例子这里

否则,Huang 2017 中的 eqn 2.2 here 定义了 lambda。您可以使用

uniroot
函数来求解每个 mu 值。

© www.soinside.com 2019 - 2024. All rights reserved.