Running examples in ‘bsts-Ex.R’ failed
The error most likely occurred in:

> ### Name: mbsts
> ### Title: Multivariate Bayesian Structural Time Series
> ### Aliases: mbsts
> ### Keywords: models regression
> 
> ### ** Examples
> 
> seed <- 8675309
> set.seed(seed)
> 
> ntimes <- 250
> nseries <- 20
> nfactors <- 6
> residual.sd <- 1.2
> state.innovation.sd <- .75
> 
> ##---------------------------------------------------------------------------
> ## simulate latent state for fake data.
> ##---------------------------------------------------------------------------
> state <- matrix(rnorm(ntimes * nfactors, 0, state.innovation.sd), nrow = ntimes)
> for (i in 1:ncol(state)) {
+   state[, i] <- cumsum(state[, i])
+ }
> 
> ##---------------------------------------------------------------------------
> ## Simulate "observed" data from state.
> ##---------------------------------------------------------------------------
> observation.coefficients <- matrix(rnorm(nseries * nfactors), nrow = nseries)
> print("observation.coefficients =\n", observation.coefficients)
[1] "observation.coefficients =\n"
> diag(observation.coefficients) <- 1.0
> observation.coefficients[upper.tri(observation.coefficients)] <- 0
> 
> errors <- matrix(rnorm(nseries * ntimes, 0, residual.sd), ncol = ntimes)
> y <- t(observation.coefficients %*% t(state) + errors)
> 
> ## Not run: 
> ##D cat("simulated y (first 10 rows): \n")
> ##D print(y[1:10, ])
> ##D 
> ##D ##---------------------------------------------------------------------------
> ##D ## Plot the data.
> ##D ##---------------------------------------------------------------------------
> ##D par(mfrow=c(1,2))
> ##D plot.ts(y, plot.type="single", col = rainbow(nseries), main = "observed data")
> ##D plot.ts(state, plot.type = "single", col = 1:nfactors, main = "latent state")
> ## End(Not run)
> 
> ##---------------------------------------------------------------------------
> ## Fit the model
> ##---------------------------------------------------------------------------
> ss <- AddSharedLocalLevel(list(), y, nfactors = nfactors)
> 
> opts <- list("fixed.state" = t(state),
+   fixed.residual.sd = rep(residual.sd, nseries),
+   fixed.regression.coefficients = matrix(rep(0, nseries), ncol = 1))
> 
> model <- mbsts(y, shared.state.specification = ss, niter = 100,
+   data.format = "wide", seed = seed)
=-=-=-=-= Iteration 0 Tue Apr 28 15:02:41 2020 =-=-=-=-=
=-=-=-=-= Iteration 10 Tue Apr 28 15:02:43 2020 =-=-=-=-=
=-=-=-=-= Iteration 20 Tue Apr 28 15:02:44 2020 =-=-=-=-=
=-=-=-=-= Iteration 30 Tue Apr 28 15:02:45 2020 =-=-=-=-=
=-=-=-=-= Iteration 40 Tue Apr 28 15:02:47 2020 =-=-=-=-=
=-=-=-=-= Iteration 50 Tue Apr 28 15:02:48 2020 =-=-=-=-=
=-=-=-=-= Iteration 60 Tue Apr 28 15:02:49 2020 =-=-=-=-=
=-=-=-=-= Iteration 70 Tue Apr 28 15:02:51 2020 =-=-=-=-=
=-=-=-=-= Iteration 80 Tue Apr 28 15:02:51 2020 =-=-=-=-=
=-=-=-=-= Iteration 90 Tue Apr 28 15:02:52 2020 =-=-=-=-=
> 
> ##---------------------------------------------------------------------------
> ## Plot the state
> ##---------------------------------------------------------------------------
> par(mfrow=c(1, nfactors))
> ylim <- range(model$shared.state, state)
> for (j in 1:nfactors) {
+   PlotDynamicDistribution(model$shared.state[, j, ], ylim=ylim)
+   lines(state[, j], col = "blue")
+ }
Warning in min.default(numeric(0), na.rm = TRUE) :
  no non-missing arguments to min; returning Inf
Warning in max.default(numeric(0), na.rm = TRUE) :
  no non-missing arguments to max; returning -Inf
Error in .FilledPlot(timestamps, cbind(lower.quantile, upper.quantile),  : 
  length(timestamps) == nrow(quantile.matrix) is not TRUE
Calls: PlotDynamicDistribution -> .FilledPlot -> stopifnot
Execution halted