Learn R Programming

FunctionalCalibration (version 1.0.0)

functional_calibration_wavelets: Functional Data Calibration with Wavelets

Description

This function performs functional calibration based on the following model:

$$A_i(x_m) = \displaystyle \sum_{l=1}^{L} y_{il} \alpha_l(x_m) + e_i(x_m), \quad i = 1,...,I, \quad m = 1,...,M = 2^J$$

where the functions \(\alpha_l(x)\) are estimated using wavelet decomposition.

In matrix notation, the model is represented as:

$$A = \alpha y + e$$

Usage

functional_calibration_wavelets(
  data,
  weights,
  wavelet = "DaubExPhase",
  method = "bayesian",
  tau = 1,
  p = NULL,
  sigma = NULL,
  MC = FALSE,
  type = "soft",
  singular = FALSE,
  x = NULL
)

Value

The function returns a list containing two objects:

alpha

A matrix with the estimated functional coefficients \(\alpha\).

Plots

A list of plot objects, each representing the corresponding function \(\alpha_l(x)\).

Arguments

data

A matrix \(M\) x \(I\) where each column represents one sample of the aggregated function — the matrix \(A\) in the model.

weights

A matrix \(L\) x \(I\) representing the weight values associated with each sample — the matrix \(y\) in the model.

wavelet

A string indicating the wavelet family to be used in the Discrete Wavelet Transform (DWT).

method

A string specifying the shrinkage method applied to the empirical wavelet coefficients. Options are: "bayesian", "universal", "sure", "probability", or "cv".

tau

A numeric value for the \(\tau\) parameter in the Bayesian shrinkage. If NULL, it is estimated from the data.

p

A numeric value for the \(p\) parameter in the Bayesian shrinkage. If NULL, it is estimated from the data.

sigma

A numeric value for the \(\sigma\) parameter in the Bayesian shrinkage. If NULL, it is estimated from the data.

MC

A logical evaluating to TRUE or FALSE indicating if the integrals in the Bayesian shrinkage are approximated using Monte Carlo simulation.

type

A string indicating whether the thresholding should be "soft" or "hard" (applies only when the method is not "bayesian").

singular

A logical evaluating to TRUE or FALSE indicating if it adds a small constant (1e-10) to the diagonal of \(yy^T\) to stabilize the matrix inversion.

x

A numeric vector of values at which the function is evaluated. If NULL, the default is the sequence 1:nrow(data).

References

dos Santos Sousa, A. R. (2024). A wavelet-based method in aggregated functional data analysis. Monte Carlo Methods and Applications, 30(1), 19-30.

Examples

Run this code
functional_calibration_wavelets(simulated_data$data, simulated_data$weights)
functional_calibration_wavelets(simulated_data$data, simulated_data$weights,
                                tau = 5, p = 0.95, sigma = 0.1, x = simulated_data$x)
functional_calibration_wavelets(simulated_data$data, simulated_data$weights,
                                method = "universal")

Run the code above in your browser using DataLab