Datasets#
- class FDApy.simulation.Datasets(basis_name, random_state=None)[source]#
Simulate published paper datasets.
- Parameters:
- Attributes:
data – An object that represents the simulated data.
noisy_data – An object that represents a noisy version of the simulated data.
sparse_data – An object that represents a sparse version of the simulated data.
Methods
add_noise([noise_variance])Add noise to functional data objects.
add_noise_and_sparsify([noise_variance, ...])Generate a noisy and sparse version of functional data objects.
new(n_obs[, n_clusters, argvals])Simulate realizations of the Datasets.
sparsify([percentage, epsilon])Generate a sparse version of functional data objects.
- add_noise(noise_variance=1.0)[source]#
Add noise to functional data objects.
This function generates an artificial noisy version of a functional data object of class
DenseFunctionalDataby adding realizations of Gaussian random variables \(\epsilon \sim \mathcal{N}(0, \sigma^2)\) to the observations. The variance \(\sigma^2\) can be supplied by the user. The generated data are given by\[Y(t) = X(t) + \epsilon.\]- Parameters:
noise_variance (float) – The variance \(\sigma^2\) of the Gaussian noise that is added to the data.
- Returns:
Create the class attribute noisy_data.
- Return type:
None
- add_noise_and_sparsify(noise_variance=1.0, percentage=0.9, epsilon=0.05)[source]#
Generate a noisy and sparse version of functional data objects.
This function generates an artificially noisy and sparse version of a functional datasets. From a functional dataset, it first generates the noisy version and then the sparse version based on the noisy one.
- Parameters:
- Returns:
Create the class attributes noisy_data and sparse_data.
- Return type:
None
- new(n_obs, n_clusters=1, argvals=None, **kwargs)[source]#
Simulate realizations of the Datasets.
This function generates
n_obsrealizations of the Datasets object.- Parameters:
- Returns:
Create the class attributes data.
- Return type:
None
- sparsify(percentage=0.9, epsilon=0.05)[source]#
Generate a sparse version of functional data objects.
This function generates an artificially sparsified version of a functional data object of class
DenseFunctionalData. The percentage (and the uncertainty around it) of the number of observation points retained can be supplied by the user. Let \(p\) be the defined percentage and \(\epsilon\) be the uncertainty value. The retained number of observations will be different for each curve and be between \(p - \epsilon\) and \(p + \epsilon\).