Learn R Programming

FunctionalCalibration (version 1.0.0)

plot_aggregated_curve: Aggregated Curve Plot

Description

Generates the plot of the aggregated curve based on the functional coefficients and their corresponding weights. The aggregated curve is computed as:

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

Usage

plot_aggregated_curve(alpha, weights, title = NULL, x = NULL)

Value

The function returns the plot of the aggregated function.

Arguments

alpha

A numeric matrix where each column represents the values of a function \(\alpha_l(x)\) evaluated at each point in \(x\).

weights

A numeric vector with the weight values corresponding to each function \(\alpha_l(x)\).

title

A string specifying the title of the plot.

x

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

Examples

Run this code
plot_aggregated_curve(simulated_data$alphas, c(0.7, 0.3))
plot_aggregated_curve(simulated_data$alphas, c(0.7, 0.3),
                      "Aggregated Curve Example", simulated_data$x)

Run the code above in your browser using DataLab