Fill NA or specified positions.
Generic function for filling
NA values using seasonal Kalman filter.
na.StructTS(object, ...) ## S3 method for class 'ts': na.StructTS(object, ..., na.rm = FALSE, maxgap = Inf) ## S3 method for class 'zoo': na.StructTS(object, ..., na.rm = FALSE, maxgap = Inf)
- an object.
- other arguments passed to methods.
- logical. Whether to remove end portions or fill them with NA.
- Runs of more than
NAs are retained, other
NAs are removed and the last occurrence in the resulting series prior to each time point in
xoutis used as that time point's output value.
Interpolate with seasonal Kalman filter. The input object should have a frequency. It is assumed the cycle length is 1.
z <- zooreg(rep(10 * seq(4), each = 4) + rep(c(3, 1, 2, 4), times = 4), start = as.yearqtr(2000), freq = 4) z <- NA zout <- na.StructTS(z) plot(cbind(z, zout), screen = 1, col = 1:2, type = c("l", "p"), pch = 20)
Looks like there are no examples yet.