#include "inmat.h" #include "predict.h" #include "ds.h" #include char outbuf[130]; char dsn[64]; char outdsn[64]; char logfile[64]; char parmdsn[64]; DOUBLE ltab[1000]; char *ident[255]; char format[130]; int debug=0; int input_type = -1; int outascii=0; char quotechar = '\"'; int labheads=0; short prediction_id[20]; DOUBLE prediction_times[20]; float prediction_sum[30]; int ntimes=0; unsigned char prediction_p_type[10]; int prediction_p_id[10]; float prediction_p_sum[10]; int npred=0; static FILE *f; int main(argc,argv) int argc; char **argv; { int i; if (!lexopen(argv[1],ltab,(DOUBLE *)<ab[LTAB])) exit(1); KeywordInstall(); result = yyparse(); if (result) { printf("Parse was rejected\n"); return 1; } if (yydebug) printf("Parse was accepted\n"); if (debug) { printf("The dataset is %s\n", dsn); printf("The output dataset is %s\n", outdsn); } if (inparm(parmdsn)) mxerror(21,parmdsn); if (input_type==STATAIN) { stata_setup(dsn); } else if(labheads){ result=raw_setup(dsn,format); if (result) mxerror(10,dsn); headread(); } indv_setup(0); if (outascii) { f=fopen(outdsn,"w"); if (!f) mxerror(12,outdsn); fprintf(f," Obs_Num"); for (i=0; i=0) d[idcons] = 1.0; for (j=0; jiii) ? kkk : iii; jj = kkk + iii - j; ik = (k>i)? k:i; /* printf("Updating %d %d %d %d %22.7e %22.7e\n", j*(j+1)/2+jj, ij=(ik*(ik-1))/2+i+k, iii, kkk, d[ii], d[kk], a[ij]); */ cov[j*(j+1)/2+jj] += a[(ik*(ik-1))/2+i+k]*d[ii]*d[kk]; } /* For Bailey-Makeham */ for (j=0; j300.0)p=300.0; p = exp(-esp[0]/esp[1]*(1.0-exp(-p)) - esp[2]*t); prediction_sum[j] = 1.0-p; } if (outascii) { fprintf(f,"%10ld ",nobs); for (j=0; j