simulate_data {sasfunclust}R Documentation

Simulate data for functional clustering

Description

Generate synthetic data as in the simulation study of Centofanti et al., 2021.

Usage

simulate_data(
  scenario,
  n_i = 50,
  nbasis = 30,
  length_tot = 50,
  var_e = 1,
  var_b = 1
)

Arguments

scenario

A character strings indicating the scenario considered. It could be "Scenario I", "Scenario II", and "Scenario III".

n_i

Number of curves in each cluster.

nbasis

The dimension of the set of B-spline functions.

length_tot

Number of evaluation points.

var_e

Variance of the measurement error.

var_b

Diagonal entries of the coefficient variance matrix, which is assumed to be diagonal, with equal diagonal entries, and the same among clusters.

Value

A list containing the following arguments:

X: Observation matrix, where the rows correspond to argument values and columns to replications.

X_fd: Functional observations without measurement error.

mu_fd: True cluster mean function.

grid: The vector of time points where the curves are sampled.

clus: True cluster membership vector.

Examples

library(sasfunclust)
train<-simulate_data("Scenario I",n_i=20,var_e = 1,var_b = 0.5^2)

[Package sasfunclust version 1.0.0 Index]