forked from esiwgnahz/DGSA
-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_DGSA_Reservoir_Sensitivity_forNPV.m
94 lines (60 loc) · 3.32 KB
/
main_DGSA_Reservoir_Sensitivity_forNPV.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
%% Distance based global sensitivity analysis - Application to reservoir responses
% Part1: Compute main/conditional effects of Prior models
% Author : Jihoon Park (jhpark3@stanford.edu)
% Date : 17 May 2016
clear all; close all; fclose('all'); rng('default');
%% 0. Add directories for path
addpath(genpath(pwd))
%% 1. Specify inputs for DGSA.
addpath(genpath(pwd))
% Loading the NPV information
save_path = 'Y:/mzechner/Projects/BM/Code/Data/PolymerPilotWC_Matlab/';
FileName_dgsa = [save_path 'NPV_dGSA'];
load(FileName_dgsa);
DGSA.ParametersNames = ParameterNames_dgsa;
DGSA.ParametersValues = ParameterMatrix_dgsa;
DGSA.D = Distance_PP_FF;
DGSA.N = size(ParameterMatrix_dgsa,1)
%% 4. Compute & display main effects
% 4.1 Inputs for clustering and display options.
DGSA.Nbcluster=3; % # of clusters
DGSA.MainEffects.Display.ParetoPlotbyCluster=1; % if true, main effects over cluster will be displayed with Pareto plot.
DGSA.MainEffects.Display.StandardizedSensitivity='CI';
% if 'CI', the confidence interval will be overlapped on the Pareto plot
% if 'Pareto', Pareto plots will be displayed only
% if 'None' No plot will be generated for standardd main effects
% (default)
% 4.2 Compute main effects from DGSA.
SigLevel_CI=[.95,.9,1]; % This is needed only when you want to display confidence intervals
% If you do not need to display confidence intervals,set DGSA.MainEffects.Display.StandardizedSensitivity='Preto' or 'None'
% 4.3 Perform clustering
DGSA.Clustering=kmedoids(DGSA.D,DGSA.Nbcluster,10); % In this example, K medoid clustering is applied.
% 4.4 Compute Main Effects
DGSA=ComputeMainEffects(DGSA,SigLevel_CI); % If you use Pareto plot or do not want to display main effects, remove SigLevel_CI, otherwise it shows an error.
%% Display cdfs
cdf_MainFactor(DGSA.ParametersValues, DGSA.Clustering, DGSA.ParametersNames,{'visoil',}); % In this example, CDFs for 'owc' and 'oilvis' will be displayed.
%% 5. Compute & Display conditional effects
% 5.1 Specify additional variables to estimate conditional effects.
DGSA.ConditionalEffects.NbBins=3*ones(1,length(DGSA.ParametersNames));
% 5.2 Compute conditional effects
rng('default');
DGSA=ComputeConditionalEffects(DGSA);
% 5.3 Display conditional effcts
% Speicify the method to display standardized conditional effects.
DGSA.ConditionalEffects.Display.SensitivityByClusterAndBins=1; % if true, display pareto plots to visualize sensitivities by bins/clusters.
DGSA.ConditionalEffects.Display.StandardizedSensitivity='Hplot'; % If omitted Pareto plot will be used. However, this is not recommended when there are lots of parameters
% Visualize conditional effects
DisplayConditionalEffects(DGSA,DGSA.ConditionalEffects.Display.StandardizedSensitivity)
% 5.4 Display class condtional CDFs
cdf_ConditionalEffects('owc','kvkh',DGSA,1)
%% 6. Check the response
% Use MDS plot to check the result of clustering
ClusterColor=DisplayMDSplot(DGSA.D, DGSA.Clustering);
% Specify texts for plots
PlotLabels.xlabtxt='Time (day)'; PlotLabels.ylabtxt='WWPT (stb)';
PlotLabels.xlimits=[0, 7300]; PlotLabels.ylimits=[0 7E7];
% Visualize dynamic response by clusters
dynamicbycluster(DGSA.Clustering,PriorResponses, ClusterColor,PlotLabels);
%% Save all variables for futher application
%save('VariablesSaved/DGSA_Completed.mat');
%save('VariablesSaved/DGSA_Spatial_Completed.mat');