Skip to content
D

delta-arfima

Project ID: 452

DELTA (Data Panel dan Time Series) adalah sebuah aplikasi statistik yang dibangun pada tahun 2017. Project ini merupakan pengembangan modul ARFIMA pada aplikasi DELTA.

DELTA: ARFIMA Module

Data Panel dan Time Series DELTA is a statistical analysis application built to analyze panel and time series type of data. Time series often used to forecast data. One of the time series modelling forecasting method is Autoregressive Fractionally Integrated Moving Average (ARFIMA), a modelling method for handling non stationary data with short memory, long memory or long range dependence (LRD), or both.

Feature

  1. Forecasting with Modelling method: AR, MA, ARMA, ARIMA, ARFIMA.
  2. Auto fractional differencing: Periodogram Estimator/Geweke Porter-Hudak (GPH) and Smoothed Periodogram (Sperio) estimator.

Installation

User Manual

  1. After installing DELTA.exe, start DELTA application.
  2. Click Folder icon or File -> Open to import data.
  3. Click browse and a smaller window will show up, choose the file you wanted to import then click Open, the smaller window will be closed. Click Ok to import the file.
  4. Click Analysis menu -> ARFIMA.
  5. Choose the variable, input ARFIMA specification (AR(p), Differencing/Fractional differencing(d), Moving Average(q)).
  6. If you're not sure of the d parameter value, check the Auto fractional differencing, choose one of the method.
  7. Check Forecast to forecast the data, input the forecasting period(s).
  8. Type in the Output Name and check the Save predict value to save the predicted data in the main window as a new variable.
  9. Check the Forecast graph to generate a graph of actual and forecast data.
  10. Click OK.

Programming Language

  • Python 3.5
  • R 2.7

Package Requirement

  • numpy
  • math
  • statsmodels
  • matplotlib

Development Tools

  • IDE: Jetbrain PyCharm vers. 2017.1
  • GUI designer: Qt Designer from PyQt5

GUI Development

  1. Open Qt Designer.
  2. Design the GUI.
  3. Save the design as .ui.
  4. Conver .ui into .py through command prompt.
    pyuic5 -x [your .ui file] -o [your .py file]

Code Sample

  • Fractional differencing GPH
 def fracdiffgph(self):
    self.x = np.squeeze(np.asarray(self.x))
    g = int(np.floor(self.n ** self.bandw_exp))
    p = [i for i in range(0, g)]
    j = np.array(p)
    kk = [i for i in range(0, self.n - 1)]
    w = 2 * math.pi * (j + 1) / self.n
    mx = np.mean(self.x)
    var_x = np.sum(((self.x - mx) ** 2) / self.n)
    cov_x = []
    for k in kk:
        k = k + 1
        cov_x.append(np.sum((self.x[:(self.n - k)] - mx) * (self.x[(k):(self.n)] - mx)) / self.n)
    cov_x = np.array(cov_x)
    periodogram = []
    kk = np.array(kk)
    for i in range(0, g):
        cos = []
        for k in kk:
            k = k + 1
            cos.append(math.cos(w[i] * (k)))
        periodogram.append(var_x + 2 * np.sum(cov_x * cos))
    pos = []
    for i in range(0, len(periodogram)):
        if periodogram[i] > 0:
            pos.append(j[i])
    y_reg = []
    x_reg = []
    for i in range(0, len(pos)):
        y_reg.append(np.log(periodogram[pos[i]] / (2 * math.pi)))
        x_reg.append(2 * np.log(2 * math.sin(w[pos[i]] / 2)))
    y_reg = np.transpose(np.matrix((y_reg)))
    x_reg2 = np.transpose(np.matrix((x_reg)))
    x_reg = np.concatenate((np.ones((np.shape(x_reg2)[0], 1)), x_reg2), 1)
    d_gph = np.linalg.inv(np.matrix.transpose(x_reg) * x_reg) * (
            np.matrix.transpose(x_reg) * y_reg)
    d_gph2 = d_gph[1]
    x_r2 = np.transpose(x_reg2 - np.mean(x_reg2)) * (
            x_reg2 - np.mean(x_reg2))
    var_d = math.pi ** 2 / (6 * x_r2)
    res = y_reg - (x_reg * d_gph)
    var_reg = np.transpose(res) * res / ((g - 1) * x_r2)
    out = np.squeeze([-d_gph2, np.sqrt(var_d), np.sqrt(var_reg)])
    return out[0]

Main Architecture

Screenshoot

Authors

Karisma R. Muthmainnah