Full model without rainfall: burn-in and thinning
Load packages, read data and source custom scripts
rm(list = ls())
library(bamlss)
#> Loading required package: coda
#> Loading required package: colorspace
#> Loading required package: mgcv
#> Loading required package: nlme
#> This is mgcv 1.8-31. For overview type 'help("mgcv-package")'.
#>
#> Attaching package: 'bamlss'
#> The following object is masked from 'package:mgcv':
#>
#> smooth.construct
library(gamlss.dist)
#> Loading required package: MASS
path_proj <- day2day::git_path()
path_data <- file.path(path_proj, "data")
path_processed <- file.path(path_data, "processed")
path_modelled <- file.path(path_data, "modelled")
bwdata_file <- file.path(path_processed, "bwdata_41_model.fst")
path_modelled_data <- file.path(path_modelled, "lbw-15-full-no-rain.rds")
# path_modelled_rectified <- gsub("(\\.rds)$", "-rectified\\1", path_modelled_data)
path_modelled_burned <- gsub("(\\.rds)$", "-burned\\1", path_modelled_data)
path_form <- gsub("(\\.rds)$", "-form\\1", path_modelled_data)
bwdata_model <- fst::read_fst(bwdata_file)
model <- readRDS(path_modelled_data)
form <- readRDS(path_form)
Burn-in and thinning
model$samples <- window(model$samples, start = 3001, thin = 10)
Compute results
system.time(model$results <- results.bamlss.default(model))
#> user system elapsed
#> 57.047 0.148 57.191
system.time(saveRDS(model, file = path_modelled_burned))
#> user system elapsed
#> 4.062 0.004 4.119
Maximum auto-correlation function (ACF)
par(mar = c(4, 4, 0.5, 0), mfrow = c(1, 2))
plot(model, model = "pi", which = "max-acf", spar = FALSE)
MCMC convergence
par(mar = c(4, 4, 3, 1), mfrow = c(1, 2))
plot(model, which = "samples")
Time to execute the task
Only useful when executed with Rscript
.
proc.time()
#> user system elapsed
#> 86.897 0.414 87.422