Become an expert in R — Interactive courses, Cheat Sheets, certificates and more!
Get Started for Free

cond.mode

Conditional mode


Description

Computes the mode for conditional distribution function.

Usage

cond.mode(Fc, method = "monoH.FC", draw = TRUE)

Arguments

Fc

Object estimated by cond.F function.

method

Specifies the type of spline to be used. Possible values are "diff", "fmm", "natural", "periodic" and "monoH.FC".

draw

=TRUE, plots the conditional distribution and density function.

Details

The conditional mode is calculated as the maximum argument of the derivative of the conditional distribution function (density function f).

Value

Return the mode for conditional distribution function.

  • mode.cond Conditional mode.

  • x Grid of length n where the the conditional density function is evaluated.

  • f The conditional density function evaluated in x.

Author(s)

Manuel Febrero-Bande, Manuel Oviedo de la Fuente manuel.oviedo@usc.es

References

Ferraty, F. and Vieu, P. (2006). Nonparametric functional data analysis. Springer Series in Statistics, New York.

See Also

See Also as: cond.F, cond.quantile and splinefun .

Examples

## Not run: 
n= 500
t= seq(0,1,len=101)
beta = t*sin(2*pi*t)^2
x = matrix(NA, ncol=101, nrow=n)
y=numeric(n)
x0<-rproc2fdata(n,seq(0,1,len=101),sigma="wiener")
x1<-rproc2fdata(n,seq(0,1,len=101),sigma=0.1)
x<-x0*3+x1
fbeta = fdata(beta,t)
y<-inprod.fdata(x,fbeta)+rnorm(n,sd=0.1)
prx=x[1:100];pry=y[1:100]
ind=101;ind2=101:110
pr0=x[ind];pr10=x[ind2]
ndist=161
gridy=seq(-1.598069,1.598069, len=ndist)
# Conditional Function
I=5
# Time consuming
res = cond.F(pr10[I], gridy, prx, pry, h=1)
mcond=cond.mode(res)
mcond2=cond.mode(res,method="diff")

## End(Not run)

fda.usc

Functional Data Analysis and Utilities for Statistical Computing

v2.0.2
GPL-2
Authors
Manuel Febrero Bande [aut], Manuel Oviedo de la Fuente [aut, cre], Pedro Galeano [ctb], Alicia Nieto [ctb], Eduardo Garcia-Portugues [ctb]
Initial release
2020-02-17

We don't support your browser anymore

Please choose more modern alternatives, such as Google Chrome or Mozilla Firefox.