27
. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres François Bachoc Josselin Garnier Jean-Marc Martinez CEA-Saclay, DEN, DM2S, STMF, LGLS, F-91191 Gif-Sur-Yvette, France LPMA, Université Paris 7 Septembre 2012 . Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 1/27 .

Validation de codes de calcul - Validation croisée pour l

  • Upload
    others

  • View
    7

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Validation de codes de calcul - Validation croisée pour l

.

Validation de codes de calcul - Validation croiséepour l’estimation d’hyper-paramètres

François BachocJosselin Garnier

Jean-Marc Martinez

CEA-Saclay, DEN, DM2S, STMF, LGLS, F-91191 Gif-Sur-Yvette, FranceLPMA, Université Paris 7

Septembre 2012

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 1/27 .

Page 2: Validation de codes de calcul - Validation croisée pour l

.The PhD

Two components of the PhDI Use of Kriging model for code validation

Bachoc F, Bois G, and Martinez J.M, Gaussian process computermodel validation method, Submitted.

I Work on the problem of the covariance function estimation

Bachoc F, Cross Validation and Maximum Likelihood estimationsof hyper-parameters of Gaussian processes with modelmisspecification, Submitted.

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 2/27 .

Page 3: Validation de codes de calcul - Validation croisée pour l

.

Kriging for code validationStatistical model and method studiedConclusion

Cross Validation for hyper-parameters estimationContext on Cross ValidationCase of a single variance parameter estimationConclusion

Current work and prospects

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 3/27 .

Page 4: Validation de codes de calcul - Validation croisée pour l

.Numerical code and physical system

A numerical code, or parametric numerical model, is represented by afunction f :

f : Rd × Rm → R(x , β) → f (x , β)

Observations can be made of a physical system Yreal

xi → Yreal → yi

I The inputs x are the experimental conditionsI The inputs β are the calibration parameters of the numerical codeI The outputs f (xi , β) and yi are the variable of interest

A numerical code modelizes (gives an approximation of) a physical system

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 4/27 .

Page 5: Validation de codes de calcul - Validation croisée pour l

.Statistical model (1/2)

Statistical model followed in the phd

I The physical system Yreal is a deterministic functionI There exist a correct parameter β and a model error function Z so that

Yreal (x) = f (x , β) + Z (x)

I The observations are noised Yi = Yreal (xi ) + εi , where εi are i.i.dcentered Gaussian variables

The model is different from other classical models for inverse problemswhere

I Yi = f (xi , βi ) + εi . The βi are i.i.d realizations of the random vector βI Hence the physical system is random

Fu S, An adaptive kriging method for characterizing uncertainty ininverse problems, Journée du GdR MASCOT-NUM - 23 mars 2011.

de Crécy A, A methodology to quantify the uncertainty of the physicalmodels of a code, Rapport CEA DEN/DANS/DM2S/STMF.

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 5/27 .

Page 6: Validation de codes de calcul - Validation croisée pour l

.Statistical model (2/2)

I Z is modeled as the realization of a centered Gaussian processI A Bayesian modelling is possible for the correct parameter β

I no prior information case. β is constant and unknownI prior information case. β is the realization of a Gaussian vectorN (βprior ,Qprior )

I Linear approximation of the code w.r.t β

f (x , β) =mX

j=1

hj (x)βj

Eventually, the statistical model is a Kriging model

Yi =mX

j=1

hj (xi )βj + Z (xi ) + εi

Hence calibration and prediction are carried out within the Kriging framework

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 6/27 .

Page 7: Validation de codes de calcul - Validation croisée pour l

.Results with the thermal-hydraulic code Flica IV (1/2)

The experiment consists in pressurized and possibly heated water passingthrough a cylinder. We measure the pressure drop between the two ends ofthe cylinder.Quantity of interest : The part of the pressure drop due to friction : ∆PfroTwo kinds of experimental conditions :

I System parameters : Hydraulic diameter Dh, Friction height Hf , Channelwidth e

I Environment variables : Output pressure Ps , Flowrate Ge, Parietal heatflux Φp , Liquid enthalpy hl

e, Thermodynamic title X eth, Input temperature

Te

We dispose of 253 experimental resultsImportant : Among the 253 experimental results, only 8 different systemparameters→ Not enough to use the Gaussian processes model forprediction for new system parameters→We predict for new environmentvariables only

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 7/27 .

Page 8: Validation de codes de calcul - Validation croisée pour l

.Results with the thermal-hydraulic code Flica IV (2/2)

RMSE 90% Confidence IntervalsNominal code 661Pa 234/253 ≈ 0.925

Gaussian Processes 189Pa 235/253 ≈ 0.93

- 4000

- 3000

- 2000

- 1000

0

1000

0 50 100 150 200 250

Resultats predict ion Nominal

Indice

erreur de predict ionIntervalles de confiance 90%

- 4000

- 3000

- 2000

- 1000

0

1000

0 50 100 150 200 250

Resultats predict ion Processus Gaussiens

Indice

erreur de predict ionIntervalles de confiance 90%

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 8/27 .

Page 9: Validation de codes de calcul - Validation croisée pour l

.Conclusion on code Validation

I We can improve the prediction capability of the code by completing thephysical representation with a statistical model

I Number of experimental results needs to be sufficient. No extrapolation

Further questionsI Assumptions of this statistical model. A statistical question or an

engineering/physical question ?

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 9/27 .

Page 10: Validation de codes de calcul - Validation croisée pour l

.

Kriging for code validationStatistical model and method studiedConclusion

Cross Validation for hyper-parameters estimationContext on Cross ValidationCase of a single variance parameter estimationConclusion

Current work and prospects

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 10/27 .

Page 11: Validation de codes de calcul - Validation croisée pour l

.Cross Validation (Leave-One-Out)

Gaussian Process Y observed at x1, ..., xn with values y = (y1, ..., yn)t

Cross Validation (Leave-One-Out) principle

I yi,−i = E(Y (xi )|y1, ..., yi−1, yi+1, ..., yn)

I c2i,−i = E((Y (xi )− yi,−i )

2|y1, ..., yi−1, yi+1, ..., yn)

Can be used for Kriging verification or for covariance function selection

Remark on Kriging model verificationWhen a new test sample is available, one can decorrelates the predictionerrors :

L.S. Bastos and A. O’Hagan Diagnostics for Gaussian ProcessEmulators, Technometrics, 51 (4), 425-438.

However, decorrelating the LOO errors is equivalent to decorrelating theoriginal observations

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 11/27 .

Page 12: Validation de codes de calcul - Validation croisée pour l

.Virtual Cross Validation

When mean of Y is parametric : E(Y (x)) =Pp

i=1 βi hi (x). LetI H the n × p matrix with Hi,j = hj (xi )

I R the covariance matrix of y = (y1, ..., yn)

Virtual Leave-One-OutWith

Q− = R−1 − R−1H(HT R−1H)−1HT R−1

We have :

yi − yi,−i =1

(Q−)i,i(Q−y)i and c2

i,−i =1

(Q−)i,i

If Bayesian case for β ( β ∼ N (βprior ,Qprior ) ), then same formula holdsreplacing Q− with (R + HQprior Ht )−1

O. Dubrule, Cross Validation of Kriging in a Unique Neighborhood,Mathematical Geology, 1983.

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 12/27 .

Page 13: Validation de codes de calcul - Validation croisée pour l

.Cross Validation for covariance function estimation (1/2)

Let˘σ2Kθ, σ2 ≥ 0, θ ∈ Θ

¯be a set of covariance function for Y , with Kθ a

correlation function. LetI yθ,i,−i = Eσ2,θ(Y (xi )|y1, ..., yi−1, yi+1, ..., yn)

I σ2c2θ,i,−i = Eσ2,θ((Y (xi )− yθ,i,−i )

2|y1, ..., yi−1, yi+1, ..., yn)

Leave-One-Out criteria we study

θCV ∈ argminθ∈Θ

nXi=1

(yi − yθ,i,−i )2

and

σ2CV =

1n

nXi=1

(yi − yθCV i,−i )2

c2θCV ,i,−i

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 13/27 .

Page 14: Validation de codes de calcul - Validation croisée pour l

.Cross Validation for covariance function estimation (2/2)

I Leave-One-Out estimation is tractableI Other Cross-Validation criteria exist

C.E. Rasmussen and C.K.I. Williams, Gaussian Processes forMachine Learning, The MIT Press, Cambridge, 2006.

I To the best of our knowledge : problems of the choice of the crossvalidation criterion and of the cross validation procedure are not fullysolved for Kriging

I It is our experience that when one is primarily interested in predictionmean square error and point-wise estimation of the prediction meansquare error, the Leave-One-Out criteria presented are reasonable

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 14/27 .

Page 15: Validation de codes de calcul - Validation croisée pour l

.Objectives

We want to study the cases of model misspecification, that is to say thecases when the true covariance function K1 of Y is far fromK =

˘σ2Kθ, σ2 ≥ 0, θ ∈ Θ

¯In this context we want to compare Leave-One-Out and Maximum Likelihoodestimators from the point of view of prediction mean square error andpoint-wise estimation of the prediction mean square error

We proceed in two stepsI When K =

˘σ2K2, σ

2 ≥ 0¯

, with K2 a correlation function, and K1 is thetrue covariance function : Theoretical formula and numerical tests

I In the general case : Numerical studies

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 15/27 .

Page 16: Validation de codes de calcul - Validation croisée pour l

.

Kriging for code validationStatistical model and method studiedConclusion

Cross Validation for hyper-parameters estimationContext on Cross ValidationCase of a single variance parameter estimationConclusion

Current work and prospects

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 16/27 .

Page 17: Validation de codes de calcul - Validation croisée pour l

.Setting

Let x0 be a new point and assume the mean of Y is zero and K1 isunit-variance stationary. Let

I r1 be the covariance vector between x1, ..., xn and x0 with covariancefunction K1

I r2 be the covariance vector between x1, ..., xn and x0 with covariancefunction K2

I R1 be the covariance matrix of x1, ..., xn.with covariance function K1

I R2 be the covariance matrix of x1, ..., xn.with covariance function K2

y0 = r t2R−1

2 y is the Kriging prediction

Eˆ(y0 − Y0)2|y

˜= (r t

1R−11 y − r t

2R−12 y)2 + 1− r t

1R−11 r1 is the conditional

mean square error of the non-optimal prediction

One estimates σ2 with σ2 and estimates the conditional mean square errorwith σ2c2

x0with c2

x0:= 1− r t

2R−12 r2

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 17/27 .

Page 18: Validation de codes de calcul - Validation croisée pour l

.The Risk

The RiskWe study the Risk criterion for an estimator σ2 of σ2

Rσ2,x0= E

»“Eh(y0 − Y0)2|y

i− σ2c2

x0

”2–

Formula for quadratic estimatorsWhen σ2 = y t My , we have

Rσ2,x0= f (M0,M0) + 2c1tr(M0)− 2c2f (M0,M1)

+c21 − 2c1c2tr(M1) + c2

2 f (M1,M1)

withf (A,B) = tr(A)tr(B) + 2tr(AB)

M0 = (R−12 r2 − R−1

1 r1)(r t2R−1

2 − r t1R−1

1 )R1

M1 = MR1

c1 = 1− r t1R−1

1 r1

c2 = 1− r t2R−1

2 r2

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 18/27 .

Page 19: Validation de codes de calcul - Validation croisée pour l

.CV and ML estimation

I ML estimation :σ2

ML =1n

y t R−12 y

var(σ2ML) reaches the Cramer-Rao bound 2

n

I CV estimation :

σ2CV =

1n

y t R−12

hdiag(R−1

2 )i−1

R−12 y

var(σ2CV ) can reach 2

I When K2 = K1, ML is best. Numerical study when K2 6= K1

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 19/27 .

Page 20: Validation de codes de calcul - Validation croisée pour l

.Criteria for numerical studies (1/2)

Risk on Target Ratio (RTR),

RTR(x0) =

qRσ2,x0

Eh(Y0 − Y0)2

i =

sE»“

Eˆ(y0 − Y0)2|y

˜− σ2c2

x0

”2–

Eh(Y0 − Y0)2

iBias-variance decomposition

Rσ2,x0=

0BBB@Eh(Y0 − Y0)2

i− E

“σ2c2

x0

”| {z }

bias

1CCCA2

+var“

Eh(y0 − Y0)2|y

i− σ2c2

x0

”| {z }

variance

Bias on Target Ratio (BTR) criterion

BTR(x0) =|Eh(Y0 − Y0)2

i− E

“σ2c2

x0

”|

Eh(Y0 − Y0)2

i

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 20/27 .

Page 21: Validation de codes de calcul - Validation croisée pour l

.Criteria for numerical studies (2/2)

0B@ RTR| {z }relative error

1CA2

=

0B@ BTR|{z}relative bias

1CA2

+var“

Eˆ(y0 − Y0)2|y

˜− σ2c2

x0

”Eh(Y0 − Y0)2

i2

| {z }relative variance

Integrated criteria on the prediction domain X

IRTR =

sZX

RTR2(x0)dµ(x0)

and

IBTR =

sZX

BTR2(x0)dµ(x0)

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 21/27 .

Page 22: Validation de codes de calcul - Validation croisée pour l

.Numerical results70 observations on [0, 1]5. Mean overLHS-Maximin DoE’s.Top : K1 and K2 are power-exponential,with lc,1 = lc,2 = 1.2, p1 = 1.5, and p2varying.Bot left : K1 and K2 are Matérn (non-tensorized), with lc,1 = lc,2 = 1.2,ν1 = 1.5, and ν2 varying.Bot right : K1 and K2 are Matérn 3

2(non-tensorized), with lc,1 = 1.2, andlc,2 varying. 0.0

0.1

0.2

0.3

0.4

0.5

1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0P2

rati

o

IBTR MLIBTR CVIRTR MLIRTR CV

0.0

0.2

0.4

0.6

0.8

1.0

1.2

0.5 1.0 1.5 2.0 2.5Nu2

rati

o

IBTR MLIBTR CVIRTR MLIRTR CV

0.0

0.2

0.4

0.6

0.8

1.0

0.5 1.0 1.5Lc2

rati

o

IBTR MLIBTR CVIRTR MLIRTR CV

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 22/27 .

Page 23: Validation de codes de calcul - Validation croisée pour l

.Case of a regular grid (Smolyak construction)

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.9

0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.90.0

0.5

1.0

1.5

2.0

2.5

1.1 1.2 1.3 1.4 1.5 1.6 1.7 1.8 1.9 2.0P2

rati

o

IBTR MLIBTR CVIRTR MLIRTR CV

0.0

0.5

1.0

1.5

2.0

2.5

3.0

0.5 1.0 1.5 2.0 2.5Nu2

rati

o

IBTR MLIBTR CVIRTR MLIRTR CV

0.0

0.1

0.2

0.3

0.4

0.5

0.6

0.7

0.8

0.5 1.0 1.5Lc2

rati

o

IBTR MLIBTR CVIRTR MLIRTR CV

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 23/27 .

Page 24: Validation de codes de calcul - Validation croisée pour l

.Influence of the number of pointsn observations on [0, 1]5. Pointwiseprediction (center).Top : K1 and K2 are power-exponential,with lc,1 = lc,2 = 1.2, p1 = 1.5, andp2 = 1.7.Bot left : K1 and K2 are Matérn (non-tensorized), with lc,1 = lc,2 = 1.2,ν1 = 1.5, and ν2 = 1.8.Bot right : K1 and K2 are Matérn 3

2(non-tensorized), with lc,1 = 1.2, andlc,2 = 1.8. 0.00

0.05

0.10

0.15

0.20

0.25

0.30

0.35

0.40

0.45

20 40 60 80 100 120 140 160 180 200n

rati

o

BTR MLBTR CVRTR MLRTR CV

0.00

0.05

0.10

0.15

0.20

0.25

0.30

0.35

0.40

0.45

20 40 60 80 100 120 140 160 180 200n

rati

o

BTR MLBTR CVRTR MLRTR CV

0.00

0.05

0.10

0.15

0.20

0.25

0.30

0.35

0.40

0.45

100 200 300 400 500 600n

rati

o

BTR MLBTR CVRTR MLRTR CV

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 24/27 .

Page 25: Validation de codes de calcul - Validation croisée pour l

.Conclusion on Cross Validation

I We study robustness relatively to prediction mean square errors andpoint-wise mean square error estimation

I For the variance estimation, CV is more robust than ML to correlationfunction misspecification

I This is not true for the Smolyak construction we testedI In the general case of correlation function estimation→ this is globally

confirmed in a case study on analytical functions

Possible perspectivesI Quantify the suitability of CV given a DoE ?I Problem of the choice of the CV procedure

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 25/27 .

Page 26: Validation de codes de calcul - Validation croisée pour l

.

Kriging for code validationStatistical model and method studiedConclusion

Cross Validation for hyper-parameters estimationContext on Cross ValidationCase of a single variance parameter estimationConclusion

Current work and prospects

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 26/27 .

Page 27: Validation de codes de calcul - Validation croisée pour l

.Current work and prospects

Current work :I In an expansion asymptotic context, is the regular grid a local optimum

for covariance function estimation ?I Work on ML and CV estimators

Possible prospect : For the context of model misspecification : analyticalstudy of an AR model of the kind X(t) = αX(t − 1) + ε

. Validation de codes de calcul - Validation croisée pour l’estimation d’hyper-paramètres 27/27 .