fda.usc (version 2.0.1)

Descriptive: Descriptive measures for functional data.

Description

Central and dispersion measures for functional data.

Usage

func.mean(x)

func.var(fdataobj)

func.trim.FM(fdataobj, ...)

func.trim.mode(fdataobj, ...)

func.trim.RP(fdataobj, ...)

func.trim.RT(fdataobj, ...)

func.trim.RPD(fdataobj, ...)

func.med.FM(fdataobj, ...)

func.med.mode(fdataobj, ...)

func.med.RP(fdataobj, ...)

func.med.RT(fdataobj, ...)

func.med.RPD(fdataobj, ...)

func.trimvar.FM(fdataobj, ...)

func.trimvar.mode(fdataobj, ...)

func.trimvar.RP(fdataobj, ...)

func.trimvar.RPD(fdataobj, ...)

func.trim.RT(fdataobj, ...)

func.med.RT(fdataobj, ...)

func.trimvar.RT(fdataobj, ...)

func.mean.formula(formula, data = NULL, ..., drop = FALSE)

Arguments

x

fdata or ldata class object.

fdataobj

fdata class object.

Further arguments passed to or from other methods. If the argument p is passed, it used metric.lp function, by default p=2. If the argument trim (alpha of the trimming) is passed, it used metric.lp function. If the argument deriv (number of derivatives to use) is passed. This parameter is used in depth.RPD function, by default it uses deriv =(0,1).

formula

a formula, such as y ~ group, where y is a fdata object to be split into groups according to the grouping variable group (usually a factor).

data

List that containing the variables in the formula. The item called "df" is a data frame with the grouping variable. The item called "y" is a fdata object.

drop

logical indicating if levels that do not occur should be dropped (if f is a factor or a list).

Value

func.mean.formula The value returned from split is a list of fdata containing the mean curves for the groups. The components of the list are named by the levels of f (after converting to a factor, or if already a factor and drop = TRUE, dropping unused levels).

func.mean gives mean curve.
func.var gives variance curve.
func.trim.FM Returns the average from the (1-trim)% deepest curves following FM criteria.
func.trim.mode Returns the average from the (1-trim)% deepest curves following mode criteria.
func.trim.RP Returns the average from the (1-trim)% deepest curves following RP criteria.
func.trim.RT Returns the average from the (1-trim)% deepest curves following RT criteria.
func.trim.RPD Returns the average from the (1-trim)% deepest curves following RPD criteria.
func.med.FM Returns the deepest curve following FM criteria.
func.med.mode Returns the deepest curve following mode criteria.
func.med.RP Returns the deepest curve following RP criteria.
func.med.RPD Returns the deepest curve following RPD criteria.
func.trimvar.FM Returns the marginal variance from the deepest curves followinng FM criteria.
func.trimvar.mode Returns the marginal variance from the deepest curves followinng mode criteria.
func.trimvar.RP Returns the marginal variance from the deepest curves followinng RP criteria.
func.trimvar.RT Returns the marginal variance from the deepest curves followinng RT criteria.
func.trimvar.RPD Returns the marginal variance from the deepest curves followinng RPD criteria.

References

Febrero-Bande, M., Oviedo de la Fuente, M. (2012). Statistical Computing in Functional Data Analysis: The R Package fda.usc. Journal of Statistical Software, 51(4), 1-28. http://www.jstatsoft.org/v51/i04/

Examples

Run this code
# NOT RUN {
#' # Example with Montreal Daily Temperature (fda-package)
fdataobj<-fdata(MontrealTemp)

# Measures of central tendency by group
fac<-factor(c(rep(1,len=17),rep(2,len=17)))
ldata=list("df"=data.frame(fac),"fdataobj"=fdataobj)
a1<-func.mean.formula(fdataobj~fac,data=ldata)
plot(a1)

# Measures of central tendency
a1<-func.mean(fdataobj)
a2<-func.trim.FM(fdataobj)
a3<-func.trim.mode(fdataobj)
a4<-func.trim.RP(fdataobj)
# a5<-func.trim.RPD(fdataobj,deriv=c(0,1)) # Time-consuming
a6<-func.med.FM(fdataobj)
a7<-func.med.mode(fdataobj)
a8<-func.med.RP(fdataobj)
# a9<-func.med.RPD(fdataobj,deriv=c(0,1)) # Time-consuming
# a10<-func.med.RT(fdataobj)

par(mfrow=c(1,2))
plot(c(a1,a2,a3,a4),ylim=c(-26,29),main="Central tendency: trimmed mean")
plot(c(a1,a6,a7,a8),ylim=c(-26,29),main="Central tendency: median")

## Measures of dispersion
b1<-func.var(fdataobj)
b2<-func.trimvar.FM(fdataobj)
b3<-func.trimvar.FM(fdataobj,trim=0.1)
b4<-func.trimvar.mode(fdataobj)
b5<-func.trimvar.mode(fdataobj,p=1)
b6<-func.trimvar.RP(fdataobj)
b7<-func.trimvar.RPD(fdataobj)
b8<-func.trimvar.RPD(fdataobj)
b9<-func.trimvar.RPD(fdataobj,deriv=c(0,1))
dev.new()
par(mfrow=c(1,2))
plot(c(b1,b2,b3,b4,b5),ylim=c(0,79),main="Measures of dispersion I")
plot(c(b1,b6,b7,b8,b9),ylim=c(0,79),main="Measures of dispersion II")
# }
# NOT RUN {
# }

Run the code above in your browser using DataCamp Workspace