[英]How do I use t-distribution with glm() in R?
I've established pretty conclusively that the residuals I'm generating with a standard lm()
regression can be reasonably modeled by a t-distribution with 6-ish degrees of freedom. 我已经非常确定性地确定,我可以使用标准lm()
回归生成的残差可以通过自由度为6的t分布合理地建模。 I'd like to use glm()
with that error model, but I'm not seeing that the t fits into one of the families. 我想将glm()
与该错误模型一起使用,但是我没有看到t适合其中一个系列。 Any recommendations on either alternatives to glm()
that play well with t, or a family that would serve reasonably well as a substitute for (or superset of) t? 是否有任何建议与t一起使用的glm()
替代方案,或对t的替代(或替代)合理发挥作用的家族?
Package heavy
can perform t-student regression models. heavy
包装可以执行t型学生回归模型。 Here is an example from the documentation: 这是文档中的一个示例:
library(heavy)
data(ereturns)
fit <- heavyLm(m.marietta ~ CRSP, data = ereturns, family = Student(df = 6))
summary(fit)
# Linear model under heavy-tailed distributions
# Data: ereturns; Family: Student(df = 2.83727)
#
# Residuals:
# Min 1Q Median 3Q Max
# -0.142237 -0.036156 0.003433 0.041310 0.546533
#
# Coefficients:
# Estimate Std.Error Z value p-value
# (Intercept) -0.0072 0.0082 -0.8876 0.3748
# CRSP 1.2637 0.1902 6.6459 0.0000
#
# Degrees of freedom: 60 total; 58 residual
# Scale estimate: 0.002520795
# Log-likelihood: 71.81294 on 3 degrees of freedom
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.