From dethlef at math.aau.dk  Tue Nov  9 08:39:22 2004
From: dethlef at math.aau.dk (dethlef@math.aau.dk)
Date: Tue Nov  9 08:39:30 2004
Subject: [Rd] StructTS (PR#7353)
Message-ID: <20041109073922.F28E4EAC0@slim.kubism.ku.dk>

Dear R-bugs

I have been studying the StructTS function (in package 'stats') and
functions supplied with it. I think I have found a few minor bugs in the
documentation.

I am referring to the version of StructTS supplied with the release R 2.0.0.
Output from 'version'

platform i386-pc-mingw32
arch     i386           
os       mingw32        
system   i386, mingw32  
status                  
major    2              
minor    0.0            
year     2004           
month    10             
day      04             
language R              

1) In the help page under "fixed" it is explained (file:
R-2.0.0/src/library/stats/man/StructTS.Rd): 
  "If supplied, only non-\code{NA} entries in \code{fixed} will be varied."
  Either I misunderstand this or there may be a bug in the documentation. As
I understand it, setting fixed to the value, eg. c(NA,0,NA,NA) sets the
variance of the slope component to 0 and varies the other variances to find
the maximum likelihood estimates. If I am right, I suggest the docs changed
to:
  "If supplied, only \code{NA} entries in \code{fixed} will be varied."
  ("non-" has been deleted).

E.g. try the following after invoking R:

R> StructTS(log10(UKgas), type = "BSM", fixed=c(0,NA,NA,NA))

Observe, that the first variance is fixed to zero, while the remaining three
are varied to obtain the maximum likelihood estimates.

2) There is a minor typo in the explanation of 'fitted' - a parenthesis is
missing. I suggest changing
"(that is at time \eqn{t} and not at the end of the series."
to
"(that is at time \eqn{t} and not at the end of the series)."

3) In the documentation, one of the values returned in the list is called
"convergence", while in the code, it is called "code". I suggest either to
change the documentation from
"\item{convergence}{the value returned by \code{\link{optim}}.}"
to
"\item{code}{the value returned by \code{\link{optim}}.}"

or to change the code.


Thank you for supplying a great set of functions.

Best regards,
Claus
---------------------------------------------------------------------------
Assistant Prof. Claus Dethlefsen, PhD
Department of Mathematical Sciences, Aalborg University 
Fredrik Bajers Vej 7G, DK-9220 Aalborg, Denmark
dethlef@math.aau.dk; www.math.aau.dk/~dethlef
Ph: +45 9635 8878; Fax: +45 9815 8129



---


[Rd] StructTS (PR#7353)
dethlef@math.aau.dk