Performs statistical tests to verify if a time series follows a martingale property and maintains market consistency. Three different testing methods are available.
esgmartingaletest(
r,
X,
p0,
alpha = 0.05,
method = c("onevsone", "trend", "ratio")
)
A list containing test results, which may include:
t-statistic and p-value for ratio test
trend analysis results
mean and standard deviation of martingale differences
The function implements three different approaches to test for martingale properties:
"onevsone": Compares each observation against its expected value
"trend": Analyzes trends in the martingale differences
"ratio": Tests the ratio between discounted values and initial prices
The test results help determine if the time series maintains the martingale property and market consistency under the risk-neutral measure.
# Generate sample data
r <- 0.05
X <- ts(matrix(rnorm(1000), 100, 10), start = 0, deltat = 0.1)
p0 <- 100
# Perform martingale test using ratio method
result <- esgmartingaletest(r, X, p0, method = "ratio")
#> Warning: NaNs produced
# Perform trend analysis
trend_result <- esgmartingaletest(r, X, p0, method = "trend")
#> Registered S3 method overwritten by 'quantmod':
#> method from
#> as.zoo.data.frame zoo