Saturday, February 20, 2010

reading in sigma for each data stream at each timestep

At ESA and AGU this year I presented some work I've been doing with Andrew, Dave H and Dan R.

In that work, with a lot of advice from Bill via email, I made some changes to my branch of the repository:
sipnet/branches/moore

These changes require that an extra file FILENAME.sigma be specified which mirrors FILENAME.dat and contains the sigma values for each data point.

/*Difference, version 4 - READS IN SIGMAS (dm) ESTIMATES SIGMA, RETURNS AGGREGATE INFO
Run modelF with given parameters at location loc, compare output with measured data
using data types given by dataTypeIndices[0..numDataTypes-1]
Return a measure of the difference between measured and predicted data
(Higher = worse)

/*Added read in ***sigmas
* removed ***sigma from double difference(double *sigma, ***sigmas, OutputInfo *outputInfo,
*
*/


paramchange.c
21: static double ***sigmas; /* (dm) data uncertainty read in once at start of program
53: /* Difference, version 4 - READS IN SIGMAS (dm) ESTIMATES SIGMA, RETURNS AGGREGATE INFO
70: /*Added read in ***sigmas
71: * removed ***sigma from double difference(double *sigma, ***sigmas, OutputInfo *outputInfo,
100: thisSigma = sigmas[loc][i][dataNum];
103: logLike += log(thisSigma);//(dm) now the individual sigmas for each data point is added to the logLike
522: /* Read measured data (from fileName.dat) and valid fractions (from fileName.valid) into arrays (used to also read sigmas)
597: // (dm) added code to read sigmas for each time step and each data type
598: sigmas = (double ***)malloc(numLocs * sizeof(double **));
600: sigmas[loc] = make2DArray(steps[loc], numDataTypes); // make 2-d array just big enough for known # of time steps in this location
619: readDataLine(in3, oneLine, totNumDataTypes); // read sigmas file
620: // assign sigmas elements appropriately, based on which data types we're using:
622: sigmas[loc][index][i] = oneLine[dataTypeIndices[i]];

No comments:

Post a Comment