bfa.ls {bifurcatingr}  R Documentation 
This function performs Least Squares estimation of bifurcating autoregressive (BFA) models of any order as described in Zhou & Basawa (2005).
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, p.value = FALSE )
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 variancecovariance 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, normal
confidence intervals are calculated using 
conf.level 
confidence level to be used in computing the normal
confidence intervals for model coefficients when 
p.value 
a logical that determines whether pvalues for model
coefficients should be returned. Defaults to FALSE. If TRUE, pvalues are
computed from normal distribution using estimated coefficients and

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 
x 
a matrix containing the x
data used in fitting the model. Only returned if 
y 
a vector containing the y data used in fitting the model. Only
returned if 
resids 
the model residuals. Only
returned if 
error.var 
the estimated variance of
the model errors. Only returned if 
cov.matrix 
the estimated variancecovariance matrix of the least
squares coefficients. Only returned if 
conf 
a
matrix of normal confidence intervals for model coefficients. Only returned
if 
p.value 
a matrix of twosided pvalues for
testing the significance of model coefficients. Computed from normal
distribution and using the estimated covariance matrix 
Zhou, J. & Basawa, I. V. (2005). Least squares estimation for bifurcating autoregressive processes. Statistics & Probability Letters, 74(1):7788.
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)