sven,

The $uhat gives residual on against time and not residual from scatter plot and the
save residual is saving the residual against time. Which command gives the residual from scatter plot? Tks


On Dec 15, 2011, gretl-users-request@lists.wfu.edu wrote:

Send Gretl-users mailing list submissions to
gretl-users@lists.wfu.edu

To subscribe or unsubscribe via the World Wide Web, visit
http://lists.wfu.edu/mailman/listinfo/gretl-users
or, via email, send a message with subject or body 'help' to
gretl-users-request@lists.wfu.edu

You can reach the person managing the list at
gretl-users-owner@lists.wfu.edu

When replying, please edit your Subject line so it is more specific
than "Re: Contents of Gretl-users digest..."


Today's Topics:

1. Re: two data (Sven Schreiber)
2. Re: R:VAR parameters (Allin Cottrell)
3. Re: R:VAR parameters (Leon Unger)
4. problem with a function: 'xy' is not a name of a variable
(artur tarassow)
5. Re: problem with a function: 'xy' is not a name of a variable
(Sven Schreiber)
6. Re: problem with a function: 'xy' is not a name of a variable
(artur tarassow)


----------------------------------------------------------------------

Message: 1
Date: Wed, 14 Dec 2011 20:55:11 +0100
From: Sven Schreiber <svetosch@gmx.net>
Subject: Re: [Gretl-users] two data
To: gretl-users@lists.wfu.edu
Message-ID: <4EE8FF1F.2040900@gmx.net>
Content-Type: text/plain; charset=ISO-8859-1

On 12/14/2011 08:44 PM, clarodina@lycos.com wrote:
> Should adf be done on the residual against time or the residual from
> scatter plot?
>

I think this is the right moment to refer you to the great user guide
that gretl has (aka RTFM).

happy testing,
sven





------------------------------

Message: 2
Date: Wed, 14 Dec 2011 21:53:30 -0500 (EST)
From: Allin Cottrell <cottrell@wfu.edu>
Subject: Re: [Gretl-users] R:VAR parameters
To: Gretl list <gretl-users@lists.wfu.edu>
Message-ID: <alpine.DEB.2.00.1112142139430.18573@myrtle>
Content-Type: TEXT/PLAIN; charset=US-ASCII; format=flowed

On Wed, 14 Dec 2011, Sven Schreiber wrote:

> No, non-linear restrictions are not available for system estimators
> (yet), AFAIK.
>
> Of course there are workarounds, for example specifying an equivalent
> GMM block, where I think it is possible now to test nonlinear
> restrictions. But this is admittedly not the most friendly way.

Sven's idea is a good one, and in fact it's not too difficult to
implement. Since this is quite a nice showcase for gretl's GMM I've
appended a complete (albeit trivial) example script below.

The first GMM invocation is just to show that the unrestricted VAR
can be replicated by this method. In the restricted variant, the
"trick" is to set the length of the parameter vector to the number
of free parameters, and to calculate the coefficients so as to
impose the required restriction. The nice thing is that if you
estimate the restricted model with the --two-step option the
automatic J-test tests the overidentifying restriction.

One further point: restricted GMM may fail to converge if the
restriction is too "violent" (too far distant from the unrestricted
estimates). For example, you can set the "c" parameter below to 1
and see what happens. In a very informal sense this might be taken
as "reject the null"!

<hansl>
open data9-7 -q

var 2 UNEMP PRIME
list X = const UNEMP(-1 to -2) PRIME(-1 to -2)

series u1 = $uhat[,1]
series u2 = $uhat[,2]
matrix B1 = $coeff[,1]
matrix B2 = $coeff[,2]

# unrestricted one-step GMM (should replicate the VAR)
gmm
u1 = UNEMP - lincomb(X, B1)
u2 = PRIME - lincomb(X, B2)
orthog u1 ; X
orthog u2 ; X
params B1 B2
end gmm

# look at the unrestricted product of two terms
eval B1[5]*B2[5]

# impose nonlinear restriction: B1[5]*B2[5]=c
matrix theta = B1 | B2[1:4]
scalar c = 0.05
gmm
B1 = theta[1:5]
B2 = theta[6:9] | {c / theta[5]}
u1 = UNEMP - lincomb(X, B1)
u2 = PRIME - lincomb(X, B2)
orthog u1 ; X
orthog u2 ; X
params theta
end gmm --two-step
</hansl>

Allin Cottrell


------------------------------

Message: 3
Date: Thu, 15 Dec 2011 12:10:16 +0100
From: Leon Unger <pindar@zedat.fu-berlin.de>
Subject: Re: [Gretl-users] R:VAR parameters
To: Gretl list <gretl-users@lists.wfu.edu>
Message-ID: <4EE9D598.3090206@zedat.fu-berlin.de>
Content-Type: text/plain; charset="iso-8859-1"

Hi there,

thank you Allin for this helpful showcase!

Cheers
Leon

Am 15.12.2011 03:53, schrieb Allin Cottrell:
> On Wed, 14 Dec 2011, Sven Schreiber wrote:
>
>> No, non-linear restrictions are not available for system estimators
>> (yet), AFAIK.
>>
>> Of course there are workarounds, for example specifying an equivalent
>> GMM block, where I think it is possible now to test nonlinear
>> restrictions. But this is admittedly not the most friendly way.
> Sven's idea is a good one, and in fact it's not too difficult to
> implement. Since this is quite a nice showcase for gretl's GMM I've
> appended a complete (albeit trivial) example script below.
>
> The first GMM invocation is just to show that the unrestricted VAR
> can be replicated by this method. In the restricted variant, the
> "trick" is to set the length of the parameter vector to the number
> of free parameters, and to calculate the coefficients so as to
> impose the required restriction. The nice thing is that if you
> estimate the restricted model with the --two-step option the
> automatic J-test tests the overidentifying restriction.
>
> One further point: restricted GMM may fail to converge if the
> restriction is too "violent" (too far distant from the unrestricted
> estimates). For example, you can set the "c" parameter below to 1
> and see what happens. In a very informal sense this might be taken
> as "reject the null"!
>
> <hansl>
> open data9-7 -q
>
> var 2 UNEMP PRIME
> list X = const UNEMP(-1 to -2) PRIME(-1 to -2)
>
> series u1 = $uhat[,1]
> series u2 = $uhat[,2]
> matrix B1 = $coeff[,1]
> matrix B2 = $coeff[,2]
>
> # unrestricted one-step GMM (should replicate the VAR)
> gmm
> u1 = UNEMP - lincomb(X, B1)
> u2 = PRIME - lincomb(X, B2)
> orthog u1 ; X
> orthog u2 ; X
> params B1 B2
> end gmm
>
> # look at the unrestricted product of two terms
> eval B1[5]*B2[5]
>
> # impose nonlinear restriction: B1[5]*B2[5]=c
> matrix theta = B1 | B2[1:4]
> scalar c = 0.05
> gmm
> B1 = theta[1:5]
> B2 = theta[6:9] | {c / theta[5]}
> u1 = UNEMP - lincomb(X, B1)
> u2 = PRIME - lincomb(X, B2)
> orthog u1 ; X
> orthog u2 ; X
> params theta
> end gmm --two-step
> </hansl>
>
> Allin Cottrell
> _______________________________________________
> Gretl-users mailing list
> Gretl-users@lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20111215/3ea5b6f4/attachment-0001.html

------------------------------

Message: 4
Date: Thu, 15 Dec 2011 15:02:26 +0100
From: artur tarassow <artur.tarassow@googlemail.com>
Subject: [Gretl-users] problem with a function: 'xy' is not a name of
a variable
To: Gretl list <gretl-users@lists.wfu.edu>
Message-ID:
<CAPeV81kG1Sfho63PBZ+GbLAeSngPtHYS9jY5KxwiWSJV=AU+mQ@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Hey gretl-community,

I've got a small problem with a function. Here is a small part of this
function:

---------------------------------------------------------
function void adfgls (int pmx[0::1] "lag order",
scalar crit "Critical value for initial OLS",
list vars "List of variables to test")

genr time

loop foreach i vars
ols $i const time $i(-1 to -pmx) --robust
omit --auto=crit
lis = $xlist
check = inlist(lis, time)
endloop

end function

open pe.gdt
scalar crit = 0.05
scalar px = 8
list X = pe price
adfgls(px, crit, X)
----------------------------------------------------------

I obtain the following error:

adfgls(px, crit, X)
'pe' is not the name of a variable
*** error in function adfgls
> ols $i const time $i(-1 to -pmx) --robust

What is wrong with the function?

Best,
Artur
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20111215/5507c61d/attachment-0001.html

------------------------------

Message: 5
Date: Thu, 15 Dec 2011 15:06:18 +0100
From: Sven Schreiber <svetosch@gmx.net>
Subject: Re: [Gretl-users] problem with a function: 'xy' is not a name
of a variable
To: gretl-users@lists.wfu.edu
Message-ID: <4EE9FEDA.1020107@gmx.net>
Content-Type: text/plain; charset=ISO-8859-1; format=flowed

Inside functions, you need to access list members with the list name
prepended: vars.$i instead of just $i.

hth,
sven

Am 15.12.2011 15:02, schrieb artur tarassow:
> Hey gretl-community,
>
> I've got a small problem with a function. Here is a small part of this
> function:
>
> ---------------------------------------------------------
> function void adfgls (int pmx[0::1] "lag order",
> scalar crit "Critical value for initial OLS",
> list vars "List of variables to test")
>
> genr time
>
> loop foreach i vars
> ols $i const time $i(-1 to -pmx) --robust
> omit --auto=crit
> lis = $xlist
> check = inlist(lis, time)
> endloop
>
> end function
>
> open pe.gdt
> scalar crit = 0.05
> scalar px = 8
> list X = pe price
> adfgls(px, crit, X)
> ----------------------------------------------------------
>
> I obtain the following error:
>
> adfgls(px, crit, X)
> 'pe' is not the name of a variable
> *** error in function adfgls
> > ols $i const time $i(-1 to -pmx) --robust
>
> What is wrong with the function?
>
> Best,
> Artur
>
>
> _______________________________________________
> Gretl-users mailing list
> Gretl-users@lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users



------------------------------

Message: 6
Date: Thu, 15 Dec 2011 15:09:53 +0100
From: artur tarassow <artur.tarassow@googlemail.com>
Subject: Re: [Gretl-users] problem with a function: 'xy' is not a name
of a variable
To: Gretl list <gretl-users@lists.wfu.edu>
Message-ID:
<CAPeV81nxDxYQkyojCioE-8HoT+5e-j9hGr2A0aRC+4pv-hr6gA@mail.gmail.com>
Content-Type: text/plain; charset="iso-8859-1"

Thank you Sven,
that helped me a lot. It works fine now.

Artur

2011/12/15 Sven Schreiber <svetosch@gmx.net>

> Inside functions, you need to access list members with the list name
> prepended: vars.$i instead of just $i.
>
> hth,
> sven
>
> Am 15.12.2011 15:02, schrieb artur tarassow:
> > Hey gretl-community,
> >
> > I've got a small problem with a function. Here is a small part of this
> > function:
> >
> > ---------------------------------------------------------
> > function void adfgls (int pmx[0::1] "lag order",
> > scalar crit "Critical value for initial OLS",
> > list vars "List of variables to test")
> >
> > genr time
> >
> > loop foreach i vars
> > ols $i const time $i(-1 to -pmx) --robust
> > omit --auto=crit
> > lis = $xlist
> > check = inlist(lis, time)
> > endloop
> >
> > end function
> >
> > open pe.gdt
> > scalar crit = 0.05
> > scalar px = 8
> > list X = pe price
> > adfgls(px, crit, X)
> > ----------------------------------------------------------
> >
> > I obtain the following error:
> >
> > adfgls(px, crit, X)
> > 'pe' is not the name of a variable
> > *** error in function adfgls
> > > ols $i const time $i(-1 to -pmx) --robust
> >
> > What is wrong with the function?
> >
> > Best,
> > Artur
> >
> >
> > _______________________________________________
> > Gretl-users mailing list
> > Gretl-users@lists.wfu.edu
> > http://lists.wfu.edu/mailman/listinfo/gretl-users
>
> _______________________________________________
> Gretl-users mailing list
> Gretl-users@lists.wfu.edu
> http://lists.wfu.edu/mailman/listinfo/gretl-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.wfu.edu/pipermail/gretl-users/attachments/20111215/9b5dba58/attachment.html

------------------------------

_______________________________________________
Gretl-users mailing list
Gretl-users@lists.wfu.edu
http://lists.wfu.edu/mailman/listinfo/gretl-users

End of Gretl-users Digest, Vol 59, Issue 20
*******************************************