compute_chains_info {bliss}R Documentation

compute_chains_info

Description

Compute summaries of Gibbs Sampler chains.

Usage

compute_chains_info(chain, param)

Arguments

chain

a list given by the Bliss_Gibbs_Sampler function.

param

a list containing:

K

a vector of integers, corresponding to the numbers of intervals for each covariate.

grids

a numerical vector, the observation time points.

basis

a vector of characters (optional) among : "uniform" (default), "epanechnikov", "gauss" and "triangular" which correspond to different basis functions to expand the coefficient function and the functional covariates.

Value

Return a list containing the estimates of mu and sigma_sq, the Smooth estimate and the chain autocorrelation for mu, sigma_sq and beta.

Examples


param_sim <- list(Q=1,
                  n=100,
                  p=c(50),
                  grids_lim=list(c(0,1)))
data <- sim(param_sim,verbose=TRUE)

param <- list(iter=5e2,
              K=c(3),
              n_chains = 3)
res_bliss <- fit_Bliss(data,param,verbose=TRUE,compute_density=FALSE,sann=FALSE)

param$grids <- data$grids
chains_info1 <- compute_chains_info(res_bliss$chains[[1]],param)
chains_info2 <- compute_chains_info(res_bliss$chains[[2]],param)
chains_info3 <- compute_chains_info(res_bliss$chains[[3]],param)

# Smooth estimates
ylim <- range(range(chains_info1$estimates$Smooth_estimate),
range(chains_info2$estimates$Smooth_estimate),
range(chains_info3$estimates$Smooth_estimate))
plot(data$grids[[1]],chains_info1$estimates$Smooth_estimate,type="l",ylim=ylim,
xlab="grid",ylab="")
lines(data$grids[[1]],chains_info2$estimates$Smooth_estimate,col=2)
lines(data$grids[[1]],chains_info3$estimates$Smooth_estimate,col=3)

# Autocorrelation
plot(chains_info1$autocorr_lag[,1],type="h")


[Package bliss version 1.0.2 Index]