【发布时间】:2018-03-08 14:50:28
【问题描述】:
head(quart)
str(quart)
#PDB PMTB RNB y
#1 391204.2 1030127 -3.10 0
#2 396498.0 1066861 1.60 0
#'data.frame': 55 obs. of 4 variables:
#$ PDB : num 391204 396498 399217 411447 399135 ...
#$ PMTB: num 1030127 1066861 1165360 1190639 1183382 ...
#$ RNB : num -3.1 1.6 3.1 0.83 0.3 0.6 -1.6 1.04 3.5 2.2 ...
#$ y : int 0 0 0 0 0 0 0 0 0 0 ...
glmMod<-glm(formula = y~PMTB+RNB, data = quart, family = binomial(link
logit),na.action = na.omit, x=TRUE)
x<-glmMod$x
X<-as.matrix(x)
y1<-quart$y
n1<-rep(1, length(quart$y))
y<-cbind(y1,n1-y1)
Y<-as.matrix(y)
library(glarma)
glarMod<-glarma(y,x,type="Bin",phiLags = c(1:2),method = "FS", maxit=100,
grad = 1e-6) #NotError
glarMod<-glarma(y,x,type="Bin",thetaLags = c(1:2),method = "FS", maxit=100,
grad = 1e-6) #Not Error
glarMod<-glarma(y,x,type="Bin",phiLags = c(1:4),method = "FS", maxit=100,
grad = 1e-6) #Error in glarma(y, x, type = "Bin", phiLags = c(1:4), method =
"FS", maxit 100, : Fisher Scoring fails to converge from the initial
estimates.
glarMod<-glarma(y,x,type="Bin",phiLags = c(1:4),thetaLags = c(1:4), method
="FS",maxit=100, grad = 1e-6) #Error in GL$cov %*% GL$ll.d : requires
numeric/complex matrix/vector arguments
我在最后两行中得到一个错误。我尝试在我的格拉玛模型中进行一些组合。当我尝试 AR 和 MA 的高滞后时,我发现了错误
【问题讨论】:
-
你遇到了什么错误?
-
当我尝试使用自回归 (AR) 和移动平均 (MA) 组合运行模型时,Glarma 的包会出错。错误是: 1. Reqierue 数字/复数矩阵/向量参数 2. Fisher Scoring 无法从初始估计收敛。但是,如果我尝试仅使用 AR 或 MA 运行。这是工作。
标签: r