A simple test of the martingale hypothesis in esgtoolkit

[This article was first published on T. Moudiki's Webpage - R, and kindly contributed to R-bloggers]. (You can report issue about the content on this page here)
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Disclaimer: This is a work in progress.

R code at the end.

Introduction

A fundamental utility in financial econometrics and stochastic processes is the martingale property, which implies that the best approximation of the future value of a time series or stochastic process, based on its historical values, is its present value. This property is critical in the efficient market hypothesis, risk-neutral pricing models. Testing whether a given time series satisfies the martingale hypothesis involves examining whether past values significantly predict future changes. This blog post outlines a formalized statistical test implemented in the esgtoolkit package, and leveraging multiple linear regression, F-statistics, and residual diagnostics to determine whether a time series follows a martingale process.

Martingale Hypothesis Test

Let X={X1,X2,,Xn} be a time series, where each Xt represents a multivariate observation at time t. We are interested in testing the martingale hypothesis, which posits that the future value Xt+1 is unpredictable given the past values. That is:

E[Xn+1σ(Xn,Xn1,,X1)]=Xn

Where σ(Xn,Xn1,,X1) is the sigma-algebra containing all the information about X ‘s past values.

1. Regression Model

One way to conduct such a test of the Martingale Hypothesis, is to adjust a multiple linear regression of the change in the series, ΔXt+1=Xt+1Xt, on the past values Xt,Xt1,,X1, for all t>0 :

ΔXt+1β0+β1Xt+β2Xt1++βpX1+ϵt+1

where ϵt+1 are the (centered and homoskedastic) residuals of the regression, because, under the assumption that ˆβ1=ˆβ2==ˆβp= 0 , we’d have:

E[Xt+1Xtσ(Xt,Xt1,,X1)]=0

That’s one of the simplest way to do it, and although we could think of other expressions of the conditional expectation, these would require more engineering.

2. F-statistic

The significance of the regression model is tested using the Fisher F-statistic. The null hypothesis H0 is that none of the past values X1,X2,,Xt significantly explains the change ΔXt+1 :

H0:β1=β2==βp=0

The F-statistic is computed as:

F=R2/p(1R2)/(np1)

where R2 is the coefficient of determination, and p is the number of predictors (lags). A significantly large value of F would lead to reject H0.

3. Critical Value and p-value

The critical value for the Fisher-Snedecor statistic is obtained from the F-distribution with p and np1 degrees of freedom at a chosen significance level α :

Fcritical =Fα(p,np1)

The p -value of the F-statistic is computed as:

p-value =P(FFobserved H0 is true )

If the p-value is less than the chosen significance level α, we’ll reject the null hypothesis and conclude that the past values explain the change in the time series.

4. Stationarity of Residuals

To test the stationarity of the residuals ϵt+1, we perform the Augmented Dickey-Fuller (ADF) test. The null hypothesis H0 is that the residuals are non-stationary (i.e., they follow a random walk):

H0: Residuals are non-stationary 

The test statistic is the t-statistic of the lagged residuals, and the p-value indicates whether we can reject the null hypothesis. If the p -value is less than α, we reject the null hypothesis and conclude that the residuals are stationary.

5. Autocorrelation of Residuals

In addition to the F-test, and in order to ensure no autocorrelation remains in the residuals, we perform the Ljung-Box test. The null hypothesis H0 is that there is no autocorrelation in the residuals:

H0 : No autocorrelation in residuals 

The Ljung-Box test statistic is computed as:

Q=n(n+2)mk=1ˆρ2knk

where ˆρk is the sample autocorrelation at lag k, and m is the maximum lag. The p -value is computed based on this statistic.

Examples

See: https://techtonique.github.io/ESGtoolkit/articles/martingale_test.html

image-title-here

To leave a comment for the author, please follow the link and comment on their blog: T. Moudiki's Webpage - R.

R-bloggers.com offers daily e-mail updates about R news and tutorials about learning R and many other topics. Click here if you're looking to post or find an R/data-science job.
Want to share your content on R-bloggers? click here if you have a blog, or here if you don't.

Never miss an update!
Subscribe to R-bloggers to receive
e-mails with the latest R posts.
(You will not see this message again.)

Click here to close (This popup will not appear again)