far {far} | R 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 |
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
|
center |
Logical. Does the observation need to be centered. |
na.rm |
Logical. Does the |
joined |
Logical. If |
Details
The models
A Functional AutoRegressive of order 1 (FAR(1)) process is, in a general way, defined by the following equation:
T_{n}=\rho\left(T_{n-1}\right)+\epsilon_{n}, n \in
Z
where T_{n}
and \epsilon_{n}
take their values in a
functional space (for instance an Hilbertian one), and \rho
is a linear operator. \epsilon_{n}
is a strong white noise.
Now, let us consider a vector of observations, for instance:
\left(T_{1,n},...,T_{i,n},...,T_{m,n}\right)
where each T_{i,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 Y_{n}
(the
ones we are interested in), and the exogeneous variables
X_{n}
(which influence the endogeneous ones).
Then an order 1 Functional AutoRegressive process with eXogeneous variables (FARX(1)) is defined by the equation:
Y_{n}=\rho\left(Y_{n-1}\right)+a\left(X_{n}\right)+\epsilon_{n}
, n \in Z
where \rho
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 \rho
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:
T_{n}=\left(Y_{n},X_{n+1}\right)
and T_{n}
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 T_{n}
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 T_{n}
is a FAR(2)
process then Y_{n}=\left(T_{n},T_{n-1}\right)
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
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)