? print y1
print y1
Varname: y1
Full data range: 1 - 20 (n = 20)
Current sample: 1 - 20
0.800000 0.820000 0.728000 0.701200 0.644480 0.608392 0.565597
0.530435 0.494972 0.463206 0.432769 0.404711 0.378269 0.353663
0.330599 0.309071 0.288928 0.270107 0.252507 NA
Which is not, I presume, exactly what you expected to get, but at least it
runs.
Oh yes, this is what I wanted. I only have to plot it to obtain the
theoretical correlogram.
The problem seems to be with the Spanish translation, since your message made
me try it with the "gretl --english" command, and I obtained the same as
output as you, but running the script in Spanish, I have:
----
gretl versión 1.5.0
Sesión actual: 2006/02/08 13:12
? nulldata 20
rango de observaciones: 1-20
# function definition
? function corrAR2 (scalar phi1, scalar phi2)
? series y = 1.0
? scalar rho1 = phi1 / (1-phi2)
? genr y[2] = rho1
? genr y = phi1*y(-1)+phi2*y(-2)
? genr y2 = y(1)
? return series y2
? end function
# function call
? (y1) = corrAR2 0.4 0.5
? series y = 1.0
Generada vector y (ID 4)
? scalar rho1 = phi1 / (1-phi2)
Generada escalar rho1 (ID 5) = 0
? genr y[2] = rho1
Modificado vector y (ID 4)
? genr y = phi1*y(-1)+phi2*y(-2)
Reemplazado vector y (ID 4)
? genr y2 = y(1)
Generada vector y2 (ID 6)
? print y1
Nombre de variable: y1
Rango de datos completo: 1 - 20 (n = 20)
Muestra actual: 1 - 20
0,00000
--------
--
Ignacio Díaz-Emparanza
Dpto. de Economía Aplicada III (Econometría y Estadística)
UPV-EHU