| toy_curves | R Documentation |
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.
toy_curves
A list with the following elements:
yNamed list of 3 numeric vectors of length 50, one per curve.
XtNumeric vector of 50 equally spaced time points on [0,1].
true_coefNumeric vector of length 8. True basis coefficients:
c(1.5, 0, -1, 0.8, 0, -0.5, 1.2, -0.9).
KInteger. Number of basis functions used (8).
mInteger. Number of curves (3).
sigmaNumeric. True noise standard deviation (0.1).
wNumeric. True correlation decay parameter (6).
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.
Generated via data-raw/generate_toy_curves.R.
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")
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.