Description Usage Arguments Value See Also Examples
This S3
method implements the cross-sectional mean of a
univariate functional dataset stored in a fData
object, i.e. the
mean computed point-by-point along the grid over which the dataset is
defined.
1 2 |
x |
the univariate functional dataset whose cross-sectional mean must be
computed, in form of |
... |
possible additional parameters. This argument is kept for
compatibility with the |
The function returns a fData
object with one observation
defined on the same grid as the argument x
's representing the
desired cross-sectional mean.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 | N = 1e2
P = 1e2
grid = seq( 0, 1, length.out = P )
# Generating a gaussian functional sample with desired mean
target_mean = sin( 2 * pi * grid )
C = exp_cov_function( grid, alpha = 0.2, beta = 0.2 )
fD = fData( grid, generate_gauss_fdata( N,
centerline = target_mean,
Cov = C ) )
# Graphical representation of the mean
plot( fD )
plot( mean( fD ), col = 'black', lwd = 2, lty = 2, add = TRUE )
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.