far: FARX(1) model estimation

View source: R/far.R

farR Documentation

FARX(1) model estimation

Description

Estimates the parameters of FAR(1) and FARX(1) processes (mean and autocorrelation operator)

Usage

far(data, y, x, kn, center=TRUE, na.rm=TRUE, joined=FALSE)

Arguments

data

A fdata object.

y

A vector giving the name(s) of the endogenous variable(s) of the model.

x

A vector giving the name(s) of the exogenous variable(s) of the model.

kn

A vector giving the values of the various kn (dimension of plug-in in the algorithm). If it not supplied, the default value is one.

center

Logical. Does the observation need to be centered.

na.rm

Logical. Does the n.a. need to be removed.

joined

Logical. If TRUE, the joined (whole) far model is computed, otherwise the model work with the separated variables.

Details

The models

A Functional AutoRegressive of order 1 (FAR(1)) process is, in a general way, defined by the following equation:

Tn=r(Tn-1)+En, n in Z

where Tn and En take their values in a functional space (for instance an Hilbertian one), and r is a linear operator. En is a strong white noise.

Now, let us consider a vector of observations, for instance:

(T1,n,...,Ti,n,...,Tm,n)

where each Ti,n lives in a one dimension functional space (not necessary the same). In the following, we will cut this list into two parts: the endogeneous variables Yn (the ones we are interested in), and the exogeneous variables Xn (which influence the endogeneous ones).

Then an order 1 Functional AutoRegressive process with eXogeneous variables (FARX(1)) is defined by the equation:

Yn=r(Yn-1)+a(Xn-1)+En, n in Z

where r and a are linear operators in the adequate spaces.

Estimation

This function estimates the parameters of FAR and FARX models.

First, if the mean of the data is not zero (which is required by the model), you can substance this mean using the center option. Moreover, if the data contains NA values, you can work with it using the na.rm option.

FAR Estimation

The estimation is mainly about estimating the r operator. This estimation is done in a appropriate subspace (computed from the variance of the observations). What is important to know is that the best dimension kn for this subspace is not determined by this function. So the user have to supply this dimension using the kn option. A way to chose this dimension is to first use the far.cv function on the history.

FARX Estimation

The FARX estimation can be realized by two methods: joined or not.

The joined estimation is done by “joining” the variables into one and estimating a FAR model on the resulting variable. For instance, with the previous notations, the transformation is:

Tn=(Yn,Xn+1)

and Tn is then a peculiar FAR(1) process. In such a case, you have to use the joined=TRUE oto the interpretation of this operatorption and specify one value for kn (corresponding to the Tn variable).

Alternatively, you can choose not to estimate the FARX model by the joined procedure, then kn need to be a vector with a length equal to the number of variables involved in the FARX model (endogeneous and exogeneous).

In both procedures, the endogeneous and exogeneous variables are provided through the y and x options respectively.

Results

The function returns a far object. Use the print, coef and predict functions to get more informations about the model.

Value

A far object, see details for more informations.

Note

This function could be used to estimate FAR and FARX with order higher than 1 as a change of variables can transform the process to an order 1 FAR or FARX. For instance, if Tn is a FAR(2) process then Yn=(Tn,Tn-1) is a FAR(1) process.

However, this is not a basic use of this function and may require a hard work of the user to get the result.

Author(s)

J. Damon

References

Besse, P. and Cardot, H. (1996). Approximation spline de la prévision d'un processus fonctionnel autorégressif d'ordre 1. Revue Canadienne de Statistique/Canadian Journal of Statistics, 24, 467–487.

Bosq, D. (2000) Linear Processes in Function Spaces: Theory and Applications, (Lecture Notes in Statistics, Vol. 149). New York: Springer-Verlag.

See Also

predict.far, far.cv

Examples

  # 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)

  # Cross validation (joined and separate)
  model1.cv <- far.cv(data=data1, y="X", x="Z", kn=8, ncv=10, cvcrit="X",
                center=FALSE, na.rm=FALSE, joined=TRUE)
  model2.cv <- far.cv(data=data1, y="X", x="Z", kn=c(4,4), ncv=10, cvcrit="X",
                center=FALSE, na.rm=FALSE, joined=FALSE)
  print(model1.cv)
  print(model2.cv)
  k1 <- model1.cv$minL2[1]
  k2 <- model2.cv$minL2[1:2]

  # Modelization of the FARX process (joined and separate)
  model1 <- far(data=data1, y="X", x="Z", kn=k1,
                center=FALSE, na.rm=FALSE, joined=TRUE)
  model2 <- far(data=data1, y="X", x="Z", kn=k2,
                center=FALSE, na.rm=FALSE, joined=FALSE)
  print(model1)
  print(model2)

far documentation built on Aug. 14, 2022, 1:06 a.m.

Related to far in far...