set.seed(101)
x = runif(n = 100, min = 0, max = 2*pi)
y = 1 + sin(x) + 0.1 * rnorm(100)
# Do fit with getJointPrecision=TRUE
fit = tinyVAST( formula = y ~ s(x),
data = data.frame(x=x,y=y) )
# samples from distribution for the mean
# excluding fixed effects due to CRAN checks
samples = sample_variable(fit, sample_fixed = FALSE)
Run the code above in your browser using DataLab