diff --git a/README.rst b/README.rst index abeeef8..56373ed 100755 --- a/README.rst +++ b/README.rst @@ -85,6 +85,7 @@ OpenTURNS Presentations - `Release highlights `_ - `Automotive Reliability Engineering with OpenTURNS : the Phimeca product for Renault : StaRe (STAtistical REliability) `_ + - `Overview of calibration `_ - Uncecomp 2023 diff --git a/userday2024/calibration2024/.gitignore b/userday2024/calibration2024/.gitignore new file mode 100644 index 0000000..7e4bee2 --- /dev/null +++ b/userday2024/calibration2024/.gitignore @@ -0,0 +1,2 @@ +calibration2024.run.xml +calibration2024.bcf diff --git a/userday2024/calibration2024/calibration2024.bib b/userday2024/calibration2024/calibration2024.bib new file mode 100755 index 0000000..13cfa92 --- /dev/null +++ b/userday2024/calibration2024/calibration2024.bib @@ -0,0 +1,129 @@ + +@inproceedings{Baudin2021, + title={Linear algebra of linear and nonlinear {Bayesian} calibration}, + author={Baudin, Michaël and Lebrun, Régis}, + year={2021}, + booktitle = {UNCECOMP 2021}, + pages = {339--353}, + organization = "4th ECCOMAS Thematic Conference on Uncertainty Quantification in Computational Sciences and Engineering M. Papadrakakis, V. Papadopoulos, G. Stefanou (eds.) Streamed from Athens, Greece, 28-30 June 2021", +} + +@Book{Bjorck1996, + author = {Ake Björck}, + title = {Numerical Methods for Least Squares Problems}, + publisher = {Society for Industrial Applied Mathematics}, + year = {1996}, +} + +@INPROCEEDINGS{Hansen00thelcurve, + author = {P. C. Hansen}, + title = {The {L}-Curve and its Use in the Numerical Treatment of Inverse Problems}, + booktitle = {in Computational Inverse Problems in Electrocardiology, ed. P. Johnston, Advances in Computational Bioengineering}, + year = {2000}, + pages = {119--142}, + publisher = {WIT Press} +} + +@article{trucano2006calibration, + title={Calibration, validation, and sensitivity analysis: What's what}, + author={Trucano, Timothy G and Swiler, Laura Painton and Igusa, Takera and Oberkampf, William L and Pilch, Martin}, + journal={Reliability Engineering \& System Safety}, + volume={91}, + number={10-11}, + pages={1331--1357}, + year={2006}, + publisher={Elsevier} +} + +@techreport{Blanchard2020, +author = {Jean-Baptiste Blanchard and Guillaume Damblin and Michaël Baudin}, +title = {Introduction aux problèmes de calibration de paramètres.}, +year = {2020}, +institution = {I3P, EDF R\&D et CEA}, +} + +@book{Evensen2009, +title = {Data Assimilation - The Ensemble {Kalman} Filter}, +author = {Geir Evensen}, +year = {2009}, +publisher = {SIAM} +} + +@book{Tarantola2005, + author = "Albert Tarantola", + title = "Inverse problem theory", + year = "2005", + publisher = "SIAM", +} + +@book{Asch2016, + title={Data assimilation. Methods, algorithms and applications.}, + author={Asch, Mark and Bocquet, Marc and Nodet, Maëlle}, + year={2016}, + publisher={SIAM} +} + + +@Inbook{Baudin2016, +author="Baudin, Micha{\"e}l and Dutfoy, Anne and Iooss, Bertrand and Popelin, Anne-Laure", +title="{OpenTURNS}: An Industrial Software for Uncertainty Quantification in Simulation. In: Ghanem R., Higdon D., Owhadi H. (eds) Handbook of Uncertainty Quantification.", +year="2016", +publisher="Springer International Publishing", +address="Cham", +pages="1--38", +isbn="978-3-319-11259-6", +doi="10.1007/978-3-319-11259-6_64-1", +url="https://doi.org/10.1007/978-3-319-11259-6_64-1" +} + +@techreport{BaudinMethodes2020, +author = {Michaël Baudin and Régis Lebrun}, +title = {Méthodes de calage : algorithmes mathématiques et implémentation dans {OpenTURNS}.}, +year = {2020}, +institution = {EDF R\&D}, +number={6125-3119-2020-02448-FR} +} + +@techreport{BaudinMethodes2022, +author = {Michaël Baudin}, +title = {Méthodes de calage : algorithmes mathématiques avancés et implémentation dans {OpenTURNS}.}, +year = {2022}, +institution = {EDF R\&D}, +number={6125-3119-2022-00175-FR} +} + +@techreport{garbow1980implementation, + title={Implementation guide for {MINPACK}-1.}, + author={Garbow, Burton S. and Hillstrom, Kenneth E. and More, Jorge J.}, + year={1980}, + institution={Argonne National Lab., IL (USA)} +} + +@book{kern2016methodes, + title={M{\'e}thodes num{\'e}riques pour les problemes inverses}, + author={Kern, Michel}, + year={2016}, + publisher={ISTE Group} +} + + +@book{lawson1995solving, + title={Solving least squares problems}, + author={Lawson, Charles L. and Hanson, Richard J.}, + year={1995}, + publisher={SIAM} +} + +@book{idier2013bayesian, + title={Bayesian approach to inverse problems}, + author={Idier, J{\'e}r{\^o}me}, + year={2013}, + publisher={John Wiley \& Sons} +} + +@book{hansen2013least, + title={Least squares data fitting with applications}, + author={Hansen, Per Christian and Pereyra, Victor and Scherer, Godela}, + year={2013}, + publisher={JHU Press} +} diff --git a/userday2024/calibration2024/calibration2024.tex b/userday2024/calibration2024/calibration2024.tex new file mode 100755 index 0000000..7c2d29d --- /dev/null +++ b/userday2024/calibration2024/calibration2024.tex @@ -0,0 +1,149 @@ +% Copyright (C) 2024 - Michaël Baudin + +\documentclass[9pt]{beamer} + +%\setbeameroption{hide notes} +%\setbeameroption{show notes} +%\setbeameroption{show only notes} + +\input{macros} + +\title[Calibration in OpenTURNS]{Overview of calibration features in OpenTURNS} + +\author[M. Baudin]{ +Michaël Baudin \inst{1} +} + +\institute[EDF]{ +\inst{1} EDF R\&D. 6, quai Watier, 78401, Chatou Cedex - France, michael.baudin@edf.fr +} + + +\date[]{June 19th 2024, Palaiseau, France} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{document} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} +\titlepage + +\begin{center} +\includegraphics[height=0.15\textheight]{figures/edf.jpg} +\end{center} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} +\frametitle{Introduction} + +Calibration is the step B' of the generic methodology\footnote{See\cite{Baudin2016, BaudinMethodes2020}.}. + +\begin{figure} +\begin{center} +\includegraphics[width=0.7\textwidth]{MethodologieIncertitude-EN.pdf} +\end{center} +\caption{The step B' brings the observed predictions from the model +closer to the observed outputs to calibrate the parameters.} +\end{figure} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame} +\frametitle{Introduction} + +We have: +\begin{itemize} +\item a dataset, +\item a parametric model with unknown parameters. +\end{itemize} + +We search for: +\begin{itemize} +\item parameter values, +\item such that the predictions of the model are as close as possible to the data. +\end{itemize} + +Since the dataset is random, we want the distribution of the parameters. + +From there, we can compute confidence intervals of the parameters. + +\begin{figure} +\begin{center} +\includegraphics[width=0.5\textwidth]{flooding_before_calibration.pdf} +\end{center} +\caption{Observations compared to the predictions of a model.} +\end{figure} + +\end{frame} + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}[fragile] +\section{Overview} +\frametitle{Overview} + +In OpenTURNS, we have several calibration features: +\begin{itemize} +\item \href{https://openturns.github.io/openturns/latest/theory/data_analysis/data_analysis.html#calibration}{theory help pages} +\item \href{https://openturns.github.io/openturns/latest/user_manual/calibration.html}{API help pages} +\item \href{https://openturns.github.io/openturns/latest/auto_calibration/index.html}{examples}. +\end{itemize} + + +There are two types of features : +\begin{itemize} +\item linear and non linear least squares, Gaussian linear and non linear calibration : \pyvar{*Calibration} classes. These classes compute the \textbf{posterior distribution of the parameters}. +\item Monte Carlo Markov Chain (MCMC) algorithms : \pyvar{*MetropolisHastings}, etc. These classes \textbf{generate a sample from the posterior distribution of the parameters}. +\end{itemize} + +The simplest example is \href{https://openturns.github.io/openturns/latest/auto_calibration/least_squares_and_gaussian_calibration/plot_calibration_quickstart.html#sphx-glr-auto-calibration-least-squares-and-gaussian-calibration-plot-calibration-quickstart-py}{Calibrate a parametric model: a quick-start guide to calibration} + +Here, we are going to review the \href{https://openturns.github.io/openturns/latest/auto_calibration/least_squares_and_gaussian_calibration/plot_calibration_flooding.html#sphx-glr-auto-calibration-least-squares-and-gaussian-calibration-plot-calibration-flooding-py}{Calibration of the flooding model} +\end{frame} + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\begin{frame}[fragile] +\section{Conclusion} +\frametitle{Conclusion} + +Other tools : +\begin{itemize} +\item Calibration methods are also available in \href{https://persalys.fr}{Persalys} : linear and non linear least squares, Gaussian linear and non linear calibration. +\end{itemize} + +Perspectives: +\begin{itemize} +\item provide bounds to the optimization algorithms (return truncated normal distribution if necessary); +\item unify the \pyvar{ParametricFunction} in \pyvar{*Calibration} and \pyvar{*MetropolisHastings} classes (exchange the roles of $x$ and $\theta$); +\item calibrate parametric functions with field output more easily; +\item provide algorithms to automatically compute finite difference steps (not specific to calibration); +\item provide the covariance matrix of the parameters as a diagonal matrix when possible; +\item scale the parameters to calibrate (not specific to calibration); +\item implement \pyvar{CalibrationResult.isBayesian()} (see \href{https://github.com/openturns/openturns/issues/2560}{2560}); +\item implement a \pyvar{CalibrationResult} structure for M.-H. classes. +\end{itemize} +\end{frame} + + + +%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% + +\section{References} +\begin{frame}[allowframebreaks] +\frametitle{Références} +\nocite{*} +\bibliographystyle{apalike} +\bibliography{calibration2024} +\end{frame} + +\end{document} diff --git a/userday2024/calibration2024/figures/MethodologieIncertitude-EN.pdf b/userday2024/calibration2024/figures/MethodologieIncertitude-EN.pdf new file mode 100755 index 0000000..473f05f Binary files /dev/null and b/userday2024/calibration2024/figures/MethodologieIncertitude-EN.pdf differ diff --git a/userday2024/calibration2024/figures/MethodologieIncertitude-EN.svg b/userday2024/calibration2024/figures/MethodologieIncertitude-EN.svg new file mode 100755 index 0000000..e5ee91b --- /dev/null +++ b/userday2024/calibration2024/figures/MethodologieIncertitude-EN.svg @@ -0,0 +1,960 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + image/svg+xml + + + + + + + Step C : Uncertainty Propagation + + Step A : Study Specification + + InputUncertain : XFixed : d + + Modely=g(x,d) + + OutputY=gd(X) + + Quantity ofintereste.g.: variance, probability + + +   + + + + Step C' : Sensitivity Analysis, Ranking + + + Step B : UncertaintyQuantificationModeling with probability distribution :direct methods, statistics, expertise.  + + + + + + Step B' : Quantification of sourcesInverse methods, calibration, assimilation + + + Observed variablesYobs + + + + + + + + + + + + + + + + + + + diff --git a/userday2024/calibration2024/figures/edf.jpg b/userday2024/calibration2024/figures/edf.jpg new file mode 100755 index 0000000..cf221fb Binary files /dev/null and b/userday2024/calibration2024/figures/edf.jpg differ diff --git a/userday2024/calibration2024/figures/flooding_before_calibration.pdf b/userday2024/calibration2024/figures/flooding_before_calibration.pdf new file mode 100755 index 0000000..de90d9d Binary files /dev/null and b/userday2024/calibration2024/figures/flooding_before_calibration.pdf differ diff --git a/userday2024/calibration2024/macros.tex b/userday2024/calibration2024/macros.tex new file mode 100755 index 0000000..79a4d2b --- /dev/null +++ b/userday2024/calibration2024/macros.tex @@ -0,0 +1,54 @@ +% Copyright (C) 2012 - EDF R&D - Michael Baudin + +% To highlight source code +\usepackage{listings} +\definecolor{darkgreen}{rgb}{0,0.5,0} +\definecolor{violet}{rgb}{0.5,0,1} + +\usepackage{lmodern}% http://ctan.org/pkg/lm + +\usetheme{Montpellier} +\setbeamertemplate{navigation symbols}{} % Remove navigation +\useoutertheme{infolines} + +\usepackage[utf8]{inputenc} +\usepackage[T1]{fontenc} + +\usepackage{graphicx} +\unitlength=1cm +\graphicspath{{./figures/}} + +\usepackage{hyperref} +\hypersetup{colorlinks=true, linkcolor=blue, linktocpage, urlcolor=blue} + +\def\bx{{\bf x}} +\def\RR{\mathbb{R}} + +\newcommand{\pyvar}[1]{\texttt{#1}} + +\def \ot {OpenTURNS} + +\definecolor{codegreen}{rgb}{0,0.6,0} +\definecolor{codegray}{rgb}{0.5,0.5,0.5} +\definecolor{codepurple}{rgb}{0.58,0,0.82} +\definecolor{backcolour}{rgb}{0.95,0.95,0.92} +\lstdefinestyle{mystyle}{ + backgroundcolor=\color{backcolour}, commentstyle=\color{codegreen}, + keywordstyle=\color{magenta}, + numberstyle=\tiny\color{codegray}, + stringstyle=\color{codepurple}, + basicstyle=\ttfamily\tiny, + breakatwhitespace=false, + breaklines=true, + captionpos=b, + keepspaces=true, + numbers=left, + numbersep=5pt, + showspaces=false, + showstringspaces=false, + showtabs=false, + tabsize=1, + numbers=none +} + +\lstset{style=mystyle, language=python}