fit_Bliss: fit_Bliss

View source: R/Bliss_method.R

fit_BlissR Documentation

fit_Bliss

Description

Fit the Bayesian Functional Linear Regression model (with Q functional covariates).

Usage

fit_Bliss(
  data,
  param,
  sann = TRUE,
  compute_density = TRUE,
  support_estimate = TRUE,
  sann_trace = FALSE,
  verbose = TRUE
)

Arguments

data

a list containing:

y

a numerical vector, the outcomes.

x

a list of matrices, the qth matrix contains the observations of the qth functional covariate at time points given by grids.

grids

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

param

a list containing:

iter

an integer, the number of iterations of the Gibbs sampler algorithm.

K

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

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.

lims_kde

an integer (optional), correspond to the lims option of the kde2d funtion.

new_grids

a list of Q vectors (optional) to compute beta samples on different grids.

Temp_init

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

thin

an integer (optional) to thin the posterior sample.

times_sann

an integer (optional), the number of times the algorithm will be executed

times_sann

an integer (optional), the number of times the algorithm will be executed

allow_reducing

a boolean value (optional), indicate if the function is allowed to reduce the number of sample times of each functional covariate.

verbose_cpp

a boolean value (optional). Write stuff from the Rcpp scripts if TRUE.

sann

a logical value. If TRUE, the Bliss estimate is computed with a Simulated Annealing Algorithm. (optional)

compute_density

a logical value. If TRUE, the posterior density of the coefficient function is computed. (optional)

support_estimate

a logical value. If TRUE, the estimate of the coefficient function support is computed. (optional)

sann_trace

a logical value. If TRUE, the trace of the Simulated Annealing algorithm is included into the result object. (optional)

verbose

write stuff if TRUE (optional).

Value

return a list containing:

alpha

a list of Q numerical vector. Each vector is the function alpha(t) associated to a functional covariate. For each t, alpha(t) is the posterior probabilities of the event "the support covers t".

beta_posterior_density

a list of Q items. Each item contains a list containing information to plot the posterior density of the coefficient function with the image function.

grid_t

a numerical vector: the x-axis.

grid_beta_t

a numerical vector: the y-axis.

density

a matrix: the z values.

new_beta_sample

a matrix: beta sample used to compute the posterior densities.

beta_sample

a list of Q matrices. The qth matrix is a posterior sample of the qth functional covariates.

Bliss_estimate

a list of numerical vectors corresponding to the Bliss estimates of each functional covariates.

data

a list containing the data.

posterior_sample

a list of information about the posterior sample: the trace matrix of the Gibbs sampler, a list of Gibbs sampler parameters and the posterior densities.

support_estimate

a list of support estimates of each functional covariate.

support_estimate_fct

another version of the support estimates.

trace_sann

a list of Q matrices which are the trace of the Simulated Annealing algorithm.

Examples

# see the vignette BlissIntro.

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