Displaying 1 result from an estimated 1 matches for "modpc1".
Did you mean:
model1
2012 Jun 19
1
Error when trying to update cpglm model
...
dat<-expand.grid(period=period,herd=herd)
beta<-c(-.3,1.7,2.5,3.4)
X<-model.matrix(~period,dat)
mu<-as.vector(exp(X%*%beta))
phi<-1; p<-1.6
dat$resp<-rtweedie(nrow(dat),p,mu,phi)
## cpglm model
modPC1<-cpglm(resp~period,data=dat)
head(modPC1@model.frame)
## Simulating new response vector and re-fitting the model
sim.hnp<-function(glmfit){
dat.1<-glmfit@model.frame
n<-nrow(dat.1)
dat.1[,1]<-rtweedie(n,glmfit$p,fitted(glmfit),glmfit$phi)
mfun<-update(object=glmfit,da...