/* nag_arma_time_series(g05hac) Example Program * * Copyright 1992 Numerical Algorithms Group. * * Mark 3, 1992. */ #include #include #include #include #define NA 3 #define NB 2 #define NR 20 #define NW 10 int main(void) { Integer i, ip, iq, n; double phi[NA], theta[NB], w[NW]; double mean, vara; double ref[NR]; Boolean start; Integer seed = 0; Vprintf("g05hac Example Program Results\n\n"); g05cbc(seed); ip = 2; iq = 0; n = NW; phi[0] = 0.4; phi[1] = 0.2; mean = 0.0; vara = 2.0; /* Generate an ARMA series with 5 terms */ start = TRUE; g05hac(start, ip, iq, phi, theta, mean, vara, (Integer)5, w, ref, NAGERR_DEFAULT); /* Add further 5 terms to the previous series*/ start = FALSE; g05hac(start, ip, iq, phi, theta, mean, vara, (Integer)5, &w[5], ref, NAGERR_DEFAULT); for (i = 0; i < n; ++i) Vprintf("%12.4f \n", w[i]); return EXIT_SUCCESS; }