Welcome | State space notation | Functions | > kal.fil.bin.id |
Last update Apr 29, 2003 |
DESCRIPTION:Extended Kalman filter for binomial data assuming identity link and linear Gaussian latent process. The specific model is
USAGE:kal.fil.bin.id(ssm)
REQUIRED ARGUMENTS:
OPTIONAL ARGUMENTS:The following attributes of the ssm object might be needed:
VALUE:Returns an object of class ssm with the same attributes as the object in the call, but with attribute filtered updated with:
SIDE EFFECTS:None
DETAILS:The filter works by sequentially approximating the binomial observation density with a Gaussian density based on a Taylor expansion around the values supplied in the attribute m.start of the ssm object. If m.start is not supplied, the Taylor expansion will be around the one-step forecast mean of the observation.
REFERENCES:Durbin & Koopman, (2002), Time Series Analysis by State Space Models, Oxford Statistical Science Series.Fahrmeir & Tutz, (1994), Multivariate Statistical Modelling Based on Generalized Linear Models, Springer Series in Statistics. Klein, (2003), State Space Models for Exponential Family Data, Ph.D. Thesis, Department of Statistics, University of Southern Denmark. EXAMPLES:# Specify a state space model ss <- ssm(Ft = function(i,x,phi) {c(1,1)}, Gt = function(i,x,phi) {matrix(c(1,0,0,0),ncol=2,byrow=T)}, Wt = function(i,x,phi) {diag(2)/50}, m0 = c(5,0), C0 = diag(10,2), nt = rep(10,50), fam = "binomial", link = "identity") # Simulate observations ss <- simulate.ssm(ss, n=50) # Apply the extended Kalman filter ss <- kal.fil.bin.id(ss) # Plot the simulated and filtered signal plot(apply(ss$filtered$mt,1,sum), ylim=c(0,11.5), type="l") lines(ss$simulated$lambda, lty=2) points(ss$Yt, pch=16) legend(0,11.5,legend=c("Filtered signal", "Simulated signal","Yt"), lty=c(1,2,-1), marks=c(-1,-1,16)) title("Results from kal.fil.bin.id") |