R/rw.drift.R

Defines functions rw.drift

rw.drift <- function(x)
{
    x.diff <- diff(x)
    model <- summary(lm(x.diff ~ 1))
    drift <- model$coefficients[1, 1]
    fits <- ts(x - c(NA, model$residuals))
    tsp(fits) <- tsp(x)
    return(list(drift = drift, sec = model$coefficients[1, 2],
        see = model$sigma, fits = fits))
}

Try the ftsa package in your browser

Any scripts or data that you put into this service are public.

ftsa documentation built on May 29, 2024, 2:47 a.m.