Closed ymatsumotomatsu closed 4 years ago
Sorry, I would need reproducible example to understand what is wrong with your results. You might want to test different initial values to fitSSM
to see if the results depend on those.
Different initial values help. Test for example fitSSM(modSUTSE, rep(-2,6), method="BFGS")
and you get better optimum and the results look more reasonable.
I guess this is solved?
Hello. I've been working on estimating coordinates with kalman filter.
I can't calculate estimated values of one of multivariate time-series. Time-series have no missing value and its sizes are same.
Code: library(KFAS)
cam1 <- read.table("cam1.dat", header = T) cam2 <- read.table("cam2.dat", header = T)
x1 <- ts(cam1$x) x2 <- ts(cam2$x)
modSUTSE <- SSModel(cbind(x1,x2) ~ SSMtrend(1, Q = matrix(NA,2,2), type = "distinct"), H = matrix(NA,2,2)) fitSUTSE <- fitSSM(modSUTSE, numeric(6), method="BFGS") kfsSUTSE <- KFS(fitSUTSE$model)
afilt <- kfsSUTSE$alphahat[1:554,]
plot(x1,lty=3,xlab="フレーム",ylab="距離") lines(afilt[,1],lwd=2)
plot(x2,lty=3,xlab="フレーム",ylab="距離") lines(afilt[,2],lwd=2)
Result:
And, I can't calculate if I replace x1 with x2 as well.
How should I do this?