centre: Mean function, variance function, median function, trim mean...

Description Usage Arguments Value Author(s) See Also Examples

View source: R/centre.R

Description

Mean function, variance function, median function, trim mean function of functional data

Usage

1

Arguments

x

An object of class matrix.

type

Mean, variance, median or trim mean?

Value

Return mean function, variance function, median function or trim mean function.

Author(s)

Han Lin Shang

See Also

pcscorebootstrapdata, mean.fts, median.fts, sd.fts, var.fts

Examples

1
2
3
4
5
6
7
# mean function is often removed in the functional principal component analysis.
# trimmed mean function is sometimes employed for robustness in the presence of outliers.
# In calculating trimmed mean function, several functional depth measures were employed.	
centre(x = ElNino_ERSST_region_1and2$y, type = "mean")
centre(x = ElNino_ERSST_region_1and2$y, type = "var")
centre(x = ElNino_ERSST_region_1and2$y, type = "median")
centre(x = ElNino_ERSST_region_1and2$y, type = "trimmed")

Example output

Loading required package: forecast
Loading required package: rainbow
Loading required package: MASS
Loading required package: pcaPP
Loading required package: sde
Loading required package: stats4
Loading required package: fda
Loading required package: splines
Loading required package: Matrix

Attaching package: 'fda'

The following object is masked from 'package:forecast':

    fourier

The following object is masked from 'package:graphics':

    matplot

Loading required package: zoo

Attaching package: 'zoo'

The following objects are masked from 'package:base':

    as.Date, as.Date.numeric

sde 2.0.15
Companion package to the book
'Simulation and Inference for Stochastic Differential Equations With R Examples'
Iacus, Springer NY, (2008)
To check the errata corrige of the book, type vignette("sde.errata")

Attaching package: 'ftsa'

The following objects are masked from 'package:stats':

    sd, var

       1        2        3        4        5        6        7        8 
24.28290 25.78725 26.17696 25.26580 24.07174 22.82754 21.72188 20.79087 
       9       10       11       12 
20.50087 20.77203 21.45261 22.60333 
        1         2         3         4         5         6         7         8 
0.8312815 0.6104055 0.8431023 1.3386591 1.7628376 1.7652707 1.5543457 1.2479587 
        9        10        11        12 
1.0041384 1.0415756 1.2217236 1.1739643 
 1950  1951  1952  1953  1954  1955  1956  1957  1958  1959  1960  1961  1962 
21.33 24.61 21.93 23.43 20.66 21.20 22.19 25.14 23.10 22.50 21.71 22.15 21.77 
 1963  1964  1965  1966  1967  1968  1969  1970  1971  1972  1973  1974  1975 
22.25 21.24 24.35 21.57 22.07 21.51 24.09 21.12 21.58 24.90 21.51 22.35 21.70 
 1976  1977  1978  1979  1980  1981  1982  1983  1984  1985  1986  1987  1988 
24.50 22.52 21.94 23.28 22.76 22.49 23.25 27.36 22.18 21.85 22.05 24.10 21.46 
 1989  1990  1991  1992  1993  1994  1995  1996  1997  1998  1999  2000  2001 
22.04 22.83 23.33 23.98 24.16 22.21 22.20 21.24 26.12 25.36 22.36 22.75 22.28 
 2002  2003  2004  2005  2006  2007  2008  2009  2010  2011  2012  2013  2014 
23.51 21.77 22.05 22.35 22.91 21.52 23.68 23.78 23.14 23.42 24.14 21.22 24.67 
 2015  2016  2017  2018 
25.32 23.77 22.89 22.40 
    1950     1951     1952     1953     1954     1955     1956     1957 
21.40444 23.50111 22.03778 23.07778 20.68444 21.29000 21.92667 23.87333 
    1958     1959     1960     1961     1962     1963     1964     1965 
22.84556 22.47889 22.00222 22.00667 21.65333 22.42556 21.37333 23.66889 
    1966     1967     1968     1969     1970     1971     1972     1973 
21.89333 21.61444 21.99111 23.44000 21.54333 21.76556 24.22333 21.89778 
    1974     1975     1976     1977     1978     1979     1980     1981 
22.07111 21.61778 23.49667 22.36778 22.13778 22.95667 22.49000 22.13556 
    1982     1983     1984     1985     1986     1987     1988     1989 
23.79000 25.38444 22.35333 21.78444 22.62111 24.02667 21.84556 22.35667 
    1990     1991     1992     1993     1994     1995     1996     1997 
22.40111 23.14444 23.49333 23.51778 22.56889 22.24778 21.68222 25.68667 
    1998     1999     2000     2001     2002     2003     2004     2005 
24.40778 22.21000 22.36111 22.18111 23.23111 22.48889 22.48222 22.23778 
    2006     2007     2008     2009     2010     2011     2012     2013 
22.99000 21.67222 23.23444 23.35333 22.29778 22.63111 23.05889 21.79889 
    2014     2015     2016     2017     2018 
23.60444 24.60889 23.42778 22.66444 22.64111 

ftsa documentation built on Jan. 13, 2021, 6:21 p.m.