cable.change.conf: Confidence Interval for CTP of AR(p) Bent Cable

View source: R/code.r

cable.change.confR Documentation

Confidence Interval for CTP of AR(p) Bent Cable

Description

The critical time point (CTP) is estimated and accompanied by a Wald confidence interval.

Usage

cable.change.conf(ar.p.fit, level)

Arguments

ar.p.fit

A cable.ar.p.iter object for AR(p0) data.

level

A numeric value between 0 and 1, exclusive.

Details

The CTP is the unique time point at which the cable's slope changes sign. If this exists, then it must happen inside the transition τ\pmγ, and is estimated by this function based on the bent-cable regression supplied as ar.p.fit. Additionally, an approximate confidence interval using the Wald method is obtained by estimating the asymptotic variance of the CTP estimator. Variance estimation involves inverting an approximate Fisher information matrix by calling the built-in R function solve.

cable.change.conf returns an error if the CTP (almost) does not exist, e.g. when the estimated bent cable slope (almost) does not change signs, or when the fit from ar.p.fit is obtained with a time vector that is not c(0,1,2,...). See Warnings below.

Value

change.hat

The estimated CTP.

var

The estimated asymptotic variance of the CTP estimator.

interval

The 100*level percent Wald confidence interval for the CTP.

Warnings

Computations for the CTP estimate and confidence interval are based on a time vector of the form c(0,1,2,...). For any other form for the time vector, the CTP will not be computed, and on-screen warnings will appear. To ensure compatibility between the model fit and CTP estimates, the user is advised to fit the model using the default time vector. Then, if necessary, the user may transform the results to the preferred time scale after the model and CTP estimates have been produced.

The above computational issue implies that the function cannot handle non-time-series data. Rationale: In a non-time-series context design points are often non-equidistant, and the cable's slope often never changes sign; even with a sign change, the point at which this takes place may be less interpretable. In such a context, the user is advised to rely on confidence regions for (τ,γ) (see References).

Note

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

Author(s)

Grace Chiu

References

See the bentcableAR package references.

See Also

solve, cable.ar.p.plot

Examples

data(sockeye)

# AR(2) cable fit
fit.ar2 <- cable.ar.p.iter( c(13,.1,-.5,11,4,.5,-.5),
	sockeye$logReturns, tol=1e-4 )
cable.change.conf( fit.ar2, .9 )

	# compare to this:
	# fit.ar2 <- bentcable.ar( sockeye$logReturns, 
	#	init.cable=c(13,.1,-.5,11,4), p=2, ci.level=.9 )
	# cable.change.conf( fit.ar2$cable, .9 )

# AR(2) stick fit
stick.ar2 <- cable.ar.p.iter( c(13,.1,-.5,11,.5,-.5),
	sockeye$logReturns, tol=1e-4, stick=TRUE)
cable.change.conf( stick.ar2, .9)
	# compare to this:
	# stick.ar2 <- bentcable.ar( sockeye$logReturns,
	#	init.cable=c(13,.1,-.5,11), p=2, stick=TRUE, ci.level=.9 )
	#	cable.change.conf( stick.ar2$cable, .9 )

# AR(4) stick fit
fit.ar4 <- cable.ar.p.iter( c(13,.1,-.5,11,.5,-.5,.5,-.5),
	sockeye$logReturns, tol=1e-4, stick=TRUE )
cable.change.conf( fit.ar4, .9 )

	# compare to this:
	# fit.ar4 <- bentcable.ar( sockeye$logReturns,
	#	init.cable=c(13,.1,-.5,11), p=4, stick=TRUE, ci.level=.9 )
	# cable.change.conf( fit.ar4$cable, .9 )

bentcableAR documentation built on June 28, 2022, 5:05 p.m.