sampleFuncy: Simulate functional data.

Description Usage Arguments Details Value Author(s) References See Also Examples

Description

Generates a functional dataset for 2-6 clusters.

Usage

1
2
3
4
5
6
7
sampleFuncy(obsNr=100, k=4, timeNr=20, timeNrMax=NULL,
            timeNrMin=NULL, timeInterval=c(0, 1),
            nrGridPts=30, sd=0.3, reg=TRUE)
## S4 method for signature 'sampleFuncy'
Cluster(object)
## S4 method for signature 'sampleFuncy'
Data(object,...)

Arguments

obsNr

Number of curves.

k

Number of classes.

timeNr

Number of time points for regular datasets in Format2 (see funcit).

timeNrMax

Maximal number of time points for irregular datasets in Format1 (see funcit).

timeNrMin

Minimal number of time points for irregular dataset in Format1 (see funcit).

timeInterval

Time interval where time points are drawn from.

nrGridPts

Time interval is divided into nrGridPts grid points where time points are randomly drawn from.

sd

Standard deviation from the center curves.

reg

Regular dataset in Format2 or irregular dataset in Format1 (see funcit).

object

An object of class sampleFuncy

...

Not used.

Details

Curves are generated by adding a normally distributed error term with mean 0 and standard deviation sd to the center functions. The center functions are sampled from

If reg=TRUE all curves are evaluated on the same time points. If reg=FALSE evaluation place and number can differ for each curve.

Value

Author(s)

Christina Yassouridis

References

Christina Yassouridis and Dominik Ernst and Friedrich Leisch. Generalization, Combination and Extension of Functional Clustering Algorithms: The R Package funcy. Journal of Statistical Software. 85 (9). 1–25. 2018

See Also

funcit

Examples

1
2
3
4
5
6
7
8
9
##sample a regular dataset
set.seed(2705)
ds <- sampleFuncy(obsNr=100, k=4, timeNr=20, reg=TRUE)
plotFuncy(ds)

##sample an irregular dataset
set.seed(2705)
ds <- sampleFuncy(obsNr=100, k=4, timeNrMin=3, timeNrMax=10, reg=FALSE)
plotFuncy(ds, lty=1)

Example output

Loading required package: flexclust
Loading required package: grid
Loading required package: lattice
Loading required package: modeltools
Loading required package: stats4
Loading required package: splines

funcy documentation built on May 2, 2019, 9:22 a.m.

Related to sampleFuncy in funcy...