bfa_ls {bifurcatingr}R Documentation

Least Squares Estimation of Bifurcating Autoregressive Models

Description

This function performs Least Squares estimation of bifurcating autoregressive (BFA) models of any order as described in Zhou and Basawa (2005).

Usage

bfa_ls(
  z,
  p,
  x_data = FALSE,
  y_data = FALSE,
  resids = FALSE,
  error_cor = TRUE,
  error_var = FALSE,
  cov_matrix = FALSE,
  conf = FALSE,
  conf_level = 0.95,
  B = 49,
  p_value = FALSE
)

Arguments

z

a numeric vector containing the tree data

p

an integer determining the order of bifurcating autoregressive model to be fit to the data

x_data

a logical that determines whether the x data used in fitting the model should be returned. Defaults to FALSE.

y_data

a logical that determines whether the y data used in fitting the model should be returned. Defaults to FALSE.

resids

a logical that determines whether the model residuals should be returned. Defaults to FALSE.

error_cor

a logical that determines whether the estimated correlation between pairs of model errors (e_{2t}, e_{2t+1}) should be returned. Defaults to TRUE.

error_var

a logical that determines whether the estimated variance of the model errors should be returned. Defaults to FALSE.

cov_matrix

a logical that determines whether the estimated variance-covariance matrix of the least squares estimates should be returned. Defaults to FALSE.

conf

a logical that determines whether confidence intervals for model coefficients should be returned. Defaults to FALSE. If TRUE, asymptotic normal confidence intervals for the intercept and the slops are calculated using cov_matrix. In addition, normal bootstrap confidence interval, and percentile confidence interval for the slop are calculated.

conf_level

confidence level to be used in computing the normal confidence intervals for model coefficients when conf=TRUE. Defaults to 0.95.

B

number of bootstrap samples (replicates)

p_value

a logical that determines whether p-values for model coefficients should be returned. Defaults to FALSE. If TRUE, p-values are computed from normal distribution using estimated coefficients and cov_matrix.

Value

coef

a matrix containing the least squares estimates of the autoregressive coefficients

error_cor

the least squares estimate of the correlation between pairs of model errors (e_{2t}, e_{2t+1}). Only returned if error_cor=TRUE

x

a matrix containing the x data used in fitting the model. Only returned if x_data=TRUE

y

a vector containing the y data used in fitting the model. Only returned if y_data=TRUE

resids

the model residuals. Only returned if resids=TRUE

error_var

the estimated variance of the model errors. Only returned if error_var=TRUE

cov_matrix

the estimated variance-covariance matrix of the least squares coefficients. Only returned if cov_matrix=TRUE

conf

a matrix of normal confidence intervals for model coefficients. Only returned if conf=TRUE

p_value

a matrix of two-sided p-values for testing the significance of model coefficients. Computed from normal distribution and using the estimated covariance matrix cov_matrix. Only returned if p_value=TRUE

References

Zhou, J. & Basawa, I. V. (2005). Least squares estimation for bifurcating autoregressive processes. Statistics & Probability Letters, 74(1):77-88.

Examples

z <- bfa_tree_gen(127, 1, 1, 1, -0.9, -0.9, 0, 10, c(0.7))
bfa_ls(z, p=1)
bfa_ls(z,p=1,conf=TRUE,cov_matrix = TRUE,conf_level = 0.9,p_value=TRUE)

[Package bifurcatingr version 2.1.0 Index]