# partialAR

R package for fitting the partially autoregressive model

The partially autoregressive model is a time series model that is given by the following specification:

``````   X[t] = M[t] + R[t]
M[t] = rho * M[t-1] + epsilon_M[t]
R[t] = R[t-1] + epsilon_R[t]
epsilon_M[t] ~ NID(0, sigma_M^2)
epsilon_R[t] ~ NID(0, sigma_R^2)``````

Thus, the series X[t] is a sum of a random walk R[t], representing the permanent component, and a mean-reverting series M[t], representing the transient component.

This model was previously studied in Summers  and also in Poterba and Summers  in their often cited work on mean reversion in the S&P 500.

One example application of the partially autoregressive model is as follows. In the calendar year 2014, the behavior of Coca-Cola (KO) and Pepsi (PEP) were quite similar, as evidenced by charts of their stock prices. Despite this, cointegration tests find that they were not cointegrated. Thus, the question arises, “How far were they from being cointegrated?” The partially autoregressive model gives a possible answer to this question. When a partially autoregressive model is fit, it is found that 90% of the variance of the daily fluctuations of the residual series is due to a transient mean-reverting component, while 10% of the variance is due to a permanent random walk component.

The partialAR package provides routines for estimating the parameters of a partially autoregressive model and for testing goodness of fit.

A companion paper  can be found on SSRN.

 Summers, Lawrence H. Does the stock market rationally reflect fundamental values?. The Journal of Finance 41.3 (1986): 591-601.

 Poterba, James M., and Lawrence H. Summers. Mean reversion in stock prices: Evidence and implications. Journal of Financial Economics} 22.1 (1988): 27-59.

 Clegg, Matthew. Modeling Time Series with Both Permanent and Transient Components Using the Partially Autoregressive Model (January 28, 2015). Available at SSRN: http://ssrn.com/abstract=2556957
{"ft_lang_label":"__label__en","ft_lang_prob":0.9041266,"math_prob":0.8532152,"size":1980,"snap":"2019-35-2019-39","text_gpt3_token_len":492,"char_repetition_ratio":0.1325911,"word_repetition_ratio":0.0,"special_character_ratio":0.2530303,"punctuation_ratio":0.12732096,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.9888806,"pos_list":[0],"im_url_duplicate_count":[null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2019-09-21T20:08:34Z\",\"WARC-Record-ID\":\"<urn:uuid:d778799c-61be-4e7d-bd12-c10dfb34e1b3>\",\"Content-Length\":\"4310\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:2fa6480b-e359-445a-b410-e90dea212fb8>\",\"WARC-Concurrent-To\":\"<urn:uuid:e41ed83f-4bcb-45c1-81cb-8383a55b37a0>\",\"WARC-IP-Address\":\"99.84.104.110\",\"WARC-Target-URI\":\"https://cloud.r-project.org/web/packages/partialAR/README.html\",\"WARC-Payload-Digest\":\"sha1:DUKX7PSN7CGRIA3LK2FC3NMUR2QY2UPY\",\"WARC-Block-Digest\":\"sha1:MNTDDEBBKKB3DFPZVOJ3SMRSUXAXHERL\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2019/CC-MAIN-2019-39/CC-MAIN-2019-39_segments_1568514574662.80_warc_CC-MAIN-20190921190812-20190921212812-00363.warc.gz\"}"}