53.8k views
5 votes
IN PYTHON

The second column in the data file globtemp.csv (see attached) are annual global temperature deviations from 1880 to 2004.
a. Fit an ARIMA(p,d,q) model or any other models defined in Python to the data.
b. Perform all of the necessary diagnostics for the model fitted in Part a.
c. After deciding on an appropriate model, forecast (with limits) the next 10 years. Comments
The globtemp.csv file has 3 columns as Date, std, and Mean:
Date std Mean
1880 -0.11 *
1881 -0.13 *
1882 -0.01 -0.14
1883 -0.04 -0.17
1884 -0.42 -0.19
1885 -0.23 -0.28
1886 -0.25 -0.32
1887 -0.45 -0.22
1888 -0.23 -0.22
1889 0.04 -0.28
1890 -0.22 -0.27
1891 -0.55 -0.3
1892 -0.4 -0.37
1893 -0.39 -0.4
1894 -0.32 -0.34
1895 -0.32 -0.29
1896 -0.27 -0.25
1897 -0.15 -0.24
1898 -0.21 -0.18
1899 -0.25 -0.14
1900 -0.05 -0.17
1901 -0.05 -0.2
1902 -0.3 -0.23
1903 -0.35 -0.27
1904 -0.42 -0.29
1905 -0.25 -0.31
1906 -0.15 -0.31
1907 -0.41 -0.28
1908 -0.3 -0.27
1909 -0.31 -0.29
1910 -0.21 -0.28
1911 -0.25 -0.28
1912 -0.33 -0.22
1913 -0.28 -0.16
1914 -0.02 -0.15
1915 0.06 -0.18
1916 -0.2 -0.19
1917 -0.46 -0.2
1918 -0.33 -0.25
1919 -0.09 -0.21
1920 -0.15 -0.14
1921 -0.04 -0.11
1922 -0.09 -0.11
1923 -0.16 -0.11
1924 -0.11 -0.09
1925 -0.15 -0.08
1926 0.04 -0.05
1927 -0.05 -0.07
1928 0.01 -0.05
1929 -0.22 -0.05
1930 -0.03 -0.03
1931 0.03 -0.06
1932 0.04 0
1933 -0.11 -0.01
1934 0.05 -0.02
1935 -0.08 0
1936 0.01 0.05
1937 0.12 0.04
1938 0.15 0.08
1939 -0.02 0.1
1940 0.14 0.1
1941 0.11 0.08
1942 0.1 0.1
1943 0.06 0.07
1944 0.1 0.05
1945 -0.01 0.06
1946 0.01 0.04
1947 0.12 0
1948 -0.03 -0.03
1949 -0.09 -0.04
1950 -0.17 -0.05
1951 -0.02 -0.02
1952 0.03 -0.03
1953 0.12 -0.01
1954 -0.09 -0.04
1955 -0.09 -0.03
1956 -0.18 -0.04
1957 0.08 -0.01
1958 0.1 0
1959 0.05 0.06
1960 -0.02 0.05
1961 0.1 0.04
1962 0.05 -0.02
1963 0.03 -0.04
1964 -0.25 -0.08
1965 -0.15 -0.09
1966 -0.07 -0.12
1967 -0.02 -0.06
1968 -0.09 -0.03
1969 0 -0.03
1970 0.04 -0.04
1971 -0.1 0.01
1972 -0.05 0
1973 0.18 -0.01
1974 -0.06 -0.03
1975 -0.02 0.01
1976 -0.21 -0.01
1977 0.16 0.03
1978 0.07 0.08
1979 0.13 0.21
1980 0.27 0.19
1981 0.4 0.25
1982 0.1 0.25
1983 0.34 0.22
1984 0.16 0.18
1985 0.13 0.23
1986 0.19 0.25
1987 0.35 0.27
1988 0.42 0.34
1989 0.28 0.4
1990 0.49 0.36
1991 0.44 0.31
1992 0.16 0.32
1993 0.18 0.31
1994 0.31 0.3
1995 0.47 0.34
1996 0.36 0.45
1997 0.4 0.47
1998 0.71 0.46
1999 0.43 0.5
2000 0.41 0.56
2001 0.56 0.55
2002 0.7 0.59
2003 0.66 *
2004 0.6 *

User Jzilla
by
8.5k points

1 Answer

3 votes

Final answer:

To fit an ARIMA model to the annual global temperature deviations, one would load the data, check for stationarity, determine ARIMA parameters through ACF and PACF plots, fit the model, perform diagnostics, and forecast with confidence intervals for the next 10 years.

Step-by-step explanation:

Fitting an ARIMA Model to Temperature Data

To fit an ARIMA model to the second column of the globtemp.csv file which contains annual global temperature deviations from 1880 to 2004, we would follow these steps in Python:

  1. Load the dataset using a library such as pandas.
  2. Check the stationarity of the temperature deviation time series. If non-stationary, differentiate the data (d in ARIMA).
  3. Plot the autocorrelation function (ACF) and partial autocorrelation function (PACF) to determine the parameters p and q for the ARIMA model.
  4. Fit the ARIMA model using the determined parameters.
  5. Perform model diagnostics, such as checking the residuals.
  6. Forecast the next 10 years using the fitted model and generate confidence intervals.

Model Diagnostics and Forecasting

Once the ARIMA model is fitted, we would assess its performance by using model diagnostics such as:

  • Examining the residuals to ensure they are normally distributed (which suggests a good fit).
  • Using the Ljung-Box test to check the lack of autocorrelation in residuals.
  • Evaluating the model with criteria like AIC or BIC to compare with other models.

For forecasting, we would use the model to predict future values. Adding confidence intervals to these predictions is crucial to understand the potential range of the forecasts. Package functions typically handle this calculation.

User KasparTr
by
8.0k points