#First Example: Fit exact MLE to AR(4)
set.seed(3323)
phi<-c(2.7607,-3.8106,2.6535,-0.9238)
z<-SimulateGaussianAR(phi,1000)
ans<-FitARz(z,4,MeanMLEQ=TRUE)
ans
coef(ans)
## Not run: #save time building package
# #Second Example: compare with sample mean result
# ans<-FitARz(z,4)
# coef(ans)
#
# #Third Example: Fit subset ARz
# z<-log(lynx)
# FitARz(z, c(1,2,4,7,10,11))
# #now obain exact MLE for Mean as well
# FitARz(z, c(1,2,4,7,10,11), MeanMLE=TRUE)
#
# #Fourth Example: Fit subset ARz
# somePACF<-c(0.5,0,0,0,-0.9)
# someAR<-PacfToAR(somePACF)
# z<-SimulateGaussianAR(someAR,1000)
# ans=FitARz(z, c(1,5),MeanMLEQ=TRUE)
# coef(ans)
# GetFitARz(z,c(1,5))#assuming a known zero mean
# ## End(Not run)
Run the code above in your browser using DataLab