## S3 method for class 'formula':
func.mean(formula, data = NULL,\dots,drop=FALSE)
func.mean(fdataobj)
func.var(fdataobj)
func.trim.FM(fdataobj,...)
func.trim.mode(fdataobj,...)
func.trim.RP(fdataobj,...)
func.trim.RT(fdataobj,...)
func.trim.RPD(fdataobj,...)
func.trim.HD(fdataobj,...)
func.trim.PD(fdataobj,...)
func.trim.SD(fdataobj,...)
func.trim.MhD(fdataobj,...)
func.med.FM(fdataobj,...)
func.med.mode(fdataobj,...)
func.med.RP(fdataobj,...)
func.med.RT(fdataobj,...)
func.med.RPD(fdataobj,...)
func.med.HD(fdataobj,...)
func.med.PD(fdataobj,...)
func.med.SD(fdataobj,...)
func.med.MhD(fdataobj,...)
func.trimvar.FM(fdataobj,...)
func.trimvar.mode(fdataobj,...)
func.trimvar.RP(fdataobj,...)
func.trimvar.RT(fdataobj,...)
func.trimvar.RPD(fdataobj,...)
fdata
class object.p
is passed, it used metric.lp
function, by default p=2
.
If the argument trim
(alpha of the 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.trim.HD
Returns the average from the (1-trim)
% deepest curves following HD criteria.
func.trim.PD
Returns the average from the (1-trim)
% deepest curves following PD criteria.
func.trim.SD
Returns the average from the (1-trim)
% deepest curves following SD criteria.
func.trim.MhD
Returns the average from the (1-trim)
% deepest curves following MhD criteria.
func.med.FM
Returns the deepest curve following FM criteria.
func.med.mode
Returns the deepest curve following mode criteria.
func.med.mode
Returns the deepest curve following RP criteria.
func.med.RP
Returns the deepest curve following RP criteria.
func.med.RPD
Returns the deepest curve following RPD criteria.
func.med.HD
Returns the deepest curve following HD criteria.
func.med.PD
Returns the deepest curve following PD criteria.
func.med.SD
Returns the deepest curve following SD criteria.
func.med.MhD
Returns the deepest curve following MhD 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.RP
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.
}# 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)
dev.new()
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))
b10<-func.trimvar.RT(fdataobj)
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,10),ylim=c(0,79),main="Measures of dispersion II")
Run the code above in your browser using DataLab