This function takes a bamlss object which was created using a sampler function and continues sampling from the last state of the MCMC chain.

continue(object, cores = NULL, combine = TRUE,
  sleep = NULL, results = TRUE, ...)

Arguments

object

A bamlss object which contains samples.

cores

An integer specifying the number of cores that should be used for the sampler function. This is based on function mclapply of the parallel package.

combine

Should the new samples be combined with the old samples into one mcmc matrix? Note that if combine = FALSE and the number of iterations differ from one sampling step to the other there will be an error since the start and end points in the samples mcmc objects are different!

sleep

Time the system should sleep before the next core is started.

results

If a results function was used to create the bamlss object, should the results function be applied using the new samples?

...

Arguments passed to the sampler function.

Value

A bamlss object.

See also

Examples

if (FALSE) ## Simulate and run model with MCMC.
set.seed(123)
d <- GAMart()
b <- bamlss(num ~ s(x1) + s(x2) + s(x3) + te(lon,lat), data = d)
#> AICc -133.365 logPost  70.7124 logLik 100.6751 edf 31.765 eps 0.9003 iteration   1
#> AICc -265.806 logPost 149.9555 logLik 167.5114 edf 32.303 eps 0.2972 iteration   2
#> AICc -288.417 logPost 159.9160 logLik 182.8770 edf 35.820 eps 0.0825 iteration   3
#> AICc -289.663 logPost 159.4556 logLik 185.5998 edf 37.619 eps 0.0249 iteration   4
#> AICc -289.761 logPost 159.2466 logLik 186.0664 edf 37.975 eps 0.0051 iteration   5
#> AICc -289.788 logPost 159.2106 logLik 186.1146 edf 38.004 eps 0.0009 iteration   6
#> AICc -289.793 logPost 159.2033 logLik 186.1218 edf 38.008 eps 0.0001 iteration   7
#> AICc -289.794 logPost 159.2022 logLik 186.1229 edf 38.009 eps 0.0000 iteration   8
#> AICc -289.794 logPost 159.2022 logLik 186.1229 edf 38.009 eps 0.0000 iteration   8
#> elapsed time:  0.43sec
#> Starting the sampler...
#> 
#> |                    |   0%  8.81sec
#> |*                   |   5%  8.15sec  0.43sec
#> |**                  |  10%  7.58sec  0.84sec
#> |***                 |  15%  7.14sec  1.26sec
#> |****                |  20%  6.86sec  1.72sec
#> |*****               |  25%  6.51sec  2.17sec
#> |******              |  30%  6.10sec  2.61sec
#> |*******             |  35%  5.69sec  3.07sec
#> |********            |  40%  5.26sec  3.51sec
#> |*********           |  45%  4.84sec  3.96sec
#> |**********          |  50%  4.42sec  4.42sec
#> |***********         |  55%  3.98sec  4.87sec
#> |************        |  60%  3.54sec  5.31sec
#> |*************       |  65%  3.10sec  5.76sec
#> |**************      |  70%  2.67sec  6.23sec
#> |***************     |  75%  2.22sec  6.67sec
#> |****************    |  80%  1.78sec  7.12sec
#> |*****************   |  85%  1.34sec  7.57sec
#> |******************  |  90%  0.89sec  8.03sec
#> |******************* |  95%  0.45sec  8.47sec
#> |********************| 100%  0.00sec  8.92sec

## Continue sampling.
a <- continue(b)
#> Starting the sampler...
#> 
#> |                    |   0% 10.00sec
#> |*                   |   5%  9.06sec  0.48sec
#> |**                  |  10%  8.23sec  0.91sec
#> |***                 |  15%  7.59sec  1.34sec
#> |****                |  20%  7.08sec  1.77sec
#> |*****               |  25%  6.65sec  2.22sec
#> |******              |  30%  6.25sec  2.68sec
#> |*******             |  35%  5.81sec  3.13sec
#> |********            |  40%  5.39sec  3.59sec
#> |*********           |  45%  4.95sec  4.05sec
#> |**********          |  50%  4.50sec  4.50sec
#> |***********         |  55%  4.11sec  5.02sec
#> |************        |  60%  3.69sec  5.54sec
#> |*************       |  65%  3.25sec  6.04sec
#> |**************      |  70%  2.78sec  6.49sec
#> |***************     |  75%  2.32sec  6.96sec
#> |****************    |  80%  1.87sec  7.49sec
#> |*****************   |  85%  1.41sec  7.97sec
#> |******************  |  90%  0.94sec  8.43sec
#> |******************* |  95%  0.47sec  8.88sec
#> |********************| 100%  0.00sec  9.34sec

## Plot all samples.
## plot(a, which = "samples")