# ar1est: MLE or LSE for AR(1) parameter. Sample mean correction used... In mleur: Maximum likelihood unit root test

## Description

Fast exact computation of the MLE for AR(1) by solving the likelihood equation. The sample mean correction is used, so the method is not strickly speaking exact but the name derives from the fact that if the mean is known and was used instead of the sample mean the estimate would be an exact MLE estimate of the parameter in the AR(1) model. It has been shown that effect of estimating the sample mean is negligible.

## Usage

 `1` ```ar1est(z, method = c("MLE", "LSE")) ```

## Arguments

 `z` time series or vector `method` must be "MLE" or "LSE"

## Details

The exact MLE for mean-zero an AR(1) time series satisfies a cubic equation. The solution of this equation for the MLE given by Zhang (2002) is used. This approach is more reliable as well as faster than the usual approach to the exact MLE using a numerical optimization technique which can occasionally have convergence problems.

## Value

MLE for the parameter

## Author(s)

A.I. McLeod and Ying Zhang

## References

Zhang, Y. (2002). Topics in Autoregression, Ph.D. Thesis, University of Western Ontario.

## Examples

 ```1 2 3 4 5 6 7 8 9``` ```#Example 1 #compare MLE and LSE for vel series ar1est(vel) ar1est(vel, method="MLE") ar1est(vel, method="LSE") # #Example 2 ar1est(DiffBA) ar1est(DiffBA, method="LSE") ```

### Example output

```Loading required package: urca
Loading required package: stabledist
Loading required package: fGarch
Loading required package: timeDate
Loading required package: timeSeries
Loading required package: fBasics

Rmetrics Package fBasics
Analysing Markets and calculating Basic Statistics
Copyright (C) 2005-2014 Rmetrics Association Zurich
Educational Software for Financial Engineering and Computational Science
Rmetrics is free software and comes with ABSOLUTELY NO WARRANTY.
https://www.rmetrics.org --- Mail to: info@rmetrics.org
Loading required package: lattice
[1] 0.9958396
[1] 0.9958396
[1] 0.9503162
[1] 0.6803431
[1] 0.6943426
```

mleur documentation built on May 1, 2019, 7:31 p.m.