Bliss_Simulated_Annealing: Bliss_Simulated_Annealing

View source: R/Bliss_Simulated_Annealing.R

Bliss_Simulated_AnnealingR Documentation

Bliss_Simulated_Annealing

Description

A Simulated Annealing algorithm to compute the Bliss estimate.

Usage

Bliss_Simulated_Annealing(
  beta_sample,
  posterior_sample,
  param,
  verbose_cpp = FALSE
)

Arguments

beta_sample

a matrix. Each row is a coefficient function computed from the posterior sample.

posterior_sample

a list resulting from the Bliss_Gibbs_Sampler function.

param

a list containing:

grids

a list of numerical vectors, the qth vector is the grid of time points for the qth functional covariate.

basis

a character (optional). The possible values are "uniform" (default), "epanechnikov", "gauss" and "triangular" which correspond to different basis functions to expand the coefficient function and the functional covariates

burnin

an integer (optional), the number of iteration to drop from the posterior sample.

iter_sann

an integer (optional), the number of iteration of the Simulated Annealing algorithm.

k_max

an integer (optional), the maximal number of intervals for the Simulated Annealing algorithm.

l_max

an integer (optional), the maximal interval length for the Simulated Annealing algorithm.

Temp_init

a nonnegative value (optional), the initial temperature for the cooling function of the Simulated Annealing algorithm.

Q

an integer, the number of functional covariates.

p

a vector of integers, the numbers of time point of each functional covariate.

verbose

write stuff if TRUE (optional).

verbose_cpp

Rcpp writes stuff if TRUE (optional).

Value

a list containing:

Bliss_estimate

a numerical vector, corresponding to the Bliss estimate of the coefficient function.

Smooth_estimate

a numerical vector, which is the posterior expectation of the coefficient function for each time points.

trace

a matrix, the trace of the algorithm.

Examples


data(data1)
data(param1)
data(res_bliss1)
param1$Q <- length(data1$x)
param1$grids <- data1$grids
param1$p <- sapply(data1$grids,length)

posterior_sample <- res_bliss1$posterior_sample
beta_sample <- compute_beta_sample(posterior_sample,param1)

res_sann <- Bliss_Simulated_Annealing(beta_sample,posterior_sample,param1)


bliss documentation built on May 29, 2024, 8:35 a.m.