0

我正在尝试使用 logit 链接在模拟数据集上拟合 beta 回归模型。我知道 Betareg() 在处理包含值太接近 1 或 0 的数据时可能存在错误。但是在我使用 rnorm() 的模拟数据集中,有时,Betareg() 仍然报告错误并为某些看起来的数据生成 NaN很好,并且没有太接近 1 或 0 的值。有人可以帮我吗?

数据是

> x<-c(0.1, 0.2, 0.4, 0.8, 1.6, 3.2, 6.4)
> y
           [,1]       [,2]       [,3]       [,4]       [,5]
[1,] 0.01779058 0.02210689 0.02152855 0.02037511 0.02094074
[2,] 0.06070216 0.06936479 0.06911103 0.06606770 0.06664003
[3,] 0.18223578 0.19705668 0.19656892 0.19700391 0.19229480
[4,] 0.45660308 0.44121469 0.45117471 0.45561142 0.43977104
[5,] 0.74109078 0.73783605 0.74497220 0.72809619 0.73898651
[6,] 0.90884892 0.90109477 0.90387874 0.90309146 0.90403630
[7,] 0.97270366 0.96866961 0.96959994 0.96985593 0.96910566
> log.x<-log(x)
> betareg(y[,1] ~ log.x)

错误消息是

Error in chol.default(K) : 
  the leading minor of order 3 is not positive definite
In addition: Warning message:
In sqrt(wpp) : NaNs produced
Error in chol.default(K) : 
  the leading minor of order 3 is not positive definite
In addition: Warning messages:
1: In betareg.fit(X, Y, Z, weights, offset, link, link.phi, type, control) :
  failed to invert the information matrix: iteration stopped prematurely
2: In sqrt(wpp) : NaNs produced
4

0 回答 0