Title: | Fitting of Exponential Autoregressive (EXPAR) Model |
---|---|
Description: | The amplitude-dependent exponential autoregressive (EXPAR) time series model, initially proposed by Haggan and Ozaki (1981) <doi:10.2307/2335819> has been implemented in this package. Throughout various studies, the model has been found to adequately capture the cyclical nature of datasets. Parameter estimation of such family of models has been tackled by the approach of minimizing the residual sum of squares (RSS). Model selection among various candidate orders has been implemented using various information criteria, viz., Akaike information criteria (AIC), corrected Akaike information criteria (AICc) and Bayesian information criteria (BIC). An illustration utilizing data of egg price indices has also been provided. |
Authors: | Saikath Das [aut, cre], Bishal Gurung [aut], Achal Lama [aut], KN Singh [aut] |
Maintainer: | Saikath Das <[email protected]> |
License: | GPL-3 |
Version: | 0.1.0 |
Built: | 2025-02-16 04:31:13 UTC |
Source: | https://github.com/cran/EXPAR |
Searches for the best EXPAR model among many orders (defaults upto 5), compares them using information criterion and returns the best fit.
best_EXPAR(ts_data, max.p = 5, ic = "AIC", opt_method = "BFGS")
best_EXPAR(ts_data, max.p = 5, ic = "AIC", opt_method = "BFGS")
ts_data |
A univarite time series data, to which an EXPAR model is to be fitted. |
max.p |
The maximum order upto which models are to be searched for comparison. |
ic |
Information criterion to be used for model selection: Akaike information criterion ( |
opt_method |
The optimization algorithm to be used for RSS minimization. Corresponds to arguments from |
Fits max.p
number of EXPAR models to the given dataset by minimisation of RSS using optimise_EXPAR()
and returns the best model among the evaluated ones. Model selection is based on the information critera given in ic
.
The various information criterion are calculated (estimated) from RSS as,
where, are the number of observations and the number of parameters, respectively.
Returns the fitted EXPAR model as a list with the following components,
series |
The data used for fitting the model. |
order |
Order |
n |
Number of observations in |
k |
Number of parameters in the model. |
par |
Parameters of the fitted model. |
Fitted |
Fitted values obtained from the model. |
Residuals |
Residuals of the fitted model. |
RSS |
The residual sum of squares. |
AIC |
Akaike information criterion, evaluated from |
AIC_c |
Corrected Akaike information criterion, evaluated from |
BIC |
Bayesian information criterion, evaluated from |
counts |
|
convergence |
|
message |
|
Saikath Das, Bishal Gurung, Achal Lama and KN Singh
Haggan and Ozaki (1981). Modelling nonlinear random vibrations using an amplitude-dependent autoregressive time series model. Biometrika, 68(1):189-199. <doi:10.1093/biomet/68.1.189>.
Gurung (2015). An exponential autoregressive (EXPAR) model for the forecasting of all India annual rainfall. Mausam, 66(4):847-849. <doi:10.54302/mausam.v66i4.594>.
datats <- ts(egg_price_index[,3], start = c(2013, 1), frequency = 12) best_EXPAR(datats)
datats <- ts(egg_price_index[,3], start = c(2013, 1), frequency = 12) best_EXPAR(datats)
This data set contains observations of Consumer Price Index (CPI) of eggs for urban areas in India. It consists of 86 monthly observations, ranging from January, 2013 till February, 2020. Some observations after this point of time were also available, but were discarded due to their questionable reliability and missingness pertaining to the onset of COVID-19 pandemic from March, 2020.
egg_price_index
egg_price_index
A data frame containing 86 observations. Observations are contained in the "egg_price_index"
column, while the first two columns pertain to year and month of observation, repectively.
Fits an EXPAR model to the dataset for given parameter values, without any optimisation.
fit_EXPAR(ts_data, par)
fit_EXPAR(ts_data, par)
ts_data |
A univariate data to which the model is to be fitted, preferably (but not limited to) a |
par |
The parameter vector. Any value from the parametric space of EXPAR model is permissible. Number of required parameters is |
This function uses the form of EXPAR model to generate consecutive fitted observations as theoretical values obtained from the model. The form of EXPAR model employed is given by,
where, and
is white noise process with zero mean and constant variance
The process of fitting involves using actual observations in the dataset in the RHS of above equation and obtaining the fitted values . No optimization is done as parameter estimation is omitted. It is useful for simulation of data with given order and parameters.
Returns the fitted EXPAR model as a list with the following components,
Fitted |
Fitted values obtained from LHS of the aforementioned model. Due to obvious reasons, fits of the first |
Residuals |
The residuals |
RSS |
The residual sum of squares. |
AIC |
Akaike information criterion, evaluated from |
AIC_c |
Corrected Akaike information criterion, evaluated from |
BIC |
Bayesian information criterion, evaluated from |
datats <- ts(egg_price_index[,3], start = c(2013, 1), frequency = 12) fit_EXPAR(datats, par = c(0.45,0.68,0.48))
datats <- ts(egg_price_index[,3], start = c(2013, 1), frequency = 12) fit_EXPAR(datats, par = c(0.45,0.68,0.48))
Generates out-of-sample forecasts from any fitted EXPAR model.
forecast_EXPAR(EXPAR_model, h = 1)
forecast_EXPAR(EXPAR_model, h = 1)
EXPAR_model |
A fitted EXPAR model. |
h |
Number of periods for forecasting. Defaults to one-step ahead forecast. |
Forecasts from EXPAR model are generated iteratively using mathematical form of EXPAR model, considering fitted values and residuals while putting future error terms as zero.
Vector of forecasted values
datats <- ts(egg_price_index[,3], start = c(2013, 1), frequency = 12) best_model = best_EXPAR(datats) forecast_EXPAR(best_model, h = 5)
datats <- ts(egg_price_index[,3], start = c(2013, 1), frequency = 12) best_model = best_EXPAR(datats) forecast_EXPAR(best_model, h = 5)
Determines the initial values to be used during parameter estimation.
inital_val(ts_data, order)
inital_val(ts_data, order)
ts_data |
A univarite time series data, to which an EXPAR model is to be fitted. |
order |
Order |
This function determines the initial values required for optimising the parameters of EXPAR model. The initial values are extracted from an ARIMA model with the same order and appropriate differencing. These will act as default initial values in the
optimise_EXPAR()
and best_EXPAR()
functions, unless specified by user. Without these values, the optimisation process may fail.
It returns the initial values of the EXPAR model over which optimisation is to be done parameter estimation.
datats <- ts(egg_price_index[,3], start = c(2013, 1), frequency = 12) inital_val(datats, 2)
datats <- ts(egg_price_index[,3], start = c(2013, 1), frequency = 12) inital_val(datats, 2)
Fits an EXPAR model of given order to the data by RSS minimisation
optimise_EXPAR(ts_data, order, init, opt_method = "BFGS")
optimise_EXPAR(ts_data, order, init, opt_method = "BFGS")
ts_data |
A univarite time series data, to which an EXPAR model of given order is to be fitted. |
order |
Order |
init |
The initial values for optimisation. If omitted, initial values are decided using |
opt_method |
The optimization algorithm to be used for RSS minimization. Corresponds to arguments from |
This function estimates the parameters an EXPAR model by minimizing RSS and returns a fit with the optimised parameters. The fit is returned using the function
fit_EXPAR()
, with the parameters inputted being the optimized ones. Available optimisation techniques include possible arguments from method
in optim()
.
Returns the fitted EXPAR model as a list with the following components,
series |
The data used for fitting the model. |
order |
Order |
n |
Number of observations in |
k |
Number of parameters in the model. |
par |
Parameters of the fitted model. |
Fitted |
Fitted values obtained from the model. |
Residuals |
Residuals of the fitted model. |
RSS |
The residual sum of squares. |
AIC |
Akaike information criterion, evaluated from |
AIC_c |
Corrected Akaike information criterion, evaluated from |
BIC |
Bayesian information criterion, evaluated from |
counts |
|
convergence |
|
message |
|
datats <- ts(egg_price_index[,3], start = c(2013, 1), frequency = 12) optimise_EXPAR(datats, 2, opt_method = "BFGS")
datats <- ts(egg_price_index[,3], start = c(2013, 1), frequency = 12) optimise_EXPAR(datats, 2, opt_method = "BFGS")