import statsmodels.api as sm # Load data data = sm.datasets.sunspots.load() # Create ARMA model model = sm.tsa.ARMA(data.endog, (2,1)).fit() # Get model summary summary = model.summary()
import pandas as pd import statsmodels.api as sm # Load data data = pd.read_csv('sales_data.csv', index_col=0) # Create ARMA model model = sm.tsa.ARMA(data, (1,0)).fit() # Get model summary summary = model.summary()In this example, we load sales data from a CSV file using pandas. Then we create an ARMA(1,0) model and fit it to the data. Finally, we get the summary of the fitted model. Package library: Python statsmodels.