toy_curves: Toy Simulated Functional Dataset

toy_curvesR Documentation

Toy Simulated Functional Dataset

Description

A small simulated dataset of three functional curves used in package examples. Curves are generated from a known cubic B-spline expansion with correlated errors, making it suitable for demonstrating basis selection and recovery of true coefficients.

Usage

toy_curves

Format

A list with the following elements:

y

Named list of 3 numeric vectors of length 50, one per curve.

Xt

Numeric vector of 50 equally spaced time points on [0,1].

true_coef

Numeric vector of length 8. True basis coefficients: c(1.5, 0, -1, 0.8, 0, -0.5, 1.2, -0.9).

K

Integer. Number of basis functions used (8).

m

Integer. Number of curves (3).

sigma

Numeric. True noise standard deviation (0.1).

w

Numeric. True correlation decay parameter (6).

Details

Each curve is generated as:

y_i(t) = \sum_{k=1}^{8} \xi_{ki} B_k(t) + \varepsilon_i(t)

where (\boldsymbol{\xi}_i) = (1.5, 0, -1, 0.8, 0, -0.5, 1.2, -0.9) for all i, and \varepsilon_i \sim \text{GP}(0, \sigma^2 \Psi(w)) with \sigma = 0.1 and w = 6 (correlation function of an Ornstein-Uhlenbeck (OU) process). Basis functions 2 and 5 have zero coefficients, providing a ground truth for evaluating basis selection.

Source

Generated via data-raw/generate_toy_curves.R.

Examples

data(toy_curves)
str(toy_curves)

# Plot the three raw curves
plot(toy_curves$Xt, toy_curves$y[[1]], type = "l",
     ylab = "y", xlab = "t", main = "Toy curves")
lines(toy_curves$Xt, toy_curves$y[[2]], col = "blue")
lines(toy_curves$Xt, toy_curves$y[[3]], col = "red")

fda.vi documentation built on June 20, 2026, 5:06 p.m.