Andrea.Capodicasa@albacom.it
2003-Aug-27 10:34 UTC
[Rd] Problem in StructTS() when the first element of the serie is NA ( (PR#3990)
Hi all,
I've experienced this problem using StructTS(x) when the *first* element of
x is a NA (R:R1.7.0, os: w2ksp4).
Please look at the following code:
a=rep(1:7,10)
library(ts)
#this works
StructTS(a)
#this works
x=a
x[2]=NA
StructTS(x)
#this doesn't work
x=a
x[1]=NA
StructTS(x)
The last command returns this error
"Error in optim(init[mask], getLike, method = "L-BFGS-B", lower =
rep(0, :
L-BFGS-B needs finite values of fn"
These are my R.version() and Sys.info() relevant infos.> R.Version()
$platform
[1] "i386-pc-mingw32"
$arch
[1] "i386"
$os
[1] "mingw32"
$system
[1] "i386, mingw32"
$status
[1] ""
$major
[1] "1"
$minor
[1] "7.0"
$year
[1] "2003"
$month
[1] "04"
$day
[1] "16"
$language
[1] "R"
> Sys.info()
sysname release
version
"Windows" "NT 5.0"
"(build 2195)
Service Pack 4"
machine
"x86"
Prof Brian D Ripley
2003-Aug-27 10:45 UTC
(PR#3990) Re: [Rd] Problem in StructTS() when the first element of the serie is NA ( (PR#3990)
What is the point of supplying a time series with the first value missing? You might as well omit the first point. I'll add a `you cannot be serious, man!' error message. On Wed, 27 Aug 2003 Andrea.Capodicasa@albacom.it wrote:> Hi all, > I've experienced this problem using StructTS(x) when the *first* element of > x is a NA (R:R1.7.0, os: w2ksp4). > > Please look at the following code: > > a=rep(1:7,10) > library(ts) > > #this works > StructTS(a) > > #this works > x=a > x[2]=NA > StructTS(x) > > #this doesn't work > x=a > x[1]=NA > StructTS(x) > > The last command returns this error > "Error in optim(init[mask], getLike, method = "L-BFGS-B", lower = rep(0, : > L-BFGS-B needs finite values of fn" > > These are my R.version() and Sys.info() relevant infos. > > R.Version() > $platform > [1] "i386-pc-mingw32" > > $arch > [1] "i386" > > $os > [1] "mingw32" > > $system > [1] "i386, mingw32" > > $status > [1] "" > > $major > [1] "1" > > $minor > [1] "7.0" > > $year > [1] "2003" > > $month > [1] "04" > > $day > [1] "16" > > $language > [1] "R" > > > Sys.info() > sysname release > version > "Windows" "NT 5.0" "(build 2195) > Service Pack 4" > machine > "x86" > > ______________________________________________ > R-devel@stat.math.ethz.ch mailing list > https://www.stat.math.ethz.ch/mailman/listinfo/r-devel > >-- Brian D. Ripley, ripley@stats.ox.ac.uk Professor of Applied Statistics, http://www.stats.ox.ac.uk/~ripley/ University of Oxford, Tel: +44 1865 272861 (self) 1 South Parks Road, +44 1865 272866 (PA) Oxford OX1 3TG, UK Fax: +44 1865 272595