I posted a question few days ago but wasn't clear about my
problem so I didn't receive the answer I was looking for.

Also you are not subscribed to the gretl-devel list under the
email address you're using, which may explain communication
difficulties.
That is why I present my problem again. I was using standard
non-seasonal ARIMA(1,1,1) model which should be on the form:
Y^(t) = c + Y(t-1) + Phi*(Y(t-1)-Y(t-2)) + theta*e(t-1)
I got parameters from Gretl for c, Phi and theta. I also got
time series for Y(t) and Y^(t) for many values of t's.
I assumed that e(t-1) = Y(t) - Y^(t-1) in order to compare
values of Y^(t) that the model got and what I should get on the
spreadsheet by using the values for above parameters and the
above equation. The values didnt match at all...

The first point is that when gretl estimates an ARMA model with
mean term \mu via exact ML, the model is in fact
\phi(L) (y - \mu) = \theta(L) e_t
This is explained in the Gretl User's Guide, chapter 21 (see
equations (21.4) and (21.5) in particular. This means that in your
forecasting equation you need to replace c with (1 - \phi)c on the
right-hand side.
This will produce forecast values that are close to those given by
gretl. But they will not be identical, for this reason: what gretl
produces as the ARMA residual, available via the accessor $uhat,
is the one-step ahead forecast error,
y_t - E_{t-1} y_t
where E_{t-1} y_t is the optimal forecast of y_t as of date t-1,
produced by the Kalman filter. Now the point is that this value is
not exactly the one that is needed for "e(t-1)" in the forecasting
equation you cite. To make that equation valid you need the
optimal estimate of the (t-1)-dated innovation based on all
information up to t - 1. This is implicitly produced by the Kalman
filter, but it is not the same as gretl's reported $uhat. The
difference arises because observation of y at t allows revision of
the optimal estimates of the underlying innovations at t-1 and t.
For example, consider a Gaussian ARMA(1,1) process with an
unconditional mean of zero. Let the first observation, y_1, equal
1.5. Then the first forecast error ($uhat[1]) is also 1.5. But
this does not mean that the optimal estimate of e_1 is 1.5, once
y_1 is observed. Rather, the positive value of y_1 suggests that
the pre-sample value e_0 was positive, and the optimal estimate
of e_1 (which we need for forecasting y_2) will be < 1.5.
Allin Cottrell