[Rd] Error in arima reporting (PR#8231)

2005-10-20 Thread stoffer
When arima is used to fit a time series, the output gives an 
estimate of the mean of the series, but calls it the intercept.

For example, if x(t) = a + b x(t-1) + w(t) is a stationary AR(1)
and w(t) is white noise, then mu = a + b mu, or a = mu (1-b),
where mu = E(x(t)).  Unless b=0, the mean mu and the intercept a 
are not the same.  Here's a quick R example:

 > x = arima.sim(list(order=c(1,0,0), ar=.9), n=100) + 10
 > arima(x, order = c(1, 0, 0))

Coefficients:
  ar1  intercept
   0.8704 9.8067
s.e.  0.0496 0.6729

So x is an AR(1) with mean 10.  The "intercept" estimate
in this example should be 9.8067*(1-.8704).  Either change the 
output to read "mean" instead of "intercept", or report the 
intercept instead of the mean.

Thanks-
David

-- 


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
David S. Stoffer
Department of Statistics
University of Pittsburgh
Pittsburgh, PA  15260

phone: [412] 624-8496
   fax: [412] 648-8814
email: [EMAIL PROTECTED]
   web: http://www.stat.pitt.edu/stoffer
voice: hey dave

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] Problems with arima function (PR#8743)

2006-04-02 Thread stoffer
I have written before, but to no avail.  I have found two minor 
problems with fitting time series models with R.  The thing is, they 
may be solved with MINOR adjustments to the code.

I have posted these problems with detailed examples here:
http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm

Briefly, the problems are
(1) When fitting time series models when there is an AR term present, 
the output says it's giving you the estimate of the intercept, when, 
in fact, it's giving you the estimate of the mean.  These are NOT the 
same when an AR term is present.  This occurs in everything I've seen, 
from ar.ols(), ar.mle(), ... and in arima().

(2) When fitting ARIMA models when there differencing, the constant 
term (intercept) is assumed to be zero.  This ignores the possibility 
that there is drift.  In this case, the estimation is WRONG.

Details and examples are at the url mentioned above.  To remedy (1), 
simply change "intercept" to "mean"  or actually list the intercept 
instead of the mean.  To remedy (2), allow for the option to include 
an intercept.  I tried using xreg in the arima command, but could not 
come up with a proper solution to this problem.

Thank you for your time.
D. Stoffer


-- 


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
David S. Stoffer
Department of Statistics
University of Pittsburgh
Pittsburgh, PA  15260

phone: [412] 624-8496
   fax: [412] 648-8814
email: [EMAIL PROTECTED]
   web: http://www.stat.pitt.edu/stoffer
voice: hey dave

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


[Rd] header containing (PR#8231) -- replace 8231

2006-04-03 Thread stoffer
Sorry for reporting this again, but I didn't notice that there was a 
response.  The response to PR#8231 is "This is a matter of opinion!"

First, I find this response arrogant and dismissive and I would ask 
for a second opinion. Second, the use of the term "intercept" - 
whether or not you think is "a matter of opinion" - is MISLEADING. Why 
do you want to MISLEAD users?

I believe "intercept-slope form of a line" is well established in 
mathematics.  That is, if y=a+bx then most of us would call a the 
intercept and b the slope.  Is the responder saying this is opinion? 
This is standard terminology.

For a causal AR(1) model we write
X(t) = a + b X(t-1) + W(t)
where W(t) is white noise.  The value a is the intercept and the value 
b is the slope... is the responder saying this is opinion?  How so? 
It's the slope-intercept form of the model.

If mu =E[X(t)] then mu = a + b*mu or
a = mu*(1-b)
is the relationship between the MEAN and the INTERCEPT.  They are not 
the same unless b=0.  This is NOT opinion. This is a fact.

So if I tell you the estimate of the intercept is 10, what does that 
say to you?  In the arima output (and other functions), it's saying 
the estimate of mu is 10.  Really?  You don't think that's misleading?

Again, I put this to you: Why do you want to MISLEAD the user. Get 
some other opinions on this if you don't agree with me.

Thanks again for your time and sorry for the double report.
David

-- 


-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
David S. Stoffer
Department of Statistics
University of Pittsburgh
Pittsburgh, PA  15260

phone: [412] 624-8496
   fax: [412] 648-8814
email: [EMAIL PROTECTED]
   web: http://www.stat.pitt.edu/stoffer
voice: hey dave

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] arima

2009-05-11 Thread David Stoffer

Pierre-  I wonder how many people have to submit this concern before someone
takes care of the problem.  I may have been the first to point this out
because I got a reply from an R core member that was rude, to say the least.
Now there are no responses to this query. I set up a page to keep track of R
problems with time series ... spread the word:
http://www.stat.pitt.edu/stoffer/tsa2/Rissues.htm .  You will also find some
fixes there, and you will  see that I point out some inconsistencies [e.g.,
if you use ar(), the term intercept is used differently than in arima()]. 
Unfortunately, that won't help with the fGarch problem - you should write
the maintainers: Rmetrics-core at r-project.org.






Pierre Chaussé wrote:
> 
> Hi,
> 
> I have a suggestion for the fonction arima and arima0. I think you 
> should not call the constant an intercept because it creates confusion.  
> It is not really an intercept but a mean. For an AR(1) the intercept mu 
> should be defined as:
> 
> X(t)=mu + phi X(t-1) + e(t)
> 
> What you call intercept mu is rather defined as
> 
> (X(t)-mu) = phi (X(t-1)-mu)) + e(t)
> 
> which is not a common way to define an intercept. There is an error in 
> the fGarch's predict() because of that. I think you should just be more 
> explicit.
> 
> thank you
> 
> Pierre Chaussé
> economics department
> UQÀM
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 


-
The power of accurate observation is commonly called cynicism 
by those who have not got it.  George Bernard Shaw
-- 
View this message in context: 
http://www.nabble.com/arima-tp23179485p23464456.html
Sent from the R devel mailing list archive at Nabble.com.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel


Re: [Rd] StructTS

2008-04-12 Thread David Stoffer

Hey Roy ... it's been awhile.  We have an example of structural
equation modeling in our text in section 6.5. There's also an example
and the R code for the example is here:
http://www.stat.pitt.edu/stoffer/tsa2/chap6.htm
Scroll down to "Code to do Example 6.10 via BFGS"

The scripts are written from scratch so it's easy to see what's
go on (I hope) and you can alter the code to suit your needs.
Feel free to email me if you want to discuss the problem.



Roy Mendelssohn wrote:
> 
> I apologize in advance if I picked the wrong list to post this to.  I  
> have made an effort to find the answers to these questions on CRAN,  
> but if they are there, I couldn't find them, and I was going to email  
> the developer of StructTS directly but could not find who that is.
> 
> I have 2 interrelated questions about StructTS
> 
> 1.  Where can I obtain the source code for StructTS if I wanted to  
> produce a similar function with an extended capability?
> 
> 2.  Would the person who developed StructTS have any interest in  
> adding the ability to include an AR term and/or a stochastic cycle?
> 
> Thanks in advance,
> 
> -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
> 1352 Lighthouse Avenue
> Pacific Grove, CA 93950-2097
> 
> e-mail: [EMAIL PROTECTED] (Note new e-mail address)
> voice: (831)-648-9029
> fax: (831)-648-8440
> www: http://www.pfeg.noaa.gov/
> 
> "Old age and treachery will overcome youth and skill."
> 
> __
> R-devel@r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-devel
> 
> 


-
The power of accurate observation is commonly called cynicism 
by those who have not got it.  George Bernard Shaw
-- 
View this message in context: 
http://www.nabble.com/StructTS-tp9857181p16642090.html
Sent from the R devel mailing list archive at Nabble.com.

__
R-devel@r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-devel