module load cmake
module load anaconda/4.4.0
module load expat
module load netlib-lapack/3.8.0-tb3ivhl
mkdir build
git clone git@github.com:sandialabs/UQTk.git
cd UQTk/config/
cp config-gcc-Python.sh config-gcc-Python_PyUQTk_OFF.sh
vi config-gcc-Python_PyUQTk_OFF.sh
- Modifcations for
config-gcc-Python_PyUQTk_OFF.sh:PyUQTk=OFFUQTK_SRC_DIR=../UQTk# replace UQTk-SNL with UQTk
cd ../../build
../UQTk/config/config-gcc-Python_PyUQTk_OFF.sh
make -j 8
ctest
make install
vi ~/.bash_prfile
- Edit your .bash_profile to add the following two lines:
PATH=$PATH:/home/userid/UQTk-install/bin
export UQTK_INS=/home/userid/UQTk-install
- Use the UQTk toolkit for performing developing surrogate models, sensitivity analysis, and calibration.
- UQTk script -
UQTk/examples/iuq/workflow.x. - Input files required:
ytrain.dat- nrow=0.8*nsamples, ncols= 365*num_QoIs; Model evaluations at training samplesptrain.dat- nrow=0.8*nsamples, ncols=num of parameters for calibrationyval.dat- nrow=0.2*nsamples, ncols= 365*num_QoIs; Model evaluations at validation samplespval.dat- nrow=0.2*nsamples, ncols=num of parameters for calibrationprange.dat:d x 2Parameter physical rangespnames.txt:d x 1List of parameter namesoutnames.txt:L x 1List of output names- Note - 365 is used in my examples since I am calibrating daily values. Replace 365 with 12 if calibrating monthly values.
- Note - Scripts for generating ytrain.dat are included in this repo. Use the shell script to run the scripts and generate
ytrain.dat,yval.dat,ptrain.dat, andpval.dat)
-
File location:
UQTk/examples/iuq/workflow.x -
Step 1a: Prepare ensemble of model simulations.
-
Step 1b: Build surrogates for each output given ensemble of simulations. Output:
results.pk
-
Step 1c: Sample plotting examples, relying on
results.pk. Main outputs:sens_main.epssens_total.eps
-
Step 1d: Reads
results.pkto generate surrogate multiindex and coefficient text files, as well as estimated surrogate error file that will be used for inference. Outputs:surr_errors.datpccfp.X_all.datmindexp.X_all.dat
-
Step 2a: Prepare observational/experimental data for inference. Outputs:
xdata_all.txt:- nrows= 365*num_QoIs, ncols=2
- first column is day number and second column contains QoI number e.g., 0, 1, 2 for three QoIs.
ydata_all.txt:- nrows= 365*num_QoIs, ncols=1
- Data values
dataerr_all.dat:- nrows= 365*num_QoIs, ncols=1
- Standard deviation measure of the data. Often using surrogate error as a placeholder
ind_calib.dat:- nrows= 365*num_QoIs, ncols=1
- Masking array of 0's and 1's to indicate which data points are to be used for inference (1 for data point to be used for calibration)
- This file can be generated by
awk ‘$2==0{print 1}; $2!=0{print 0}’ xdata_all.txt > ind_calib.dat. i.e., use all data points for first QoIs and none for the other two.
-
Step 2b: Select observational/experimental data and run inference (preparing and running calibration).
fixindnom.dat- this file should contain ids of parameters that should be fixed at the nominal values. All other parameters are calibrated. So for example, if there are total of 18 parameters but we want to calibrate only five of them (5, 12,13, 15, 16 (counting from 0)). Thenfixindnom.datshould look like:
0 0.0
1 0.0
2 0.0
3 0.0
4 0.0
6 0.0
7 0.0
8 0.0
9 0.0
10 0.0
11 0.0
14 0.0
17 0.0
- Step 2c: Sample plotting, relying on outputs of model inference. Main outputs:
fit_shade.epspdf_tri.eps