A vector of observations, possibly with missing values.
type
Character, type of index to calculate.
Author
Peter Solymos and Khurram Nadeem
Details
ts_index calculates positional indices of elements of a vector
that fulfill the following conditions when type = "density":
(1) if there is only one observation present before the first NA,
it is not selected, else, all the observations preceding to the
first NA are selected;
(2) if there is only one observation present after the last NA,
it is not selected, else, all the observations following the
last NA are selected;
(3) if there is only one observation present between two
consecutive NAs, it is not selected, else, all the
observations falling between two consecutive NAs are selected.
ts_index calculates positional indices of elements of a vector
that immediately follow a missing (NA) value if
type = "expectation". The reason for this
is that these elements depend on missing data given a first order
Markov process. As a result, these need different treatment in
calculating log densities for model selection.