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
---
>>>>> "Claus" == Claus Dethlefsen <dethlef@math.aau.dk> >>>>> on Tue, 9 Nov 2004 08:39:22 +0100 (CET) writes:Claus> Dear R-bugs (whom did you mean? :-) Claus> I have been studying the StructTS function (in Claus> package 'stats') and functions supplied with it. I Claus> think I have found a few minor bugs in the Claus> documentation. Claus> I am referring to the version of StructTS supplied with the release R 2.0.0. .... Claus> 1) In the help page under "fixed" it is explained (file: Claus> R-2.0.0/src/library/stats/man/StructTS.Rd): Claus> "If supplied, only non-\code{NA} entries in Claus> \code{fixed} will be varied." Claus> Either I misunderstand this or there may be a bug in Claus> the documentation. As I understand it, setting fixed Claus> to the value, eg. c(NA,0,NA,NA) sets the variance of Claus> the slope component to 0 and varies the other Claus> variances to find the maximum likelihood Claus> estimates. If I am right, I suggest the docs changed Claus> to: "If supplied, only \code{NA} entries in Claus> \code{fixed} will be varied." ("non-" has been Claus> deleted). yes. thank you. You are entirely correct. Claus> E.g. try the following after invoking R: R> StructTS(log10(UKgas), type = "BSM", fixed=c(0,NA,NA,NA)) Claus> Observe, that the first variance is fixed to zero, Claus> while the remaining three are varied to obtain the Claus> maximum likelihood estimates. Claus> 2) There is a minor typo in the explanation of 'fitted' - a parenthesis is Claus> missing. I suggest changing Claus> "(that is at time \eqn{t} and not at the end of the series." Claus> to Claus> "(that is at time \eqn{t} and not at the end of the series)." indeed, thank you. Claus> 3) In the documentation, one of the values returned in the list is called Claus> "convergence", while in the code, it is called "code". I suggest either to Claus> change the documentation from Claus> "\item{convergence}{the value returned by \code{\link{optim}}.}" Claus> to Claus> "\item{code}{the value returned by \code{\link{optim}}.}" Claus> or to change the code. Changing the code has the potential to break other code relying on StrucTS() {and we are in deep-freeze for R 2.0.1} --> I'm changing the documentation. Claus> Thank you for supplying a great set of functions. and thank you for the bug report! Martin Maechler, ETH Zurich