Running ‘tests.R’ [0s/1s]
Running the tests in ‘tests/tests.R’ failed.
Complete output:
  > 
  > require(dlmodeler)
  Loading required package: dlmodeler
  > 
  > ####################
  > # tests for 'core' #
  > ####################
  > 
  > # create a DLM by specifying its vectors and matrices
  > # check if the model is valid
  > mod <- dlmodeler.build(
  + 		a0 = c(0,0), # initial state: (level, trend)
  + 		P0 = diag(c(0,0)), # initial state variance set to...
  + 		P0inf = diag(2), # ...use exact diffuse initialization
  + 		matrix(c(1,0,1,1),2,2), # state transition matrix
  + 		diag(c(1,1)), # state disturbance selection matrix
  + 		diag(c(.5,.05)), # state disturbance variance matrix
  + 		matrix(c(1,0),1,2), # observation design matrix
  + 		matrix(1,1,1) # observation disturbance variance matrix
  + )
  > 
  > print(mod)
  constant dlmodel(state dim=2, dist dim=2, obs dim=1) 'noname'
   - model has 1 component: noname
  > if(!(dlmodeler.check(mod)$status==TRUE)) stop("unit test failed")
  > if(!(dlmodeler.check(mod)$m==2)) stop("unit test failed")
  > if(!(dlmodeler.check(mod)$r==2)) stop("unit test failed")
  > if(!(dlmodeler.check(mod)$d==1)) stop("unit test failed")
  > if(!(dlmodeler.check(mod)$timevar==FALSE)) stop("unit test failed")
  > if(!(is.na(dlmodeler.check(mod)$timevar.Tt))) stop("unit test failed")
  > if(!(is.na(dlmodeler.check(mod)$timevar.Rt))) stop("unit test failed")
  > if(!(is.na(dlmodeler.check(mod)$timevar.Qt))) stop("unit test failed")
  > if(!(is.na(dlmodeler.check(mod)$timevar.Zt))) stop("unit test failed")
  > if(!(is.na(dlmodeler.check(mod)$timevar.Ht))) stop("unit test failed")
  > 
  > 
  > # an empty DLM with 4 state variables (3 of which are stochastic)
  > # and bi-variate observations, check if the model is valid
  > mod <- dlmodeler.build(dimensions=c(4,3,2))
  > 
  > print(mod)
  constant dlmodel(state dim=4, dist dim=3, obs dim=2) 'noname'
   - model has 1 component: noname
  > if(!(dlmodeler.check(mod)$status==TRUE)) stop("unit test failed")
  > if(!(dlmodeler.check(mod)$m==4)) stop("unit test failed")
  > if(!(dlmodeler.check(mod)$r==3)) stop("unit test failed")
  > if(!(dlmodeler.check(mod)$d==2)) stop("unit test failed")
  > if(!(dlmodeler.check(mod)$timevar==FALSE)) stop("unit test failed")
  > if(!(is.na(dlmodeler.check(mod)$timevar.Tt))) stop("unit test failed")
  > if(!(is.na(dlmodeler.check(mod)$timevar.Rt))) stop("unit test failed")
  > if(!(is.na(dlmodeler.check(mod)$timevar.Qt))) stop("unit test failed")
  > if(!(is.na(dlmodeler.check(mod)$timevar.Zt))) stop("unit test failed")
  > if(!(is.na(dlmodeler.check(mod)$timevar.Ht))) stop("unit test failed")
  > 
  > 
  > # operations on matrices
  > v1 <- matrix(1:9,nrow=3,ncol=3)
  > v2 <- array(1:18,dim=c(3,3,2))
  > 
  > m1 <- dlmodeler:::dlmodeler.timevar.fun(v1,v1,function(x,y) x+y)
  > if(!(sum(abs(m1-v1-v1))==0)) stop("unit test failed")
  > m21 <- dlmodeler:::dlmodeler.timevar.fun(v2,v1,function(x,y) x+y)
  > if(!(sum(abs(m21[,,1]-v1-v1))==0)) stop("unit test failed")
  > if(!(sum(abs(m21[,,2]-v1-v1-9))==0)) stop("unit test failed")
  > m22 <- dlmodeler:::dlmodeler.timevar.fun(v1,v2,function(x,y) x+y)
  > if(!(sum(abs(m22[,,1]-m21[,,1]))==0)) stop("unit test failed")
  > if(!(sum(abs(m22[,,2]-m21[,,2]))==0)) stop("unit test failed")
  > m3 <- dlmodeler:::dlmodeler.timevar.fun(v2,v1,function(x,y) x+y)
  > if(!(sum(abs(m3[,,1]-v1-v1))==0)) stop("unit test failed")
  > if(!(sum(abs(m3[,,2]-v1-matrix(10:18,nrow=3,ncol=3)))==0)) stop("unit test failed")
  > 
  > mt <- matrix(c(0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,9,9,9,0,0,0,9,9,9,0,0,0,9,9,9),nrow=6,ncol=6)
  > md <- dlmodeler:::dlmodeler.timevar.fun(v1,v2,dlmodeler:::dlmodeler.bdiag)
  > if(!(sum(abs(md[,,2]-md[,,1]-mt))==0)) stop("unit test failed")
  > 
  > # operators
  > m1 <- dlmodeler.build.dseasonal(12)
  > m2 <- dlmodeler.build.polynomial(0)
  > m3 <- dlmodeler.build.dseasonal(5)
  > m4 <- dlmodeler.build.constant(4)
  > 
  > m1+m2+m3
  Error in m1 + m2 : non-numeric argument to binary operator
  Execution halted