3 Mar 2008 10:01

## Re: Scaled Frequency in Periodogram

```El Monday 03 March 2008 02:09:24 Allin Cottrell escribió:
> On Sun, 2 Mar 2008, Thomas La Bone wrote:
> > I am playing with sunspot data on a Sunday night, making
> > periodograms in various software packages (R, SAS, ITSM, and
> > Gretl). The Gretl periodogram is quite nice, with the period on
> > the upper x axis and the "scaled frequency" on the lower x axis.
> > None of the other packages present scaled frequency as a default
> > (I don't know if they offer it at all), and I have been unable
> > to nail down exactly what it is. Can anyone offer a simple
> > explanation of scaled frequency as it is used in Gretl, or even
> > better, a specific reference? Thanks.
>
> W. Greene, Econometric Analysis, 4e, chapter 18, section 18.2.8.
> I suppose there must be a counterpart in more recent editions;
> I'll see if I can find a newer reference.

I don't have this reference, but looking at the numbers I can guess that:

if T is the period, and Nobs the number of observations, the scaled frequency
is

f=Nobs/T,

or said in another way, if w is the angular frequency, (w=2*pi/T)

f=w*(Nobs/2*pi)

--

--
Ignacio Diaz-Emparanza
```

3 Mar 2008 11:45

### Re: Scaled Frequency in Periodogram

```Yes, that seems to be what Gretl is doing. Thanks. The next question is
why? What is the advantage of scaling the frequency in this way?

Tom

Ignacio Diaz-Emparanza wrote:
>
> I don't have this reference, but looking at the numbers I can guess that:
>
> if T is the period, and Nobs the number of observations, the scaled frequency
> is
>
> f=Nobs/T,
>
> or said in another way, if w is the angular frequency, (w=2*pi/T)
>
> f=w*(Nobs/2*pi)
>
```
3 Mar 2008 18:23

### Re: Scaled Frequency in Periodogram

```On Mon, 3 Mar 2008, Thomas La Bone wrote:

> Yes, that seems to be what Gretl is doing. Thanks. The next question is why?
> What is the advantage of scaling the frequency in this way?

If you have a time series with a marked cycle, a peak in the spectrum at a
specified "scaled frequency" tells you how many cycles you're likely to
observe in the data. Nice to have. Try this:

nulldata 150
setobs 1 1 --special
set seed 12345

e = normal()
series y = 0
y = 1.5*y(-1) - 0.8*y(-2) + e

Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche

r.lucchetti@...
http://www.econ.univpm.it/lucchetti```
```On Mon, 3 Mar 2008, Thomas La Bone wrote:

> Yes, that seems to be what Gretl is doing. Thanks. The next question is why?
> What is the advantage of scaling the frequency in this way?

If you have a time series with a marked cycle, a peak in the spectrum at a
```

6 Mar 2008 01:56

### Re: Scaled Frequency in Periodogram

```In this example an AR(2) dataset is simulated. I do not have a lot of
experience with the Gretl language and it is not clear to me how  to
generate an MA dataset. Can someone suggest the appropriate commands
needed to generate an MA(2) dataset, for example. Thanks

Tom

Riccardo (Jack) Lucchetti wrote:
> On Mon, 3 Mar 2008, Thomas La Bone wrote:
>
>> Yes, that seems to be what Gretl is doing. Thanks. The next question
>> is why? What is the advantage of scaling the frequency in this way?
>
> If you have a time series with a marked cycle, a peak in the spectrum at
> a specified "scaled frequency" tells you how many cycles you're likely
> to observe in the data. Nice to have. Try this:
>
> nulldata 150
> setobs 1 1 --special
> set seed 12345
>
> e = normal()
> series y = 0
> y = 1.5*y(-1) - 0.8*y(-2) + e
>
>
> Riccardo (Jack) Lucchetti
> Dipartimento di Economia
> Universit` Politecnica delle Marche
>
```

6 Mar 2008 03:34

### Re: Scaled Frequency in Periodogram

```On Wed, 5 Mar 2008, Thomas La Bone wrote:

> In this example an AR(2) dataset is simulated. I do not have a
> lot of experience with the Gretl language and it is not clear to
> me how to generate an MA dataset. Can someone suggest the
> appropriate commands needed to generate an MA(2) dataset, for
> example.

After the preamble,

nulldata 500
setobs 1 1 --special

The language is pretty much transparent:

series e = normal()
series MA2 = e + .4*e(-1) + .1*e(-2)

Allin Cottrell
```
6 Mar 2008 07:39

### Re: Scaled Frequency in Periodogram

```On Wed, 5 Mar 2008, Allin Cottrell wrote:

> On Wed, 5 Mar 2008, Thomas La Bone wrote:
>
>> In this example an AR(2) dataset is simulated. I do not have a
>> lot of experience with the Gretl language and it is not clear to
>> me how to generate an MA dataset. Can someone suggest the
>> appropriate commands needed to generate an MA(2) dataset, for
>> example.
>
> After the preamble,
>
>  nulldata 500
>  setobs 1 1 --special
>
> The language is pretty much transparent:
>
>  series e = normal()
>  series MA2 = e + .4*e(-1) + .1*e(-2)

Riccardo (Jack) Lucchetti
Dipartimento di Economia
Università Politecnica delle Marche

r.lucchetti@...
http://www.econ.univpm.it/lucchetti```
```On Wed, 5 Mar 2008, Allin Cottrell wrote:
```

6 Mar 2008 11:47

### Re: Scaled Frequency in Periodogram

```Thanks everyone. How could a student miss a chapter called "cheat
sheet"? That chapter has a taste of what I have been looking for --
examples of Gretl code doing a variety of tasks. As a new user, it would
be very helpful if there was a section on the main Gretl web page that
had examples of code submitted by more experienced users (like profs
using Gretl to teach a time series course). Just a suggestion.

Tom

Riccardo (Jack) Lucchetti wrote:
> On Wed, 5 Mar 2008, Allin Cottrell wrote:
>
>> On Wed, 5 Mar 2008, Thomas La Bone wrote:
>>
>>> In this example an AR(2) dataset is simulated. I do not have a
>>> lot of experience with the Gretl language and it is not clear to
>>> me how to generate an MA dataset. Can someone suggest the
>>> appropriate commands needed to generate an MA(2) dataset, for
>>> example.
>>
>> After the preamble,
>>
>>  nulldata 500
>>  setobs 1 1 --special
>>
>> The language is pretty much transparent:
>>
>>  series e = normal()
>>  series MA2 = e + .4*e(-1) + .1*e(-2)
>
```

5 Mar 2008 10:46

### Re: Scaled Frequency in Periodogram

```El Monday 03 March 2008 18:23:37 Riccardo (Jack) Lucchetti escribió:
> > Yes, that seems to be what Gretl is doing. Thanks. The next question is
> > why? What is the advantage of scaling the frequency in this way?
>
> If you have a time series with a marked cycle, a peak in the spectrum at a
> specified "scaled frequency" tells you how many cycles you're likely to
> observe in the data. Nice to have. Try this:
>
> nulldata 150
> setobs 1 1 --special
> ...

What does the option --special mean? It is not documented in the manual

--

--
Ignacio Diaz-Emparanza
UPV/EHU
Avda. Lehendakari Aguirre, 83 | 48015 BILBAO
T.: +34 946013732 | F.: +34 946013754
www.et.bs.ehu.es

```
5 Mar 2008 15:08

### Re: Scaled Frequency in Periodogram

```On Wed, 5 Mar 2008, Ignacio Diaz-Emparanza wrote:

> El Monday 03 March 2008 18:23:37 Riccardo (Jack) Lucchetti escribió:
> > nulldata 150
> > setobs 1 1 --special
> > ...
>
>  What does the option --special mean? It is not documented in
> the manual

Hmm, you're right, that needs to be added.  It's short for

--special-time-series

which can be used to indicate that a dataset is time series, but
not with any standard, recognized frequency.  The difference is
that if you did

nulldata 150
setobs 1 1 --time-series

you would be defined the data as annual, starting in the year 1,
but with --special you're being non-committal about the dates.

Allin.

```
```On Wed, 5 Mar 2008, Ignacio Diaz-Emparanza wrote:

```