/* txmean.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: xmean Input parameter: bin_file -> name of binary ARMA series file [ created by garma ] */ #include "ccmath.h" void main(int na,char **av) { double *x,*y,xm,x0; int nm,n,j; FILE *fp; if(na!=2){ printf("para: bin_file\n"); exit(-1);} fp=fopen(*++av,"rb"); fread((void *)&nm,sizeof(int),1,fp); x=(double *)calloc(2*nm,sizeof(double)); n=fread((char *)x,sizeof(double),nm,fp); if(n!=nm){ printf("I/O error\n"); exit(1);} printf(" Test of ARMA Series Mean Extraction\n"); printf(" model file: %s\n",*av); for(j=0,y=x+n,x0=0.; j