Running ‘test_code.r’
Running the tests in ‘tests/test_code.r’ failed.
Complete output:
  > #library(tscount)
  > 
  > begin <- Sys.time()
  > 
  > checkfit <- function(seed, n=50, model, param, xreg=NULL, distr="poisson", distrcoefs=NULL, link="identity", startestims=FALSE, extended=FALSE, interv=FALSE, ...){
  +   if(missing(seed)) seed <- 1945
  +   set.seed(seed)
  +   #Simulate a time series from the given model:
  +   timser <- tsglm.sim(n=n, param=param, model=model, xreg=xreg, link=link, distr=distr, distrcoefs=distrcoefs)$ts
  +   print(unlist(param))
  +   #Fit the given model to the time series:
  +   print(fit <- tsglm(ts=timser, model=model, xreg=xreg, link=link, distr=distr, ...))
  +   if(startestims){ #Try the different methods for start estimation:
  +     tsglm(ts=timser, model=model, xreg=xreg, link=link, distr=distr, start.control=list(method="iid"), final.control=NULL)
  +     tsglm(ts=timser, model=model, xreg=xreg, link=link, distr=distr, start.control=list(method="GLM"), final.control=NULL)
  +     tsglm(ts=timser, model=model, xreg=xreg, link=link, distr=distr, start.control=list(method="CSS"), final.control=NULL)
  +     tsglm(ts=timser, model=model, xreg=xreg, link=link, distr=distr, start.control=list(method="MM"), final.control=NULL)
  +   }
  +   if(extended){ #Apply the standard methods for the fitted model:
  +     summary(fit)
  +     residuals(fit, type="pearson")
  +     residuals(fit, type="anscombe")
  +     par(mfrow=c(3,2))
  +       plot(fit, ask=FALSE)
  +     fitted(fit)
  +     coef(fit)
  +     predict(fit, n.ahead=4)
  +     #logLik(fit) #already included in summary-method
  +     vcov(fit)
  +     #AIC(fit) #already included in summary-method
  +     #BIC(fit) #already included in summary-method
  +     se(fit, B=3)
  +     #pit(fit) #already included in plot-method
  +     #marcal(fit) #already included in plot-method
  +     scoring(fit)
  +   }
  +   if(interv){
  +     interv_test(fit, tau=floor(n/2), delta=0.8, external=FALSE, est_interv=TRUE, ...)
  +     interv_detect(fit, taus=floor(0.45*n):ceiling(0.55*n), delta=0.8, B=3, ...)
  +     interv_multiple(fit, taus=floor(0.45*n):ceiling(0.55*n), deltas=c(0,1), B=3, final.control_bootstrap=NULL, ...)
  +   }
  +   return(TRUE)
  + }
  > 
  > checkfit(model=list(past_obs=1, past_mean=1), param=list(intercept=2, past_obs=0.4, past_mean=0.3), startestims=TRUE, extended=TRUE)
  Error in tsglm.sim(n = n, param = param, model = model, xreg = xreg, link = link,  : 
    could not find function "tsglm.sim"
  Calls: checkfit
  Execution halted