1

In MATLAB, we can specify an ARIMA(p, D, q) model with known parameter values by using the following function

enter image description here

tdist = struct('Name','t','DoF',10);
model = arima('Constant',0.4,'AR',{0.8,-0.3},'MA',0.5,...
                        'D',1,'Distribution',tdist,'Variance',0.15)

In Python or R, Can I do this to build my own model?

After that, I need use this model to predict my dataset

enter image description here

In Python or R, Can I do this?

Tung Kieu
  • 79
  • 9
  • type `help("arima")` in R. It has a `predict` method. – shayaa Oct 20 '16 at 07:43
  • Python: Build model(http://statsmodels.sourceforge.net/devel/generated/statsmodels.tsa.arima_model.ARIMA.html) and predict(http://statsmodels.sourceforge.net/devel/generated/statsmodels.tsa.arima_model.ARIMA.predict.html#statsmodels.tsa.arima_model.ARIMA.predict) with your params. – su79eu7k Oct 20 '16 at 15:58
  • When you build model you have to choose the order parameter (lag) and after fit() the result is the model that contains coefficients, However, we can't choose own coefficients to build model @su79eu7k – Tung Kieu Oct 21 '16 at 02:36
  • In python, you can choose anything if you want. Please check the answer below. @TùngKiềuVũThanh – su79eu7k Oct 21 '16 at 05:10

1 Answers1

1

Python StatsModels example below.

In.

test_model = sm.tsa.ARIMA(test_data['log_PI'], [1, 1, 0]).fit()
test_model.params

Out.

const             0.001166
ar.L1.D.log_PI    0.593834
dtype: float64

In.

_ = test_model.plot_predict(end="2016-12")

Out.

enter image description here

In.

# Constant param change
test_model.params.const = 0.02
# test_model.params[0] = 0.02

# AR params change
# test_model.params[1] = 0.9
# test_model.arparams[0] = 0.9

_ = test_model.plot_predict(end="2016-12")

Out.

enter image description here

su79eu7k
  • 7,031
  • 3
  • 34
  • 40