tests/gbm.R

library(spatPomp)
set.seed(2)

gbm_model <- gbm(U=2,N=5) 

gbm_pf <- pfilter(gbm_model,Np=5)

paste("gbm pfilter loglik:",round(logLik(gbm_pf),3))

## A call to igirf using the moment-based guide function can test compiled code for eunit_measure, munit_measure, vunit_measure, dunit_measure, runit_measure, rprocess, skeleton, rinit and partrans. 

gbm_igirf_out <- igirf(gbm_model,
  Ngirf = 2,
  rw.sd = rw_sd(rho=0.02, sigma=0.02, tau=0.02),
  cooling.type = "geometric",
  cooling.fraction.50 = 0.5,
  Np=5,
  Ninter = 2,
  lookahead = 1,
  Nguide = 4,
  kind = 'moment',
  verbose = FALSE
)

paste("gbm igirf loglik:", round(logLik(gbm_igirf_out),3))

## --------------------------------------------
## using gbm to test arma_benchmark()
## ____________________________________________

a1 <- arma_benchmark(gbm_model,order=c(1,0,0))

paste("ARMA benchmark:", round(a1$total,3))
kidusasfaw/spatPomp documentation built on May 2, 2024, 6:12 p.m.