From: Matthias Maier Date: Sat, 24 Feb 2024 00:53:07 +0000 (-0600) Subject: Update header: MCMC-Laplace X-Git-Url: https://gitweb.dealii.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=a2e786353af0150a7a6c4204e8587bae717a6d79;p=code-gallery.git Update header: MCMC-Laplace --- diff --git a/MCMC-Laplace/Matlab/exact_values.m b/MCMC-Laplace/Matlab/exact_values.m index d66e47f..a639539 100644 --- a/MCMC-Laplace/Matlab/exact_values.m +++ b/MCMC-Laplace/Matlab/exact_values.m @@ -1,3 +1,12 @@ +%% ----------------------------------------------------------------------------- +%% +%% SPDX-License-Identifier: LGPL-2.1-or-later +%% Copyright (C) 2022 by Wolfgang Bangerth +%% +%% This file is part of the deal.II code gallery. +%% +%% ----------------------------------------------------------------------------- + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%% list of "exact" measurement values, z_hat %%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/MCMC-Laplace/Matlab/forward_solver.m b/MCMC-Laplace/Matlab/forward_solver.m index 33e0a1d..c0443d8 100644 --- a/MCMC-Laplace/Matlab/forward_solver.m +++ b/MCMC-Laplace/Matlab/forward_solver.m @@ -1,3 +1,12 @@ +%% ----------------------------------------------------------------------------- +%% +%% SPDX-License-Identifier: LGPL-2.1-or-later +%% Copyright (C) 2022 by Wolfgang Bangerth +%% +%% This file is part of the deal.II code gallery. +%% +%% ----------------------------------------------------------------------------- + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%% forward solver function %%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/MCMC-Laplace/Matlab/get_statistics.m b/MCMC-Laplace/Matlab/get_statistics.m index c99353a..834dbd6 100644 --- a/MCMC-Laplace/Matlab/get_statistics.m +++ b/MCMC-Laplace/Matlab/get_statistics.m @@ -1,3 +1,12 @@ +%% ----------------------------------------------------------------------------- +%% +%% SPDX-License-Identifier: LGPL-2.1-or-later +%% Copyright (C) 2022 by Wolfgang Bangerth +%% +%% This file is part of the deal.II code gallery. +%% +%% ----------------------------------------------------------------------------- + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%% compute statistics on data set %%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/MCMC-Laplace/Matlab/log_probability.m b/MCMC-Laplace/Matlab/log_probability.m index 62ed698..24bdae9 100644 --- a/MCMC-Laplace/Matlab/log_probability.m +++ b/MCMC-Laplace/Matlab/log_probability.m @@ -1,3 +1,12 @@ +%% ----------------------------------------------------------------------------- +%% +%% SPDX-License-Identifier: LGPL-2.1-or-later +%% Copyright (C) 2022 by Wolfgang Bangerth +%% +%% This file is part of the deal.II code gallery. +%% +%% ----------------------------------------------------------------------------- + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%% compute log probability, log pi %%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/MCMC-Laplace/Matlab/main.m b/MCMC-Laplace/Matlab/main.m index 45f86a4..5b6d300 100644 --- a/MCMC-Laplace/Matlab/main.m +++ b/MCMC-Laplace/Matlab/main.m @@ -1,3 +1,12 @@ +%% ----------------------------------------------------------------------------- +%% +%% SPDX-License-Identifier: LGPL-2.1-or-later +%% Copyright (C) 2022 by Wolfgang Bangerth +%% +%% This file is part of the deal.II code gallery. +%% +%% ----------------------------------------------------------------------------- + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%% Run MCMC sampler to estimate posterior distribution %%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/MCMC-Laplace/Matlab/plot_solution.m b/MCMC-Laplace/Matlab/plot_solution.m index 39ddb2b..c9bc461 100644 --- a/MCMC-Laplace/Matlab/plot_solution.m +++ b/MCMC-Laplace/Matlab/plot_solution.m @@ -1,3 +1,12 @@ +%% ----------------------------------------------------------------------------- +%% +%% SPDX-License-Identifier: LGPL-2.1-or-later +%% Copyright (C) 2022 by Wolfgang Bangerth +%% +%% This file is part of the deal.II code gallery. +%% +%% ----------------------------------------------------------------------------- + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%% plots solution, u, to Poisson equation %%%%%%%%%%%%%%%%%%%% %%%%%%%%%%%%%%%% associated to theta and a 32x32 mesh %%%%%%%%%%%%%%%%%%%%% diff --git a/MCMC-Laplace/Matlab/precomputations.m b/MCMC-Laplace/Matlab/precomputations.m index 4d0426e..bf8791e 100644 --- a/MCMC-Laplace/Matlab/precomputations.m +++ b/MCMC-Laplace/Matlab/precomputations.m @@ -1,3 +1,12 @@ +%% ----------------------------------------------------------------------------- +%% +%% SPDX-License-Identifier: LGPL-2.1-or-later +%% Copyright (C) 2022 by Wolfgang Bangerth +%% +%% This file is part of the deal.II code gallery. +%% +%% ----------------------------------------------------------------------------- + %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% %%%%%%% do all precomputations necessary for MCMC simulations %%%%%%%%%%%%% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% diff --git a/MCMC-Laplace/Python/forward_solver.py b/MCMC-Laplace/Python/forward_solver.py index a49d3e4..8cfae07 100644 --- a/MCMC-Laplace/Python/forward_solver.py +++ b/MCMC-Laplace/Python/forward_solver.py @@ -1,3 +1,12 @@ +## ----------------------------------------------------------------------------- +## +## SPDX-License-Identifier: LGPL-2.1-or-later +## Copyright (C) 2022 by Wolfgang Bangerth +## +## This file is part of the deal.II code gallery. +## +## ----------------------------------------------------------------------------- + import numpy as np import scipy.sparse from scipy.sparse.linalg import spsolve diff --git a/MCMC-Laplace/mcmc-laplace.cc b/MCMC-Laplace/mcmc-laplace.cc index 382a278..44a0de2 100644 --- a/MCMC-Laplace/mcmc-laplace.cc +++ b/MCMC-Laplace/mcmc-laplace.cc @@ -1,24 +1,16 @@ -/* --------------------------------------------------------------------- +/* ----------------------------------------------------------------------------- * - * Copyright (C) 2019 by the deal.II authors and Wolfgang Bangerth. + * SPDX-License-Identifier: LGPL-2.1-or-later + * Copyright (C) 2019 by Wolfgang Bangerth * - * This file is part of the deal.II library. + * This file is part of the deal.II code gallery. * - * The deal.II library is free software; you can use it, redistribute - * it, and/or modify it under the terms of the GNU Lesser General - * Public License as published by the Free Software Foundation; either - * version 2.1 of the License, or (at your option) any later version. - * The full text of the license can be found in the file LICENSE.md at - * the top level directory of deal.II. - * - * --------------------------------------------------------------------- - + * ----------------------------------------------------------------------------- * * Author: Wolfgang Bangerth, Colorado State University, 2019. */ - #include #include #include