stick.ar.0 {bentcableAR}R Documentation

Broken-Stick Regression for Independent Data

Description

This function is the main engine for bentcable.ar when a broken stick (i.e. \gamma=0 for bent cable) model is assumed for independent data. For AR(p) time-series data, this function is intended for determining an appropriate p and initial values for the stick parameters.

Usage

stick.ar.0(init.vect, y.vect, t.vect = NULL, n = NA)

Arguments

init.vect

A numeric vector of initial values, in the form of c(b0,b1,b2,tau).

y.vect

A numeric vector of response data.

t.vect

A numeric vector of design points, which need not be equidistant. Specifying t.vect=NULL is equivalent to specifying the default time points c(0,1,2,...).

n

Length of response vector (optional).

Details

The returned object is compatible with a cable.ar.p.iter object for independent data.

The broken stick as a special case of the bent cable has form f(t) = b_0 + b_1 t + b_2 (t-\tau) I\{t>\tau\} .

Broken-stick regression by maximum likelihood for independent data is performed via nonlinear least-squares estimation of \theta=(b_0,b_1,b_2,\tau) through the built-in R function nls. The estimation relies on the user-supplied initial values in init.

Value

fit

An nls object that is the maximum likelihood fit.

y, t, n

As supplied by the user.

p, stick

The values 0 and TRUE, respectively; used internally by bentcable.ar and cable.ar.0.fit.

Note

This function is intended for internal use by bentcable.ar.

Author(s)

Grace Chiu

References

See the bentcableAR package references.

See Also

cable.ar.p.iter, fullcable.t, cable.fit.known.change.

Examples

data(sockeye)

stick.ar.0( c(13,.1,-.7,12), sockeye$logReturns )

[Package bentcableAR version 0.3.1 Index]