目录
💥1 概述
📚2 运行结果
🎉3 参考文献
👨💻4 Matlab代码
💥1 概述
此代码实现了多保真方法来估计方差和全局敏感度指数。当模型具有不确定的输入时,模型输出也是不确定的。基于方差的全局敏感性分析通过将总方差除以由于每个输入和输入之间的相互作用而产生的方差百分比来量化每个不确定输入对输出的相对影响。
主要和总效应敏感性指数可以使用蒙特卡罗估计来估计。为了估计d输入的主效应敏感性指数和总效应敏感性指数,需要对每个蒙特卡罗样本进行(d+2)函数评估,以便在模型昂贵且d较大时,蒙特卡罗估计可能非常昂贵。我们提出了多保真估计器,它将使用昂贵模型计算的一些高保真样本与使用更便宜的代理模型计算的许多低保真样本相结合,以产生固定计算预算的方差估计低于单独使用高保真模型获得的方差估计,同时保持高保真估计的准确性。
📚2 运行结果
🎉3 参考文献
【1】 Xuhui Meng and George Em Karniadakis. A composite neural network that learns from multi- fidelity data: Application to function approximation and inverse pde problems. Journal of Computational Physics, 2019.
【2】 Mohammad Motamed. A multi-fi delity neural network surrogate sampling method for uncertainty quanti fication. 2019.
👨💻4 Matlab代码
主函数部分代码:
%% SETUP
clear
addpath('../mfgsa')
samples = load('samples.mat'); % load pre-computed samples for bootstrapping
d = 5; % dimension of uncertain input
% function definitions that bootstrap from precomputed function outputs
fcns{1} = @(Z) deal(samples.yA(Z,1), samples.yB(Z,1), squeeze(samples.yC(Z,1,:)));
fcns{2} = @(Z) deal(samples.yA(Z,2), samples.yB(Z,2), squeeze(samples.yC(Z,2,:)));
w = [1.94; 6.2e-3]; % assign model weights/costs
vec = [2 2]; % says that functions are bootstrapping
budget = 1000*60; % minutes times seconds
%% COMPUTE MULTIFIDELITY GLOBAL SENSITIVITY ANALYSIS REPLICATES
n_reps = 100; % number of replicates
estim = 'Saltelli'; % which estimator to use -- 'Owen' or 'Saltelli'
% allocate storage
avg = zeros(n_reps,2); vr = zeros(n_reps,2);
mc_sm = zeros(n_reps,d); mc_st = zeros(n_reps,d);
mf_sm = zeros(n_reps,d); mf_st = zeros(n_reps,d);
for n = 1:n_reps
% estimate model statistics using small pilot sample
stats = estimate_statistics(fcns,10,vec);
% call mfsobol.m with just the high-fidelity model to get Monte
% Carlo estimate
[sm,st,mu,sigsq] = mfsobol(fcns(1),d,w(1),stats,budget,vec(1),estim);
avg(n,1) = mu;
vr(n,1) = sigsq;
mc_sm(n,:) = sm;
mc_st(n,:) = st;
% call mfsobol.m with full array of functions to get multifidelity
% estimates
[sm,st,mu,sigsq] = mfsobol(fcns,d,w,stats,budget,vec,estim);
avg(n,2) = mu;
vr(n,2) = sigsq;
mf_sm(n,:) = sm;
mf_st(n,:) = st;
end