Bliss_Simulated_Annealing {bliss}R Documentation

Bliss_Simulated_Annealing

Description

A Simulated Annealing algorithm to compute the Bliss estimate.

Usage

Bliss_Simulated_Annealing(
  beta_sample,
  normalization_values,
  param,
  verbose = FALSE
)

Arguments

beta_sample

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

normalization_values

a matrix given by the function Bliss_Gibbs_Sampler.

param

a list containing:

grid

a numerical vector, the time points.

K

an integer, the number of intervals.

basis

a character vector (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.

verbose

write 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.

argmin

an integer, the index of the iteration minimizing the Bliss loss.

difference

a numerical vector, the difference between the Bliss estimate and the smooth estimate.

sdifference

a numerical vector, a smooth version of difference.

Examples


data(data1)
data(param1)
param1$grids<-data1$grids
# result of res_bliss1<-fit_Bliss(data=data1,param=param1)
data(res_bliss1)
beta_sample <- compute_beta_sample(posterior_sample=res_bliss1$posterior_sample,
                                   param=param1,Q=1)
param_test<-list(grid=param1$grids[[1]],iter=1e3,K=2)
test<-Bliss_Simulated_Annealing(beta_sample[[1]],
                 res_bliss1$posterior_sample$param$normalization_values[[1]],
                 param=param_test)
ylim <- range(range(test$Bliss_estimate),range(test$Smooth_estimate))
plot(param_test$grid,test$Bliss_estimate,type="l",ylim=ylim)
lines(param_test$grid,test$Smooth_estimate,lty=2)


[Package bliss version 1.0.4 Index]