Skip to content

"lag1.plot {astsa}" vs. "lag.plot {stats}"

6 messages · Paul Bivand, Roy Mendelssohn - NOAA Federal

#
I'm following http://www.stat.pitt.edu/stoffer/tsa3/R_toot.htm to ramp
up on both time series and R.  About 40% of the way down, the tutorial
uses lag1.plot from astsa and lag.plot from stats.  The positioning of
the dots look different between the two.  Nothing jumps out at me from
the help pages that explains why they would be different.  Can anyone
confirm this difference, and hopefully suggest explanations?
#
Not certain which plot you are looking at, but my guess is the answer is contained somewhere here:

http://www.stat.pitt.edu/stoffer/tsa3/Rissues.htm

in particular perhaps issues 4-5.

-Roy M.
**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new address and phone***
110 Shaffer Road
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
2 days later
#
On Apr 17, 2015, at 7:30 PM, Paul Domaskis <paul.domaskis <at>
gmail.com> wrote:
Roy Mendelssohn - NOAA Federal <roy.mendelssohn <at> noaa.gov> writes:
Yup, that's it.  What the stats package refers to as lag is
time-advancement.  I assume that this odd definition is due to the
fact that we read from left to right, so a time plot that shifts right
looks like it's racing ahead, even though it is sliding backward along
the time axis.  Heck, it's even infused in the way we refer to
advancing in time, which *often* refers to time progression, i.e.
moving rightward along the time access.

Anyway, the point where this wrinkle occurs in the aforementioned
tutorial is 

   lag.plot(dljj, 9, do.lines=FALSE)  
   lag1.plot(dljj, 9)  # if you have astsa loaded (not shown) 

The following code shows the correction to the use of lag.plot so that
it matches lag1.plot:

   # From tutorial
   lag.plot(dljj, 9, do.lines=FALSE)

   # Correction
   deve.new()
   lag.plot(dljj, set.lags=-1:-9, do.lines=FALSE)

   # astsa's implementation matches above Correctoion
   dev.new()
   lag1.plot(dljj, 9)
#
Roy Mendelssohn - NOAA Federal <roy.mendelssohn <at> noaa.gov> writes:
| Not certain which plot you are looking at, but my guess is the
| answer is contained somewhere here:
| http://www.stat.pitt.edu/stoffer/tsa3/Rissues.htm in particular
| perhaps issues 4-5.
On Apr 20, 2015, Paul Domaskis <paul.domaskis <at> gmail.com> wrote:
| Yup, that's it.  What the stats package refers to as lag is
| time-advancement.  I assume that this odd definition is due to the
| fact that we read from left to right, so a time plot that shifts
| right looks like it's racing ahead, even though it is sliding
| backward along the time axis.  Heck, it's even infused in the way we
| refer to advancing in time, which *often* refers to time
| progression, i.e.  moving rightward along the time access.
| 
| Anyway, the point where this wrinkle occurs in the aforementioned
| tutorial is 
| 
|    lag.plot(dljj, 9, do.lines=FALSE)  
|    lag1.plot(dljj, 9)  # if you have astsa loaded (not shown) 
| 
| The following code shows the correction to the use of lag.plot so
| that it matches lag1.plot:
| 
|    # From tutorial
|    lag.plot(dljj, 9, do.lines=FALSE)
| 
|    # Correction
|    deve.new()
|    lag.plot(dljj, set.lags=-1:-9, do.lines=FALSE)
| 
|    # astsa's implementation matches above Correctoion
|    dev.new()
|    lag1.plot(dljj, 9)

By the way, the tsa3 issues page that you reference above...it's
indicates the problems with existing time series functions as the
reason for developing corrected functsion in astsa/tsa3.  But the
actual documentation for these corrected functions are extremely
sparse.  Is there another source of documentation that actually
explains the corrections done?
#
<snip>
I would suggest contacting the author. astsa is an R package on CRAN, but I don?t think the manual discusses the differences.

-Roy


**********************
"The contents of this message do not reflect any position of the U.S. Government or NOAA."
**********************
Roy Mendelssohn
Supervisory Operations Research Analyst
NOAA/NMFS
Environmental Research Division
Southwest Fisheries Science Center
***Note new address and phone***
110 Shaffer Road
Santa Cruz, CA 95060
Phone: (831)-420-3666
Fax: (831) 420-3980
e-mail: Roy.Mendelssohn at noaa.gov www: http://www.pfeg.noaa.gov/

"Old age and treachery will overcome youth and skill."
"From those who have been given much, much will be expected" 
"the arc of the moral universe is long, but it bends toward justice" -MLK Jr.
#
Roy Mendelssohn - NOAA Federal <roy.mendelssohn <at> noaa.gov> writes:
|> By the way, the tsa3 issues page that you reference above...it's
|> indicates the problems with existing time series functions as the
|> reason for developing corrected functsion in astsa/tsa3.  But the
|> actual documentation for these corrected functions are extremely
|> sparse.  Is there another source of documentation that actually
|> explains the corrections done?
|
| I would suggest contacting the author. astsa is an R package on
| CRAN, but I don?t think the manual discusses the differences.

Will do.  Thanks.