• Non ci sono risultati.

MODELLI ARIMA IN SAS ESEMPIO: DECESSI NEL COMUNE DI GENOVA

N/A
N/A
Protected

Academic year: 2021

Condividi "MODELLI ARIMA IN SAS ESEMPIO: DECESSI NEL COMUNE DI GENOVA"

Copied!
12
0
0

Testo completo

(1)

MODELLI ARIMA IN SAS

ESEMPIO: DECESSI NEL COMUNE DI GENOVA

proc arima data=a.tot9102;

identify var=decessi nlag=400 outcov=pluto;

run;quit;

goption reset=(all) htitle=1.5 ftext=SWISSB; symbol7 i=needle ;

axis20 order=-0.5 to 0.5 by 0.1 label=(angle=90); axis21 order=-0.1 to 0.1 by 0.1label=(angle=90);

proc gplot data=pluto;

title 'correlation decessi - dati grezzi fino 2002';

plot corr*lag=7/ vaxis=axis20;

plot partcorr*lag=7/ vaxis=axis20;

run;quit; title ' ';

(2)

proc arima data=a.tot9102;

identify var=decessi (365) nlag=400 outcov=pluto;

run;quit;

proc gplot data=pluto;

title 'correlation decessi - dati differenziati di 365 fino 2002';

plot corr*lag=7/ vaxis=axis20;

plot corr*lag=7/ vaxis=axis21;

plot partcorr*lag=7/ vaxis=axis20;

plot partcorr*lag=7/ vaxis=axis21;

run;quit; title ' ';

(3)

The ARIMA Procedure Name of Variable = Decessi

Period(s) of Differencing 365 Mean of Working Series -0.23245 Standard Deviation 7.769272 Number of Observations 4018 Observation(s) eliminated by differencing 365 Autocorrelations

Lag Covariance Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 Std Error 0 60.361595 1.00000 | |********************| 0 1 5.189344 0.08597 | .|** | 0.015776 2 6.349836 0.10520 | .|** | 0.015892 3 7.353399 0.12182 | .|** | 0.016064 4 6.428958 0.10651 | .|** | 0.016293 5 4.464818 0.07397 | .|* | 0.016465

(OMISSIS)

(4)

Partial Autocorrelations

Lag Correlation -1 9 8 7 6 5 4 3 2 1 0 1 2 3 4 5 6 7 8 9 1 1 0.08597 | .|** | 2 0.09853 | .|** | 3 0.10702 | .|** | 4 0.08198 | .|** | 5 0.04139 | .|* | 6 0.05128 | .|* | 7 0.03692 | .|* |

(OMISSIS)

Autocorrelation Check for White Noise To Chi- Pr >

Lag Square DF ChiSq ---Autocorrelations--- 6 231.18 6 <.0001 0.086 0.105 0.122 0.107 0.074 0.086 12 313.89 12 <.0001 0.073 0.067 0.071 0.028 0.046 0.053 18 365.47 18 <.0001 0.069 0.045 0.052 0.035 0.035 0.028 24 383.56 24 <.0001 0.030 0.038 0.042 0.006 -0.001 0.016 30 387.63 30 <.0001 0.004 0.013 0.011 0.008 0.005 0.024 36 398.84 36 <.0001 0.008 0.025 0.014 0.033 0.019 0.021 42 404.35 42 <.0001 0.026 -0.007 0.011 -0.001 0.023 0.002 48 419.62 48 <.0001 -0.020 0.007 0.015 -0.018 0.001 -0.052 54 427.89 54 <.0001 -0.018 -0.020 -0.019 -0.008 -0.022 -0.021 60 433.60 60 <.0001 0.003 -0.017 -0.003 -0.024 -0.008 -0.021 66 460.59 66 <.0001 -0.041 0.035 -0.009 0.032 0.030 -0.040 72 471.05 72 <.0001 -0.015 -0.034 -0.030 -0.001 -0.012 0.012 78 475.50 78 <.0001 0.007 -0.020 0.007 -0.003 -0.008 -0.022 84 477.46 84 <.0001 0.000 -0.000 -0.001 -0.004 0.016 0.014 90 485.21 90 <.0001 0.007 0.019 0.003 0.026 -0.028 -0.007 96 500.19 96 <.0001 0.018 -0.015 -0.029 0.048 0.000 0.003 102 504.52 102 <.0001 0.020 -0.023 0.010 0.004 0.002 0.004 108 522.92 108 <.0001 -0.037 -0.020 -0.027 0.039 0.009 -0.020 114 534.56 114 <.0001 0.015 -0.014 0.015 -0.014 -0.038 -0.023

(OMISSIS)

(5)

proc arima data=a.tot9102;

identify var=decessi(365) nlag=400 noprint outcov=pluto;

estimate p=(1) q=(1)(365) ; run;quit;

The ARIMA Procedure

Conditional Least Squares Estimation

Standard Approx

Parameter Estimate Error t Value Pr > |t| Lag MU -0.22041 0.06199 -3.56 0.0004 0 MA1,1 0.84651 0.02451 34.54 <.0001 1 MA2,1 0.74915 0.01108 67.63 <.0001 365 AR1,1 0.92223 0.01786 51.64 <.0001 1 Constant Estimate -0.01714

Variance Estimate 37.68492 Std Error Estimate 6.138805 AIC 25988.96 SBC 26014.15 Number of Residuals 4018

* AIC and SBC do not include log determinant.

Correlations of Parameter Estimates

Parameter MU MA1,1 MA2,1 AR1,1 MU 1.000 -0.001 0.002 -0.002 MA1,1 -0.001 1.000 -0.002 0.940 MA2,1 0.002 -0.002 1.000 -0.010 AR1,1 -0.002 0.940 -0.010 1.000 Autocorrelation Check of Residuals To Chi- Pr >

Lag Square DF ChiSq ---Autocorrelations--- 6 2.49 3 0.4763 -0.014 0.014 0.010 -0.007 -0.003 0.009 12 6.74 9 0.6646 -0.012 0.006 0.004 -0.029 -0.000 -0.004 18 9.66 15 0.8404 0.010 0.009 0.016 0.006 0.013 -0.009 24 13.50 21 0.8900 -0.013 0.027 0.000 0.004 -0.004 -0.001 30 15.84 27 0.9560 -0.013 -0.010 -0.006 -0.005 -0.015 -0.004 36 17.46 33 0.9879 -0.005 0.003 -0.003 0.016 -0.008 0.007 42 21.44 39 0.9899 0.010 -0.005 0.006 -0.019 0.016 0.014 48 31.13 45 0.9422 -0.023 0.006 -0.000 -0.005 0.005 -0.042 54 35.20 51 0.9551 -0.012 -0.021 -0.012 0.006 0.013 -0.009

(OMISSIS)

354 378.18 351 0.1525 0.009 -0.010 0.003 -0.027 0.006 0.006 360 385.53 357 0.1434 0.009 -0.006 0.020 -0.034 0.003 -0.000 366 399.45 363 0.0910 -0.030 -0.026 0.028 0.006 -0.011 0.025 372 404.11 369 0.1006 0.000 -0.017 -0.022 0.012 -0.007 0.009 378 407.80 375 0.1173 -0.010 -0.009 0.001 0.005 -0.023 -0.010 384 417.71 381 0.0945 0.011 0.014 0.012 0.005 0.015 -0.039 390 425.87 387 0.0843 0.005 -0.021 0.022 0.018 0.009 -0.021 396 429.32 393 0.1000 -0.016 -0.007 -0.002 -0.004 -0.008 0.020 Model for variable Decessi

Estimated Mean -0.22041 Period(s) of Differencing 365 Autoregressive Factors

Factor 1: 1 - 0.92223 B**(1) Moving Average Factors Factor 1: 1 - 0.84651 B**(1) Factor 2: 1 - 0.74915 B**(365)

(6)

ALTRI MODELLI

proc arima data=a.tot9102;

identify var=decessi(365) nlag=400 noprint outcov=pluto;

estimate p=(1) q=(1)(364,365,366) ; run;quit;

The ARIMA Procedure

Conditional Least Squares Estimation

Standard Approx

Parameter Estimate Error t Value Pr > |t| Lag MU -0.22051 0.06600 -3.34 0.0008 0 MA1,1 0.84684 0.02430 34.86 <.0001 1 MA2,1 -0.0003287 0.01110 -0.03 0.9764 364 MA2,2 0.74930 0.01109 67.56 <.0001 365 MA2,3 -0.02274 0.01110 -2.05 0.0406 366 AR1,1 0.92286 0.01765 52.29 <.0001 1

proc arima data=a.tot9102;

identify var=decessi(365) nlag=400 noprint outcov=pluto;

estimate p=(1,2) q=(1)(365) ; run;quit;

The ARIMA Procedure

Conditional Least Squares Estimation

Standard Approx

Parameter Estimate Error t Value Pr > |t| Lag MU -0.22039 0.06108 -3.61 0.0003 0 MA1,1 0.82904 0.03029 27.37 <.0001 1 MA2,1 0.74867 0.01109 67.53 <.0001 365 AR1,1 0.89121 0.03400 26.21 <.0001 1 AR1,2 0.02073 0.01861 1.11 0.2653 2

proc arima data=a.tot9102;

identify var=decessi(365) nlag=400 noprint outcov=pluto;

estimate p=(1) q=(1,2)(365) ; run;quit;

The ARIMA Procedure

Conditional Least Squares Estimation

Standard Approx

Parameter Estimate Error t Value Pr > |t| Lag MU -0.22039 0.06108 -3.61 0.0003 0 MA1,1 0.85141 0.02560 33.26 <.0001 1 MA1,2 -0.01857 0.01713 -1.08 0.2784 2 MA2,1 0.74868 0.01109 67.53 <.0001 365 AR1,1 0.91390 0.02028 45.06 <.0001 1

(7)

FORECAST

proc arima data=a.tot9102;

identify var=decessi(365) nlag=400 noprint outcov=pluto;

estimate p=(1) q=(1)(365) ;

forecast lead=365 out=prev_d_t id=g interval=day noprint;

run;quit;

data prev_d_t2; merge prev_d_t a.totale; by g;run;

axis9 label=none;

axis10 order=('01jan2003'd to '01jan2004'd by quarter) label=none MAJOR=(HEIGHT=.1);

axis12 order=('01jul2003'd to '01sep2003'd by week) ; /*....*/

symbol1 c=red i=j l=1 v=dot h=0.5; symbol2 c=blue i=j l=1 v=dot h=0.5;

symbol3 c=green i=j l=1 v=none; symbol4 c=blue i=j l=1 v=none;

title 'decessi - forecast';

proc gplot data=prev_d_t2;

plot decessi*g=1 /*forecast*g=2*/ l95*g=3 u95*g=4/overlay haxis=axis10;

plot decessi*g=1 /*forecast*g=2*/ l95*g=3 u95*g=4/overlay haxis=axis12;

/*....*/

run;quit;

(8)

ESEMPIO: SCARTO ASSOLUTO DALLA MEDIA DELLE TEMPERATURE

proc arima data=a.tot9102;

identify var= t_min_scartoa nlag=400 outcov=pippo;

run;quit;

proc gplot data= pippo;

title 'correlation temperature - dati grezzi fino 2002';

plot corr*lag=7/ vaxis=axis20;

plot partcorr*lag=7/ vaxis=axis20;

run;quit; title ' ';

(9)

title 'scarto assoluto dalla media delle temperature minime';

proc arima data=a.tot9102;

identify var=t_min_scartoa(1,365) nlag=400 noprint outcov=pippo ; estimate p=(1,2,3) q=(2)(365) ;

forecast lead=365 out=prev_t id=g noprint interval=day;

run;quit;

The ARIMA Procedure

Name of Variable = t_min_scartoa Mean of Working Series 5.16058 Standard Deviation 3.110429 Number of Observations 4383 Autocorrelation Check for White Noise To Chi- Pr >

Lag Square DF ChiSq ---Autocorrelations--- 6 9999.99 6 <.0001 0.833 0.742 0.678 0.635 0.597 0.571 12 9999.99 12 <.0001 0.543 0.524 0.505 0.492 0.477 0.462 18 9999.99 18 <.0001 0.443 0.428 0.418 0.404 0.385 0.367 24 9999.99 24 <.0001 0.349 0.340 0.332 0.321 0.309 0.303 30 9999.99 30 <.0001 0.286 0.271 0.260 0.241 0.226 0.209 36 9999.99 36 <.0001 0.190 0.176 0.157 0.140 0.122 0.109 42 9999.99 42 <.0001 0.096 0.084 0.073 0.055 0.035 0.018 48 9999.99 48 <.0001 0.006 -0.004 -0.014 -0.026 -0.040 -0.051 54 9999.99 54 <.0001 -0.059 -0.069 -0.084 -0.093 -0.109 -0.125 60 9999.99 60 <.0001 -0.139 -0.156 -0.175 -0.193 -0.208 -0.221 Conditional Least Squares Estimation

Standard Approx

Parameter Estimate Error t Value Pr > |t| Lag MU -0.0006338 0.0003855 -1.64 0.1002 0 MA1,1 0.98049 0.0046012 213.10 <.0001 2 MA2,1 0.72378 0.01159 62.44 <.0001 365 AR1,1 -0.34986 0.01573 -22.24 <.0001 1 AR1,2 0.72552 0.01362 53.26 <.0001 2 AR1,3 0.08746 0.01599 5.47 <.0001 3 Constant Estimate -0.00034

Variance Estimate 3.600917 Std Error Estimate 1.897608 AIC 16552.28 SBC 16590.07 Number of Residuals 4017 * AIC and SBC do not include log determinant.

Correlations of Parameter Estimates

Parameter MU MA1,1 MA2,1 AR1,1 AR1,2 AR1,3 MU 1.000 -0.019 -0.035 -0.000 -0.011 -0.005 MA1,1 -0.019 1.000 -0.005 0.010 0.456 0.173 MA2,1 -0.035 -0.005 1.000 0.004 0.022 0.018 AR1,1 -0.000 0.010 0.004 1.000 0.338 -0.687 AR1,2 -0.011 0.456 0.022 0.338 1.000 0.408 AR1,3 -0.005 0.173 0.018 -0.687 0.408 1.000

(10)

Autocorrelation Check of Residuals To Chi- Pr >

Lag Square DF ChiSq ---Autocorrelations--- 6 12.04 1 0.0005 -0.003 -0.028 -0.016 0.026 0.006 0.035 12 23.94 7 0.0012 0.013 0.015 0.010 0.026 0.035 0.024 18 30.39 13 0.0041 -0.005 -0.008 0.024 0.020 0.005 -0.023 24 36.83 19 0.0083 -0.022 -0.017 0.001 -0.005 -0.022 0.018 30 42.50 25 0.0159 -0.012 -0.015 0.026 -0.020 -0.002 0.001 36 47.33 31 0.0305 -0.014 0.000 -0.028 -0.004 -0.012 -0.008 42 57.62 37 0.0165 -0.007 -0.012 0.017 -0.005 -0.028 -0.036 48 61.89 43 0.0309 -0.010 -0.005 -0.004 -0.007 -0.022 -0.020 54 63.15 49 0.0842 0.008 0.002 -0.006 0.013 0.006 -0.001 60 68.93 55 0.0982 0.018 0.003 -0.022 -0.023 -0.004 -0.008 66 84.28 61 0.0259 -0.009 -0.031 0.026 -0.001 0.043 -0.014 72 88.41 67 0.0410 -0.019 0.010 -0.003 -0.007 0.019 0.010 78 95.09 73 0.0423 0.015 0.014 0.001 0.024 -0.015 0.020 84 99.70 79 0.0578 -0.011 -0.004 0.013 -0.013 0.024 0.008 90 109.25 85 0.0394 -0.019 0.021 0.027 0.024 0.002 -0.014 96 116.44 91 0.0373 -0.025 0.017 0.004 -0.020 0.019 0.006 102 124.05 97 0.0334 -0.006 0.003 0.016 -0.007 -0.032 0.022 108 124.53 103 0.0732 -0.003 -0.004 -0.005 0.002 0.008 -0.000 114 136.96 109 0.0362 0.010 0.007 -0.044 -0.026 0.016 -0.004 120 138.02 115 0.0707 -0.002 -0.007 -0.013 0.004 0.000 -0.004 126 144.24 121 0.0735 -0.017 -0.026 0.011 -0.014 -0.011 -0.011 132 149.00 127 0.0886 0.019 -0.017 0.010 -0.009 0.002 0.018 138 151.03 133 0.1357 0.002 -0.000 0.013 0.003 -0.010 0.015 144 153.16 139 0.1944 0.005 -0.008 -0.003 0.012 0.013 0.010 150 159.19 145 0.1986 -0.025 0.007 -0.008 0.026 -0.002 0.006

Model for variable t_min_scartoa Estimated Mean -0.00063 Period(s) of Differencing 1,365

Autoregressive Factors

Factor 1: 1 + 0.34986 B**(1) - 0.72552 B**(2) - 0.08746 B**(3)

Moving Average Factors Factor 1: 1 - 0.98049 B**(2) Factor 2: 1 - 0.72378 B**(365)

(11)

ESEMPIO: DECESSI CON INPUT

SCARTO ASSOLUTO DALLA MEDIA DELLE TEMPERATURE MINIME

/*CROSSCORRELAZIONI CON DATI PREWHINTED*/

title 'decessi con input scarto assoluto dalla media delle temperature minime';

proc arima data=a.tot9102;

identify var=t_min_scartoa(1,365) nlag=400 noprint outcov=pippo ; estimate p=(1,2,3) q=(2)(365) ;

identify var=decessi(365) nlag=400 crosscorr=t_min_scartoa(365) noprint outcov=pluto;

estimate p=(1) q=(1)(365) input=((2)t_min_scartoa);

forecast lead=365 out=prev_d_t id=g interval=day noprint;

run;quit;

data prev_d_t2; merge prev_d_t a.totale; by g;run;

proc gplot data=pluto;

title 'Crosscorrelation decessi / temperature minime scarto - dati prewhinted ';

where crossvar ne ' ';

plot corr*lag=7/ vaxis=axis21;

run;quit; title ' ';

title 'decessi con input scarto ass. dalla media delle temp minime';

proc gplot data=prev_d_t2;

plot decessi*g=1 /*forecast*g=2*/ l95*g=3 u95*g=4/overlay haxis=axis12;

/*....*/

run;quit;

(12)

Riferimenti

Documenti correlati

Le tavole contengono in prevalenza dati assoluti; sono stati anche calcolati alcuni indicatori demografici (ad esempio, a livello regionale, la speranza di vita a O

[r]

In the simplest case of AR(1) models, we have proved the stationarity (with suitable variance of the initial condition) when the parameter satis…es j j &lt; 1.. In general, there

163/2006 PER L’AFFIDAMENTO DEI SERVIZI TIPOGRAFICI DI INDIRE ED ERASMUS+ PER LA DURATA DI 4 (QUATTRO) ANNI [CIG ACCORDO QUADRO: 6244300F5B] PER LA FORNITURA DI MATERIALE

Si vuole stabilire se esiste una dipendenza fra il flusso di un corso d’acqua (cioè la quantità di acqua che passa in un minuto) e la profondità del corso d’acqua.. Per ottenere

Come sempre, nella costruzione di un modello si cerca un compromesso tra l’aderenza del modello alla realt` a fisica e la semplicit` a del modello stesso: pi` u i compartimenti

Acquisire informazioni dettagliate e operative sulle principali attività amministrative e di controllo di una società che offre servizi di elaborazione dati contabili

(2) Per x negativo 1/x assume valori negativi: valori negativi quanto si voglia piccoli in valore assoluto per x negativo abbastanza grande in valore assoluto (1/x ha limite 0 − per