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.21sec
#> Starting the sampler...
#> 
#> |                    |   0%  5.59sec
#> |*                   |   5%  4.60sec  0.24sec
#> |**                  |  10%  4.23sec  0.47sec
#> |***                 |  15%  3.98sec  0.70sec
#> |****                |  20%  3.76sec  0.94sec
#> |*****               |  25%  3.57sec  1.19sec
#> |******              |  30%  3.39sec  1.45sec
#> |*******             |  35%  3.17sec  1.71sec
#> |********            |  40%  2.93sec  1.96sec
#> |*********           |  45%  2.70sec  2.21sec
#> |**********          |  50%  2.48sec  2.48sec
#> |***********         |  55%  2.25sec  2.75sec
#> |************        |  60%  2.00sec  3.00sec
#> |*************       |  65%  1.75sec  3.25sec
#> |**************      |  70%  1.50sec  3.50sec
#> |***************     |  75%  1.25sec  3.76sec
#> |****************    |  80%  1.00sec  4.00sec
#> |*****************   |  85%  0.75sec  4.26sec
#> |******************  |  90%  0.50sec  4.52sec
#> |******************* |  95%  0.25sec  4.77sec
#> |********************| 100%  0.00sec  5.02sec

## Continue sampling.
a <- continue(b)
#> Starting the sampler...
#> 
#> |                    |   0%  4.40sec
#> |*                   |   5%  4.48sec  0.24sec
#> |**                  |  10%  4.17sec  0.46sec
#> |***                 |  15%  3.93sec  0.69sec
#> |****                |  20%  3.74sec  0.93sec
#> |*****               |  25%  3.57sec  1.19sec
#> |******              |  30%  3.35sec  1.44sec
#> |*******             |  35%  3.15sec  1.69sec
#> |********            |  40%  2.93sec  1.96sec
#> |*********           |  45%  2.71sec  2.22sec
#> |**********          |  50%  2.49sec  2.49sec
#> |***********         |  55%  2.25sec  2.75sec
#> |************        |  60%  2.01sec  3.02sec
#> |*************       |  65%  1.77sec  3.28sec
#> |**************      |  70%  1.57sec  3.67sec
#> |***************     |  75%  1.31sec  3.92sec
#> |****************    |  80%  1.05sec  4.19sec
#> |*****************   |  85%  0.79sec  4.47sec
#> |******************  |  90%  0.53sec  4.75sec
#> |******************* |  95%  0.26sec  5.03sec
#> |********************| 100%  0.00sec  5.28sec

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