Learn R Programming

FunctionalCalibration (version 1.0.0)

weight_estimation: Weight Estimation

Description

Estimates the weights associated with the functional coefficients \(\alpha_l(x)\) using the using Ordinary Least Squares.

The problem can be formulated as:

$$A(x) = \displaystyle \sum_{l=1}^{L} y_l \alpha_l(x)$$

where \(A(x)\) is the aggregated function evaluated at each point \(x\), \(\alpha_l(x)\) are the functional coefficients, and \(y_l\) are the weights to be estimated.

Usage

weight_estimation(data, alpha)

Value

The function returns a vector with the estimated weights obtained using Ordinary Least Squares.

Arguments

data

A numeric vector representing one sample of the aggregated function \(A(x)\), evaluated at a grid of points \(x\).

alpha

A numeric matrix where each column represents the values of a function \(\alpha_l(x)\) evaluated at the same grid of points as data.

Examples

Run this code
weight_estimation(simulated_data$data[,1], simulated_data$alphas)

Run the code above in your browser using DataLab