[R] Unable to compute Confidence Intervals from output from MARSS package
Bill Poling
B|||@Po||ng @end|ng |rom ze||@@com
Wed Jan 23 20:19:08 CET 2019
Ashim.
I see where I was mistaken, using MARSSparamsCIs(fit) <--Somehow I got an s in between param & Cis.
I now get new error similarly as you, my apologies.
final <- MARSSparamCIs(fit)
Error in dpari[time.varying] <- dparmat(MLEobj, time.varying, t = t) : replacement has length zero
WHP
From: R-help <r-help-bounces using r-project.org> On Behalf Of Ashim Kapoor
Sent: Wednesday, January 23, 2019 1:38 AM
To: r-help using r-project.org
Subject: [R] Unable to compute Confidence Intervals from output from MARSS package
Dear All,
I am trying to use this package --->
https://cran.r-project.org/web/packages/MARSS/index.html
I am reading this book which shows some examples based on the above package
---> https://nwfsc-timeseries.github.io/atsa-labs/
In a few words, the incantation MARSS(...) estimates the parameters and
MARSSparamCIs should return the confidence intervals. My problem is that
MARSSparamCIs returns this error :-
> MARSSparamCIs(fit)
Error in MARSSharveyobsFI(MLEobj) : replacement has length zero
>
### This page and the next page, explains the jargon used :
https://nwfsc-timeseries.github.io/atsa-labs/sec-dlm-example-of-a-univariate-dlm.html
### Here is a MWE to recreate the error :-
# This is a Time Varying Parameters regression
# Here a is fixed and b is doing a RW.
x1 <- rnorm(1000)
b <- cumsum(rnorm(1000, sd = sqrt(.6)))
y <- 1 + b*x1 + rnorm(1000)
Z = array(NA,c(1,2,1000))
Z[1,1,] = rep(1,1000)
Z[1,2,] = x1
mod2.list = list ( B = matrix(c(1,0,0,1),nrow = 2 , byrow = T), U =
matrix(0,2,1),
Q = matrix(list(0,0,0,"s2b"),2,2), Z= Z, A = matrix(0), R = matrix("r"))
fit = MARSS(as.vector(y), model = mod2.list,inits =
list(x0=matrix(0,nrow=2,ncol=1)))
MARSSparamsCIs(fit)
# The above will give this error :
Error in MARSSharveyobsFI(MLEobj) : replacement has length zero
Best Regards,
Ashim
[[alternative HTML version deleted]]
______________________________________________
mailto:R-help using r-project.org mailing list -- To UNSUBSCRIBE and more, see
https://stat.ethz.ch/mailman/listinfo/r-help
PLEASE do read the posting guide http://www.R-project.org/posting-guide.html
and provide commented, minimal, self-contained, reproducible code.
Confidentiality Notice This message is sent from Zelis. ...{{dropped:13}}
More information about the R-help
mailing list