The hardware and bandwidth for this mirror is donated by METANET, the Webhosting and Full Service-Cloud Provider.
If you wish to report a bug, or if you are interested in having us mirror your free-software or open-source project, please feel free to contact us at mirror[@]metanet.ch.

Package {MAARTS}


Type: Package
Title: Merger and Acquisition Autoregressive Time-Series Models
Version: 1.0.0
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>.
License: GPL-3
Depends: R (≥ 4.0.0)
Imports: forecast, tseries, urca, stats, graphics, grDevices, utils, lmtest, sandwich, nortest, moments, strucchange, ggplot2, gridExtra, MASS, numDeriv
Suggests: testthat (≥ 3.0.0), knitr, rmarkdown
Config/testthat/edition: 3
Encoding: UTF-8
Language: en-US
LazyData: true
RoxygenNote: 7.3.3
VignetteBuilder: knitr
NeedsCompilation: no
Packaged: 2026-07-17 15:09:00 UTC; 30017827
Author: Shikhar Tyagi ORCID iD [aut, cre], Mohd Mudassir [aut], Vrijesh Tripathi [aut]
Maintainer: Shikhar Tyagi <shikhar1093tyagi@gmail.com>
Repository: CRAN
Date/Publication: 2026-07-26 11:00:02 UTC

MAARTS: Merger and Acquisition Autoregressive Time-Series Models

Description

The MAARTS package provides a complete framework for M&A time-series analysis including:

Details

A comprehensive R package for analyzing Merger and Acquisition (M&A) time-series data using specialized Autoregressive (AR) models.

Models

The package implements three specialized M&A time-series models:

M-ARS

Merged Autoregressive Spline model with linear spline trend around merger knot points. See ma_ars_model.

MM-AR

Multiple-Merger Autoregressive model for simultaneous treatment of multiple merger events. See ma_multiple_merger_ar.

MM-ARE

Multiple-Merger Autoregressive with Explanatory series, extending MM-AR with exogenous predictor variables. See ma_multiple_merger_ar.

Author(s)

Maintainer: Shikhar Tyagi shikhar1093tyagi@gmail.com (ORCID)

Authors:

Examples

# Load sample M&A time-series data
data(ma_sample_data)

# Descriptive statistics
desc_stats <- ma_descriptive_stats(ma_sample_data)

# Stationarity tests
stationarity <- ma_stationarity_tests(ma_sample_data)

# Fit AR model
ar_model <- ma_ar_fit(ma_sample_data, order = 2)

# Forecast with confidence intervals
fc <- ma_forecast(ar_model, h = 12, confidence = c(0.80, 0.90, 0.95, 0.99))

# Fit M-ARS model
mars_model <- ma_ars_model(ma_sample_data, order = 2, merger_times = 50)


Forecast Accuracy Measures for M&A Time-Series

Description

Computes comprehensive forecast accuracy measures including MSE, MAE, RMSE, MAPE, SMAPE, MASE, and Theil's U statistic.

Usage

ma_accuracy(actual, predicted)

Arguments

actual

Numeric vector of actual values

predicted

Numeric vector of predicted/forecasted values

Value

An object of class ma_accuracy

Examples

actual <- c(1, 2, 3, 4, 5)
predicted <- c(1.1, 2.2, 2.9, 4.1, 5.2)
accuracy <- ma_accuracy(actual, predicted)

ACF and PACF Analysis for M&A Time-Series

Description

Computes autocorrelation and partial autocorrelation functions with significance bounds and optional plotting.

Usage

ma_acf_pacf(data, lag_max = NULL, plot = TRUE)

Arguments

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.

Value

An object of class ma_acf_pacf

Examples

data(ma_sample_data)
acf_result <- ma_acf_pacf(ma_sample_data, plot = FALSE)

ACF Plot using ggplot2

Description

ACF Plot using ggplot2

Usage

ma_acf_plot(
  y,
  lag_max = 20,
  confidence_level = 0.95,
  title = "Autocorrelation Function"
)

Arguments

y

Numeric vector of time series data

lag_max

Maximum lag

confidence_level

Confidence level for significance bounds

title

Plot title

Value

A ggplot object showing the autocorrelation function with significance bounds.


AR Model Estimation for M&A Time-Series

Description

Fit an Autoregressive model to M&A time-series data with comprehensive diagnostics.

Usage

ma_ar_fit(data, order = NULL, method = "OLS")

Arguments

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")

Value

A list containing model fit, parameters, and diagnostics

Examples

data(ma_sample_data)
ar_model <- ma_ar_fit(ma_sample_data, order = 2)

Merger and Acquisition AR with Spline (M-ARS) Model

Description

Fits an AR model with spline function to account for non-linear trends around merger events.

Usage

ma_ars_model(
  y,
  merger_times,
  order = 1,
  knots_before = 1,
  knots_after = 1,
  method = "OLS",
  spline_degree = 1
)

Arguments

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)

Value

List containing model parameters, fitted values, residuals, and diagnostic information

Examples

y <- rnorm(100)
result <- ma_ars_model(y, merger_times = c(50), order = 2)

Bayesian Estimation with Loss Functions

Description

Internal function for Bayesian estimation using Normal-Inverse-Gamma conjugate prior.

Usage

ma_bayesian_estimation(Y, X, method)

Arguments

Y

Response vector

X

Design matrix

method

Loss function ("ALF", "ELF", "SELF")

Value

List containing estimation results


Descriptive Statistics for M&A Time-Series

Description

Computes comprehensive descriptive statistics for M&A time-series data, including measures of central tendency, dispersion, shape, and distribution.

Usage

ma_descriptive_stats(data, include_tests = TRUE)

Arguments

data

A numeric vector or time series object

include_tests

Logical. If TRUE, runs comprehensive normality tests.

Value

A list of class ma_descriptive_stats containing the descriptive statistics.

Examples

data(ma_sample_data)
stats <- ma_descriptive_stats(ma_sample_data)
print(stats)

Diagnostic Tests for M&A AR Models

Description

Performs Ljung-Box and Box-Pierce tests for residual autocorrelation.

Usage

ma_diagnostic_tests(model, lag = NULL)

Arguments

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))

Value

An object of class ma_diagnostic_tests

Examples

data(ma_sample_data)
ar_model <- ma_ar_fit(ma_sample_data, order = 2)
diagnostics <- ma_diagnostic_tests(ar_model)

Forecasting for M&A AR Models

Description

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).

Usage

ma_forecast(model, h = 10, confidence = c(0.8, 0.9, 0.95, 0.99))

Arguments

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))

Value

An object of class ma_forecast

Examples

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

Description

Forecast Plot using ggplot2

Usage

ma_forecast_plot(
  forecast_result,
  historical_data = NULL,
  title = "Forecast with Confidence Intervals"
)

Arguments

forecast_result

A ma_forecast object

historical_data

Optional vector of historical data

title

Plot title

Value

A ggplot object showing historical data with forecasts and confidence bands.


Histogram Plot using ggplot2

Description

Histogram Plot using ggplot2

Usage

ma_histogram_plot(y, bins = 30, title = "Histogram with Density")

Arguments

y

Numeric vector

bins

Number of bins

title

Plot title

Value

A ggplot object showing a histogram with an overlaid normal density curve.


Impulse Response Function for M&A AR Models

Description

Computes impulse response functions (IRF), dynamic multipliers, and cumulative impulse responses to analyze shock transmission in M&A AR models.

Usage

ma_impulse_response(model, n_periods = 20, plot = TRUE)

Arguments

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.

Value

An object of class ma_impulse_response

Examples

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)

Model Comparison for M&A AR Models

Description

Compares multiple AR models using information criteria (AIC, BIC, HQIC), log-likelihood values, and accuracy measures.

Usage

ma_model_comparison(..., model_names = NULL)

Arguments

...

Multiple fitted AR model objects

model_names

Optional character vector of model names

Value

An object of class ma_model_comparison

Examples

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)

Monte Carlo Simulation for M&A AR Models

Description

Performs Monte Carlo simulation to evaluate estimator performance. Assesses bias, MSE, RMSE, and coverage probability of confidence intervals.

Usage

ma_monte_carlo_simulation(
  true_coefficients,
  n = 200,
  n_sim = 1000,
  intercept = 0,
  sigma = 1,
  confidence_level = 0.95
)

Arguments

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

Value

An object of class ma_monte_carlo_simulation

Examples

sim <- ma_monte_carlo_simulation(true_coefficients = c(0.6, -0.2),
                                  n = 100, n_sim = 100)

Multiple Merger AR Model with Explanatory Series

Description

Fits an AR model accounting for multiple merger events with explanatory series.

Usage

ma_multiple_merger_ar(
  y,
  x_explanatory = list(),
  merger_times = numeric(0),
  order = 1,
  method = "OLS"
)

Arguments

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")

Value

List containing model parameters, fitted values, residuals, and diagnostic information

Examples

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)

Normality Tests for M&A Time-Series

Description

Performs comprehensive normality tests including Shapiro-Wilk, Jarque-Bera, Anderson-Darling, Cramer-von Mises, Pearson chi-square, and Shapiro-Francia tests.

Usage

ma_normality_tests(data)

Arguments

data

A numeric vector or time series object

Value

A list containing the individual test statistics, p-values, and an overall interpretation.

Examples

y <- rnorm(100)
tests <- ma_normality_tests(y)

PACF Plot using ggplot2

Description

PACF Plot using ggplot2

Usage

ma_pacf_plot(
  y,
  lag_max = 20,
  confidence_level = 0.95,
  title = "Partial Autocorrelation Function"
)

Arguments

y

Numeric vector of time series data

lag_max

Maximum lag

confidence_level

Confidence level for significance bounds

title

Plot title

Value

A ggplot object showing the partial autocorrelation function with significance bounds.


Normal Q-Q Plot using ggplot2

Description

Normal Q-Q Plot using ggplot2

Usage

ma_qq_plot(model, title = "Normal Q-Q Plot")

Arguments

model

A fitted AR model object (ma_ar_fit or ma_ar_model class)

title

Plot title

Value

A ggplot object showing a Q-Q plot of residuals against normal quantiles.


Residual Diagnostics for M&A AR Models

Description

Performs comprehensive residual diagnostics including normality tests, heteroscedasticity tests (Breusch-Pagan, ARCH LM), and graphical diagnostics.

Usage

ma_residual_diagnostics(model, plot = TRUE, lags = c(6, 12, 18))

Arguments

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

Value

An object of class ma_residual_diagnostics

Examples

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

Description

Residual Plot using ggplot2

Usage

ma_residual_plot(model)

Arguments

model

A fitted AR model object (ma_ar_fit or ma_ar_model class)

Value

A ggplot object showing residuals over time.


Sample M&A Time-Series Data

Description

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.

Usage

ma_sample_data

Format

A time-series object (ts) of length 200 representing quarterly M&A activity from 2000 Q1 to 2049 Q4.

Source

Simulated data for demonstration purposes.

Examples

data(ma_sample_data)
plot(ma_sample_data, type = "l", main = "Sample M&A Time-Series")
ma_descriptive_stats(ma_sample_data)

Spectral Analysis for M&A Time-Series

Description

Performs spectral analysis to identify cyclical components in M&A activity using periodogram and spectral density estimation.

Usage

ma_spectral_analysis(data, plot = TRUE)

Arguments

data

A numeric vector or time series object

plot

Logical. If TRUE, produces spectral density plot.

Value

An object of class ma_spectral_analysis

Examples

data(ma_sample_data)
spectral <- ma_spectral_analysis(ma_sample_data, plot = FALSE)

Stability Analysis for M&A AR Models

Description

Evaluates the stability and stationarity conditions of AR models through characteristic root analysis, persistence measures, and half-life calculation.

Usage

ma_stability_analysis(model)

Arguments

model

A fitted AR model object (ma_ar_fit or ma_ar_model class)

Value

An object of class ma_stability_analysis

Examples

data(ma_sample_data)
ar_model <- ma_ar_fit(ma_sample_data, order = 2)
stability <- ma_stability_analysis(ar_model)

Internal function to conclude stationarity

Description

Internal function to conclude stationarity

Usage

ma_stationarity_conclusion(adf_p, pp_p, kpss_stat, kpss_cval5pct)

Stationarity Tests for M&A Time-Series

Description

Performs comprehensive stationarity and unit root tests on time-series data, including Augmented Dickey-Fuller (ADF), Phillips-Perron (PP), KPSS, and DF-GLS tests.

Usage

ma_stationarity_tests(data, lag = NULL, trend = "drift")

Arguments

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")

Value

An object of class ma_stationarity_tests containing test statistics, critical values, and p-values.

Examples

data(ma_sample_data)
stationarity <- ma_stationarity_tests(ma_sample_data)
print(stationarity)

Structural Break Analysis for M&A Time-Series

Description

Performs structural break analysis using Chow test, Bai-Perron multiple breakpoint tests, and CUSUM tests to detect changes in M&A dynamics.

Usage

ma_structural_break(data, model = NULL, break_point = NULL, max_breaks = 5)

Arguments

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

Value

An object of class ma_structural_break

Examples

y <- c(rnorm(50), rnorm(50, mean = 2))
breaks <- ma_structural_break(y, break_point = 50)

Plot method for ma_forecast

Description

Plot method for ma_forecast

Usage

## S3 method for class 'ma_forecast'
plot(x, ...)

Arguments

x

An object of class ma_forecast

...

Additional arguments (ignored)

Value

The input object x, invisibly. Called for its side effect of producing a forecast plot with confidence bands.


Print method for ma_accuracy

Description

Print method for ma_accuracy

Usage

## S3 method for class 'ma_accuracy'
print(x, ...)

Arguments

x

An object of class ma_accuracy

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_acf_pacf

Usage

## S3 method for class 'ma_acf_pacf'
print(x, ...)

Arguments

x

An object of class ma_acf_pacf

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_ar_fit

Usage

## S3 method for class 'ma_ar_fit'
print(x, ...)

Arguments

x

An object of class ma_ar_fit

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_ar_model

Usage

## S3 method for class 'ma_ar_model'
print(x, ...)

Arguments

x

An object of class ma_ar_model

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_descriptive_stats

Usage

## S3 method for class 'ma_descriptive_stats'
print(x, ...)

Arguments

x

An object of class ma_descriptive_stats

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_diagnostic_tests

Usage

## S3 method for class 'ma_diagnostic_tests'
print(x, ...)

Arguments

x

An object of class ma_diagnostic_tests

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_forecast

Usage

## S3 method for class 'ma_forecast'
print(x, ...)

Arguments

x

An object of class ma_forecast

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_impulse_response

Usage

## S3 method for class 'ma_impulse_response'
print(x, ...)

Arguments

x

An object of class ma_impulse_response

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_model_comparison

Usage

## S3 method for class 'ma_model_comparison'
print(x, ...)

Arguments

x

An object of class ma_model_comparison

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_monte_carlo_simulation

Usage

## S3 method for class 'ma_monte_carlo_simulation'
print(x, ...)

Arguments

x

An object of class ma_monte_carlo_simulation

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_residual_diagnostics

Usage

## S3 method for class 'ma_residual_diagnostics'
print(x, ...)

Arguments

x

An object of class ma_residual_diagnostics

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_spectral_analysis

Usage

## S3 method for class 'ma_spectral_analysis'
print(x, ...)

Arguments

x

An object of class ma_spectral_analysis

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_stability_analysis

Usage

## S3 method for class 'ma_stability_analysis'
print(x, ...)

Arguments

x

An object of class ma_stability_analysis

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_stationarity_tests

Usage

## S3 method for class 'ma_stationarity_tests'
print(x, ...)

Arguments

x

An object of class ma_stationarity_tests

...

Additional arguments (ignored)

Value

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

Description

Print method for ma_structural_break

Usage

## S3 method for class 'ma_structural_break'
print(x, ...)

Arguments

x

An object of class ma_structural_break

...

Additional arguments (ignored)

Value

The input object x, invisibly. Called for its side effect of printing structural break test results to the console.

These binaries (installable software) and packages are in development.
They may not be fully stable and should be used with caution. We make no claims about them.