如何修复GAMLSS回归中未找到的glim.fit'fit'中的错误

时间:2018-11-26 06:56:13

标签: r regression non-linear-regression gamlss

我正在尝试执行gamlss的零膨胀beta回归模型,如下所示>它在变量V255上可以正常工作,但对于类似变量V256却出错,如

 Error in glim.fit(f = nu.object, X = nu.X, y = y, w = w, fv = nu, os = nu.offset,  : 
      object 'fit' not foundim.fit. Object 'fit' not found.

是否有解决此问题的建议? 代码和模型。

library(tidyverse)
library(gamlss)

ddf<-as_tibble(structure(c(0, 0.250601410865784, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
                            0, 0, 0, 0.0859533622860909, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
                            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.070460669696331, 
                            0, 0, 0, 0.0223423503339291, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
                            0, 0, 0, 0, 0, 0, 0, 0, 0, 0.249115347862244, 0, 0, 0, 0, 0, 
                            0, 0, 0, 0, 0, 0, 0, 0.135218366980553, 0, 0, 0, 0, 0, 0, 0, 
                            0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0.069370836019516, 
                            0, 0, 0, 0.0225795395672321, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 
                            0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 
                            13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 
                            29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, 43, 44, 
                            45, 46, 47, 48, 49, 50, 51, 52, 53, 54, 55, 56, 57, 58, 59, 60, 
                            61, 62, 63, 64, 65), .Dim = c(65L, 3L), .Dimnames = list(NULL, 
                                                                                     c("V255", "V256", "year"))))
ddf
#Model for variable V255, it works 
model1<-gamlss(ddf$V255~ddf$year, sigma.fo=~ddf$year, nu.fo=~ddf$year,tau.fo=~ddf$year, family=BEINF)
model1
#Model for varable V256; it through an error
model2<-gamlss(ddf$V256~ddf$year, sigma.fo=~ddf$year, nu.fo=~ddf$year,tau.fo=~ddf$year, family=BEINF)

0 个答案:

没有答案