Robert Besso | 2 Feb 2009 15:19
Picon
Favicon

Time series detrend deseasonality

Hi

I would like to to do following steps with gretl if possible:
1. from a time series I have, I would like to remove trend and seasonality (equation parameters should be accessible)
I expect a sinus similar wave for seasonality eq. and a linear eq. for trend (I do not know if I can define this)
2. after removing these two "things" I would like to take the rest (the error), plot an histogram and with Maximum Likelihood extract parameters
of my density fct ...

Possible ?

Can you give me some hints ...? I will appreciate.

Thanks
GiPO

 

See all the ways you can stay connected to friends and family
<div>
Hi <br><br>I would like to to do following steps with gretl if possible:<br>1. from a time series I have, I would like to remove trend and seasonality (equation parameters should be accessible)<br>I expect a sinus similar wave for seasonality eq. and a linear eq. for trend (I do not know if I can define this)<br>2. after removing these two "things" I would like to take the rest (the error), plot an histogram and with Maximum Likelihood extract parameters <br>of my density fct ...<br><br>Possible ?<br><br>Can you give me some hints ...? I will appreciate.<br><br>Thanks<br>GiPO<br><br>&nbsp;<br><br>See all the ways you can stay connected <a href="http://www.microsoft.com/windows/windowslive/default.aspx" target="_new">to friends and family</a>
</div>
Franck Nadaud | 2 Feb 2009 16:36
Picon
Favicon

problem with matrix creation with lists

Dear all, happy new & greetings from Paris !

I experience some problem with the matrix functions. Returning to an older
script with new data it does not work properly. Well, here is some code:

###### lissage spatial des PPV
list datalist = 13 14 15 16 17 18 19 20 21 22 23 24
list ppv4 = 25 26 27 28
list ppv8 = 29 30 31 32 33 34 35 36
matrix V4 = {ppv4}
matrix V8 = {ppv8}

Everything is ok with the list commands, but when i want to create the
matrices V4 and V8, from lists ppv4 and ppv8 gretl does not do it and says:

Types de données non conformes pour l'opération

Data type non conformant for the operation

I dont really understand what happens because the script worked smoothly before.

The data are declared as cross-section, under 1.8.0 and running under win XP.

Note also that i tried to declare the matrices directly with variables number
with the same results.

Need helped or will have to reverse to an older version !

thanxs

F.

--

-- 
Franck Nadaud
Economiste
CIRED
UMR 8568 CNRS - EHESS
45 bis avenue de la Belle Gabrielle
94736 Nogent-sur-Marne Cedex
TEL 33-1-43-94-73-94
FAX: 33-1-43-94-73-70
MOB: 06-07-39-92-75
France

Allin Cottrell | 2 Feb 2009 17:11
Picon
Favicon

Re: problem with matrix creation with lists

On Mon, 2 Feb 2009, Franck Nadaud wrote:

> I experience some problem with the matrix functions. Returning to an older
> script with new data it does not work properly. Well, here is some code:
>
> ###### lissage spatial des PPV
> list datalist = 13 14 15 16 17 18 19 20 21 22 23 24
> list ppv4 = 25 26 27 28
> list ppv8 = 29 30 31 32 33 34 35 36
> matrix V4 = {ppv4}
> matrix V8 = {ppv8}
>
> Everything is ok with the list commands, but when i want to
> create the matrices V4 and V8, from lists ppv4 and ppv8 gretl
> does not do it and says:
>
> Types de données non conformes pour l'opération

Could you send a copy of your complete script, please?  I tried a
simple example of this with current gretl:

<script>
open data4-10
list ppv4 = 1 2 3 4 5
list ppv8 = 4 5 6 7 8 9
matrix V4 = {ppv4}
matrix V8 = {ppv8}
</script>

and it works OK, so I suppose there must be something more
complicated going on.  (You would get the "types" error message if
the identifier "V4" had been used for something other than a
matrix at an earlier point in the script.)

Allin Cottrell

Franck Nadaud | 2 Feb 2009 17:18
Picon
Favicon

problem with matrix creation


gretl version 1.8.0
Current session: 2009/02/02 17:16
#### Analyse spatiale des residus du modèle SVAR en PANEL de Mario-Jorge
Dear all, apologize for the redundancy

trying many things, but same problem

here is the result from my script in english:

? list datalist = 13 14 15 16 17 18 19 20 21 22 23 24
Generated list datalist
? list ppv4 = 25 26 27 28
Generated list ppv4
? list ppv8 = 29 30 31 32 33 34 35 36
Generated list ppv8
? matrix V4 = {ppv4}
Data types not conformable for operation

Error executing script: halting
> matrix V4 = {ppv4}

well, i really do not see what is wrong...

thanx for help !

cheers

Franck

--

-- 
Franck Nadaud
Economiste
CIRED
UMR 8568 CNRS - EHESS
45 bis avenue de la Belle Gabrielle
94736 Nogent-sur-Marne Cedex
TEL 33-1-43-94-73-94
FAX: 33-1-43-94-73-70
MOB: 06-07-39-92-75
France

Allin Cottrell | 2 Feb 2009 17:53
Picon
Favicon

Re: problem with matrix creation

On Mon, 2 Feb 2009, Franck Nadaud wrote:

> gretl version 1.8.0
> Current session: 2009/02/02 17:16
> #### Analyse spatiale des residus du modèle SVAR en PANEL de Mario-Jorge
> Dear all, apologize for the redundancy
>
> trying many things, but same problem
>
> here is the result from my script in english:
>
>
> ? list datalist = 13 14 15 16 17 18 19 20 21 22 23 24
> Generated list datalist
> ? list ppv4 = 25 26 27 28
> Generated list ppv4
> ? list ppv8 = 29 30 31 32 33 34 35 36
> Generated list ppv8
> ? matrix V4 = {ppv4}
> Data types not conformable for operation
>
> Error executing script: halting
> > matrix V4 = {ppv4}

Try running this (simple, complete) script:

<script>
nulldata 10
loop i=1..36
  series x$i = normal()
endloop
list datalist = 13 14 15 16 17 18 19 20 21 22 23 24
list ppv4 = 25 26 27 28
list ppv8 = 29 30 31 32 33 34 35 36
matrix V4 = {ppv4}
</script>

Here I get no error with current gretl:

? list ppv4 = 25 26 27 28
Generated list ppv4
? list ppv8 = 29 30 31 32 33 34 35 36
Generated list ppv8
? matrix V4 = {ppv4}
Generated matrix V4

We need to determine if you're seeing an error with this little
case, or if the source of the error is elsewhere in your script.

Allin.

John C Frain | 2 Feb 2009 18:56
Picon

Re: Time series detrend deseasonality

The TRAMO/SEATS routines which are available in Gretl allow one to
model your series as a SARIMA and decompose the series into seasonal,
trend, and irregular.  It gives parameter values for each process.
The process is rather complicated and I would recommend that you
consult the material be Augustin Maravall on the Bank of Spain
web-site.  If you are satisfied with a non-parametric approach the the
non=parametric X12 Census approach is also available in Gretl.

Best Regards

John

2009/2/2 Robert Besso <gipo72@...>:
> Hi
>
> I would like to to do following steps with gretl if possible:
> 1. from a time series I have, I would like to remove trend and seasonality
> (equation parameters should be accessible)
> I expect a sinus similar wave for seasonality eq. and a linear eq. for trend
> (I do not know if I can define this)
> 2. after removing these two "things" I would like to take the rest (the
> error), plot an histogram and with Maximum Likelihood extract parameters
> of my density fct ...
>
> Possible ?
>
> Can you give me some hints ...? I will appreciate.
>
> Thanks
> GiPO
>
>
>
> ________________________________
> See all the ways you can stay connected to friends and family
> _______________________________________________
> Gretl-users mailing list
> Gretl-users@...
> http://lists.wfu.edu/mailman/listinfo/gretl-users
>

--

-- 
John C Frain
Trinity College Dublin
Dublin 2
Ireland
www.tcd.ie/Economics/staff/frainj/home.html
mailto:frainj@...
mailto:frainj@...
Yuniarto Hadiwibowo | 3 Feb 2009 05:31
Picon
Favicon

Restrictions on VECM alpha and exogeneity test

Hello,

I am learning and exploring Gretl's VECM. I have problem with exogeneity test after imposing restriction
in VECM alpha.
Without restriction in VECM alpha, exogeneity test is straightforward as in Gretl manual's example.
Supposed that we already set restriction in VECM alpha, how to conduct exogeneity test on other variables?
Using the same approach, I obtain error message "Matrices not conformable for operation".
I attach the script using Verbeek data.
Thank you.

Yuniarto Hadiwibowo

<script>
open "C:\Program Files\gretl\data\verbeek\money.gdt"
smpl 1954:1 1994:4

vecm 6 2 m infl cpr y tbr --rc --quiet

restrict --full --quiet
b[1,1]=-1
b[1,3]=0
b[2,1]=0
b[2,3]=-1
end restrict
ll0 = $lnl

set echo off
var_1="m"
var_2="infl"
var_3="cpr"
var_4="y"
var_5="tbr"

loop for i=1..5 --quiet
restrict --quiet
a$i=0
end restrict
ts_$i = 2*(ll0 - $rlnl)
end loop    

printf "\n\nExogeneity Test\n"
printf "var  \t%5s [%6s]\n", "tvalue", "pvalue"
loop for i=1..5 --quiet
printf "%s \t%6.3f [%6.4f]\n", var_$i, ts_$i, pvalue(X, 2, ts_$i)
end loop
printf "\n"
set echo on

restrict --full --quiet
a5=0
end restrict
ll0 = $lnl

set echo off
loop for i=1..4 --quiet
restrict --quiet
a$i=0
end restrict
ts_$i = 2*(ll0 - $rlnl)
end loop    

printf "\n\nExogeneity Test\n"
printf "var  \t%5s [%6s]\n", "tvalue", "pvalue"
loop for i=1..4 --quiet
printf "%s \t%6.3f [%6.4f]\n", var_$i, ts_$i, pvalue(X, 2, ts_$i)
end loop
</script>

      
Attachment (exogeneity test.inp): application/x-gretlscript, 1026 bytes
Hello,

I am learning and exploring Gretl's VECM. I have problem with exogeneity test after imposing restriction
in VECM alpha.
Without restriction in VECM alpha, exogeneity test is straightforward as in Gretl manual's example.
Supposed that we already set restriction in VECM alpha, how to conduct exogeneity test on other variables?
Using the same approach, I obtain error message "Matrices not conformable for operation".
I attach the script using Verbeek data.
Thank you.

Yuniarto Hadiwibowo

<script>
open "C:\Program Files\gretl\data\verbeek\money.gdt"
smpl 1954:1 1994:4

vecm 6 2 m infl cpr y tbr --rc --quiet

restrict --full --quiet
b[1,1]=-1
b[1,3]=0
b[2,1]=0
b[2,3]=-1
end restrict
ll0 = $lnl

set echo off
var_1="m"
var_2="infl"
var_3="cpr"
var_4="y"
var_5="tbr"

loop for i=1..5 --quiet
restrict --quiet
a$i=0
end restrict
ts_$i = 2*(ll0 - $rlnl)
end loop    

printf "\n\nExogeneity Test\n"
printf "var  \t%5s [%6s]\n", "tvalue", "pvalue"
loop for i=1..5 --quiet
printf "%s \t%6.3f [%6.4f]\n", var_$i, ts_$i, pvalue(X, 2, ts_$i)
end loop
printf "\n"
set echo on

restrict --full --quiet
a5=0
end restrict
ll0 = $lnl

set echo off
loop for i=1..4 --quiet
restrict --quiet
a$i=0
end restrict
ts_$i = 2*(ll0 - $rlnl)
end loop    

printf "\n\nExogeneity Test\n"
printf "var  \t%5s [%6s]\n", "tvalue", "pvalue"
loop for i=1..4 --quiet
printf "%s \t%6.3f [%6.4f]\n", var_$i, ts_$i, pvalue(X, 2, ts_$i)
end loop
</script>

      
Franck Nadaud | 3 Feb 2009 15:53
Picon
Favicon

Re: problem with matrix & loops

Dear Allin,

thank you for your response, I just read it today morning and so I could test
the small script you sent and compare with mine.

Well, here are the results:

1) you script works perfectly well;

2) the first part of mine also... now I can define my matrices by named list
assignement and it works ok.

I guess there is some arcane win XP problem around here... gretl does not seem
to be culprit !

But now I have problems with the second segment of my script :

############################################################################

matrix W1=zeros(257,258)
list contigus1 = 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
matrix VW1={contigus1}
loop i = 1..257 --quiet
 scalar row=$i
  loop j = 1..15 --quiet
    scalar col=VW1[$i,$j]
    matrix W1[row,col]=1
  end loop
end loop
matrix WL1=W1[,1:257]
delete W1
### calcul de la matrice de lissage
matrix DEGW1=1./sumr(WL1)
matrix INVDEG=I(257).*DEGW1
matrix W1W=WL1*INVDEG
### lissage d'ordre 1 des donnees a l'aide de la matrice de contiguite
matrix LISS1=W1W*X
loop m=1..12
series lw1$m=LISS1[,$m]
end loop

############################################################################

When i run it: gretl says :

gretl version 1.8.0
Current session: 2009/02/03 15:38
? matrix W1=zeros(257,258)
Replaced matrix W1
? list contigus1 = 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
Replaced list contigus1
? matrix VW1={contigus1}
Replaced matrix VW1
? loop i = 1..257 --quiet
> scalar row=$i
> loop j = 1..15 --quiet
> scalar col=VW1[$i,$j]
> matrix W1[row,col]=1
> end loop
> end loop
Index value 0 is out of bounds
>> matrix W1[row,col]=1
>> loop j = 1..15

i dont see why he finds an index value 0 while the loops are indexed from 1 to
257 for i and 1 to 15 for j ?

I could continue with the other script but i need these computations for
comparison.

To be brief, the script computes from a data set (matrix X), the matrix of
spatially smoothed data (each observation is replaced by the mean of its
immediate neighbors). A contiguity (neighborhood) matrix is read from the list
of indexes of the neighbors of each information stored in the matrix VW1 =
{contigus1}.

But as i said, i cannot create the matrix. Ooops, yes should have stored it
once and for all, long ago ! But once i have fixed that, i will send the tests
to the community.

thanx for help and cheers.

Franck

Allin Cottrell | 3 Feb 2009 16:13
Picon
Favicon

Re: problem with matrix & loops

On Tue, 3 Feb 2009, Franck Nadaud wrote:

> thank you for your response, I just read it today morning and so
> I could test the small script you sent and compare with mine.
>
> Well, here are the results:
>
> 1) you script works perfectly well;

That's good to hear.

> 2) the first part of mine also... now I can define my matrices
> by named list assignement and it works ok.

Hmm, but what accounts for the change in this respect?

> I guess there is some arcane win XP problem around here... gretl
> does not seem to be culprit !

This is very unlikely to be a problem with the operating system.
I'd still be interested to see the entire script that failed.

> But now I have problems with the second segment of my script :
>
> ############################################################################
>
> matrix W1=zeros(257,258)
> list contigus1 = 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
> matrix VW1={contigus1}
> loop i = 1..257 --quiet
>  scalar row=$i
>   loop j = 1..15 --quiet
>     scalar col=VW1[$i,$j]
>     matrix W1[row,col]=1
>   end loop
> end loop
>
> ############################################################################
>
> When i run it: gretl says :
>
> gretl version 1.8.0
> Current session: 2009/02/03 15:38
> ? matrix W1=zeros(257,258)
> Replaced matrix W1
> ? list contigus1 = 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52
> Replaced list contigus1
> ? matrix VW1={contigus1}
> Replaced matrix VW1
> ? loop i = 1..257 --quiet
> > scalar row=$i
> > loop j = 1..15 --quiet
> > scalar col=VW1[$i,$j]
> > matrix W1[row,col]=1
> > end loop
> > end loop
> Index value 0 is out of bounds
> >> matrix W1[row,col]=1
> >> loop j = 1..15
>
> i dont see why he finds an index value 0 while the loops are
> indexed from 1 to 257 for i and 1 to 15 for j ?

You're trying to set W1[row,col].  The "row" value is obtained
from the loop index i, and therefore should run from 1 to 257, as
you say.  But "col" is obtained as VW1[i,j].  From looking at your
script, we don't know what values this will take on, and it
appears that for some i and j VW1[i,j] = 0.

Allin.
Henrique | 5 Feb 2009 21:18
Picon

OLS Forecasting

Dear gretl users,

     I had estimated a OLS using first difference variables, but I would like to forecast the dependent variable in its level. I know that this is possible on EViews, where we can estimate a regression D(y) = a + b D(x) (where "D" states for the difference operator, "a" and "b" are parameters, and "y" and "x" are the variables) and obtain the predicted "y" values automatically. How can I do this on gretl?

Best,
Henrique C. de Andrade
Doutorando em Economia Aplicada
Universidade Federal do Rio Grande do Sul
www.ufrgs.br/ppge

<div><p>Dear gretl users,<br><br>&nbsp;&nbsp;&nbsp;&nbsp; I had estimated a OLS using first difference variables, but I would like to forecast the dependent variable in its level. I know that this is possible on EViews, where we can estimate a regression D(y) = a + b D(x) (where "D" states for the difference operator, "a" and "b" are parameters, and "y" and "x" are the variables) and obtain the predicted "y" values automatically. How can I do this on gretl?<br><br>Best,<br>Henrique C. de Andrade<br>Doutorando em Economia Aplicada<br>Universidade Federal do Rio Grande do Sul<br><a href="http://www.ufrgs.br/ppge">www.ufrgs.br/ppge</a><br></p></div>

Gmane