| Title: | Merger and Acquisition Autoregressive Time-Series Models |
|---|---|
| Description: | Implements comprehensive Merger and Acquisition ('M&A') Autoregressive ('AR') time-series models with full statistical analysis capabilities. The package provides parameter estimation, forecasting with confidence intervals (80%, 90%, 95%, 99%), descriptive statistics, stationarity tests (Augmented Dickey-Fuller ('ADF'), Phillips-Perron, Kwiatkowski-Phillips-Schmidt-Shin ('KPSS'), Dickey-Fuller Generalized Least Squares ('DF-GLS')), autocorrelation analysis (Autocorrelation Function ('ACF'), Partial Autocorrelation Function ('PACF')), model diagnostics (Ljung-Box, Box-Pierce), accuracy measures (Mean Squared Error ('MSE'), Mean Absolute Error ('MAE'), Mean Absolute Scaled Error ('MASE'), Root Mean Squared Error ('RMSE'), Symmetric Mean Absolute Percentage Error ('SMAPE'), F-statistic), residual diagnostics (normality tests, heteroscedasticity tests), model stability analysis, impulse response, information criteria (Akaike Information Criterion ('AIC'), Bayesian Information Criterion ('BIC'), Hannan-Quinn Information Criterion ('HQIC')), structural break analysis, spectral analysis, and Monte Carlo simulation. Models are based on: Kumar, Mudassir, and Agiwal (2024) <https://ph02.tci-thaijo.org/index.php/thaistat/article/view/253436>, Kumar, Mudassir, and Srivastava (2025) <doi:10.1007/s44199-025-00104-3>, Kumar and Mudassir (2025) <doi:10.19139/soic-2310-5070-2029>. |
| Authors: | Shikhar Tyagi [aut, cre] (ORCID: <https://orcid.org/0000-0003-1606-0844>), Mohd Mudassir [aut], Vrijesh Tripathi [aut] |
| Maintainer: | Shikhar Tyagi <[email protected]> |
| License: | GPL-3 |
| Version: | 1.0.0 |
| Built: | 2026-09-27 10:35:19 UTC |
| Source: | https://github.com/cran/MAARTS |
Computes comprehensive forecast accuracy measures including MSE, MAE, RMSE, MAPE, SMAPE, MASE, and Theil's U statistic.
ma_accuracy(actual, predicted)ma_accuracy(actual, predicted)
actual |
Numeric vector of actual values |
predicted |
Numeric vector of predicted/forecasted values |
An object of class ma_accuracy
actual <- c(1, 2, 3, 4, 5) predicted <- c(1.1, 2.2, 2.9, 4.1, 5.2) accuracy <- ma_accuracy(actual, predicted)actual <- c(1, 2, 3, 4, 5) predicted <- c(1.1, 2.2, 2.9, 4.1, 5.2) accuracy <- ma_accuracy(actual, predicted)
Computes autocorrelation and partial autocorrelation functions with significance bounds and optional plotting.
ma_acf_pacf(data, lag_max = NULL, plot = TRUE)ma_acf_pacf(data, lag_max = NULL, plot = TRUE)
data |
A numeric vector or time series object |
lag_max |
Maximum number of lags (NULL for automatic selection) |
plot |
Logical. If TRUE, produces ACF and PACF plots. |
An object of class ma_acf_pacf
data(ma_sample_data) acf_result <- ma_acf_pacf(ma_sample_data, plot = FALSE)data(ma_sample_data) acf_result <- ma_acf_pacf(ma_sample_data, plot = FALSE)
ACF Plot using ggplot2
ma_acf_plot( y, lag_max = 20, confidence_level = 0.95, title = "Autocorrelation Function" )ma_acf_plot( y, lag_max = 20, confidence_level = 0.95, title = "Autocorrelation Function" )
y |
Numeric vector of time series data |
lag_max |
Maximum lag |
confidence_level |
Confidence level for significance bounds |
title |
Plot title |
A ggplot object showing the autocorrelation function with significance bounds.
Fit an Autoregressive model to M&A time-series data with comprehensive diagnostics.
ma_ar_fit(data, order = NULL, method = "OLS")ma_ar_fit(data, order = NULL, method = "OLS")
data |
A numeric vector or time series object |
order |
Order of the AR model (p). If NULL, automatically selected using AIC |
method |
Estimation method ("OLS" or "MLE") |
A list containing model fit, parameters, and diagnostics
data(ma_sample_data) ar_model <- ma_ar_fit(ma_sample_data, order = 2)data(ma_sample_data) ar_model <- ma_ar_fit(ma_sample_data, order = 2)
Fits an AR model with spline function to account for non-linear trends around merger events.
ma_ars_model( y, merger_times, order = 1, knots_before = 1, knots_after = 1, method = "OLS", spline_degree = 1 )ma_ars_model( y, merger_times, order = 1, knots_before = 1, knots_after = 1, method = "OLS", spline_degree = 1 )
y |
Time series response variable (numeric vector) |
merger_times |
Vector of merger time points |
order |
AR order (p) |
knots_before |
Number of knots before merger |
knots_after |
Number of knots after merger |
method |
Estimation method ("OLS", "ALF", "ELF", "SELF") |
spline_degree |
Degree of spline polynomial (currently linear spline) |
List containing model parameters, fitted values, residuals, and diagnostic information
y <- rnorm(100) result <- ma_ars_model(y, merger_times = c(50), order = 2)y <- rnorm(100) result <- ma_ars_model(y, merger_times = c(50), order = 2)
Computes comprehensive descriptive statistics for M&A time-series data, including measures of central tendency, dispersion, shape, and distribution.
ma_descriptive_stats(data, include_tests = TRUE)ma_descriptive_stats(data, include_tests = TRUE)
data |
A numeric vector or time series object |
include_tests |
Logical. If TRUE, runs comprehensive normality tests. |
A list of class ma_descriptive_stats containing the descriptive statistics.
data(ma_sample_data) stats <- ma_descriptive_stats(ma_sample_data) print(stats)data(ma_sample_data) stats <- ma_descriptive_stats(ma_sample_data) print(stats)
Performs Ljung-Box and Box-Pierce tests for residual autocorrelation.
ma_diagnostic_tests(model, lag = NULL)ma_diagnostic_tests(model, lag = NULL)
model |
A fitted AR model object (ma_ar_fit or ma_ar_model class) |
lag |
Vector of lag orders to test (default: c(6, 12, 18, 24)) |
An object of class ma_diagnostic_tests
data(ma_sample_data) ar_model <- ma_ar_fit(ma_sample_data, order = 2) diagnostics <- ma_diagnostic_tests(ar_model)data(ma_sample_data) ar_model <- ma_ar_fit(ma_sample_data, order = 2) diagnostics <- ma_diagnostic_tests(ar_model)
Generates forecasts with confidence intervals at multiple levels (80%, 90%, 95%, 99%). Supports both standard AR models (ma_ar_fit) and M&A AR models (ma_ar_model).
ma_forecast(model, h = 10, confidence = c(0.8, 0.9, 0.95, 0.99))ma_forecast(model, h = 10, confidence = c(0.8, 0.9, 0.95, 0.99))
model |
A fitted AR model object (ma_ar_fit or ma_ar_model class) |
h |
Number of periods to forecast |
confidence |
Confidence levels for intervals (default: c(0.80, 0.90, 0.95, 0.99)) |
An object of class ma_forecast
data(ma_sample_data) ar_model <- ma_ar_fit(ma_sample_data, order = 2) fc <- ma_forecast(ar_model, h = 12)data(ma_sample_data) ar_model <- ma_ar_fit(ma_sample_data, order = 2) fc <- ma_forecast(ar_model, h = 12)
Forecast Plot using ggplot2
ma_forecast_plot( forecast_result, historical_data = NULL, title = "Forecast with Confidence Intervals" )ma_forecast_plot( forecast_result, historical_data = NULL, title = "Forecast with Confidence Intervals" )
forecast_result |
A ma_forecast object |
historical_data |
Optional vector of historical data |
title |
Plot title |
A ggplot object showing historical data with forecasts and confidence bands.
Histogram Plot using ggplot2
ma_histogram_plot(y, bins = 30, title = "Histogram with Density")ma_histogram_plot(y, bins = 30, title = "Histogram with Density")
y |
Numeric vector |
bins |
Number of bins |
title |
Plot title |
A ggplot object showing a histogram with an overlaid normal density curve.
Computes impulse response functions (IRF), dynamic multipliers, and cumulative impulse responses to analyze shock transmission in M&A AR models.
ma_impulse_response(model, n_periods = 20, plot = TRUE)ma_impulse_response(model, n_periods = 20, plot = TRUE)
model |
A fitted AR model object (ma_ar_fit or ma_ar_model class) |
n_periods |
Number of periods for the impulse response |
plot |
Logical. If TRUE, produces impulse response plot. |
An object of class ma_impulse_response
data(ma_sample_data) ar_model <- ma_ar_fit(ma_sample_data, order = 2) irf <- ma_impulse_response(ar_model, n_periods = 20, plot = FALSE)data(ma_sample_data) ar_model <- ma_ar_fit(ma_sample_data, order = 2) irf <- ma_impulse_response(ar_model, n_periods = 20, plot = FALSE)
Compares multiple AR models using information criteria (AIC, BIC, HQIC), log-likelihood values, and accuracy measures.
ma_model_comparison(..., model_names = NULL)ma_model_comparison(..., model_names = NULL)
... |
Multiple fitted AR model objects |
model_names |
Optional character vector of model names |
An object of class ma_model_comparison
data(ma_sample_data) ar1 <- ma_ar_fit(ma_sample_data, order = 1) ar2 <- ma_ar_fit(ma_sample_data, order = 2) comparison <- ma_model_comparison(ar1, ar2)data(ma_sample_data) ar1 <- ma_ar_fit(ma_sample_data, order = 1) ar2 <- ma_ar_fit(ma_sample_data, order = 2) comparison <- ma_model_comparison(ar1, ar2)
Performs Monte Carlo simulation to evaluate estimator performance. Assesses bias, MSE, RMSE, and coverage probability of confidence intervals.
ma_monte_carlo_simulation( true_coefficients, n = 200, n_sim = 1000, intercept = 0, sigma = 1, confidence_level = 0.95 )ma_monte_carlo_simulation( true_coefficients, n = 200, n_sim = 1000, intercept = 0, sigma = 1, confidence_level = 0.95 )
true_coefficients |
True AR coefficients for data generation |
n |
Sample size for each simulation |
n_sim |
Number of simulations |
intercept |
True intercept value |
sigma |
True innovation standard deviation |
confidence_level |
Confidence level for coverage probability |
An object of class ma_monte_carlo_simulation
sim <- ma_monte_carlo_simulation(true_coefficients = c(0.6, -0.2), n = 100, n_sim = 100)sim <- ma_monte_carlo_simulation(true_coefficients = c(0.6, -0.2), n = 100, n_sim = 100)
Fits an AR model accounting for multiple merger events with explanatory series.
ma_multiple_merger_ar( y, x_explanatory = list(), merger_times = numeric(0), order = 1, method = "OLS" )ma_multiple_merger_ar( y, x_explanatory = list(), merger_times = numeric(0), order = 1, method = "OLS" )
y |
Time series response variable (numeric vector) |
x_explanatory |
List of explanatory time series vectors |
merger_times |
Vector of merger time points |
order |
AR order (p) |
method |
Estimation method ("OLS", "ALF", "ELF", "SELF") |
List containing model parameters, fitted values, residuals, and diagnostic information
y <- rnorm(100) x <- list(x1 = rnorm(100), x2 = rnorm(100)) result <- ma_multiple_merger_ar(y, x, merger_times = c(30, 70), order = 2)y <- rnorm(100) x <- list(x1 = rnorm(100), x2 = rnorm(100)) result <- ma_multiple_merger_ar(y, x, merger_times = c(30, 70), order = 2)
Performs comprehensive normality tests including Shapiro-Wilk, Jarque-Bera, Anderson-Darling, Cramer-von Mises, Pearson chi-square, and Shapiro-Francia tests.
ma_normality_tests(data)ma_normality_tests(data)
data |
A numeric vector or time series object |
A list containing the individual test statistics, p-values, and an overall interpretation.
y <- rnorm(100) tests <- ma_normality_tests(y)y <- rnorm(100) tests <- ma_normality_tests(y)
PACF Plot using ggplot2
ma_pacf_plot( y, lag_max = 20, confidence_level = 0.95, title = "Partial Autocorrelation Function" )ma_pacf_plot( y, lag_max = 20, confidence_level = 0.95, title = "Partial Autocorrelation Function" )
y |
Numeric vector of time series data |
lag_max |
Maximum lag |
confidence_level |
Confidence level for significance bounds |
title |
Plot title |
A ggplot object showing the partial autocorrelation function with significance bounds.
Normal Q-Q Plot using ggplot2
ma_qq_plot(model, title = "Normal Q-Q Plot")ma_qq_plot(model, title = "Normal Q-Q Plot")
model |
A fitted AR model object (ma_ar_fit or ma_ar_model class) |
title |
Plot title |
A ggplot object showing a Q-Q plot of residuals against normal quantiles.
Performs comprehensive residual diagnostics including normality tests, heteroscedasticity tests (Breusch-Pagan, ARCH LM), and graphical diagnostics.
ma_residual_diagnostics(model, plot = TRUE, lags = c(6, 12, 18))ma_residual_diagnostics(model, plot = TRUE, lags = c(6, 12, 18))
model |
A fitted AR model object (ma_ar_fit or ma_ar_model class) |
plot |
Logical. If TRUE, produces diagnostic plots (histogram, Q-Q plot, residuals vs fitted). |
lags |
Vector of lag orders for autocorrelation tests |
An object of class ma_residual_diagnostics
data(ma_sample_data) ar_model <- ma_ar_fit(ma_sample_data, order = 2) diag <- ma_residual_diagnostics(ar_model, plot = FALSE)data(ma_sample_data) ar_model <- ma_ar_fit(ma_sample_data, order = 2) diag <- ma_residual_diagnostics(ar_model, plot = FALSE)
Residual Plot using ggplot2
ma_residual_plot(model)ma_residual_plot(model)
model |
A fitted AR model object (ma_ar_fit or ma_ar_model class) |
A ggplot object showing residuals over time.
A simulated dataset representing Merger and Acquisition activity over time. This data follows an AR(2) process with parameters phi1 = 0.6, phi2 = -0.2, intercept = 10, and sigma = 2, typical of M&A time-series dynamics.
ma_sample_datama_sample_data
A time-series object (ts) of length 200 representing quarterly
M&A activity from 2000 Q1 to 2049 Q4.
Simulated data for demonstration purposes.
data(ma_sample_data) plot(ma_sample_data, type = "l", main = "Sample M&A Time-Series") ma_descriptive_stats(ma_sample_data)data(ma_sample_data) plot(ma_sample_data, type = "l", main = "Sample M&A Time-Series") ma_descriptive_stats(ma_sample_data)
Performs spectral analysis to identify cyclical components in M&A activity using periodogram and spectral density estimation.
ma_spectral_analysis(data, plot = TRUE)ma_spectral_analysis(data, plot = TRUE)
data |
A numeric vector or time series object |
plot |
Logical. If TRUE, produces spectral density plot. |
An object of class ma_spectral_analysis
data(ma_sample_data) spectral <- ma_spectral_analysis(ma_sample_data, plot = FALSE)data(ma_sample_data) spectral <- ma_spectral_analysis(ma_sample_data, plot = FALSE)
Evaluates the stability and stationarity conditions of AR models through characteristic root analysis, persistence measures, and half-life calculation.
ma_stability_analysis(model)ma_stability_analysis(model)
model |
A fitted AR model object (ma_ar_fit or ma_ar_model class) |
An object of class ma_stability_analysis
data(ma_sample_data) ar_model <- ma_ar_fit(ma_sample_data, order = 2) stability <- ma_stability_analysis(ar_model)data(ma_sample_data) ar_model <- ma_ar_fit(ma_sample_data, order = 2) stability <- ma_stability_analysis(ar_model)
Performs comprehensive stationarity and unit root tests on time-series data, including Augmented Dickey-Fuller (ADF), Phillips-Perron (PP), KPSS, and DF-GLS tests.
ma_stationarity_tests(data, lag = NULL, trend = "drift")ma_stationarity_tests(data, lag = NULL, trend = "drift")
data |
A numeric vector or time series object |
lag |
Maximum lag for the tests (optional, automatically selected if NULL) |
trend |
Type of trend to assume for KPSS and DF-GLS ("drift" or "trend") |
An object of class ma_stationarity_tests containing test statistics,
critical values, and p-values.
data(ma_sample_data) stationarity <- ma_stationarity_tests(ma_sample_data) print(stationarity)data(ma_sample_data) stationarity <- ma_stationarity_tests(ma_sample_data) print(stationarity)
Performs structural break analysis using Chow test, Bai-Perron multiple breakpoint tests, and CUSUM tests to detect changes in M&A dynamics.
ma_structural_break(data, model = NULL, break_point = NULL, max_breaks = 5)ma_structural_break(data, model = NULL, break_point = NULL, max_breaks = 5)
data |
A numeric vector or time series object |
model |
Optional fitted AR model object |
break_point |
Optional known breakpoint(s) for Chow test |
max_breaks |
Maximum number of breakpoints for Bai-Perron test |
An object of class ma_structural_break
y <- c(rnorm(50), rnorm(50, mean = 2)) breaks <- ma_structural_break(y, break_point = 50)y <- c(rnorm(50), rnorm(50, mean = 2)) breaks <- ma_structural_break(y, break_point = 50)
Plot method for ma_forecast
## S3 method for class 'ma_forecast' plot(x, ...)## S3 method for class 'ma_forecast' plot(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of producing a forecast plot with confidence bands.
Print method for ma_accuracy
## S3 method for class 'ma_accuracy' print(x, ...)## S3 method for class 'ma_accuracy' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing a summary of forecast accuracy measures to the console.
Print method for ma_acf_pacf
## S3 method for class 'ma_acf_pacf' print(x, ...)## S3 method for class 'ma_acf_pacf' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing ACF/PACF analysis results to the console.
Print method for ma_ar_fit
## S3 method for class 'ma_ar_fit' print(x, ...)## S3 method for class 'ma_ar_fit' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing model coefficients, information criteria, and stability diagnostics to the console.
Print method for ma_ar_model
## S3 method for class 'ma_ar_model' print(x, ...)## S3 method for class 'ma_ar_model' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing model type, AR coefficients, and coefficient summary to the console.
Print method for ma_descriptive_stats
## S3 method for class 'ma_descriptive_stats' print(x, ...)## S3 method for class 'ma_descriptive_stats' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing descriptive statistics and normality test results to the console.
Print method for ma_diagnostic_tests
## S3 method for class 'ma_diagnostic_tests' print(x, ...)## S3 method for class 'ma_diagnostic_tests' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing Ljung-Box and Box-Pierce test results to the console.
Print method for ma_forecast
## S3 method for class 'ma_forecast' print(x, ...)## S3 method for class 'ma_forecast' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing point forecasts and confidence intervals to the console.
Print method for ma_impulse_response
## S3 method for class 'ma_impulse_response' print(x, ...)## S3 method for class 'ma_impulse_response' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing impulse response function values and cumulative responses to the console.
Print method for ma_model_comparison
## S3 method for class 'ma_model_comparison' print(x, ...)## S3 method for class 'ma_model_comparison' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing a model comparison table with information criteria to the console.
Print method for ma_monte_carlo_simulation
## S3 method for class 'ma_monte_carlo_simulation' print(x, ...)## S3 method for class 'ma_monte_carlo_simulation' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing Monte Carlo simulation results including bias, MSE, and coverage probabilities to the console.
Print method for ma_residual_diagnostics
## S3 method for class 'ma_residual_diagnostics' print(x, ...)## S3 method for class 'ma_residual_diagnostics' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing residual summary statistics, normality tests, and heteroscedasticity test results to the console.
Print method for ma_spectral_analysis
## S3 method for class 'ma_spectral_analysis' print(x, ...)## S3 method for class 'ma_spectral_analysis' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing dominant frequency, period, and spectral density summary to the console.
Print method for ma_stability_analysis
## S3 method for class 'ma_stability_analysis' print(x, ...)## S3 method for class 'ma_stability_analysis' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing characteristic roots, persistence, half-life, and stability status to the console.
Print method for ma_stationarity_tests
## S3 method for class 'ma_stationarity_tests' print(x, ...)## S3 method for class 'ma_stationarity_tests' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing ADF, Phillips-Perron, KPSS, and DF-GLS test results to the console.
Print method for ma_structural_break
## S3 method for class 'ma_structural_break' print(x, ...)## S3 method for class 'ma_structural_break' print(x, ...)
x |
An object of class |
... |
Additional arguments (ignored) |
The input object x, invisibly. Called for its side effect of printing structural break test results to the console.