predPoly: Quadratic Predictor

View source: R/predPoly.R

predPolyR Documentation

Quadratic Predictor

Description

A quadratic polynomial fitted to the last n observations. We then extrapolate to estimate f(t + s) with s >= 1.

Usage

predPoly(x, n, s)

Arguments

x

a vector of data X_t.

n

the n to define the window size.

s

the extrapolation parametr s.

Value

a vector with values from the quadratic predictor.

Author(s)

Shelemyahu Zacks

Examples

data(DOW1941)
plot(DOW1941$Date, DOW1941$DOW1941,          
     type="l", 
     ylab="Dow Jones 1941", xlab="Date")
     
lines(DOW1941$Date, predPoly(DOW1941$DOW1941, n = 20, s= 1))


mistat documentation built on March 7, 2023, 6:43 p.m.