/* tsdiff.c CCMATH mathematics library source code. * * Copyright (C) 2000 Daniel A. Atkinson All rights reserved. * This code may be redistributed under the terms of the GNU library * public license (LGPL). ( See the lgpl.license file for details.) * ------------------------------------------------------------------------ */ /* Test: sdiff sintg Input parameters: n_diff -> integer: order of differencing and integration bin_file -> name of binary series input file [ created by garma ] */ #include "ccmath.h" void main(int na,char **av) { double *y,*d,z; int j,n,nd; FILE *fp; if(na!=3){ printf("para: n_diff bin_file\n"); exit(-1);} nd=atoi(*++av); fp=fopen(*++av,"rb"); printf(" Test of Time Series Differencing and Integration\n"); printf(" model file: %s\n",*av); printf(" difference/integration order= %d\n",nd); fread((void *)&n,sizeof(int),1,fp); y=(double *)calloc(2*n,sizeof(double)); d=y+n; fread((void *)y,sizeof(double),n,fp); /* difference the series */ for(j=0; j