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.24sec
#> Starting the sampler...
#> 
#> |                    |   0%  5.35sec
#> |*                   |   5%  5.22sec  0.27sec
#> |**                  |  10%  4.81sec  0.53sec
#> |***                 |  15%  4.58sec  0.81sec
#> |****                |  20%  4.36sec  1.09sec
#> |*****               |  25%  4.12sec  1.37sec
#> |******              |  30%  3.89sec  1.67sec
#> |*******             |  35%  3.65sec  1.96sec
#> |********            |  40%  3.38sec  2.25sec
#> |*********           |  45%  3.11sec  2.54sec
#> |**********          |  50%  2.82sec  2.82sec
#> |***********         |  55%  2.55sec  3.12sec
#> |************        |  60%  2.27sec  3.41sec
#> |*************       |  65%  1.98sec  3.68sec
#> |**************      |  70%  1.70sec  3.97sec
#> |***************     |  75%  1.42sec  4.25sec
#> |****************    |  80%  1.14sec  4.54sec
#> |*****************   |  85%  0.85sec  4.83sec
#> |******************  |  90%  0.57sec  5.11sec
#> |******************* |  95%  0.28sec  5.40sec
#> |********************| 100%  0.00sec  5.72sec

## Continue sampling.
a <- continue(b)
#> Starting the sampler...
#> 
#> |                    |   0%  5.24sec
#> |*                   |   5%  5.11sec  0.27sec
#> |**                  |  10%  4.72sec  0.52sec
#> |***                 |  15%  4.53sec  0.80sec
#> |****                |  20%  4.34sec  1.09sec
#> |*****               |  25%  4.15sec  1.38sec
#> |******              |  30%  3.93sec  1.68sec
#> |*******             |  35%  3.66sec  1.97sec
#> |********            |  40%  3.39sec  2.26sec
#> |*********           |  45%  3.09sec  2.53sec
#> |**********          |  50%  2.82sec  2.82sec
#> |***********         |  55%  2.55sec  3.11sec
#> |************        |  60%  2.26sec  3.39sec
#> |*************       |  65%  1.98sec  3.68sec
#> |**************      |  70%  1.70sec  3.97sec
#> |***************     |  75%  1.42sec  4.26sec
#> |****************    |  80%  1.14sec  4.55sec
#> |*****************   |  85%  0.85sec  4.84sec
#> |******************  |  90%  0.57sec  5.14sec
#> |******************* |  95%  0.29sec  5.43sec
#> |********************| 100%  0.00sec  5.71sec

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