fapply: Apply functions over a fdata object

Description Usage Arguments Details Value Author(s) See Also Examples

Description

fapply returns a fdata object of the same length as data. Each element of which is the result of applying FUN to the corresponding element of data.

Usage

1

Arguments

data

A fdata object

FUN

the function to be applied. In the case of functions like +, %*%, etc., the function name must be quoted.

row.names

a vector giving the names describing the results of FUN

...

optional arguments to FUN.

Details

This function has to be used only with fdata objects, unless it stop, returning no value.

Value

The returned value is a fdata object too.

Author(s)

J. Damon

See Also

apply, lapply.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
  # Simulation of a FARX process
  data1 <- simul.farx(m=10,n=400,base=base.simul.far(20,5),
                base.exo=base.simul.far(20,5),
                d.a=matrix(c(0.5,0),nrow=1,ncol=2),
                alpha.conj=matrix(c(0.2,0),nrow=1,ncol=2),
                d.rho=diag(c(0.45,0.90,0.34,0.45)),
                alpha=diag(c(0.5,0.23,0.018)),
                d.rho.exo=diag(c(0.45,0.90,0.34,0.45)),
                cst1=0.0)

  fapply(data1,sum)
  multplot(fapply(fapply(data1,abs),cumsum))

far documentation built on May 2, 2019, 9:28 a.m.

Related to fapply in far...