Learn R Programming

locits (version 1.7.7)

idlastzero: Return the index of the last zero in a vector

Description

Return the index of the last zero in a vector, otherwise stop and return errror message. A helper routine for mkcoef.

Usage

idlastzero(v)

Value

The index within v of the last (right-most or one with the largest index) zero.

Arguments

v

Vector you wish to investigate

Author

Guy Nason.

References

Nason, G.P. (2013) A test for second-order stationarity and approximate confidence intervals for localized autocovariances for locally stationary time series. J. R. Statist. Soc. B, 75, 879-904. tools:::Rd_expr_doi("10.1111/rssb.12015")

See Also

mkcoef

Examples

Run this code
idlastzero(c(3,4,5,0,9))
#[1] 4

Run the code above in your browser using DataLab