diff --git a/.DS_Store b/.DS_Store index 8069b1d04c64660dcc0234f0841dd05ea62c2d55..44a5bbbce45dbd57ddae3f986309557f4dc85f51 100644 Binary files a/.DS_Store and b/.DS_Store differ diff --git a/.gitignore b/.gitignore index a61e3835856f69dd25e30c045a81b572496c6006..4f9ce6daa25ae01acfbe87616c89c4dd2b40a4ef 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ venv .DS_Store # Ignore LyX temporary files *.lyx~ -*.lyx# +*.lyx# \ No newline at end of file diff --git a/Project3/LyX/Abbreviations.lyx b/Project3/LyX/Abbreviations.lyx new file mode 100644 index 0000000000000000000000000000000000000000..15e2a3e52192285f2f0864bac2de7d6476ce126a --- /dev/null +++ b/Project3/LyX/Abbreviations.lyx @@ -0,0 +1,311 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass IEEEtran-CompSoc +\use_default_options true +\maintain_unincluded_children no +\language ngerman +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment class +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008080 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Section* +List of Abbreviations +\end_layout + +\begin_layout Standard +\begin_inset Tabular +<lyxtabular version="3" rows="10" columns="2"> +<features tabularvalignment="middle"> +<column alignment="center" valignment="top"> +<column alignment="center" valignment="top"> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Abbreviation +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Definition +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +PDE +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Partial Differential Equation +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +MOC +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Method of Characteristics +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +FEM +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Finite Element Method +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +AD +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Artificial Diffusion +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +SU +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Streamline-Upwind +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +SUPG +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Streamline-Upwind Petrov-Galerkin +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +GLS +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Generalized Least-Squares +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Pe +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\lang american +Péclet number +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +C +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Courant number +\end_layout + +\end_inset +</cell> +</row> +</lyxtabular> + +\end_inset + + +\end_layout + +\end_body +\end_document diff --git a/Project3/LyX/Abstract.lyx b/Project3/LyX/Abstract.lyx new file mode 100644 index 0000000000000000000000000000000000000000..6bab79e95bea7ba2378130d70cd831b072604f17 --- /dev/null +++ b/Project3/LyX/Abstract.lyx @@ -0,0 +1,123 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass IEEEtran-CompSoc +\use_default_options true +\maintain_unincluded_children no +\language american +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment center +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry true +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\leftmargin 2.5cm +\topmargin 2.5cm +\rightmargin 2.5cm +\bottommargin 2.5cm +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Abstract +Roads are an important part of our lives. + We use them to get to work, + to our hobbies or just to visit our friends by car, + bus or by bike. + Too crowded roads can cause traffic jams that stop the flow of traffic. + These traffic jams restrict our movement and slow us down in our everyday life. +\end_layout + +\begin_layout Abstract +Different causes of traffic jams and possibilities to dissolve those were discussed in a previous work. +\end_layout + +\begin_layout Abstract +This work focus on the uncertainty quantification of mathematical modeling of traffic jams. + It assumes that the true density of cars is just known at certain positions, + as it can be observed by cameras. + With these observations, + the uncertainty of the mathematical model will be quantified. +\end_layout + +\begin_layout Keywords +Scalar Conservation Law, + Monte-Carlo Markov-Chain, + Uncertainty Quantification +\end_layout + +\end_body +\end_document diff --git a/Project3/LyX/Appendix.lyx b/Project3/LyX/Appendix.lyx new file mode 100644 index 0000000000000000000000000000000000000000..6cc3470537c13c008c0d5d140d19f8eb9a69fb13 --- /dev/null +++ b/Project3/LyX/Appendix.lyx @@ -0,0 +1,108 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass IEEEtran-CompSoc +\use_default_options true +\maintain_unincluded_children no +\language english +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment class +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008080 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Section +\start_of_appendix +Inserting the Dimensionless Parameter +\begin_inset CommandInset label +LatexCommand label +name "sec:Appendix_AInserting-the-Dimensionless" + +\end_inset + + +\end_layout + +\begin_layout Standard + +\end_layout + +\end_body +\end_document diff --git a/Project3/LyX/Bibliography.bib b/Project3/LyX/Bibliography.bib new file mode 100644 index 0000000000000000000000000000000000000000..d1e5628b81ab76231c9688aec8a9f39d2f367945 --- /dev/null +++ b/Project3/LyX/Bibliography.bib @@ -0,0 +1,64 @@ +@unpublished{SteinerEvje-Lecture, + author = {Steinar Evje}, + note = {}, + title = {Lecture notes: Data-Driven Modeling of Conservation Laws}, + year = {2025} +} + +@unpublished{LectureNotes, + author = {Siddhartha Mishra, Ulrik Skre Fjordholm and R´emi Abgrall}, + note = {}, + title = {Lecture notes: Numerical methods for conservation laws +and related equations}, + year = {2025} +} + +@unpublished{Intro_ConsLaw_2021, + author = {Steinar Evje}, + note = {}, + title = {Basic theory for nonlinear conservation laws + exercises}, + year = {2021} +} + + +@article{KUZNETSOV20085695, +title = {Modeling traffic jams in intracellular transport in axons}, +journal = {International Journal of Heat and Mass Transfer}, +volume = {51}, +number = {23}, +pages = {5695-5699}, +year = {2008}, +note = {Biomedical-Related Special Issue}, +issn = {0017-9310}, +doi = {https://doi.org/10.1016/j.ijheatmasstransfer.2008.04.022}, +url = {https://www.sciencedirect.com/science/article/pii/S0017931008002731}, +author = {A.V. Kuznetsov and K. Hooman}, +keywords = {Molecular motors, Motor-assisted transport, Neurons, Axons and dendrites, Intracellular organelles, Traffic jams}, +abstract = {Irregularities in intracellular traffic in axons caused by mutations of molecular motors may lead to “traffic jams”, which often result in swelling of axons causing various neurodegenerative diseases. The purpose of this paper is to suggest a model of the formation of traffic jams in axons during molecular-motor-assisted transport of intracellular organelles utilizing transport equations developed in Smith and Simmons [D.A. Smith, R.M. Simmons, Models of motor-assisted transport of intracellular particles, Biophys. J. 80 (2001) 45–68], which describe the motion of intracellular particles under the combined action of diffusion and motor-driven transport. According to this model, large intracellular organelles are transported in the cytoplasm by a combined action of diffusion and motor-driven transport. In an axon, organelles are transported away from the neuron’s body toward the axon’s terminal by kinesin-family molecular motors running on tracks composed by microtubules; old and used components are carried back toward neuron’s body by dynein-family molecular motors. Binding/detachment kinetic processes between the organelles and microtubules are specified by first rate reaction constants; these lead to coupling between the three organelle concentrations.} +} + +Péclet number. (2024, May 6). In Wikipedia. https://en.wikipedia.org/wiki/P%C3%A9clet_number +@misc{Peclet_Wikipedia, + author = {{Péclet number}}, + month = {May}, + day = {6}, + url = {https://en.wikipedia.org/wiki/P%C3%A9clet_number}, + year = {2024}, + howpublished = {In \textit{Wikipedia}}, +} + +@unpublished{HabscheidProject1, + author = {Jan Habscheid}, + note = {}, + title = {Project 1: Data-Driven Modeling of Conservation Laws}, + url = {https://git.rwth-aachen.de/JanHab/ddm}, + year = {2024} +} + +@software{Repository, + author = {Habscheid, Jan}, + month = {April}, + title = {Reproducibility Repository for Data-Driven Modeling of Conservation Laws}, + URL = {https://git.rwth-aachen.de/JanHab/ddm}, + year = {2025}, +} diff --git a/Project3/LyX/DiscussionAndConclusion.lyx b/Project3/LyX/DiscussionAndConclusion.lyx new file mode 100644 index 0000000000000000000000000000000000000000..577f1e669f8c305f2dbefa10380ddbb2bc74bb39 --- /dev/null +++ b/Project3/LyX/DiscussionAndConclusion.lyx @@ -0,0 +1,167 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass IEEEtran-CompSoc +\use_default_options true +\maintain_unincluded_children no +\language american +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment class +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\spellchecker_ignore american Fortran +\spellchecker_ignore american parallelized +\spellchecker_ignore american parallelizes +\spellchecker_ignore american OpenMP +\spellchecker_ignore american openMP +\spellchecker_ignore american parallelization +\spellchecker_ignore american parallelizing +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Section +Discussion and Conclusion +\begin_inset CommandInset label +LatexCommand label +name "sec:Discussion-and-Conclusion" + +\end_inset + + +\end_layout + +\begin_layout Standard +This work presented an accurate algorithm to quantify the uncertainty +\begin_inset Formula $k(x)$ +\end_inset + + in a scalar conservation law of the form +\begin_inset Formula $u_{t}+\left(k(x)f(u)\right)_{x}=0$ +\end_inset + +. + +\end_layout + +\begin_layout Standard +The major impact of the resistance function on the solution and the importance to predict this accurately were emphasized. + An optimal choice for the different hyperparameter was discussed and the influence of those on the solution. + +\end_layout + +\begin_layout Standard +Increasing the observations from one dataset to two datasets showed a positive effect on the prediction of the resistance function. +\end_layout + +\begin_layout Standard +For future work it remains interesting to find a computationally more efficient method, + as the MCMC algorithm depends on many iterations and is computationally complex. + Furthermore, + several efforts can be made to improve the identification of the resistance function. +\end_layout + +\begin_layout Enumerate +Increase the number of MCMC iterations and adapt the control parameter +\begin_inset Formula $\beta$ +\end_inset + + when the convergence does not show an improvement about a certain number of steps. +\end_layout + +\begin_deeper +\begin_layout Enumerate +Another possible modification can be to check the acceptance ratio of changes after each MCMC iteration and adapt the control parameter +\begin_inset Formula $\beta$ +\end_inset + + to accept a certain ratio of changes. +\end_layout + +\end_deeper +\begin_layout Enumerate +Run several independent MCMC iterations with different random starts and take the one with the smallest loss. +\end_layout + +\begin_layout Enumerate +Increase the number of true datasets even further, + as going from one to two datasets already showed promising results. +\end_layout + +\end_body +\end_document diff --git a/Project3/LyX/Figures/ArtificialDiffusion/final_error_ArtDiffComparison.pdf b/Project3/LyX/Figures/ArtificialDiffusion/final_error_ArtDiffComparison.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5d48c642b08dd20e8a5b89f9d5b4b73e3e61b854 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/final_error_ArtDiffComparison.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff0.pdf b/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9a0edc6329c9978a2fff20fdf088850176be82a9 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff0.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff1.pdf b/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..942c9aff96947e27df388b11805fa790bd1ceeb0 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff1.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff2.pdf b/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3a3ce5b79deb4a6eb08947ff0f3200e88b9d0370 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff2.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff3.pdf b/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..80a2f8d62bb191117c2661b6ad04b92ac26d4e1f Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff3.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff4.pdf b/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..829ca5d2ee6fcbfeda958aac5b5e603f3dd17928 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/loss_theta_ArtDiff4.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff0.pdf b/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f1a9f06ba51857f984db55a06a1cd1de985cd239 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff0.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff1.pdf b/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2270dfe22e45286f365a822a28af2ddd302e37f8 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff1.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff2.pdf b/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..21db19a3abfdb107e9f1a6702bf40abfd26eee91 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff2.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff3.pdf b/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6afa3a6adf6ca198b604a1e9adc00c16a3e9b522 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff3.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff4.pdf b/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..aa55b4c0ce9befd99c3738bf9a4115566d3a859e Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiff4.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiffComparison.pdf b/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiffComparison.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ab64d1b2c6b091cdb582c8cfb80131fe3e377837 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/losses_ArtDiffComparison.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff0.pdf b/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ecfba0be83fa47e8f8805bea74fd3d50cdeefc3f Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff0.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff1.pdf b/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6a74e28b6b62a52611b73a3296c5ca54a176a13c Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff1.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff2.pdf b/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d733992afe6ff438301d7fac80c1712e85cd95a7 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff2.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff3.pdf b/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..31545b195c81ddded04505d96abad42ce2acf430 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff3.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff4.pdf b/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..072500edd72e3c7a4cfcd6ef0976d1c0a7bc7ca7 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff4.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff0.pdf b/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6f3e1a14f659ccec66355c553f648d538dab13a9 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff0.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff1.pdf b/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..30f9041cb4c9ec88a529e94aa23ce984d22e1561 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff1.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff2.pdf b/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8f022474a08c6f58f10deeedfcc70619ed72a73d Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff2.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff3.pdf b/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ec320a903c145559435b97b7f2d60d9d9b85afef Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff3.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff4.pdf b/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..69d1c3ffbc99386d96d41fe5391185a9c925590f Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiff4.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiffComparison.pdf b/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiffComparison.pdf new file mode 100644 index 0000000000000000000000000000000000000000..458b8a7344d211bd0ca00f4d28bc8e7d02dea5a6 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/prediction_kx_ArtDiffComparison.pdf differ diff --git a/Project3/LyX/Figures/ArtificialDiffusion/results_ArtDiffComparison.npz b/Project3/LyX/Figures/ArtificialDiffusion/results_ArtDiffComparison.npz new file mode 100644 index 0000000000000000000000000000000000000000..5f9c41e013cd1eee3e383e8d0741c567db97c836 Binary files /dev/null and b/Project3/LyX/Figures/ArtificialDiffusion/results_ArtDiffComparison.npz differ diff --git a/Project3/LyX/Figures/DoubleSample/loss_theta.pdf b/Project3/LyX/Figures/DoubleSample/loss_theta.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7a33f31b1f39505b76c6b575a50e21c1203b1c18 Binary files /dev/null and b/Project3/LyX/Figures/DoubleSample/loss_theta.pdf differ diff --git a/Project3/LyX/Figures/DoubleSample/losses.pdf b/Project3/LyX/Figures/DoubleSample/losses.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1f0efdccc42b32ce9a711fd45ef0d1b0119455d2 Binary files /dev/null and b/Project3/LyX/Figures/DoubleSample/losses.pdf differ diff --git a/Project3/LyX/Figures/DoubleSample/predicted_vs_true_both_samples_sample_1.pdf b/Project3/LyX/Figures/DoubleSample/predicted_vs_true_both_samples_sample_1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..af5916c812803f63f0aa99b1533897da4e9b7562 Binary files /dev/null and b/Project3/LyX/Figures/DoubleSample/predicted_vs_true_both_samples_sample_1.pdf differ diff --git a/Project3/LyX/Figures/DoubleSample/predicted_vs_true_both_samples_sample_2.pdf b/Project3/LyX/Figures/DoubleSample/predicted_vs_true_both_samples_sample_2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5178d17e14d6c9be7fb0f61d28d3652ac107c4c0 Binary files /dev/null and b/Project3/LyX/Figures/DoubleSample/predicted_vs_true_both_samples_sample_2.pdf differ diff --git a/Project3/LyX/Figures/DoubleSample/prediction_kx.pdf b/Project3/LyX/Figures/DoubleSample/prediction_kx.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f7d54a268c33042487b04ece39dd537dd3be015b Binary files /dev/null and b/Project3/LyX/Figures/DoubleSample/prediction_kx.pdf differ diff --git a/Project3/LyX/Figures/DoubleSample/weights.pdf b/Project3/LyX/Figures/DoubleSample/weights.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bf9d24cfb43d9162617255b10e0fbde979b1df20 Binary files /dev/null and b/Project3/LyX/Figures/DoubleSample/weights.pdf differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_0.png b/Project3/LyX/Figures/InfluenceResistance/sample_0.png new file mode 100644 index 0000000000000000000000000000000000000000..b7b419b9d98edb8984138baa214544226fdfe4ef Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_0.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_1.png b/Project3/LyX/Figures/InfluenceResistance/sample_1.png new file mode 100644 index 0000000000000000000000000000000000000000..ff54c7b7d8b7164eb45c93c14ce33b3ead0bec4c Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_1.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_10.png b/Project3/LyX/Figures/InfluenceResistance/sample_10.png new file mode 100644 index 0000000000000000000000000000000000000000..d504beba88e69b22ffeae8a0ae7d5dddb0fc9e29 Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_10.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_11.png b/Project3/LyX/Figures/InfluenceResistance/sample_11.png new file mode 100644 index 0000000000000000000000000000000000000000..37974f8ff92230e69839e8f72942ffbbf03dd722 Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_11.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_12.png b/Project3/LyX/Figures/InfluenceResistance/sample_12.png new file mode 100644 index 0000000000000000000000000000000000000000..431bc6b9169ae5b25ef0d9867e04c30145a57c22 Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_12.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_13.png b/Project3/LyX/Figures/InfluenceResistance/sample_13.png new file mode 100644 index 0000000000000000000000000000000000000000..8c3705784fa15ffecd3f53b9891690ff902be616 Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_13.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_14.png b/Project3/LyX/Figures/InfluenceResistance/sample_14.png new file mode 100644 index 0000000000000000000000000000000000000000..e38061c969536a563390562031f12ad210895c9b Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_14.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_2.png b/Project3/LyX/Figures/InfluenceResistance/sample_2.png new file mode 100644 index 0000000000000000000000000000000000000000..159aacbbde7fd0fd2ef282ec003203abfc438bde Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_2.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_3.png b/Project3/LyX/Figures/InfluenceResistance/sample_3.png new file mode 100644 index 0000000000000000000000000000000000000000..67ef665484b5e8e0af48bda0121b8b499c830afc Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_3.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_4.png b/Project3/LyX/Figures/InfluenceResistance/sample_4.png new file mode 100644 index 0000000000000000000000000000000000000000..9c67d523ce9a6ae6cd1c660fd879b02e5c7fb6e3 Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_4.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_5.png b/Project3/LyX/Figures/InfluenceResistance/sample_5.png new file mode 100644 index 0000000000000000000000000000000000000000..3b34dd32ff10ed661f998f323ca3acb097f0d416 Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_5.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_6.png b/Project3/LyX/Figures/InfluenceResistance/sample_6.png new file mode 100644 index 0000000000000000000000000000000000000000..9379a812fda345cac073a1ea80c0e4bb31b7f5de Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_6.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_7.png b/Project3/LyX/Figures/InfluenceResistance/sample_7.png new file mode 100644 index 0000000000000000000000000000000000000000..6253999da19d0a897f098545edb06f4c65f904aa Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_7.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_8.png b/Project3/LyX/Figures/InfluenceResistance/sample_8.png new file mode 100644 index 0000000000000000000000000000000000000000..4855b348fd41ddc75dec25284c62e84e95fb304d Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_8.png differ diff --git a/Project3/LyX/Figures/InfluenceResistance/sample_9.png b/Project3/LyX/Figures/InfluenceResistance/sample_9.png new file mode 100644 index 0000000000000000000000000000000000000000..3ebe791f2e2cf5d2703ec3faa429fc7fe459248b Binary files /dev/null and b/Project3/LyX/Figures/InfluenceResistance/sample_9.png differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/best_loss_theta.pdf b/Project3/LyX/Figures/Optimization/SingleSample/best_loss_theta.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f94d06f7a96801003d5453b8f0002d427b1a4c67 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/best_loss_theta.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/best_losses.pdf b/Project3/LyX/Figures/Optimization/SingleSample/best_losses.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ae38411676247c986e47ce7a09a4057708b8eea9 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/best_losses.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/best_predicted_vs_true_single_sample.pdf b/Project3/LyX/Figures/Optimization/SingleSample/best_predicted_vs_true_single_sample.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f2bd936b7eb8c3826fe4f1d86118d65fe1da5a25 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/best_predicted_vs_true_single_sample.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/best_prediction_kx_ITERATION.pdf b/Project3/LyX/Figures/Optimization/SingleSample/best_prediction_kx_ITERATION.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a46bb92b082773146cda73ff6c95d19026d34f49 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/best_prediction_kx_ITERATION.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_0.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..adedddb045e3d62c53cd8a5923ab8a2c0e0c3796 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_0.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_1.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f286f013fe1144509adaacdd569624970906e4e1 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_1.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_10.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_10.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a67c439ba39a3ca985da93081955492b5e2626d6 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_10.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_11.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_11.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3aa4c756aa528dbd208c799870b838bac27fb59a Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_11.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_12.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_12.pdf new file mode 100644 index 0000000000000000000000000000000000000000..620def1ccb3488cfdbe6b5fef66712aa7fdfee34 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_12.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_13.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_13.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d2d05503fba4b63d2582f08d03968d4fa6a92f59 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_13.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_14.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_14.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f4e96ac5a060589af1e41edda785a490c07dfe6b Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_14.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_15.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_15.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bfe17ea1d35da5477db941572630314a16679214 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_15.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_16.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_16.pdf new file mode 100644 index 0000000000000000000000000000000000000000..11a8fccc8c5505422598c2aeef20a8ef7020ec9b Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_16.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_17.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_17.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bf8de6ca07cffae6d902eac6cc4e4ca156383dfa Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_17.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_18.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_18.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f8a5f2050c63d3aeb3604a361528e522e29e9c6b Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_18.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_19.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_19.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7964d58fa81ffc9035dcae6ffce3c0756f442ebe Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_19.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_2.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bc56dbb65f24cf15562aeaf289b8e762628bd82f Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_2.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_20.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_20.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ca2d012868b11205216d575e1ef3dca711a43b90 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_20.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_21.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_21.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c4b416ca0c58b7a216055728ca2e5930b266eb0b Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_21.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_22.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_22.pdf new file mode 100644 index 0000000000000000000000000000000000000000..896f22fd1405dbea55f13e892386597b32d05633 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_22.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_23.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_23.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0c18bd42da9b5bd7666bfa9f396fbb98670f2235 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_23.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_24.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_24.pdf new file mode 100644 index 0000000000000000000000000000000000000000..93c6727eed7e2e507a66ffe100ad59c0a0720533 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_24.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_3.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..31d8753dfa595449b5de156a682871d696e20725 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_3.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_4.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..546feee3f1a97c8407dcfba82b9e3364e18e0f58 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_4.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_5.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_5.pdf new file mode 100644 index 0000000000000000000000000000000000000000..07143fa448231eb9ccedcb934f762392d54b17d9 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_5.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_6.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_6.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7af6a4bcaffce9fb8b12b98644cfac32007e3f5f Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_6.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_7.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_7.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6f5f6600f93de1baaf481a1403d3c936e1018985 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_7.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_8.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_8.pdf new file mode 100644 index 0000000000000000000000000000000000000000..52d4c280f701b95dc8de68f5b380fda9213e6929 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_8.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_9.pdf b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_9.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5eb8336b49884a539027b3a88f81420ece6bf738 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/loss_theta_ITERATION_9.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_0.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..20946a874615b8db3bc571b3d212fae594578ad0 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_0.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_1.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a1da8bb83a9e6e52ecc2416430c0426b35df5ab3 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_1.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_10.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_10.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5cf4601e74b1bdd39c769b57fd2d51ec22b309d2 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_10.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_11.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_11.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d5b6c50cc2a10f35d867e50ff9da0b65782e83d3 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_11.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_12.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_12.pdf new file mode 100644 index 0000000000000000000000000000000000000000..565994efdbe2c2e081a31c2716b17f870cd792a8 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_12.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_13.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_13.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a8220289cbd6d73fefe8d8736666c96839f219c5 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_13.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_14.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_14.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2721e5da21b50649207a7d41628407efd9bb65cd Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_14.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_15.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_15.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fd99cdb503d56e4e1c59813b04c26eb282c37bba Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_15.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_16.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_16.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d98e13cae6266d7f5e288bae07b81bb98966ea2c Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_16.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_17.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_17.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1738e7522889bb1b1ade3c50a54a22be46def163 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_17.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_18.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_18.pdf new file mode 100644 index 0000000000000000000000000000000000000000..de9c70779202590c23dcf5664b3c7450941a37d3 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_18.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_19.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_19.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d9ed5076bf0cc007cc54d5a32b9e0a0c8b03d4d6 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_19.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_2.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f985a8b5e8f4a7a42dcbf6a0e4411126faa62ea5 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_2.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_20.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_20.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0a371e1852d7cc819223fd29053a38cb2439a3df Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_20.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_21.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_21.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1008c3e2d4c20d7ff7ab04c4e0cbd0e6e241b079 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_21.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_22.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_22.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fe90e231176c08669545b94a46c3073bd9f2743b Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_22.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_23.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_23.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8085633c1aa164866cf31501ff3bea03e414b717 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_23.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_24.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_24.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7801274f738711b549e8ce2182df1e1215443c38 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_24.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_3.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..81063463cea6577af43ef9f8da874cd3e8f9690f Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_3.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_4.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3d8f16b9a53231cd4874a76ae425715c896b8d69 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_4.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_5.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_5.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e51a9d794654ebf51045798fcaec5f63b1cd0aa8 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_5.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_6.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_6.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fd018b33914e24e726c92bdd76bb47058570f352 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_6.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_7.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_7.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1669162d8981523a9ff7af0ed1906deec67cd3a2 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_7.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_8.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_8.pdf new file mode 100644 index 0000000000000000000000000000000000000000..10a37d65d50bfabaf02ba0ce61a4580c594ca7e1 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_8.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_9.pdf b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_9.pdf new file mode 100644 index 0000000000000000000000000000000000000000..25a11fc8ab2a9c9c49cd17e2791e8935349ba157 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/losses_ITERATION_9.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_0.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ff7f58d281d856ab8ab9a6d9dedb0a369b346063 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_0.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_1.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..555ebb22a24d25f51f60620a52bf2ddfdb408546 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_1.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_10.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_10.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2d104cd3ec71c0ea4f5286fb38bbf5548b0a2f89 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_10.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_11.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_11.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1504aab3aa940b36920fc2f63afdadf293e54e55 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_11.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_12.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_12.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e763bd13d1f2d2f19490faddad110a929a5dcaf0 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_12.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_13.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_13.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e3383216b6f469eabf36d4566a2e8a8a5a0ef1b6 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_13.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_14.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_14.pdf new file mode 100644 index 0000000000000000000000000000000000000000..671c1c4b20c4d1c810f77c7347d014e6d88ebd64 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_14.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_15.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_15.pdf new file mode 100644 index 0000000000000000000000000000000000000000..497b278bf419887e8293eb5edb3d85d9f5c4f03f Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_15.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_16.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_16.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ecd73637d978c3412dd6a8340b6aeff7becf8bdd Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_16.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_17.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_17.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c42eeaaeacaeb60d5d2c1c490a135f2096270151 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_17.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_18.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_18.pdf new file mode 100644 index 0000000000000000000000000000000000000000..440e1aed0f43173b11667681948a27268a4a7e27 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_18.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_19.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_19.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cd5aebeae0f0fba775c7034696b0e99dedb8c966 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_19.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_2.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f2c3539740eec0b0d088356a9f690f518f1579a7 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_2.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_20.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_20.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f74dc994a369573658fe3380659a26c29f33ce4b Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_20.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_21.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_21.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d7d22023a06479c84da44ef5cf45f8ebdad53318 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_21.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_22.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_22.pdf new file mode 100644 index 0000000000000000000000000000000000000000..aad89343ea25124b1bc0ad28262b5cc22974b021 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_22.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_23.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_23.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1384d690c16fc1f07465ec74f5549d59c513f041 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_23.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_24.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_24.pdf new file mode 100644 index 0000000000000000000000000000000000000000..795c103c958a775aa71d70428711ccbdcc45c716 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_24.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_3.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3537f5dd4e54c1fac3df58e7f53983489fc800e6 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_3.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_4.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..83c1dfc6d7b8415650e39f3e107c0bbac68b3c8a Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_4.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_5.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_5.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ce0f8954dd5286bffd696b1d13bf3d5ba10f1500 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_5.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_6.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_6.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4180c7714b5fd637a5e1aa0aaede55cd0b34885b Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_6.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_7.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_7.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9727ab2cbbe8e79293f8c8d1a76a76549b756bed Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_7.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_8.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_8.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cf04e1efcc44bbb7aec147778c8fa196e33341c1 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_8.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_9.pdf b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_9.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7bfe66290bb57ddf243515ac467164ff0e4f4af7 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_9.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_0.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8b50e1bb4c8fde73841e37546b79a8f49121be4f Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_0.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_1.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1bbcef6e0a83cf866ac3f54d0a7c6a5be17e9dcd Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_1.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_10.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_10.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d73b61cbd9cbf8b0a7a12f1fa3e028e52a273072 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_10.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_11.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_11.pdf new file mode 100644 index 0000000000000000000000000000000000000000..321471b719ce635aa007da4aeddef9916cfb7953 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_11.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_12.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_12.pdf new file mode 100644 index 0000000000000000000000000000000000000000..49d6c4690afbe37a70d4ea55b22cbba53546c0f0 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_12.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_13.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_13.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3b610d9b30f74cbd27dfe7927c0354b24d7cc0cf Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_13.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_14.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_14.pdf new file mode 100644 index 0000000000000000000000000000000000000000..aae2774cf1b90ee8fd3abcdcd34bb594cc6bf32e Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_14.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_15.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_15.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b5d9f9a37b7daf54d848700e77b81342d162069b Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_15.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_16.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_16.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c9cbf9b8498f750c4e41204d957f680241d18652 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_16.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_17.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_17.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6a6218409a55550f0f5db28af6ac888fedd14972 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_17.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_18.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_18.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f68d8a13616854574c35af4df6eb6f3f5a0d6dd6 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_18.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_19.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_19.pdf new file mode 100644 index 0000000000000000000000000000000000000000..331d9443804b16a7cd999c72509482229bf7d47a Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_19.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_2.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e30767d4a1e0fe5508a3b5a46871452dfa79ad8d Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_2.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_20.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_20.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4aad9242b063a35a79a746c5216a38ddd42ac2e1 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_20.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_21.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_21.pdf new file mode 100644 index 0000000000000000000000000000000000000000..98d68128ee71653f4d4b02a11b09a01b8aaf9b51 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_21.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_22.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_22.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c51d069dd7245741c8cc60877430ab98dc3986ff Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_22.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_23.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_23.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ea7f971f3023cf7b3bf22ad65f2700fc46919b58 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_23.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_24.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_24.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c06a1e82a47721a6f4582acb50ee19ba82c1c539 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_24.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_3.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0faeccab2d5e6023fb74779a2feb97eb1f01daa8 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_3.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_4.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d4de60e7a782609dfa18bda0d34586ae07192c4d Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_4.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_5.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_5.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9b686983efdec6132bc26107ed471defa37677fa Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_5.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_6.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_6.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c7884cbc98d3e16a885a1ee655bfee6e93788ccc Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_6.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_7.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_7.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0ae7fa9ee59072d1fa5eed4942c4176164ae5dfa Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_7.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_8.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_8.pdf new file mode 100644 index 0000000000000000000000000000000000000000..34701d66b1a75ce2904b79fc5cd494a97ad2b01b Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_8.pdf differ diff --git a/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_9.pdf b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_9.pdf new file mode 100644 index 0000000000000000000000000000000000000000..45270f663612697afd2aab0a6541f8f858bb5d7d Binary files /dev/null and b/Project3/LyX/Figures/Optimization/SingleSample/prediction_kx_ITERATION_9.pdf differ diff --git a/Project3/LyX/Figures/Optimization/TunerConvergence.pdf b/Project3/LyX/Figures/Optimization/TunerConvergence.pdf new file mode 100644 index 0000000000000000000000000000000000000000..585c4ad219fff7719d2e67ae08cca6de45813c42 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/TunerConvergence.pdf differ diff --git a/Project3/LyX/Figures/Optimization/TunerConvergence.png b/Project3/LyX/Figures/Optimization/TunerConvergence.png new file mode 100644 index 0000000000000000000000000000000000000000..e19609f2575174193b5ad4cd52e8f470cd6a29a7 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/TunerConvergence.png differ diff --git a/Project3/LyX/Figures/Optimization/TunerObjective.pdf b/Project3/LyX/Figures/Optimization/TunerObjective.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cf93029dbac4790f5984f98d2760c8ff542e5b3d Binary files /dev/null and b/Project3/LyX/Figures/Optimization/TunerObjective.pdf differ diff --git a/Project3/LyX/Figures/Optimization/TunerObjective.png b/Project3/LyX/Figures/Optimization/TunerObjective.png new file mode 100644 index 0000000000000000000000000000000000000000..ec868020dc0717223089afb919508a1f9f17d0e5 Binary files /dev/null and b/Project3/LyX/Figures/Optimization/TunerObjective.png differ diff --git a/Project3/LyX/Figures/SingleSample/loss_theta.pdf b/Project3/LyX/Figures/SingleSample/loss_theta.pdf new file mode 100644 index 0000000000000000000000000000000000000000..923e9585ab1436ea8176faf372840891314cc800 Binary files /dev/null and b/Project3/LyX/Figures/SingleSample/loss_theta.pdf differ diff --git a/Project3/LyX/Figures/SingleSample/losses.pdf b/Project3/LyX/Figures/SingleSample/losses.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1c7e361e783fdb68262a4612f29a87a74914f150 Binary files /dev/null and b/Project3/LyX/Figures/SingleSample/losses.pdf differ diff --git a/Project3/LyX/Figures/SingleSample/predicted_vs_true_single_sample.pdf b/Project3/LyX/Figures/SingleSample/predicted_vs_true_single_sample.pdf new file mode 100644 index 0000000000000000000000000000000000000000..436f01cef8217a39f9021d2ed90a46a0ee010c22 Binary files /dev/null and b/Project3/LyX/Figures/SingleSample/predicted_vs_true_single_sample.pdf differ diff --git a/Project3/LyX/Figures/SingleSample/prediction_kx.pdf b/Project3/LyX/Figures/SingleSample/prediction_kx.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f2c55dbda2b5a9a093aeb89511b581e21c674417 Binary files /dev/null and b/Project3/LyX/Figures/SingleSample/prediction_kx.pdf differ diff --git a/Project3/LyX/Figures/SingleSample/weights.pdf b/Project3/LyX/Figures/SingleSample/weights.pdf new file mode 100644 index 0000000000000000000000000000000000000000..82bb77be61a0d4c5c931c60b24d1ef30b13c197c Binary files /dev/null and b/Project3/LyX/Figures/SingleSample/weights.pdf differ diff --git a/Project3/LyX/Implementation.lyx b/Project3/LyX/Implementation.lyx new file mode 100644 index 0000000000000000000000000000000000000000..92223eece7498795a76a880d6d837cfc83819807 --- /dev/null +++ b/Project3/LyX/Implementation.lyx @@ -0,0 +1,118 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass IEEEtran-CompSoc +\use_default_options true +\maintain_unincluded_children no +\language english +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment class +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008080 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Section +Implementation +\begin_inset CommandInset label +LatexCommand label +name "sec:Implementation" + +\end_inset + + +\end_layout + +\begin_layout Standard +Find all the following examples, + visualizations and the belonging code implementation in the reproducability repository for this project (see +\begin_inset CommandInset citation +LatexCommand cite +key "Repository" +literal "false" + +\end_inset + +). + All the implementations are done with the Python programming language, + mainly with the numpy package for vector operations and matplotlib for visualizations. +\end_layout + +\end_body +\end_document diff --git a/Project3/LyX/Introduction.lyx b/Project3/LyX/Introduction.lyx new file mode 100644 index 0000000000000000000000000000000000000000..ec830f0c361622b63c463b5ba038dd6a2cf92d5f --- /dev/null +++ b/Project3/LyX/Introduction.lyx @@ -0,0 +1,236 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass IEEEtran-CompSoc +\begin_preamble +\usepackage{tikz} +\usetikzlibrary{decorations.pathreplacing} +\end_preamble +\use_default_options true +\begin_modules +eqs-within-sections +figs-within-sections +\end_modules +\maintain_unincluded_children no +\language american +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment center +\paperfontsize default +\spacing single +\use_hyperref true +\pdf_title "Modeling Traffic Flow" +\pdf_author "Jan Habscheid" +\pdf_subject "Data-Driven Modeling of Conservation Laws" +\pdf_keywords "Traffic Flow, Advection, Riemann Problem, Lax-Entropy" +\pdf_bookmarks true +\pdf_bookmarksnumbered false +\pdf_bookmarksopen false +\pdf_bookmarksopenlevel 1 +\pdf_breaklinks false +\pdf_pdfborder false +\pdf_colorlinks false +\pdf_backref false +\pdf_pdfusetitle true +\papersize default +\use_geometry true +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine natbib +\cite_engine_type numerical +\biblio_style plainurl +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\branch 18.11.2024 +\selected 0 +\filename_suffix 0 +\color background background +\end_branch +\branch 21.11.2024 +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch 14112024 +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch 07112024 +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch 28112024 +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Inputs +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Abstract +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Introduction +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Theory and Methods +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Implementation and Validation +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Results +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Discussion and Conclusion +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch References +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Abbreviations +\selected 0 +\filename_suffix 0 +\color background background +\end_branch +\branch Implementation +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch List of Variables +\selected 0 +\filename_suffix 0 +\color background background +\end_branch +\branch Appendix +\selected 0 +\filename_suffix 0 +\color background background +\end_branch +\index Index +\shortcut idx +\color #008000 +\end_index +\leftmargin 2cm +\topmargin 1.5cm +\rightmargin 2cm +\bottommargin 1.5cm +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Section +Introduction +\begin_inset CommandInset label +LatexCommand label +name "sec:Introduction" + +\end_inset + + +\end_layout + +\begin_layout Standard +Traffic jams are part of everyday life. + Most people use the road, + either by car, + bus or bike, + to get to work, + to meet friends, + to go shopping or to enjoy hobbies. + Through this enormous use of the road, + traffic jams occur. + Traffic jams lead to a smaller speed of vehicles, + if too many vehicles are close to each other. +\end_layout + +\begin_layout Standard +The question that arises is, + how to reduce these traffic jams to increase the traffic’s quality. + This work assumes that the density of cars is measured at certain parts of the road and that a mathematical model is known, + up to an uncertain function. + The objective of this work is to present a general methodology to identify this uncertain function, + based on the known mathematical model and observation data. +\end_layout + +\end_body +\end_document diff --git a/Project3/LyX/ListOfVariables.lyx b/Project3/LyX/ListOfVariables.lyx new file mode 100644 index 0000000000000000000000000000000000000000..95c35cdefbcbe150aaa994a1b67351adbf820af8 --- /dev/null +++ b/Project3/LyX/ListOfVariables.lyx @@ -0,0 +1,767 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass IEEEtran-CompSoc +\use_default_options true +\maintain_unincluded_children no +\language english +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment class +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry false +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008080 +\end_index +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Subsection* +List of Variables +\begin_inset CommandInset label +LatexCommand label +name "subsec:ListOfVariables" + +\end_inset + + +\end_layout + +\begin_layout Standard +All the variables, + listed in the following table, + are in their dimensionless form. +\end_layout + +\begin_layout Standard +\align center + +\lang american +\begin_inset Tabular +<lyxtabular version="3" rows="19" columns="3"> +<features tabularvalignment="middle"> +<column alignment="center" valignment="top"> +<column alignment="center" valignment="top"> +<column alignment="center" valignment="top"> +<row> +<cell multicolumn="1" alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\series bold +DIMENSIONLESS VARIABLES +\end_layout + +\end_inset +</cell> +<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\series bold +Variable +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\series bold +Default Value +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\series bold +Property +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $L$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $20$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Axon length +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $D_{0}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $0.4$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Diffusion coefficient +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $N_{0}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $0.1$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\lang american +Concentration of free particles at left boundary +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $N_{L}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $0.01$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\lang american +Concentration of free particles at right boundary +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $k_{-}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +1 +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\lang american +binding rate in negative direction +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $\sigma_{0},\sigma_{L}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $0.1,0.1$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\lang american +Degree of loading at left and right boundary +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $k_{p},k_{n}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $0.5$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\lang american +Detachment rate for particles in positive and negative direction +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $\Delta x$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +0.2 +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Cell size +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $t_{\text{end}}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +10 +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Final time +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $N_{\text{time}}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +200 +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Number of time steps +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $\Delta t$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $0.05$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +Time step size +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell multicolumn="1" alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell multicolumn="1" alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +<cell multicolumn="2" alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +<cell multicolumn="2" alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell multicolumn="1" alignment="center" valignment="top" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\series bold +INDEXING +\end_layout + +\end_inset +</cell> +<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" bottomline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\series bold +Variable +\end_layout + +\end_inset +</cell> +<cell multicolumn="1" alignment="center" valignment="top" topline="true" bottomline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\series bold +Meaning +\end_layout + +\end_inset +</cell> +<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $\cdot^{j}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell multicolumn="1" alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $j$ +\end_inset + +-th time step +\end_layout + +\end_inset +</cell> +<cell multicolumn="2" alignment="center" valignment="top" topline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +</row> +<row> +<cell alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $\cdot_{i}$ +\end_inset + + +\end_layout + +\end_inset +</cell> +<cell multicolumn="1" alignment="center" valignment="top" topline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout +\begin_inset Formula $i$ +\end_inset + +-th grid point +\end_layout + +\end_inset +</cell> +<cell multicolumn="2" alignment="center" valignment="top" topline="true" bottomline="true" leftline="true" rightline="true" usebox="none"> +\begin_inset Text + +\begin_layout Plain Layout + +\end_layout + +\end_inset +</cell> +</row> +</lyxtabular> + +\end_inset + + +\end_layout + +\end_body +\end_document diff --git a/Project3/LyX/Project3Habscheid.lyx b/Project3/LyX/Project3Habscheid.lyx new file mode 100644 index 0000000000000000000000000000000000000000..451eac1dfa3a50493c3205f2de9fe4daa572de7a --- /dev/null +++ b/Project3/LyX/Project3Habscheid.lyx @@ -0,0 +1,418 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass IEEEtran-CompSoc +\begin_preamble +\usepackage{tikz} +\usetikzlibrary{decorations.pathreplacing} +\end_preamble +\use_default_options true +\begin_modules +eqs-within-sections +figs-within-sections +\end_modules +\maintain_unincluded_children no +\language american +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics pdftex +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment center +\paperfontsize default +\spacing single +\use_hyperref true +\pdf_title "Modeling Traffic Flow" +\pdf_author "Jan Habscheid" +\pdf_subject "Data-Driven Modeling of Conservation Laws" +\pdf_keywords "Traffic Flow, Advection, Riemann Problem, Lax-Entropy" +\pdf_bookmarks true +\pdf_bookmarksnumbered false +\pdf_bookmarksopen false +\pdf_bookmarksopenlevel 1 +\pdf_breaklinks false +\pdf_pdfborder false +\pdf_colorlinks false +\pdf_backref false +\pdf_pdfusetitle true +\papersize default +\use_geometry true +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine natbib +\cite_engine_type numerical +\biblio_style plainurl +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\branch 18.11.2024 +\selected 0 +\filename_suffix 0 +\color background background +\end_branch +\branch 21.11.2024 +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch 14112024 +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch 07112024 +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch 28112024 +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Inputs +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Abstract +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Introduction +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Theory and Methods +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Implementation and Validation +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Results +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Discussion and Conclusion +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch References +\selected 1 +\filename_suffix 0 +\color background background +\end_branch +\branch Abbreviations +\selected 0 +\filename_suffix 0 +\color background background +\end_branch +\branch Implementation +\selected 0 +\filename_suffix 0 +\color background background +\end_branch +\branch List of Variables +\selected 0 +\filename_suffix 0 +\color background background +\end_branch +\branch Appendix +\selected 0 +\filename_suffix 0 +\color background background +\end_branch +\index Index +\shortcut idx +\color #008000 +\end_index +\leftmargin 2cm +\topmargin 1.5cm +\rightmargin 2cm +\bottommargin 1.5cm +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Title + +\lang english +USING MONTE CARLO MARKOV CHAIN (MCMC) TO IDENTIFY UNKNOWN FLUX FUNCTION FROM OBSERVATION DATA +\begin_inset Foot +status open + +\begin_layout Plain Layout + +\lang english +Date: + 05.04.2025, + +\begin_inset Newline newline +\end_inset + +Referee: + Steinar Evje +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Author + +\lang english +Jan Habscheid +\begin_inset Foot +status open + +\begin_layout Plain Layout + +\lang english +Author: + Jan Habscheid, + +\begin_inset CommandInset href +LatexCommand href +name "J.Habscheid@stud.uis.no" +target "J.Habscheid@stud.uis.no" +type "mailto:" +literal "false" + +\end_inset + +, + Student ID: + 287338 +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Branch Inputs +inverted 0 +status open + +\begin_layout Standard +\begin_inset Branch Abstract +inverted 0 +status open + +\begin_layout Standard +\begin_inset CommandInset include +LatexCommand input +filename "Abstract.lyx" +literal "false" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Branch Introduction +inverted 0 +status open + +\begin_layout Standard +\begin_inset CommandInset include +LatexCommand input +filename "Introduction.lyx" +literal "false" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Branch Theory and Methods +inverted 0 +status open + +\begin_layout Standard +\begin_inset CommandInset include +LatexCommand input +filename "TheoryAndMethods.lyx" +literal "false" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Branch Implementation +inverted 0 +status open + +\begin_layout Standard +\begin_inset CommandInset include +LatexCommand input +filename "Implementation.lyx" +literal "false" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Branch Results +inverted 0 +status open + +\begin_layout Standard +\begin_inset CommandInset include +LatexCommand input +filename "Results.lyx" +literal "false" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Branch Discussion and Conclusion +inverted 0 +status open + +\begin_layout Standard +\begin_inset CommandInset include +LatexCommand input +filename "DiscussionAndConclusion.lyx" +literal "false" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Branch References +inverted 0 +status open + +\begin_layout Standard +\begin_inset CommandInset bibtex +LatexCommand bibtex +btprint "btPrintCited" +bibfiles "Bibliography" +options "plainurl" +encoding "default" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_body +\end_document diff --git a/Project3/LyX/Results.lyx b/Project3/LyX/Results.lyx new file mode 100644 index 0000000000000000000000000000000000000000..411bf73e01625519ade654c858b7c85e53e619cc --- /dev/null +++ b/Project3/LyX/Results.lyx @@ -0,0 +1,1771 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass IEEEtran-CompSoc +\begin_preamble +\usepackage{tikz} +\end_preamble +\use_default_options true +\maintain_unincluded_children no +\language american +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment center +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry true +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\leftmargin 2.5cm +\topmargin 2.5cm +\rightmargin 2.5cm +\bottommargin 2.5cm +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Section +Results +\begin_inset CommandInset label +LatexCommand label +name "sec:Results" + +\end_inset + + +\end_layout + +\begin_layout Standard + +\lang english +Find all the following examples, + visualizations and the belonging code implementation in the reproducability repository for this project (see +\begin_inset CommandInset citation +LatexCommand cite +key "Repository" +literal "false" + +\end_inset + +). + All the implementations are done with the Python programming language, + mainly with the numpy package for vector operations and matplotlib for visualizations. +\end_layout + +\begin_layout Standard +Two true solutions are available, + +\begin_inset Formula $d^{I}$ +\end_inset + + and +\begin_inset Formula $d^{II}$ +\end_inset + + with the respective initial data +\begin_inset Formula $u_{0}^{I}(x)$ +\end_inset + + and +\begin_inset Formula $u_{0}^{II}(x)$ +\end_inset + +. +\end_layout + +\begin_layout Standard +\begin_inset Formula +\begin{align} +u_{0}^{I}(x) & =\begin{cases} +0.2 & ,x\in[0,0.5]\\ +0.4 & ,x\in(0.5,1.5]\\ +0.6 & ,x\in(1.5,2.5]\\ +0.7 & ,x\in(2.5,3.5]\\ +0.4 & ,x\in(3.5,4] +\end{cases}\\ +u_{0}^{II}(x) & =\begin{cases} +0.1 & ,x\in[0,0.5]\\ +0.3 & ,x\in(0.5,1.5]\\ +0.7 & ,x\in(1.5,2.5]\\ +0.2 & ,x\in(2.5,4] +\end{cases} +\end{align} + +\end_inset + +If not stated otherwise, + the artificial diffusion parameter +\begin_inset Formula $M$ +\end_inset + + is set to one. +\end_layout + +\begin_layout Subsection +Influence of Resistance Function +\begin_inset Note Note +status open + +\begin_layout Plain Layout +Maybe move this to the introduction as a motivation? +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +First, + quantify the influence of the resistance function on the solution of the general conservation law for initial data +\begin_inset Formula $u_{0}^{I}(x)$ +\end_inset + +. + The resistance functions are assumed to follow a normal distribution with mean +\begin_inset Formula $1$ +\end_inset + + and standard deviation +\begin_inset Formula $0.25$ +\end_inset + +. + +\end_layout + +\begin_layout Standard +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/InfluenceResistance/sample_0.png + lyxscale 30 + width 60text% + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Caption Standard + +\begin_layout Plain Layout +\begin_inset CommandInset label +LatexCommand label +name "fig:InfluenceResistanceFunction-1" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Newline newline +\end_inset + + +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/InfluenceResistance/sample_1.png + lyxscale 30 + width 60text% + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Caption Standard + +\begin_layout Plain Layout +\begin_inset CommandInset label +LatexCommand label +name "fig:InfluenceResistanceFunction-2" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\begin_inset Newline newline +\end_inset + + +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/InfluenceResistance/sample_2.png + lyxscale 30 + width 60text% + +\end_inset + + +\end_layout + +\begin_layout Plain Layout +\begin_inset Caption Standard + +\begin_layout Plain Layout +\begin_inset CommandInset label +LatexCommand label +name "fig:InfluenceResistanceFunction-3" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +The resistance function +\begin_inset Formula $k(x)$ +\end_inset + + has a major impact on the solution of the general conservation law +\begin_inset Formula $u_{t}+\left(k(x)f(u)\right)_{x}=0$ +\end_inset + +. + Randomly generated, + normal distributed resistance functions are shown on the left, + while the predicted solution (solid lines) and the true solution (dotted lines) at observation points +\begin_inset Formula $x_{i}\in[0.75,1.5,2.25,3.25]$ +\end_inset + + for initial data +\begin_inset Formula $u_{0}^{I}(x)$ +\end_inset + + are shown on the right. +\begin_inset CommandInset label +LatexCommand label +name "fig:InfluenceResistanceFunction" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\end_inset + +Figure +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:InfluenceResistanceFunction" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + + shows three different, + randomly generated, + resistance functions (left) and the corresponding solution +\begin_inset Formula $u(x_{i},t)$ +\end_inset + + at +\begin_inset Formula $x_{i}\in[0.75,1.5,2.25,3.25]$ +\end_inset + + (right). + The resistance function is visualized over the spatial domain while the solution +\begin_inset Formula $u(x_{i},t)$ +\end_inset + + is visualized for the different positions over time. + The solid line is the predicted solution, + while the dotted points show the true observations. +\end_layout + +\begin_layout Standard +Although all resistance functions follow the same random distribution, + the solution for the conservation law differs strongly. + Figure +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:InfluenceResistanceFunction-1" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + + shows a shock for all observations, + while Figures +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:InfluenceResistanceFunction-2" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + + and +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:InfluenceResistanceFunction-3" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + + only show shocks for certain observation points. + Additionally, + the value of +\begin_inset Formula $u$ +\end_inset + + at some observation points increase over time for certain resistance functions, + while it decreases for others. +\end_layout + +\begin_layout Standard +Therefore, + the solution of the PDE is strongly sensitive to the chosen resistance function, + which emphasizes the huge challenge of the MCMC algorithm. +\end_layout + +\begin_layout Subsection +Finding the Best Hyperparameter +\begin_inset CommandInset label +LatexCommand label +name "subsec:FindingBestHyperparameter" + +\end_inset + + +\end_layout + +\begin_layout Standard +As the choice for the parameter +\begin_inset Formula $\beta$ +\end_inset + + and +\begin_inset Formula $\sigma^{}$ +\end_inset + + has a huge impact on the accuracy of the MCMC algorithm a hyperparameter optimization is performed. + The optimization is based on a bayesian optimization using Gaussian processes. + It runs 25 different MCMC algorithms to find the one with the smallest loss function +\begin_inset Formula $\Phi(\Theta)$ +\end_inset + +. + The number of MCMC iterations is fixed to 150 for the optimization. + The algorithm typically converges after this number of iterations and further improvements for the loss function are rather small. + +\end_layout + +\begin_layout Standard +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/Optimization/TunerConvergence.pdf + lyxscale 30 + width 45text% + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +The loss function +\begin_inset Formula $\Phi(\Theta)$ +\end_inset + + over the different optimization steps. + The best values for both parameter are found after 22 iterations. +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/Optimization/TunerObjective.pdf + lyxscale 30 + width 45text% + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +The objective of the optimization showing the tested values for +\begin_inset Formula $\beta$ +\end_inset + + and +\begin_inset Formula $\sigma^{}$ +\end_inset + +. +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +The gaussian process starts with a default value of +\begin_inset Formula $\beta=0.05$ +\end_inset + + and +\begin_inset Formula $\sigma^{}=0.25$ +\end_inset + +. + It searches in the range +\begin_inset Formula $\beta\in[0.01,0.1]$ +\end_inset + + and +\begin_inset Formula $\sigma^{}\in[0.1,0.4]$ +\end_inset + + and yields the optimal values +\begin_inset Formula $\beta_{\text{opt}}=0.0364,\sigma_{\text{opt}}=0.2443$ +\end_inset + +. +\begin_inset CommandInset label +LatexCommand label +name "fig:HyperparameterOptimization" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +Figures +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:HyperparameterOptimization" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + + visualizes the results of this hyperparameter optimization for +\begin_inset Formula $\beta\in[0.01,0.1],\sigma^{2}\in[0.1,0.4]$ +\end_inset + + with a start value +\begin_inset Formula $\beta=0.05$ +\end_inset + + and +\begin_inset Formula $\sigma^{2}=0.25$ +\end_inset + +. + The best parameter +\begin_inset Formula $\beta_{\text{opt}}=0.0364,\sigma_{\text{opt}}=0.2443$ +\end_inset + + yield a loss +\begin_inset Formula $\Phi(\Theta)=7.9612$ +\end_inset + +. + Note that the initial guess for the standard deviation was very good, + while the parameter +\begin_inset Formula $\beta$ +\end_inset + + shows better results for a reduced value. + The optimal parameter will be used for the remaining results. +\end_layout + +\begin_layout Subsection +Performing MCMC on a Single True Solution +\begin_inset CommandInset label +LatexCommand label +name "subsec:MCMC_SingleSample" + +\end_inset + + +\end_layout + +\begin_layout Standard +Initial distribution +\begin_inset Formula $u_{0}^{I}(x)$ +\end_inset + + is considered with the objective to identify the resistance function from this data.. +\end_layout + +\begin_layout Standard +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/SingleSample/loss_theta.pdf + lyxscale 30 + width 50text% + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +The loss function +\begin_inset Formula $\Phi(\Theta)$ +\end_inset + + over the iterations plotted in a log-log plot. + The loss improves consistent over the first iterations and finds an optimum at which it does not improve further. +\begin_inset CommandInset label +LatexCommand label +name "fig:MCMC_SingleSample_Loss" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/SingleSample/prediction_kx.pdf + lyxscale 30 + width 50text% + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +Prediction for resistance function +\begin_inset Formula $k(x)$ +\end_inset + +. +\begin_inset CommandInset label +LatexCommand label +name "fig:MCMC_SingleSample_k" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\begin_inset Newline newline +\end_inset + + +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/SingleSample/predicted_vs_true_single_sample.pdf + lyxscale 30 + width 60text% + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +Prediction vs true data for +\begin_inset Formula $u_{0}^{I}(x)$ +\end_inset + + over time at positions +\begin_inset Formula $x\in[0.75,1.5,2.25,3.25]$ +\end_inset + +. + The predictions (solid lines) at position +\begin_inset Formula $x\in[0.75,3.25]$ +\end_inset + + are an almost perfect match with the true data (dots). + For +\begin_inset Formula $x\in[1.5,2.25]$ +\end_inset + + the prediction underestimates the true solution, + partially. + +\begin_inset CommandInset label +LatexCommand label +name "fig:MCMC_SingleSample_u" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +Solution of MCMC for +\begin_inset Formula $u_{0}^{I}(x)$ +\end_inset + +. + The loss function shows a good convergence behavior and the predicted solution at +\begin_inset Formula $x\in[0.75,1.5,2.25,3.25]$ +\end_inset + + is close to the true solution at those points. +\begin_inset CommandInset label +LatexCommand label +name "fig:MCMC_SingleSample" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Plain Layout + +\end_layout + +\end_inset + +Figure +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:MCMC_SingleSample" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + + shows the evolution of the loss function (Figure +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:MCMC_SingleSample_Loss" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +), + the final estimation for the resistance function (Figure +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:MCMC_SingleSample_k" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +) and the final solution for the conservation law at the observation points ( +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:MCMC_SingleSample_u" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +). + +\end_layout + +\begin_layout Standard +The loss function is displayed in a double logarithmic plot, + showing consistent improvements for the prediction until it reaches a plateau. + New predictions are accepted on this plateau, + but those new predictions do not improve the accuracy. + +\end_layout + +\begin_layout Standard +The predicted resistance function shows a minimum at +\begin_inset Formula $x_{2}$ +\end_inset + + and maxima at +\begin_inset Formula $x_{6}$ +\end_inset + + and +\begin_inset Formula $x_{8}$ +\end_inset + +. + Using this resistance function to predict the values for +\begin_inset Formula $u$ +\end_inset + + at the four observation points yields very good results, + visualized in Figure +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:MCMC_SingleSample_u" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +. + The x-axis shows the time and the y-axis the value of +\begin_inset Formula $u$ +\end_inset + + at positions +\begin_inset Formula $x\in[0.75,1.5,2.25,3.25]$ +\end_inset + + (blue, + red, + green, + purple). + At positions +\begin_inset Formula $x\in[0.75,3.25]$ +\end_inset + + the prediction (solid lines) is an almost perfect match with the true solution (dots). + Nevertheless, + at positions +\begin_inset Formula $x\in[1.5,2.25]$ +\end_inset + + the predicted solution overestimates the true solution, + partially. + Generally, + the solution is very accurate at smooth regions and struggles with steep gradients. +\end_layout + +\begin_layout Subsubsection +Influence of Artificial Diffusion +\begin_inset CommandInset label +LatexCommand label +name "subsec:ArtificialDiffusion" + +\end_inset + + +\end_layout + +\begin_layout Standard +The amount of numerical diffusion, + added to the discretization scheme, + influences the solution of the PDE. + The original PDE is no longer solved, + but a slightly adapted one (compare with project 1 and 2), + making the numerical discretization inconsistent. + +\begin_inset Formula +\begin{align} +u_{t}+\left(k(x)f(u)\right)_{x} & =0\\ +\Rightarrow u_{t}^{\epsilon}+\left(k(x)f(u^{\epsilon})\right)_{x} & =u_{xx}^{\epsilon} +\end{align} + +\end_inset + +The higher the number of +\begin_inset Formula $M$ +\end_inset + +, + the higher the amount of artificial diffusion +\begin_inset Formula $u_{xx}^{\epsilon}$ +\end_inset + +, + smoothing the solution, + especially the shocks. + The shocks are hard to predict with the MCMC algorithm, + but nevertheless they are in the true dataset. + However, + only the shocks in the numerical solution are smoothed, + not in the observations. + Therefore, + adding to much artificial diffusion yields problems in the accuracy of the MCMC algorithm. +\end_layout + +\begin_layout Standard +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout + +\end_layout + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/ArtificialDiffusion/final_error_ArtDiffComparison.pdf + lyxscale 30 + width 50text% + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +Loss function +\begin_inset Formula $\Phi(\Theta)$ +\end_inset + + for different values of artificial diffusion +\begin_inset CommandInset label +LatexCommand label +name "fig:ArtificialDiffusion_Loss" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/ArtificialDiffusion/prediction_kx_ArtDiffComparison.pdf + lyxscale 30 + width 50text% + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +Reconstructed resistance function for different values of artificial diffusion. +\begin_inset CommandInset label +LatexCommand label +name "fig:ArtificialDiffusion_k" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +The parameter +\begin_inset Formula $M$ +\end_inset + +, + describing the amount of artificial diffusion added to the numerical discretization, + has a large impact on the accuracy of the MCMC algorithm. + The Figure shows four different values of +\begin_inset Formula $M\in[1,2,3,4]$ +\end_inset + + (blue, + red, + green, + purple). + The MCMC algorithm performs worse for increasing numbers of artificial diffusion, + which results in differences for the resistance function. + Increasing values of artificial diffusion result in smoothing of the shocks. + However, + this smoothing is only present in the numerical scheme, + not in the true solution. +\begin_inset CommandInset label +LatexCommand label +name "fig:ArtificialDiffusion" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\begin_layout Standard +Figure +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:ArtificialDiffusion" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + + shows the influence of the artificial diffusion parameter +\begin_inset Formula $M$ +\end_inset + + on the accuracy of the MCMC algorithm. + The final loss increases exponentially for increasing numerical diffusion (Figure +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:ArtificialDiffusion_Loss" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +), + emphasizing to use a consistent numerical scheme with a small amount of artificial diffusion. + The resistance function even yields a complete different solution for different numbers of +\begin_inset Formula $M$ +\end_inset + + (Figure +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:ArtificialDiffusion_k" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +). + +\end_layout + +\begin_layout Standard +As a consequence, + the value +\begin_inset Formula $M$ +\end_inset + + will be fixed to one for the remaining project. +\end_layout + +\begin_layout Subsection +Extending the MCMC Algorithm to Two True Solutions +\end_layout + +\begin_layout Standard +For now, + only initial distribution +\begin_inset Formula $u_{0}^{I}(x)$ +\end_inset + +, + with the corresponding true solution +\begin_inset Formula $d^{I}$ +\end_inset + +, + was considered. + In this example, + both initial distributions +\begin_inset Formula $u_{0}^{I}(x)$ +\end_inset + + and +\begin_inset Formula $u_{0}^{II}(x)$ +\end_inset + + with corresponding solutions +\begin_inset Formula $d^{I}$ +\end_inset + + and +\begin_inset Formula $d^{II}$ +\end_inset + + are used to inspect the influence of multiple true solutions on the MCMC algorithm. + The calculated loss +\begin_inset Formula $\text{LOSS}_{\alpha}$ +\end_inset + + is the combined loss of both distributions. +\begin_inset Formula +\begin{align} +\text{LOSS}_{\alpha}^{I} & =\Phi^{I}(\alpha)=\frac{1}{2}\frac{\left(h^{I}(\alpha)-d^{I}\right)\left(h^{I}(\alpha)-d^{I}\right)^{T}}{\gamma^{2}}\\ +\text{LOSS}_{\alpha}^{II} & =\Phi^{II}(\alpha)=\frac{1}{2}\frac{\left(h^{II}(\alpha)-d^{II}\right)\left(h^{II}(\alpha)-d^{II}\right)^{T}}{\gamma^{2}}\\ +\text{LOSS}_{\alpha} & =\Phi^{I}(\alpha)+\Phi^{II}(\alpha) +\end{align} + +\end_inset + + +\end_layout + +\begin_layout Standard +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/DoubleSample/loss_theta.pdf + lyxscale 30 + width 50text% + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +The loss function +\begin_inset Formula $\Phi(\Theta)$ +\end_inset + + over the iterations plotted in a log-log plot. + The algorithm shows a continuous improvement over the first 70-80 steps and then oscillates around an optimum. + +\begin_inset CommandInset label +LatexCommand label +name "fig:MCMC_DoubleSample_Loss" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/DoubleSample/prediction_kx.pdf + lyxscale 30 + width 50text% + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +Prediction for resistance function +\begin_inset Formula $k(x)$ +\end_inset + +. + The global minimum is again at +\begin_inset Formula $x_{2}$ +\end_inset + + but only one global maximum at +\begin_inset Formula $x_{6}$ +\end_inset + + is present. + +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:MCMC_SingleSample" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +. + +\begin_inset CommandInset label +LatexCommand label +name "fig:MCMC_DoubleSample_k" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Newline newline +\end_inset + + +\begin_inset Box Frameless +position "t" +hor_pos "c" +has_inner_box 1 +inner_pos "t" +use_parbox 0 +use_makebox 0 +width "40text%" +special "none" +height "1in" +height_special "totalheight" +thickness "0.4pt" +separation "3pt" +shadowsize "4pt" +framecolor "foreground" +backgroundcolor "none" +status open + +\begin_layout Plain Layout +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/DoubleSample/predicted_vs_true_both_samples_sample_1.pdf + lyxscale 30 + width 100text% + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +Prediction vs true data for +\begin_inset Formula $u_{0}^{I}(x)$ +\end_inset + +. + The solution improved, + compared to the one presented in section +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:MCMC_SingleSample" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +. + Only slight offsets at +\begin_inset Formula $x=0.75$ +\end_inset + + for +\begin_inset Formula $t\approx0.5$ +\end_inset + + and +\begin_inset Formula $x=2.25$ +\end_inset + + for +\begin_inset Formula $t\approx1.9$ +\end_inset + + can be identified. + At positions +\begin_inset Formula $x\in[1.5,3.25]$ +\end_inset + + almost no difference between the predicted and the true solution can be seen. + +\begin_inset CommandInset label +LatexCommand label +name "fig:MCMC_DoubleSample_u1" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Box Frameless +position "t" +hor_pos "c" +has_inner_box 1 +inner_pos "t" +use_parbox 0 +use_makebox 0 +width "40text%" +special "none" +height "1in" +height_special "totalheight" +thickness "0.4pt" +separation "3pt" +shadowsize "4pt" +framecolor "foreground" +backgroundcolor "none" +status open + +\begin_layout Plain Layout +\begin_inset Float figure +placement document +alignment document +wide false +sideways false +status open + +\begin_layout Plain Layout +\begin_inset Graphics + filename Figures/DoubleSample/predicted_vs_true_both_samples_sample_2.pdf + lyxscale 30 + width 100text% + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +Prediction vs true data for +\begin_inset Formula $u_{0}^{II}(x)$ +\end_inset + +. + The solution at all four observed positions is very accurate, + showing only slight perturbances in front of the shock at +\begin_inset Formula $x=3.25$ +\end_inset + +, + with a very accurate reproduction of the shock. +\begin_inset CommandInset label +LatexCommand label +name "fig:MCMC_DoubleSample_u2" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + + +\begin_inset Caption Standard + +\begin_layout Plain Layout +Solution of MCMC for +\begin_inset Formula $u_{0}^{I}$ +\end_inset + + and +\begin_inset Formula $u_{0}^{II}$ +\end_inset + +. + Considering two datasets, + instead of only a single dataset, + improves the accuracy of the MCMC algorithm. + It is hard to compare the absolute value of the loss function, + compared to the value from section +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:MCMC_SingleSample" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +, + as it combines the error of both distributions. + Nevertheless, + the prediction of +\begin_inset Formula $u$ +\end_inset + + at the observed positions can be interpreted and shows a clear improvement. + The prediction is an almost perfect match for both distributions, + at all four positions over the whole time. + It only shows slight perturbances at sharp gradients. +\begin_inset CommandInset label +LatexCommand label +name "fig:MCMC_DoubleSample" + +\end_inset + + +\end_layout + +\end_inset + + +\end_layout + +\end_inset + +Figure +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:MCMC_DoubleSample" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + + visualizes the solution, + when considering both initial distributions. + The loss function shows a clear convergence (see Figure +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:MCMC_DoubleSample_Loss" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +) with a good initial improvement until it oscillates around a minimum. +\end_layout + +\begin_layout Standard +The found resistance function (Figure +\begin_inset CommandInset ref +LatexCommand ref +reference "fig:MCMC_DoubleSample_k" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +) is similar to the one from section +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:MCMC_SingleSample" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + + for +\begin_inset Formula $x\in[0,2.5)$ +\end_inset + + and shows differences for +\begin_inset Formula $x\in[2.5,4]$ +\end_inset + +. + +\end_layout + +\begin_layout Standard +Where the solution from section +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:MCMC_SingleSample" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + + shows two critical regions, + the newly identified function predicts the true solution in these regions very accurate. + Furthermore, + the observation points for the second dataset are reproduced very accurate, + too. + The prediction only shows slight problems at sharp gradients, + which probably occurs because of the remaining numerical diffusion. + This numerical diffusion changes the numerical solution, + compared to the true solution, + even for a perfectly identified resistance function (compare with section +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:ArtificialDiffusion" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +). +\end_layout + +\end_body +\end_document diff --git a/Project3/LyX/TheoryAndMethods.lyx b/Project3/LyX/TheoryAndMethods.lyx new file mode 100644 index 0000000000000000000000000000000000000000..958fc5a143e750428f7ee8a1f2f15df8f6067acb --- /dev/null +++ b/Project3/LyX/TheoryAndMethods.lyx @@ -0,0 +1,868 @@ +#LyX 2.4 created this file. For more info see https://www.lyx.org/ +\lyxformat 620 +\begin_document +\begin_header +\save_transient_properties true +\origin unavailable +\textclass IEEEtran-CompSoc +\begin_preamble +\usepackage{tikz} +\usetikzlibrary{decorations.pathreplacing} +\end_preamble +\use_default_options true +\maintain_unincluded_children no +\language american +\language_package default +\inputencoding utf8 +\fontencoding auto +\font_roman "default" "default" +\font_sans "default" "default" +\font_typewriter "default" "default" +\font_math "auto" "auto" +\font_default_family default +\use_non_tex_fonts false +\font_sc false +\font_roman_osf false +\font_sans_osf false +\font_typewriter_osf false +\font_sf_scale 100 100 +\font_tt_scale 100 100 +\use_microtype false +\use_dash_ligatures true +\graphics default +\default_output_format default +\output_sync 0 +\bibtex_command default +\index_command default +\float_placement class +\float_alignment center +\paperfontsize default +\spacing single +\use_hyperref false +\papersize default +\use_geometry true +\use_package amsmath 1 +\use_package amssymb 1 +\use_package cancel 1 +\use_package esint 1 +\use_package mathdots 1 +\use_package mathtools 1 +\use_package mhchem 1 +\use_package stackrel 1 +\use_package stmaryrd 1 +\use_package undertilde 1 +\cite_engine basic +\cite_engine_type default +\biblio_style plain +\use_bibtopic false +\use_indices false +\paperorientation portrait +\suppress_date false +\justification true +\use_refstyle 1 +\use_formatted_ref 0 +\use_minted 0 +\use_lineno 0 +\index Index +\shortcut idx +\color #008000 +\end_index +\spellchecker_ignore american Sobolev +\spellchecker_ignore american OpenMP +\spellchecker_ignore american scalable +\spellchecker_ignore american discretized +\spellchecker_ignore american splitted +\spellchecker_ignore american bilinear +\leftmargin 2.5cm +\topmargin 2.5cm +\rightmargin 2.5cm +\bottommargin 2.5cm +\secnumdepth 3 +\tocdepth 3 +\paragraph_separation indent +\paragraph_indentation default +\is_math_indent 0 +\math_numbering_side default +\quotes_style english +\dynamic_quotes 0 +\papercolumns 1 +\papersides 1 +\paperpagestyle default +\tablestyle default +\tracking_changes false +\output_changes false +\change_bars false +\postpone_fragile_content true +\html_math_output 0 +\html_css_as_file 0 +\html_be_strict false +\docbook_table_output 0 +\docbook_mathml_prefix 1 +\end_header + +\begin_body + +\begin_layout Section +Theory and Methods +\begin_inset CommandInset label +LatexCommand label +name "sec:Theory-and-Methods" + +\end_inset + + +\end_layout + +\begin_layout Standard +Consider the general mathematical description of a traffic flow (see project 2 for more reference) +\begin_inset Formula +\begin{align} +u_{t}+f(u)_{x} & =0,\quad x\in[a,b]\\ +u(x,t=0) & =u_{0}(x)\\ +u_{x}\big|_{x=x_{\text{in}}} & =u_{\text{in}}\\ +u_{x}\big|_{x=x_{\text{out}}} & =u_{\text{out}} +\end{align} + +\end_inset + +with +\begin_inset Formula $a=0$ +\end_inset + +, + +\begin_inset Formula $b=4$ +\end_inset + +, + the flux function +\begin_inset Formula $f(u)=u(1-u)$ +\end_inset + +. + In reality, + this model is influenced by some uncertainty, + quantified by the +\begin_inset Quotes eld +\end_inset + +resistance +\begin_inset Quotes erd +\end_inset + + function +\begin_inset Formula $k(x)$ +\end_inset + + +\begin_inset Formula +\begin{align} +u_{t}+\left(k(x)f(u)\right)_{x} & =0,\quad x\in[a,b]\\ +u(x,t=0) & =u_{0}(x)\\ +u_{x}\big|_{x=a}=u_{x}\big|_{x=b} & =0 +\end{align} + +\end_inset + +The boundaries are described by Neumann boundary conditions. + Purpose of this work is to identify the resistance function +\begin_inset Formula $k(x)$ +\end_inset + + for a known solution +\begin_inset Formula $u(x_{i},t)$ +\end_inset + + at specified positions +\begin_inset Formula $x_{i}$ +\end_inset + +. + Therefore, + an inverse problem will be formulated, + which utilizes Monte-Carlo Markov-Chains for the uncertainty quantification. +\end_layout + +\begin_layout Subsection +Numerical Discretization of the General Conservation Law +\end_layout + +\begin_layout Standard +The general conservation law will be solved numerically with an explicit Euler for time integration and an upwind method for the spatial derivatives. + Discretizing the equation results in +\begin_inset Formula +\begin{equation} +\frac{u_{i}^{n+1}-u_{i}^{n}}{\Delta t}+\frac{1}{\Delta x}\left(k(x_{i+\frac{1}{2}})F_{i+\frac{1}{2}}^{n}-k(x_{i-\frac{1}{2}})F_{i-\frac{1}{2}}^{n}\right)=0 +\end{equation} + +\end_inset + +with the numerical flux +\begin_inset Formula +\begin{equation} +F_{i+\frac{1}{2}}=\frac{f(u_{i}^{n})+f(u_{i+1}^{n})}{2}-\frac{M}{2}\left(u_{i+1}^{n}-u_{i}^{n}\right) +\end{equation} + +\end_inset + +and the time step size +\begin_inset Formula $\Delta t$ +\end_inset + +, + +\begin_inset Formula $\Delta x$ +\end_inset + + the spatial discretization, + the upper index +\begin_inset Formula $\cdot^{n}$ +\end_inset + + identify the time and the lower index +\begin_inset Formula $\cdot_{i}$ +\end_inset + + identifying the space. + +\begin_inset Formula $M$ +\end_inset + + adds a certain amount of artificial diffusion. + For more reference on the numerical discretization scheme see project 1 and project 2. +\end_layout + +\begin_layout Subsection +The Resistance Function +\begin_inset Formula $k(x)$ +\end_inset + + +\end_layout + +\begin_layout Standard +Assume that the resistance function is represented as a piecewise linear function over the spatial domain. + The function is defined at 11 uniformly spaced points +\begin_inset Formula $\{x_{i}\}_{i=0}^{i=10}$ +\end_inset + + including the boundary +\begin_inset Formula +\begin{align} +x_{i} & \in\left[a,a+\frac{b-a}{11},2\frac{b-a}{11},\dots,b\right]\\ +k_{i} & =k(x_{i}) +\end{align} + +\end_inset + +The points +\begin_inset Formula $x_{i}$ +\end_inset + + are known. + However, + the respective values of the resistance function are unknown and the objective is to identify these 11 values. + Assume that the resistance function is close to one +\begin_inset Formula +\begin{equation} +k(x)\in[0.25,1.75] +\end{equation} + +\end_inset + + +\end_layout + +\begin_layout Subsection +The Observer +\end_layout + +\begin_layout Standard +Assume that the density of cars is observed by some cameras. + These cameras are placed at four positions +\begin_inset Formula $\tilde{x}_{i}\in[0.75,1.5,2.25,3.25]$ +\end_inset + +. + The density of cars is observed at some uniformly sampled, + discrete timeframes +\begin_inset Formula +\begin{equation} +t_{i}\in[t_{0},t_{1},\dots t_{N}] +\end{equation} + +\end_inset + +with the first timeframe observing the initial distribution +\begin_inset Formula $t_{0}=0$ +\end_inset + + and the last timeframe observing the final distribution +\begin_inset Formula $t_{N}=10=T_{\text{end}}$ +\end_inset + +. + +\begin_inset Formula $N=40$ +\end_inset + + different observations are made in total. +\end_layout + +\begin_layout Subsection +Monte-Carlo Marcov-Chains +\end_layout + +\begin_layout Standard +The general idea of a Monte-Carlo Marcov-Chain (MCMC) is to identify an unknown parameter +\begin_inset Formula $\Theta$ +\end_inset + +, + based on true solutions. + For this work, + the Metropolis-Hastings algorithm will be utilized to identify the resistance function +\begin_inset Formula $k(x)$ +\end_inset + + (see +\begin_inset CommandInset citation +LatexCommand cite +key "SteinerEvje-Lecture" +literal "false" + +\end_inset + +). + The algorithm iteratively minimizes the loss function +\begin_inset Formula $\Phi$ +\end_inset + + describing the mismatch between the prediction +\begin_inset Formula $\Theta$ +\end_inset + + and true solution +\begin_inset Formula $d$ +\end_inset + +. +\begin_inset Formula +\begin{equation} +\Phi^{k}\sim\parallel h(\Theta^{k})-d\parallel^{2} +\end{equation} + +\end_inset + + +\end_layout + +\begin_layout Standard +The main assumption is, + that the unknown parameter vector can be described by a normal distribution. + This assumption can be reformulated in a way to describe the true solution +\begin_inset Formula $d$ +\end_inset + + by the current solution +\begin_inset Formula $h(\Theta)$ +\end_inset + + and some offset +\begin_inset Formula $\eta$ +\end_inset + +. +\begin_inset Formula +\begin{align} +d & =h(\Theta)+\eta\\ +\eta & =d-h(\Theta)\sim N(0,\gamma^{2}\boldsymbol{I}) +\end{align} + +\end_inset + + +\end_layout + +\begin_layout Standard +with the probability for the random variable +\begin_inset Formula $\eta$ +\end_inset + + given by +\begin_inset Formula $P(\eta;0,\gamma^{2}\boldsymbol{I})$ +\end_inset + + and the identity matrix +\begin_inset Formula $\boldsymbol{I}$ +\end_inset + +. +\begin_inset Formula +\begin{align} +P\left(\eta=d-h(\Theta);0,\gamma^{2}\boldsymbol{I}\right) & =\frac{1}{\sqrt{2\pi\gamma^{2}}}\exp\left[-\frac{1}{2}\frac{\left(d-h(\Theta)\right)\left(d-h(\Theta)\right)^{2}}{\gamma^{2}}\right]\\ + & =\frac{1}{\sqrt{2\pi\gamma^{2}}}\exp\left[-\frac{1}{2}\frac{\parallel d-h(\Theta)\parallel^{2}}{\gamma^{2}}\right]\\ + & =\frac{1}{\sqrt{2\pi\gamma^{2}}}\exp\left[-\Phi(\Theta)\right]\\ + & =P_{\Theta}\\ +\text{with: }\Phi(\Theta) & =\frac{1}{2}\frac{\parallel d-h(\Theta)\parallel^{2}}{\gamma^{2}} +\end{align} + +\end_inset + +Also consider a slightly perturbed version +\begin_inset Formula $\phi$ +\end_inset + + of +\begin_inset Formula $\Theta$ +\end_inset + +, + which is randomly generated. + The probability for the random variable +\begin_inset Formula $\eta$ +\end_inset + + can be calculated according to +\begin_inset Formula +\begin{align} +p\left(\eta=d-h(\phi);0,\gamma^{2}\boldsymbol{I}\right) & =\frac{1}{\sqrt{2\pi\gamma^{2}}}\exp\left[-\Phi(\phi)\right]\\ + & =P_{\phi}\\ +\text{with: }\Phi(\phi) & =\frac{1}{2}\frac{\parallel d-h(\phi)\parallel^{2}}{\gamma^{2}} +\end{align} + +\end_inset + +The arising question is if either +\begin_inset Formula $\Theta$ +\end_inset + + or +\begin_inset Formula $\phi$ +\end_inset + + describes the unknown function +\begin_inset Formula $k(x)$ +\end_inset + + better. + The smaller the value of +\begin_inset Formula $\Phi(\cdot)\sim\parallel d-h(\cdot)\parallel$ +\end_inset + + the better does +\begin_inset Formula $h(\cdot)$ +\end_inset + + describes the unknown function. + Rewriting this ends in a rule to choose the property with the higher probability. +\begin_inset Formula +\begin{equation} +\max\{P_{\Theta},P_{\phi}\} +\end{equation} + +\end_inset + +If +\begin_inset Formula $\phi$ +\end_inset + + has the higher probability ( +\begin_inset Formula $\frac{P_{\phi}}{P_{\Theta}}\geq1$ +\end_inset + +), + +\begin_inset Formula $\Theta$ +\end_inset + + should be updated to match +\begin_inset Formula $\phi$ +\end_inset + +, + otherwise it can be continued with the current +\begin_inset Formula $\Theta$ +\end_inset + + and tried again with another randomly generated perturbation +\begin_inset Formula $\phi$ +\end_inset + +. + To avoid ending in local minima, + an element of randomness is introduced. + The decision function +\begin_inset Formula $a(\Theta,\phi)$ +\end_inset + + is defined for this. +\begin_inset Formula +\begin{equation} +a(\Theta,\phi)=\min\{1,\frac{P_{\phi}}{P_{\Theta}}\}\qquad\text{with: }\frac{P_{\phi}}{P_{\Theta}}=\exp\left[\Phi(\Theta)-\Phi(\phi)\right] +\end{equation} + +\end_inset + +The current prediction +\begin_inset Formula $\Theta$ +\end_inset + + will be updated, + if a randomly, + uniformly sampled number +\begin_inset Formula $i$ +\end_inset + + ( +\begin_inset Formula $i\sim U([0,1])$ +\end_inset + + is smaller than a, + otherwise the algorithm continues with the current guess. +\end_layout + +\begin_layout Subsubsection +The Metropolis-Hastings Algorithm +\end_layout + +\begin_layout Standard +Define +\begin_inset Formula +\begin{align} +a(\Theta,\phi) & =\min\{1,\exp(\Phi(\Theta)-\Phi(\phi)\}\\ +\text{LOSS}_{\alpha} & =\Phi(\alpha)=\frac{1}{2}\frac{\left(h(\alpha)-d\right)\left(h(\alpha)-d\right)^{T}}{\gamma^{2}}\\ +\eta\sim N(0,\gamma^{2}\boldsymbol{I}),\quad\gamma & =0.03\\ +\mu & =1,\\ +\beta=\beta,\quad\sigma & =\sigma\\ +\tau & =100 +\end{align} + +\end_inset + +where the newly introduced parameter +\begin_inset Formula $\mu$ +\end_inset + + describes the mean of the assumed normal distribution and +\begin_inset Formula $\tau$ +\end_inset + + is the number of iteration steps performed before the MCMC algorithm starts, + as a burn-in period. + Note that the parameter +\begin_inset Formula $\beta$ +\end_inset + + and +\begin_inset Formula $\sigma$ +\end_inset + + are not fixed, + yet. + Their optimal values will be calculated in a hyperparameter optimization in section +\begin_inset CommandInset ref +LatexCommand ref +reference "subsec:FindingBestHyperparameter" +plural "false" +caps "false" +noprefix "false" +nolink "false" + +\end_inset + +. + Index +\begin_inset Formula $k$ +\end_inset + + describes the current iteration index. +\end_layout + +\begin_layout Standard +The algorithm is as follows: +\end_layout + +\begin_layout Enumerate +Start with initial guess +\begin_inset Formula $\Theta^{(0)}\sim N(\mu,\sigma^{2}\boldsymbol{I})$ +\end_inset + + +\end_layout + +\begin_deeper +\begin_layout Enumerate +Avoid to much noise by clipping the boundaries of +\begin_inset Formula $\Theta^{(0)}\in[0.8,1.2]$ +\end_inset + + +\end_layout + +\end_deeper +\begin_layout Enumerate +Calculate the perturbation: + +\begin_inset Formula $\phi^{(k)}=\sqrt{1-\beta^{2}}\Theta^{(k)}+\beta\xi^{(k)},\xi^{(k)}\sim N(0,\sigma^{2}\boldsymbol{I})$ +\end_inset + + +\end_layout + +\begin_layout Enumerate +Calculate the decision function +\begin_inset Formula $a(\Theta,\phi)$ +\end_inset + + +\end_layout + +\begin_layout Enumerate +Draw a random number +\begin_inset Formula $i^{(k)}$ +\end_inset + + from a uniform distribution and determine +\begin_inset Formula $\Theta^{(k+1)}$ +\end_inset + + +\end_layout + +\begin_deeper +\begin_layout Enumerate +If +\begin_inset Formula $i\leq a(\Theta,\phi)$ +\end_inset + + update +\begin_inset Formula $\Theta^{(k+1)}=\phi^{(k)}$ +\end_inset + + +\end_layout + +\begin_layout Enumerate +Else update +\begin_inset Formula $\Theta^{(k+1)}=\Theta^{(k)}$ +\end_inset + + +\end_layout + +\end_deeper +\begin_layout Standard +For the burn-in period, + steps 2-4 are repeated for +\begin_inset Formula $k\in[0,\tau]$ +\end_inset + + to precondition the prediction vector +\begin_inset Formula $\Theta$ +\end_inset + +. + Then, + the MCMC algorithm is performed, + where steps 2-4 are repeated for +\begin_inset Formula $k\in[0,n_{\text{MCMC}}]$ +\end_inset + + and for each MCMC step the steps are repeated 20 times, + too. +\end_layout + +\begin_layout Subsubsection +Discussing the Parameter of the MCMC Algorithm +\end_layout + +\begin_layout Standard +The parameter +\begin_inset Formula $\beta$ +\end_inset + + is of high interest for the algorithm, + as it controls the difference between the guess +\begin_inset Formula $\Theta^{(k)}$ +\end_inset + + and the perturbation +\begin_inset Formula $\phi^{(k)}$ +\end_inset + +. + An increased value for +\begin_inset Formula $\beta$ +\end_inset + + will increase this difference, + giving a higher weight to the random value +\begin_inset Formula $\xi^{(k)}$ +\end_inset + +, + which may lead to a faster improvement of the loss function but comes with the danger to get stuck in a local minimum. + A good rule of thumb is to start with large steps and a large +\begin_inset Formula $\beta$ +\end_inset + + in the beginning to then iteratively reduce this parameter for a better convergence. + Nevertheless, + this work utilizes a constant parameter +\begin_inset Formula $\beta$ +\end_inset + +, + for the sake of simplicity. + +\begin_inset Note Note +status collapsed + +\begin_layout Plain Layout +In this work, + the parameter +\begin_inset Formula $\beta$ +\end_inset + + is updated after each MCMC iteration, + based on the acceptance rate to update the guess +\begin_inset Formula $\Theta^{(k+1)}=\phi^{(k)}$ +\end_inset + +. +\end_layout + +\end_inset + + +\begin_inset Note Note +status collapsed + +\begin_layout Plain Layout +The parameter +\begin_inset Formula $\beta$ +\end_inset + + is updated after each MCMC iteration to push the algorithm to an acceptance rate of +\begin_inset Formula $\omega\in[\omega_{\min},\omega_{\max}]$ +\end_inset + + +\end_layout + +\begin_layout Enumerate +If the acceptance rate is below +\begin_inset Formula $\omega_{\min}$ +\end_inset + + update +\begin_inset Formula $\beta=\frac{9}{10}\beta$ +\end_inset + + +\end_layout + +\begin_deeper +\begin_layout Enumerate +If the acceptance rate is above +\begin_inset Formula $\omega_{\max}$ +\end_inset + + update +\begin_inset Formula $\beta=\frac{11}{10}\beta$ +\end_inset + + +\end_layout + +\end_deeper +\end_inset + + +\begin_inset Note Note +status collapsed + +\begin_layout Plain Layout +The different observations are weighted differently to ensure that the resistance function +\begin_inset Formula $k(x)$ +\end_inset + + is accurately calculated on the whole domain Consider the weighting vector +\begin_inset Formula $w=[w_{1},w_{2},w_{3},w_{4}]$ +\end_inset + +, + with +\begin_inset Formula $w_{i}=1\forall i\in[0,4]$ +\end_inset + + +\end_layout + +\begin_layout Enumerate +After each iteration update the weights +\end_layout + +\begin_deeper +\begin_layout Enumerate +Calculate +\begin_inset Formula $\tilde{w}_{i}=L_{2}(h(\Theta_{i}),d_{i})$ +\end_inset + + and calculate +\begin_inset Formula $w_{i}=n\frac{\tilde{w}_{i}}{\sum_{i=1}^{n}\tilde{w}_{i}}$ +\end_inset + + +\end_layout + +\end_deeper +\end_inset + + +\end_layout + +\begin_layout Standard +The randomly generated parameter +\begin_inset Formula $\Theta^{(0)}$ +\end_inset + + influences the initial convergence behavior, + as it determines the starting point of the optimization problem. + If +\begin_inset Formula $\Theta^{(0)}$ +\end_inset + + is chosen very close to the true solution the algorithm will converge fast. + If, + on the other hand, + +\begin_inset Formula $\Theta^{(0)}$ +\end_inset + + is chosen poorly, + it will take more iterations for the algorithm to come to a good solution. + It may even happen that the algorithm will get stuck in some local minimum, + instead of finding the global minimum. + To reduce randomness in the algorithm, + it is a good choice to either reduce the standard deviation +\begin_inset Formula $\sigma^{(0)}$ +\end_inset + + for the initial guess or to clip the range of +\begin_inset Formula $\Theta^{(0)}$ +\end_inset + +. + Both will reduce the range, + and therefore the variance, + of the initial guess, + reducing the impact of randomness. + It is unknown if this will improve the convergence behavior, + as the variance of the true solution may differ, + but it will balance the convergence behavior for different initial guesses. +\end_layout + +\end_body +\end_document diff --git a/Project3/src/Figures/ArtificialDiffusion/final_error_ArtDiffComparison.pdf b/Project3/src/Figures/ArtificialDiffusion/final_error_ArtDiffComparison.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5d48c642b08dd20e8a5b89f9d5b4b73e3e61b854 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/final_error_ArtDiffComparison.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff0.pdf b/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9a0edc6329c9978a2fff20fdf088850176be82a9 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff0.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff1.pdf b/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..942c9aff96947e27df388b11805fa790bd1ceeb0 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff1.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff2.pdf b/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3a3ce5b79deb4a6eb08947ff0f3200e88b9d0370 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff2.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff3.pdf b/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..80a2f8d62bb191117c2661b6ad04b92ac26d4e1f Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff3.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff4.pdf b/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..829ca5d2ee6fcbfeda958aac5b5e603f3dd17928 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/loss_theta_ArtDiff4.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff0.pdf b/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f1a9f06ba51857f984db55a06a1cd1de985cd239 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff0.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff1.pdf b/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2270dfe22e45286f365a822a28af2ddd302e37f8 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff1.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff2.pdf b/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..21db19a3abfdb107e9f1a6702bf40abfd26eee91 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff2.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff3.pdf b/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6afa3a6adf6ca198b604a1e9adc00c16a3e9b522 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff3.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff4.pdf b/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..aa55b4c0ce9befd99c3738bf9a4115566d3a859e Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiff4.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiffComparison.pdf b/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiffComparison.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ab64d1b2c6b091cdb582c8cfb80131fe3e377837 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/losses_ArtDiffComparison.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff0.pdf b/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ecfba0be83fa47e8f8805bea74fd3d50cdeefc3f Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff0.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff1.pdf b/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6a74e28b6b62a52611b73a3296c5ca54a176a13c Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff1.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff2.pdf b/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d733992afe6ff438301d7fac80c1712e85cd95a7 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff2.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff3.pdf b/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..31545b195c81ddded04505d96abad42ce2acf430 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff3.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff4.pdf b/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..072500edd72e3c7a4cfcd6ef0976d1c0a7bc7ca7 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/predicted_vs_true_single_sample_ArtDiff4.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff0.pdf b/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6f3e1a14f659ccec66355c553f648d538dab13a9 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff0.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff1.pdf b/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..30f9041cb4c9ec88a529e94aa23ce984d22e1561 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff1.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff2.pdf b/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8f022474a08c6f58f10deeedfcc70619ed72a73d Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff2.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff3.pdf b/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ec320a903c145559435b97b7f2d60d9d9b85afef Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff3.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff4.pdf b/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..69d1c3ffbc99386d96d41fe5391185a9c925590f Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiff4.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiffComparison.pdf b/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiffComparison.pdf new file mode 100644 index 0000000000000000000000000000000000000000..458b8a7344d211bd0ca00f4d28bc8e7d02dea5a6 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/prediction_kx_ArtDiffComparison.pdf differ diff --git a/Project3/src/Figures/ArtificialDiffusion/results_ArtDiffComparison.npz b/Project3/src/Figures/ArtificialDiffusion/results_ArtDiffComparison.npz new file mode 100644 index 0000000000000000000000000000000000000000..5f9c41e013cd1eee3e383e8d0741c567db97c836 Binary files /dev/null and b/Project3/src/Figures/ArtificialDiffusion/results_ArtDiffComparison.npz differ diff --git a/Project3/src/Figures/DoubleSample/loss_theta.pdf b/Project3/src/Figures/DoubleSample/loss_theta.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7a33f31b1f39505b76c6b575a50e21c1203b1c18 Binary files /dev/null and b/Project3/src/Figures/DoubleSample/loss_theta.pdf differ diff --git a/Project3/src/Figures/DoubleSample/losses.pdf b/Project3/src/Figures/DoubleSample/losses.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1f0efdccc42b32ce9a711fd45ef0d1b0119455d2 Binary files /dev/null and b/Project3/src/Figures/DoubleSample/losses.pdf differ diff --git a/Project3/src/Figures/DoubleSample/predicted_vs_true_both_samples_sample_1.pdf b/Project3/src/Figures/DoubleSample/predicted_vs_true_both_samples_sample_1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..af5916c812803f63f0aa99b1533897da4e9b7562 Binary files /dev/null and b/Project3/src/Figures/DoubleSample/predicted_vs_true_both_samples_sample_1.pdf differ diff --git a/Project3/src/Figures/DoubleSample/predicted_vs_true_both_samples_sample_2.pdf b/Project3/src/Figures/DoubleSample/predicted_vs_true_both_samples_sample_2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5178d17e14d6c9be7fb0f61d28d3652ac107c4c0 Binary files /dev/null and b/Project3/src/Figures/DoubleSample/predicted_vs_true_both_samples_sample_2.pdf differ diff --git a/Project3/src/Figures/DoubleSample/prediction_kx.pdf b/Project3/src/Figures/DoubleSample/prediction_kx.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f7d54a268c33042487b04ece39dd537dd3be015b Binary files /dev/null and b/Project3/src/Figures/DoubleSample/prediction_kx.pdf differ diff --git a/Project3/src/Figures/DoubleSample/weights.pdf b/Project3/src/Figures/DoubleSample/weights.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bf9d24cfb43d9162617255b10e0fbde979b1df20 Binary files /dev/null and b/Project3/src/Figures/DoubleSample/weights.pdf differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_0.png b/Project3/src/Figures/InfluenceResistance/sample_0.png new file mode 100644 index 0000000000000000000000000000000000000000..b7b419b9d98edb8984138baa214544226fdfe4ef Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_0.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_1.png b/Project3/src/Figures/InfluenceResistance/sample_1.png new file mode 100644 index 0000000000000000000000000000000000000000..ff54c7b7d8b7164eb45c93c14ce33b3ead0bec4c Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_1.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_10.png b/Project3/src/Figures/InfluenceResistance/sample_10.png new file mode 100644 index 0000000000000000000000000000000000000000..d504beba88e69b22ffeae8a0ae7d5dddb0fc9e29 Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_10.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_11.png b/Project3/src/Figures/InfluenceResistance/sample_11.png new file mode 100644 index 0000000000000000000000000000000000000000..37974f8ff92230e69839e8f72942ffbbf03dd722 Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_11.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_12.png b/Project3/src/Figures/InfluenceResistance/sample_12.png new file mode 100644 index 0000000000000000000000000000000000000000..431bc6b9169ae5b25ef0d9867e04c30145a57c22 Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_12.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_13.png b/Project3/src/Figures/InfluenceResistance/sample_13.png new file mode 100644 index 0000000000000000000000000000000000000000..8c3705784fa15ffecd3f53b9891690ff902be616 Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_13.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_14.png b/Project3/src/Figures/InfluenceResistance/sample_14.png new file mode 100644 index 0000000000000000000000000000000000000000..e38061c969536a563390562031f12ad210895c9b Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_14.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_2.png b/Project3/src/Figures/InfluenceResistance/sample_2.png new file mode 100644 index 0000000000000000000000000000000000000000..159aacbbde7fd0fd2ef282ec003203abfc438bde Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_2.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_3.png b/Project3/src/Figures/InfluenceResistance/sample_3.png new file mode 100644 index 0000000000000000000000000000000000000000..67ef665484b5e8e0af48bda0121b8b499c830afc Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_3.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_4.png b/Project3/src/Figures/InfluenceResistance/sample_4.png new file mode 100644 index 0000000000000000000000000000000000000000..9c67d523ce9a6ae6cd1c660fd879b02e5c7fb6e3 Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_4.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_5.png b/Project3/src/Figures/InfluenceResistance/sample_5.png new file mode 100644 index 0000000000000000000000000000000000000000..3b34dd32ff10ed661f998f323ca3acb097f0d416 Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_5.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_6.png b/Project3/src/Figures/InfluenceResistance/sample_6.png new file mode 100644 index 0000000000000000000000000000000000000000..9379a812fda345cac073a1ea80c0e4bb31b7f5de Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_6.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_7.png b/Project3/src/Figures/InfluenceResistance/sample_7.png new file mode 100644 index 0000000000000000000000000000000000000000..6253999da19d0a897f098545edb06f4c65f904aa Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_7.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_8.png b/Project3/src/Figures/InfluenceResistance/sample_8.png new file mode 100644 index 0000000000000000000000000000000000000000..4855b348fd41ddc75dec25284c62e84e95fb304d Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_8.png differ diff --git a/Project3/src/Figures/InfluenceResistance/sample_9.png b/Project3/src/Figures/InfluenceResistance/sample_9.png new file mode 100644 index 0000000000000000000000000000000000000000..3ebe791f2e2cf5d2703ec3faa429fc7fe459248b Binary files /dev/null and b/Project3/src/Figures/InfluenceResistance/sample_9.png differ diff --git a/Project3/src/Figures/Optimization/SingleSample/best_loss_theta.pdf b/Project3/src/Figures/Optimization/SingleSample/best_loss_theta.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f94d06f7a96801003d5453b8f0002d427b1a4c67 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/best_loss_theta.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/best_losses.pdf b/Project3/src/Figures/Optimization/SingleSample/best_losses.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ae38411676247c986e47ce7a09a4057708b8eea9 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/best_losses.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/best_predicted_vs_true_single_sample.pdf b/Project3/src/Figures/Optimization/SingleSample/best_predicted_vs_true_single_sample.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f2bd936b7eb8c3826fe4f1d86118d65fe1da5a25 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/best_predicted_vs_true_single_sample.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/best_prediction_kx_ITERATION.pdf b/Project3/src/Figures/Optimization/SingleSample/best_prediction_kx_ITERATION.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a46bb92b082773146cda73ff6c95d19026d34f49 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/best_prediction_kx_ITERATION.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_0.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..adedddb045e3d62c53cd8a5923ab8a2c0e0c3796 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_0.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_1.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f286f013fe1144509adaacdd569624970906e4e1 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_1.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_10.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_10.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a67c439ba39a3ca985da93081955492b5e2626d6 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_10.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_11.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_11.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3aa4c756aa528dbd208c799870b838bac27fb59a Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_11.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_12.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_12.pdf new file mode 100644 index 0000000000000000000000000000000000000000..620def1ccb3488cfdbe6b5fef66712aa7fdfee34 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_12.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_13.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_13.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d2d05503fba4b63d2582f08d03968d4fa6a92f59 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_13.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_14.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_14.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f4e96ac5a060589af1e41edda785a490c07dfe6b Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_14.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_15.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_15.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bfe17ea1d35da5477db941572630314a16679214 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_15.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_16.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_16.pdf new file mode 100644 index 0000000000000000000000000000000000000000..11a8fccc8c5505422598c2aeef20a8ef7020ec9b Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_16.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_17.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_17.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bf8de6ca07cffae6d902eac6cc4e4ca156383dfa Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_17.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_18.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_18.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f8a5f2050c63d3aeb3604a361528e522e29e9c6b Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_18.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_19.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_19.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7964d58fa81ffc9035dcae6ffce3c0756f442ebe Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_19.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_2.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..bc56dbb65f24cf15562aeaf289b8e762628bd82f Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_2.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_20.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_20.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ca2d012868b11205216d575e1ef3dca711a43b90 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_20.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_21.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_21.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c4b416ca0c58b7a216055728ca2e5930b266eb0b Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_21.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_22.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_22.pdf new file mode 100644 index 0000000000000000000000000000000000000000..896f22fd1405dbea55f13e892386597b32d05633 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_22.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_23.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_23.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0c18bd42da9b5bd7666bfa9f396fbb98670f2235 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_23.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_24.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_24.pdf new file mode 100644 index 0000000000000000000000000000000000000000..93c6727eed7e2e507a66ffe100ad59c0a0720533 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_24.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_3.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..31d8753dfa595449b5de156a682871d696e20725 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_3.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_4.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..546feee3f1a97c8407dcfba82b9e3364e18e0f58 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_4.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_5.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_5.pdf new file mode 100644 index 0000000000000000000000000000000000000000..07143fa448231eb9ccedcb934f762392d54b17d9 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_5.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_6.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_6.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7af6a4bcaffce9fb8b12b98644cfac32007e3f5f Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_6.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_7.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_7.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6f5f6600f93de1baaf481a1403d3c936e1018985 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_7.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_8.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_8.pdf new file mode 100644 index 0000000000000000000000000000000000000000..52d4c280f701b95dc8de68f5b380fda9213e6929 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_8.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_9.pdf b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_9.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5eb8336b49884a539027b3a88f81420ece6bf738 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/loss_theta_ITERATION_9.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_0.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..20946a874615b8db3bc571b3d212fae594578ad0 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_0.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_1.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a1da8bb83a9e6e52ecc2416430c0426b35df5ab3 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_1.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_10.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_10.pdf new file mode 100644 index 0000000000000000000000000000000000000000..5cf4601e74b1bdd39c769b57fd2d51ec22b309d2 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_10.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_11.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_11.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d5b6c50cc2a10f35d867e50ff9da0b65782e83d3 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_11.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_12.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_12.pdf new file mode 100644 index 0000000000000000000000000000000000000000..565994efdbe2c2e081a31c2716b17f870cd792a8 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_12.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_13.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_13.pdf new file mode 100644 index 0000000000000000000000000000000000000000..a8220289cbd6d73fefe8d8736666c96839f219c5 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_13.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_14.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_14.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2721e5da21b50649207a7d41628407efd9bb65cd Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_14.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_15.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_15.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fd99cdb503d56e4e1c59813b04c26eb282c37bba Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_15.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_16.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_16.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d98e13cae6266d7f5e288bae07b81bb98966ea2c Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_16.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_17.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_17.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1738e7522889bb1b1ade3c50a54a22be46def163 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_17.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_18.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_18.pdf new file mode 100644 index 0000000000000000000000000000000000000000..de9c70779202590c23dcf5664b3c7450941a37d3 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_18.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_19.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_19.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d9ed5076bf0cc007cc54d5a32b9e0a0c8b03d4d6 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_19.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_2.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f985a8b5e8f4a7a42dcbf6a0e4411126faa62ea5 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_2.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_20.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_20.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0a371e1852d7cc819223fd29053a38cb2439a3df Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_20.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_21.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_21.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1008c3e2d4c20d7ff7ab04c4e0cbd0e6e241b079 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_21.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_22.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_22.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fe90e231176c08669545b94a46c3073bd9f2743b Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_22.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_23.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_23.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8085633c1aa164866cf31501ff3bea03e414b717 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_23.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_24.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_24.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7801274f738711b549e8ce2182df1e1215443c38 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_24.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_3.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..81063463cea6577af43ef9f8da874cd3e8f9690f Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_3.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_4.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3d8f16b9a53231cd4874a76ae425715c896b8d69 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_4.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_5.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_5.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e51a9d794654ebf51045798fcaec5f63b1cd0aa8 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_5.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_6.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_6.pdf new file mode 100644 index 0000000000000000000000000000000000000000..fd018b33914e24e726c92bdd76bb47058570f352 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_6.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_7.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_7.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1669162d8981523a9ff7af0ed1906deec67cd3a2 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_7.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_8.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_8.pdf new file mode 100644 index 0000000000000000000000000000000000000000..10a37d65d50bfabaf02ba0ce61a4580c594ca7e1 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_8.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_9.pdf b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_9.pdf new file mode 100644 index 0000000000000000000000000000000000000000..25a11fc8ab2a9c9c49cd17e2791e8935349ba157 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/losses_ITERATION_9.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_0.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ff7f58d281d856ab8ab9a6d9dedb0a369b346063 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_0.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_1.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..555ebb22a24d25f51f60620a52bf2ddfdb408546 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_1.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_10.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_10.pdf new file mode 100644 index 0000000000000000000000000000000000000000..2d104cd3ec71c0ea4f5286fb38bbf5548b0a2f89 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_10.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_11.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_11.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1504aab3aa940b36920fc2f63afdadf293e54e55 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_11.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_12.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_12.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e763bd13d1f2d2f19490faddad110a929a5dcaf0 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_12.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_13.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_13.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e3383216b6f469eabf36d4566a2e8a8a5a0ef1b6 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_13.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_14.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_14.pdf new file mode 100644 index 0000000000000000000000000000000000000000..671c1c4b20c4d1c810f77c7347d014e6d88ebd64 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_14.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_15.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_15.pdf new file mode 100644 index 0000000000000000000000000000000000000000..497b278bf419887e8293eb5edb3d85d9f5c4f03f Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_15.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_16.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_16.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ecd73637d978c3412dd6a8340b6aeff7becf8bdd Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_16.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_17.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_17.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c42eeaaeacaeb60d5d2c1c490a135f2096270151 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_17.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_18.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_18.pdf new file mode 100644 index 0000000000000000000000000000000000000000..440e1aed0f43173b11667681948a27268a4a7e27 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_18.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_19.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_19.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cd5aebeae0f0fba775c7034696b0e99dedb8c966 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_19.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_2.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f2c3539740eec0b0d088356a9f690f518f1579a7 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_2.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_20.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_20.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f74dc994a369573658fe3380659a26c29f33ce4b Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_20.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_21.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_21.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d7d22023a06479c84da44ef5cf45f8ebdad53318 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_21.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_22.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_22.pdf new file mode 100644 index 0000000000000000000000000000000000000000..aad89343ea25124b1bc0ad28262b5cc22974b021 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_22.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_23.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_23.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1384d690c16fc1f07465ec74f5549d59c513f041 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_23.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_24.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_24.pdf new file mode 100644 index 0000000000000000000000000000000000000000..795c103c958a775aa71d70428711ccbdcc45c716 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_24.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_3.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3537f5dd4e54c1fac3df58e7f53983489fc800e6 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_3.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_4.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..83c1dfc6d7b8415650e39f3e107c0bbac68b3c8a Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_4.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_5.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_5.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ce0f8954dd5286bffd696b1d13bf3d5ba10f1500 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_5.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_6.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_6.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4180c7714b5fd637a5e1aa0aaede55cd0b34885b Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_6.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_7.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_7.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9727ab2cbbe8e79293f8c8d1a76a76549b756bed Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_7.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_8.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_8.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cf04e1efcc44bbb7aec147778c8fa196e33341c1 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_8.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_9.pdf b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_9.pdf new file mode 100644 index 0000000000000000000000000000000000000000..7bfe66290bb57ddf243515ac467164ff0e4f4af7 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/predicted_vs_true_single_sample_ITERATION_9.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_0.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_0.pdf new file mode 100644 index 0000000000000000000000000000000000000000..8b50e1bb4c8fde73841e37546b79a8f49121be4f Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_0.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_1.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_1.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1bbcef6e0a83cf866ac3f54d0a7c6a5be17e9dcd Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_1.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_10.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_10.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d73b61cbd9cbf8b0a7a12f1fa3e028e52a273072 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_10.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_11.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_11.pdf new file mode 100644 index 0000000000000000000000000000000000000000..321471b719ce635aa007da4aeddef9916cfb7953 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_11.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_12.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_12.pdf new file mode 100644 index 0000000000000000000000000000000000000000..49d6c4690afbe37a70d4ea55b22cbba53546c0f0 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_12.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_13.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_13.pdf new file mode 100644 index 0000000000000000000000000000000000000000..3b610d9b30f74cbd27dfe7927c0354b24d7cc0cf Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_13.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_14.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_14.pdf new file mode 100644 index 0000000000000000000000000000000000000000..aae2774cf1b90ee8fd3abcdcd34bb594cc6bf32e Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_14.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_15.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_15.pdf new file mode 100644 index 0000000000000000000000000000000000000000..b5d9f9a37b7daf54d848700e77b81342d162069b Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_15.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_16.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_16.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c9cbf9b8498f750c4e41204d957f680241d18652 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_16.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_17.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_17.pdf new file mode 100644 index 0000000000000000000000000000000000000000..6a6218409a55550f0f5db28af6ac888fedd14972 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_17.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_18.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_18.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f68d8a13616854574c35af4df6eb6f3f5a0d6dd6 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_18.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_19.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_19.pdf new file mode 100644 index 0000000000000000000000000000000000000000..331d9443804b16a7cd999c72509482229bf7d47a Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_19.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_2.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_2.pdf new file mode 100644 index 0000000000000000000000000000000000000000..e30767d4a1e0fe5508a3b5a46871452dfa79ad8d Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_2.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_20.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_20.pdf new file mode 100644 index 0000000000000000000000000000000000000000..4aad9242b063a35a79a746c5216a38ddd42ac2e1 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_20.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_21.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_21.pdf new file mode 100644 index 0000000000000000000000000000000000000000..98d68128ee71653f4d4b02a11b09a01b8aaf9b51 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_21.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_22.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_22.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c51d069dd7245741c8cc60877430ab98dc3986ff Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_22.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_23.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_23.pdf new file mode 100644 index 0000000000000000000000000000000000000000..ea7f971f3023cf7b3bf22ad65f2700fc46919b58 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_23.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_24.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_24.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c06a1e82a47721a6f4582acb50ee19ba82c1c539 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_24.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_3.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_3.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0faeccab2d5e6023fb74779a2feb97eb1f01daa8 Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_3.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_4.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_4.pdf new file mode 100644 index 0000000000000000000000000000000000000000..d4de60e7a782609dfa18bda0d34586ae07192c4d Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_4.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_5.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_5.pdf new file mode 100644 index 0000000000000000000000000000000000000000..9b686983efdec6132bc26107ed471defa37677fa Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_5.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_6.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_6.pdf new file mode 100644 index 0000000000000000000000000000000000000000..c7884cbc98d3e16a885a1ee655bfee6e93788ccc Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_6.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_7.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_7.pdf new file mode 100644 index 0000000000000000000000000000000000000000..0ae7fa9ee59072d1fa5eed4942c4176164ae5dfa Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_7.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_8.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_8.pdf new file mode 100644 index 0000000000000000000000000000000000000000..34701d66b1a75ce2904b79fc5cd494a97ad2b01b Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_8.pdf differ diff --git a/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_9.pdf b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_9.pdf new file mode 100644 index 0000000000000000000000000000000000000000..45270f663612697afd2aab0a6541f8f858bb5d7d Binary files /dev/null and b/Project3/src/Figures/Optimization/SingleSample/prediction_kx_ITERATION_9.pdf differ diff --git a/Project3/src/Figures/Optimization/TunerConvergence.pdf b/Project3/src/Figures/Optimization/TunerConvergence.pdf new file mode 100644 index 0000000000000000000000000000000000000000..585c4ad219fff7719d2e67ae08cca6de45813c42 Binary files /dev/null and b/Project3/src/Figures/Optimization/TunerConvergence.pdf differ diff --git a/Project3/src/Figures/Optimization/TunerConvergence.png b/Project3/src/Figures/Optimization/TunerConvergence.png new file mode 100644 index 0000000000000000000000000000000000000000..e19609f2575174193b5ad4cd52e8f470cd6a29a7 Binary files /dev/null and b/Project3/src/Figures/Optimization/TunerConvergence.png differ diff --git a/Project3/src/Figures/Optimization/TunerObjective.pdf b/Project3/src/Figures/Optimization/TunerObjective.pdf new file mode 100644 index 0000000000000000000000000000000000000000..cf93029dbac4790f5984f98d2760c8ff542e5b3d Binary files /dev/null and b/Project3/src/Figures/Optimization/TunerObjective.pdf differ diff --git a/Project3/src/Figures/Optimization/TunerObjective.png b/Project3/src/Figures/Optimization/TunerObjective.png new file mode 100644 index 0000000000000000000000000000000000000000..ec868020dc0717223089afb919508a1f9f17d0e5 Binary files /dev/null and b/Project3/src/Figures/Optimization/TunerObjective.png differ diff --git a/Project3/src/Figures/SingleSample/loss_theta.pdf b/Project3/src/Figures/SingleSample/loss_theta.pdf new file mode 100644 index 0000000000000000000000000000000000000000..923e9585ab1436ea8176faf372840891314cc800 Binary files /dev/null and b/Project3/src/Figures/SingleSample/loss_theta.pdf differ diff --git a/Project3/src/Figures/SingleSample/losses.pdf b/Project3/src/Figures/SingleSample/losses.pdf new file mode 100644 index 0000000000000000000000000000000000000000..1c7e361e783fdb68262a4612f29a87a74914f150 Binary files /dev/null and b/Project3/src/Figures/SingleSample/losses.pdf differ diff --git a/Project3/src/Figures/SingleSample/predicted_vs_true_single_sample.pdf b/Project3/src/Figures/SingleSample/predicted_vs_true_single_sample.pdf new file mode 100644 index 0000000000000000000000000000000000000000..436f01cef8217a39f9021d2ed90a46a0ee010c22 Binary files /dev/null and b/Project3/src/Figures/SingleSample/predicted_vs_true_single_sample.pdf differ diff --git a/Project3/src/Figures/SingleSample/prediction_kx.pdf b/Project3/src/Figures/SingleSample/prediction_kx.pdf new file mode 100644 index 0000000000000000000000000000000000000000..f2c55dbda2b5a9a093aeb89511b581e21c674417 Binary files /dev/null and b/Project3/src/Figures/SingleSample/prediction_kx.pdf differ diff --git a/Project3/src/Figures/SingleSample/weights.pdf b/Project3/src/Figures/SingleSample/weights.pdf new file mode 100644 index 0000000000000000000000000000000000000000..82bb77be61a0d4c5c931c60b24d1ef30b13c197c Binary files /dev/null and b/Project3/src/Figures/SingleSample/weights.pdf differ diff --git a/Project3/src/GivenCode/data/True_Observation_data_1_upd.npz b/Project3/src/GivenCode/data/True_Observation_data_1_upd.npz new file mode 100644 index 0000000000000000000000000000000000000000..6f5b7a461a46130dc4c17b5e4be67580e0ca16ad Binary files /dev/null and b/Project3/src/GivenCode/data/True_Observation_data_1_upd.npz differ diff --git a/Project3/src/GivenCode/data/True_Observation_data_2_upd.npz b/Project3/src/GivenCode/data/True_Observation_data_2_upd.npz new file mode 100644 index 0000000000000000000000000000000000000000..e2cbb0afdbefde4b0a0752468bcd6bbba4270851 Binary files /dev/null and b/Project3/src/GivenCode/data/True_Observation_data_2_upd.npz differ diff --git a/Project3/src/GivenCode/data/mcmc_u0X1_sample100_it1_student_Mars21.npz b/Project3/src/GivenCode/data/mcmc_u0X1_sample100_it1_student_Mars21.npz new file mode 100644 index 0000000000000000000000000000000000000000..3c01361ba59ed24723c51e2c016df26803947969 Binary files /dev/null and b/Project3/src/GivenCode/data/mcmc_u0X1_sample100_it1_student_Mars21.npz differ diff --git a/Project3/src/GivenCode/mcmc_task2_u0X1_final_student_mars21.py b/Project3/src/GivenCode/mcmc_task2_u0X1_final_student_mars21.py new file mode 100644 index 0000000000000000000000000000000000000000..c46cea7789148cb4fc2cb06c887d0773fb46bd3f --- /dev/null +++ b/Project3/src/GivenCode/mcmc_task2_u0X1_final_student_mars21.py @@ -0,0 +1,422 @@ +import matplotlib.pyplot as plt +import numpy as np +#import scipy.io as sio +import scipy.sparse as sparse + +try: + from simulations_Feb20 import simulate_g +except ImportError: + from python_scripts.simulations_Feb20 import simulate_g + + +############################################## +# read observation data provided by teacher # +############################################## + +# use only the first data set +observation = np.load("data/True_Observation_data_1_upd.npz") +#print( list(observation.keys()) ) + + +###################################################################################### +# In the following different parameters required for solving conslaw are extracted # +###################################################################################### + + +# number of observation data set +Ant_Init = 1 + +#y_k_true = observation["y_k_true"] +#y_k_true = np.zeros_like(y_k_true) + +# provide information about grid, +x = observation["x"] +xh = observation["xh"] + +# grid cells for cons law +N = observation["M"].item() + +# Final time +T = observation["T"].item() + +# describe time points for which we have observations +time_obs = observation["t_obspoint"] +JX = time_obs <= T + +Ldom = observation["Ldom"].item() +dx = Ldom/N + +# positions of point values for k(x) +x_k = observation["x_k"] + +# index vector for numbering positions in space and time +Nt = np.sum(JX) +Ix = np.arange(0, N) +It = np.arange(0, Nt) + +# number of unknown points to be determined in k(x) which is assumed piecewise linear +Mr = observation["Mr"].item() + +############################### +# Observation data h(theta) # +############################### +u_true_X1 = np.zeros((Nt)) +u_true_X2 = np.zeros((Nt)) +u_true_X3 = np.zeros((Nt)) +u_true_X4 = np.zeros((Nt)) + +# correct when Ant_Init = 1 +u_true_X1 = observation["u_true_X1"] +u_true_X2 = observation["u_true_X2"] +u_true_X3 = observation["u_true_X3"] +u_true_X4 = observation["u_true_X4"] + + +# provide initial data set: each initialdata (of total=Ant_Init) is a column +initial_true = np.zeros((N,2)) +initial_true[:,0] = observation["u0"] + + +# provide position of observation points X_1, X_2, X_3, X_4 +X_position = observation["X_position"] +X_1 = X_position[0] +X_2 = X_position[1] +X_3 = X_position[2] +X_4 = X_position[3] + + +#################################### +# define parameters used in MCMC # +#################################### +add_unc = 0.03 # noise in observation data +error_val = 100 # lower limit in Loss function +kk_tolerance = 1000 # number of steps in MCMC algorithm +teller = 1 +tau = 20 # extract "theta^k" with step size "tau" to represent a posteriori "theta" + +N_ens = int(kk_tolerance/tau) + +# function to create one long column vector to represent the matrix of +# 4 column vectors representing observation data at X1, X2, X3, X4 +def gen_measurements(u, weights): + measurement = [] + for i, u in enumerate(u): + m = u + add_unc * np.random.normal(size=Nt * Ant_Init) + m[m < 0] = 0 + m[m > 1] = 1 + measurement.append(weights[i] * m) + return np.concatenate(measurement) + + +# weight factor used to adjust the importance of the 4 different time series +weights = [1, 1, 1, 1] + +# compute one single column vector to represent all observation data +measurement = gen_measurements([u_true_X1, u_true_X2, u_true_X3, u_true_X4], weights) + + +# parametervector "theta" which is updated by the mcmc algorithm +# theta is composed of both k(x) and f(u) - however, only k(x) unknown +initial_ensemble_kx = np.zeros((Mr, 1)) + +# we generate an ensemble parameter vector by extracting every 20th member from "initial_ensemble_F" +updated_ensemble_kx = np.zeros((Mr, N_ens)) + +# mcmc parameter +#beta = 0.05 * 4 # +beta = 0.05 # +#beta = 0.05 * 0.25 # + +# we generate initial k(x) ~ {k_i}_i=1^9 as random normal distribution N(mu,sigma) +mu = 1 +sigma = 0.25 + + + +######################################################### +# Choose what should be the initial parameter vector # +######################################################### + + + +mcmc_start = True +#mcmc_start = False + +if mcmc_start: + ##################################### + # choice 1: generate theta^{(0)} # + ##################################### + + print("Initial guess of k(x)") + kk_x = np.random.normal(loc=mu, scale=sigma, size=Mr) + kk_x[kk_x < 0.95] = 0.95 + kk_x[kk_x > 1.3] = 1.3 + kkx_u = kk_x +else: + ####################################### + # choice 2: start with theta^{(k)} # + ####################################### + + with np.load('data/mcmc_u0X1_sample100_it1_student_Mars21.npz') as data_kx: + #with np.load('data/mcmc_u0X1_sample100_it2_student_Mars21.npz') as data_kx: + #with np.load('data/mcmc_u0X1_sample100_it3_student_Mars21.npz') as data_kx: + #with np.load('data/mcmc_u0X1_sample100_it4_student_Mars21.npz') as data_kx: + kkx_u = data_kx["theta_1"] + + +# Create the y_k vector with padding 1s at the beginning and the end +y_k = np.concatenate(([1], kkx_u, [1])) + + +# number of parameter vectors (in case of more than one ensemble) +K = 0 + + +# Create the plot +plt.figure(1) +plt.plot(x_k, y_k) +plt.axis([-0.1, Ldom + 0.1, 0.1, 1.9]) +plt.grid(True) +plt.xlabel("X") +plt.ylabel("k(x)") +plt.title("Resistance k(x)") + +# plt.ioff() + +# Show the plot and pause execution to view it +plt.show(block=False) +plt.pause(2) # Pause for a short period of time; adjust as needed + +# Close the plot after pausing +plt.close(1) + +# "initial_ensemble_kx" is composed of vector k(x) (M:M+Mr) +# which is hidden and we seek to recover +initial_ensemble_kx[0:Mr, K] = kkx_u + +####################################################### +# Run simulation to generate h(kkx_u) +####################################################### + +############################### +# Step S3: Compute h(theta) # +############################### + +# h ~ simulate forward model +# theta ~ initial_ensemble_kx + +# u_X = +# ensembleOfPredictedObservations = + +ensembleOfPredictedObservations = simulate_g( + N, x, xh, Ldom, T, + initial_true, + Ant_Init, + Nt, + time_obs, + It, + JX, + K, + weights, + initial_ensemble_kx, + X_1, X_2, X_3, X_4, + x_k, kkx_u, + u_true_X1, u_true_X2, u_true_X3, u_true_X4, + #to_plot=False, + #to_plot=True, +) + + +# do a numbering of the column vector of predicted observation = 1 long column vector +# in case we want to throw away some observation data +measIndex = np.arange(0, ensembleOfPredictedObservations.shape[0]) +weight_obs = sparse.diags(1 / (add_unc * np.ones(measIndex.shape[0])) ** 2) + + +# Compute loss function +meas_diff = ensembleOfPredictedObservations[measIndex, K] - measurement[measIndex] +Phi_kkx = meas_diff.T @ weight_obs @ meas_diff + + +# Initialization +theta_1 = kkx_u.copy() +Phi_theta_1 = Phi_kkx.copy() + +Loss = -1 * np.ones(kk_tolerance + 1) +Loss[0] = Phi_theta_1.copy() + +input("Now entering main loop: \n Press enter to continue!") + +# counter of steps in MCMC +kk = 0 + +while Loss[kk] > error_val and kk < kk_tolerance: + + + ##################################################################### + # Step S2: compute "phi=gu" as a perturbation of "theta=fu_kp1" # + ##################################################################### + + phi_1 = np.sqrt((1 - beta**2)) * theta_1 + beta * sigma * np.random.normal(size = Mr) + + phi_1[phi_1 < 0.25] = 0.25 + phi_1[phi_1 > 1.75] = 1.75 + + # prepare for solving the conservation law to obtain h(phi) + initial_ensemble_kx[np.arange(0, Mr), K] = phi_1 + + # Run simulation to generate G(gu) + # u_X is the generated time series to be compared with data + + + ############################### + # Step S3: Compute h(phi) # + ############################### + ensembleOfPredictedObservations = simulate_g( + N, x, xh, Ldom, T, + initial_true, + Ant_Init, + Nt, + time_obs, + It, + JX, + K, + weights, + initial_ensemble_kx, + X_1, X_2, X_3, X_4, + x_k, theta_1, + u_true_X1, u_true_X2, u_true_X3, u_true_X4 + ) + + # Compute Loss + meas_diff = ensembleOfPredictedObservations[measIndex, K] - measurement[measIndex] + Phi_phi_1 = meas_diff.T @ weight_obs @ meas_diff + + ######################################## + # Step S3: Compute a(theta_1, phi_1) # + ######################################## + + # MCMC a(theta,phi) + a_theta_1_phi_1 = np.min([1, np.exp(Phi_theta_1 - Phi_phi_1)] ) + + ########################################################## + # Step S4 and S5: compare "choice" and "a(theta, phi)" # + ######################################################### + + choice = np.random.uniform(0, 1) + + if choice <= a_theta_1_phi_1: + theta_1 = phi_1.copy() + Phi_theta_1 = Phi_phi_1.copy() + + else: + theta_1 = theta_1.copy() + Phi_theta_1 = Phi_theta_1.copy() + + ##################################################### + # check if we should extract this parameter vector # + ##################################################### + + check = kk / tau + + if check == teller: + updated_ensemble_kx[0 : Mr, teller] = theta_1 + teller += 1 + + fig, axs = plt.subplots(1, 2, figsize=(15, 5)) + + #axs[0].plt.figure() + axs[0].to_plot = Loss[Loss >= 0] + axs[0].plot(Loss) + axs[0].set_title("Loss function") + axs[0].set_ylabel("Loss") + axs[0].set_xlabel("Iteration number") + axs[0].grid(True) + #axs[0].show() + + y_k_ident = np.concatenate([[1], theta_1, [1]]) + + #axs[1].plt.figure() + #axs[1].plot(x_k, y_k_true, '-r') + axs[1].plot(x_k, y_k_ident,'-b') + axs[1].set_title("k(x) function") + axs[1].set_ylabel("k(x)") + axs[1].set_xlabel("x") + #axs[1].legend(['True', 'Identified']) + axs[1].legend(['Identified']) + plt.axis([0, Ldom, 0.25, 1.75]) + axs[1].grid(True) + #axs[1].show() + + # Update the plot + #plt.draw() + + # Show the plots + plt.show() + #plt.pause(2) + #input("Extracting this parameter vector: \n Press enter to continue!") + + ############################################# + # Step S6: move to next iteration in MCMC # + ############################################# + + kk += 1 + Loss[kk] = Phi_theta_1.copy() + + y_k_ident = np.concatenate([[1], theta_1, [1]]) + + print("Iteration:", kk, " Loss:", Loss[kk]) + + +###################################################### +# Save to file variables from this MCMC compuation # +###################################################### + +np.savez( + "data/mcmc_u0X1_sample100_it1_student_Mars21.npz", + #"data/mcmc_u0X1_sample100_it2_student_Mars21.npz", + #"data/mcmc_u0X1_sample100_it3_student_Mars21.npz", + # "data/mcmc_u0X1_sample100_it4_student_Mars21.npz", + # "data/mcmc_u0X1_sample100_it5_student_Mars21.npz", + #"data/mcmc_u0X1_sample100_it6_student_Mars21.npz", + Loss=Loss, + #fu_kp1=fu_kp1, + #Phi_fu_kp1_y=Phi_fu_kp1_y, + theta_1=theta_1, + Phi_theta_1=Phi_theta_1, + updatedEnsemble_kx = updated_ensemble_kx, + kk=kk, + teller=teller, + x_k=x_k, + #y_k_true=y_k_true, + y_k_ident=y_k_ident, + beta=beta, +) +print("Sampling of 100 members done") +print("Final loss was:", Loss) +print("And the lower error val was set to:", error_val) + + +# Plot the loss function +plt.figure() +to_plot = Loss[Loss >= 0] +plt.plot(Loss) +plt.title("Loss function") +plt.ylabel("Loss") +plt.xlabel("Iteration number") +#plt.axis([0, Ldom, 0.5, 2.0]) +plt.grid(True) +plt.show() + +plt.figure() +#plt.plot(x_k, y_k_true, '-r') +plt.plot(x_k, y_k_ident, '-b') +plt.title("k(x) function") +plt.ylabel("k(x)") +plt.xlabel("x") +plt.axis([0, Ldom, 0.25, 1.75]) +#plt.legend(['True', 'Identified']) +plt.legend(['Identified']) +plt.grid(True) +plt.show() + diff --git a/Project3/src/GivenCode/simulations_Feb20.py b/Project3/src/GivenCode/simulations_Feb20.py new file mode 100644 index 0000000000000000000000000000000000000000..571b913b11db935248d42ab17dd2d28e2dd0b2cd --- /dev/null +++ b/Project3/src/GivenCode/simulations_Feb20.py @@ -0,0 +1,75 @@ +#import matplotlib.pyplot as plt +import numpy as np +#import scipy.sparse as sparse + +try: + from python_scripts.solver_Feb20 import my_solver +except ImportError: + from solver_Feb20 import my_solver + + +def simulate_g( + N, x, xh, Ldom, Tend, + initial_true, + Ant_Init, + Nt, + time_obs, + It, + JX, + K, + weights, + initial_ensemble_kx, + X_1, X_2, X_3, X_4, + x_k, kx_old, + u_true_X1, u_true_X2, u_true_X3, u_true_X4, + #to_plot=False, + #to_plot = True, +): + numEns = 1 + + # vector that can store u(x1,t) for "Ant_Init" different initial data in one column vector + ensembleOfPredictedObs_X1_0toT3 = np.zeros((Nt * Ant_Init, numEns)) + ensembleOfPredictedObs_X2_0toT3 = np.zeros((Nt * Ant_Init, numEns)) + ensembleOfPredictedObs_X3_0toT3 = np.zeros((Nt * Ant_Init, numEns)) + ensembleOfPredictedObs_X4_0toT3 = np.zeros((Nt * Ant_Init, numEns)) + + # list that can store u(x1,t), u(x2,t), u(x3,t), u(x4,t) in column vector for each initial_data #K0 + u_X = [np.zeros((len(time_obs), Ant_Init)) for _ in range(4)] + + ##################################### + # Loop to simulate Ant_Init cases # + ##################################### + + for K_0 in range(0, Ant_Init): + + u_X[0][:, K_0], u_X[1][:, K_0], u_X[2][:, K_0], u_X[3][:, K_0], y_k = my_solver( + N, x, xh, Ldom, Tend, + initial_ensemble_kx[:, K], + initial_true[:, K_0], + time_obs, + [X_1, X_2, X_3, X_4], + x_k, + #to_plot=to_plot, + #to_plot = False, + #to_plot = True, + ) + + # Store the obtained 4 time series "u_X" in the "ensembleOfPredictedObs_X1_0toT3" + + ensembleOfPredictedObs_X1_0toT3[It + (K_0) * Nt, K] = u_X[0][JX, K_0] + ensembleOfPredictedObs_X2_0toT3[It + (K_0) * Nt, K] = u_X[1][JX, K_0] + ensembleOfPredictedObs_X3_0toT3[It + (K_0) * Nt, K] = u_X[2][JX, K_0] + ensembleOfPredictedObs_X4_0toT3[It + (K_0) * Nt, K] = u_X[3][JX, K_0] + + + # generate "ensembleOfPredictedObservations" which possess same structure as "measurement" + ensembleOfPredictedObservations = np.concatenate( + [ + weights[0] * ensembleOfPredictedObs_X1_0toT3, + weights[1] * ensembleOfPredictedObs_X2_0toT3, + weights[2] * ensembleOfPredictedObs_X3_0toT3, + weights[3] * ensembleOfPredictedObs_X4_0toT3, + ] + ) + # return u_X, ensembleOfPredictedObservations + return ensembleOfPredictedObservations diff --git a/Project3/src/GivenCode/solver_Feb20.py b/Project3/src/GivenCode/solver_Feb20.py new file mode 100644 index 0000000000000000000000000000000000000000..5721f0dc1d794a7a94fcb5e2d3216b457f15a2b5 --- /dev/null +++ b/Project3/src/GivenCode/solver_Feb20.py @@ -0,0 +1,112 @@ +import matplotlib.pyplot as plt +import numpy as np + + +def my_solver( + #M, + N, + x, + xh, + Ldom, + Tend, + Fluxkx_ensem, + initial_true, + time_obs, + X, + x_k, + #to_plot=False, + #to_plot=True, +): + """ + Solution of u_t + (k(x)f(u))_x = 0 + """ + + # Final time + T = Tend + + # Delta x + dx = Ldom / N + + # observation points in spatial domain + s = [ (np.sum(x <= X[i]) - 1) for i in range(4)] + + # output predicted observations + u_X_out = [np.zeros(len(time_obs)) for _ in range(4)] + + # terrain function + k_val = Fluxkx_ensem[:] + #y_k = np.concatenate((np.array([1]), k_val, np.array([1]))) + y_k = np.concatenate(([1.0], k_val, [1.0] )) + + # Define the flux function f(u) + def fun_flux(u): + f = np.zeros_like(u) + f = u * (1 - u) + return f + + + # estimate the time step dt based om CFL condition + dt_estimat = dx * (3/7) # based on max |f'| = 1, max k(x) < 4/3 + NTime = round(T / dt_estimat) + + dt = T / NTime + + #MA = max(maxfu_prime, 0.1) + + MA = 1 # Rusanov flux is used + lmd = dt / dx + + t_obs = np.linspace(0, T, NTime + 1) + + J1 = np.arange(1, N - 1) + J2 = np.arange(0, N - 1) + + u0 = initial_true[0:N] + + u = np.zeros(N) + + # teller = 1 + + u_old = u0.copy() + + # Compute predicted time serie state at t=0 + u_X = [np.zeros(NTime + 1) for i in range(4)] + for ind in range(4): + u_X[ind][0] = u0[s[ind]] + + + + for j in range(NTime): + + # fluxes at grid interface + F_half = np.zeros(N - 1) + Flux = np.zeros(N) # compute flux for all cells + + Flux = fun_flux(u_old) + F_half[J2] = 0.5 * (Flux[J2] + Flux[J2 + 1]) - 0.5 * MA * (u_old[J2 + 1] - u_old[J2] ) + + k_half = np.zeros(N - 1) + k_half[J2] = np.interp(xh[J2 + 1], x_k, y_k) + + # The numerical scheme + + u[J1] = u_old[J1] - lmd * (k_half[J1] * F_half[J1] - k_half[J1 - 1] * F_half[J1 - 1]) + + u[u > 1] = 1.0 + u[u < 0] = 0.0 + + u[0] = u[1] + u[-1] = u[-2] + + # Extract predicted observation data + for ind in range(4): + u_X[ind][j+1] = u[s[ind]] + + + u_old = u.copy() + + # transform predicted observation over to same time grid as used for true observation + for ind in range(4): + u_X_out[ind][:] = np.interp(time_obs[:], t_obs[:], u_X[ind][:]) + + return *u_X_out, y_k \ No newline at end of file diff --git a/Project3/src/HyperParameterOptimization.py b/Project3/src/HyperParameterOptimization.py new file mode 100644 index 0000000000000000000000000000000000000000..235b2bfa36b0768e9d2c89f34712e953108a269f --- /dev/null +++ b/Project3/src/HyperParameterOptimization.py @@ -0,0 +1,300 @@ +import numpy as np +import matplotlib.pyplot as plt + +import skopt +from skopt import gp_minimize # Import the skopt library for hyperparameter optimization +from skopt.plots import plot_convergence, plot_objective +from skopt.space import Real +from skopt.utils import use_named_args + +from MCMC import * + +#################################################################################################### +# Setup +#################################################################################################### +n_calls = 25 + +# MCMC and solver parameters +MCMC_STEPS = 150 #!500 +MCMC_SUBSTEPS = 20 +NUMBER_SAMPLES = 1 +if NUMBER_SAMPLES == 1: + FigureFolder = 'Figures/Optimization/SingleSample' +else: + FigureFolder = 'Figures/Optimization/DoubleSample' + +x0, x1 = 0, 4 + +NTime = 500 +T_end = 10 + +# Upwind viscosity parameter (used in flux computation) +M = 1 + +k_i = 9 +k_mu, k_sigma_default = 1., 0.25 + +beta_default = 0.05 + + +# Define hyperparameters for optimization +dim_beta = Real(low=0.01, high=0.1, name='dim_beta') +dim_k_sigma = Real(low=0.1, high=0.4, name='dim_k_sigma') + +dimensions = [ + dim_beta, + dim_k_sigma, +] + +# start parameter for optimization +default_parameters = [ + beta_default, + k_sigma_default, +] + + +#################################################################################################### +# Hyperparameter Optimization +#################################################################################################### +@use_named_args(dimensions=dimensions) +def fitness(dim_beta, dim_k_sigma): + global ITERATION + + print(f'ITERATION: {ITERATION}') + # Print the hyper-parameter configuration + print('beta:', dim_beta) + print('k_sigma:', dim_k_sigma) + print() + + # MCMC + Theta, x_Theta, LOSS_THETA, LOSS_PHI, weights_historical = MCMC( + MCMC_STEPS=MCMC_STEPS, + MCMC_SUBSTEPS=MCMC_SUBSTEPS, + tau=tau, + beta=dim_beta, + gamma=gamma, + k_i=k_i, + k_mu=k_mu, + k_sigma=dim_k_sigma, + u_true=u_true, + number_samples=NUMBER_SAMPLES + ) + + # Get the error + error = LOSS_THETA[-1] + + print(f'Error: {error}') + + if np.isnan(error): + error = 1e10 + + # plotting + # Combine both loss functions + plt.figure() + plt.title('Losses') + plt.plot(LOSS_THETA[:], '--o', color='red', label='$\Phi(\Theta)$') + plt.plot(LOSS_PHI[:], '--o', color='green', label='$\Phi(\phi$)') + plt.xlabel('Iteration') + plt.ylabel('Loss') + plt.legend() + plt.grid() + plt.savefig(f'{FigureFolder}/losses_ITERATION_{ITERATION}.pdf', bbox_inches='tight') + # plt.show() + plt.close() + + # Only the phi(theta) loss is plotted + plt.figure() + plt.title('Evolution of entropy loss') + plt.loglog(LOSS_THETA[:], '--o', color='red', label='$\Phi(\Theta)$') + plt.xlabel('log(Iteration)') + plt.ylabel('log($\Phi(\Theta)$)') + plt.grid() + plt.savefig(f'{FigureFolder}/loss_theta_ITERATION_{ITERATION}.pdf', bbox_inches='tight') + # plt.show() + plt.close() + + # Solve with the final Theta + t_vec, h_final = solve_PDE(Theta, T_end, NTime, x, dx, x_Theta, NUMBER_SAMPLES) + h_final = [extract_positions(t_vec[i], h_final[i], x) for i in range(NUMBER_SAMPLES)] + h_final = np.array([h_final[i].T for i in range(NUMBER_SAMPLES)]) + + colors = ['blue', 'red', 'green', 'purple'] + for sample in range(NUMBER_SAMPLES): + plt.figure() + plt.title(f'Predicted vs True - sample {sample+1}') + for i in range(4): + plt.plot([], [], color=colors[i], label=f'x = {x_observed[i]}') + plt.plot(times_observed, h_final[sample, i, :], color=colors[i]) + plt.plot(times_observed, u_true[i, :, sample], '--o', color=colors[i]) + plt.plot([], [], color='black', label='Predicted') + plt.plot([], [], '--o', color='black', label='True') + plt.xlabel('Time') + plt.ylabel('u(x,t)') + plt.legend(ncol=4, loc='upper center', bbox_to_anchor=(0.5, -0.1)) + plt.grid() + if NUMBER_SAMPLES == 1: + plt.savefig(f'{FigureFolder}/predicted_vs_true_single_sample_ITERATION_{ITERATION}.pdf', bbox_inches='tight') + else: + plt.savefig(f'{FigureFolder}/predicted_vs_true_both_samples_sample_{sample+1}_ITERATION_{ITERATION}.pdf', bbox_inches='tight') + # plt.show() + plt.close() + + # Plot the final theta -> prediction for k(x) + plt.figure() + plt.title('Prediction for k(x)') + plt.plot(x_Theta, Theta, '--o', color='blue') + plt.xlabel('$x$') + plt.ylabel('$k(x)$') + plt.grid() + plt.savefig(f'{FigureFolder}/prediction_kx_ITERATION_{ITERATION}.pdf', bbox_inches='tight') + # plt.show() + plt.close() + + # next iteration + ITERATION += 1 + + return error + + + + +#################################################################################################### +# Optimization +#################################################################################################### +ITERATION = 0 + +# Run the hyperparameter optimization +search_result = gp_minimize( + func=fitness, + dimensions=dimensions, + base_estimator='GP',#DUMMY', # ! 'GP', 'RF', 'ET', 'GBRT', 'DUMMY' + acq_func='EI', # Expected Improvement. + n_calls=n_calls, + x0=default_parameters, + random_state=42, +) + +# print result +print(search_result.x) + +# Plot convergence +plt.figure() +_ = plot_convergence(search_result) +plt.savefig('Figures/Optimization/TunerConvergence.pdf') +plt.savefig('Figures/Optimization/TunerConvergence.png') +# plt.show() +plt.close() + +# Plot objective +plt.figure() +_ = plot_objective(search_result, show_points=True, size=3.8) +plt.savefig('Figures/Optimization/TunerObjective.pdf') +plt.savefig('Figures/Optimization/TunerObjective.png') +# plt.show() +plt.close() + + +# Train best one +# MCMC +Theta, x_Theta, LOSS_THETA, LOSS_PHI, weights_historical = MCMC( + MCMC_STEPS=MCMC_STEPS, + MCMC_SUBSTEPS=MCMC_SUBSTEPS, + tau=tau, + beta=search_result.x[0], + gamma=gamma, + k_i=k_i, + k_mu=k_mu, + k_sigma=search_result.x[1], + u_true=u_true, + number_samples=NUMBER_SAMPLES +) + +# Save results + statistics of Theta +if NUMBER_SAMPLES == 1: + DataResultsFile = 'data/TunerResultsSingleSample.txt' +else: + DataResultsFile = 'data/TunerResultsDoubleSample.txt' +with open(f'{DataResultsFile}.txt', 'w') as f: + f.write('... Tuner Results and Timings ...\n') + f.write(f'... Tuner results ...\n') + f.write(f'n_calls: {n_calls}\n') + f.write(f'Best error: {search_result.fun}\n') + f.write(f'Best parameters: {search_result.x}\n') + f.write(f'Best beta: {search_result.x[0]}\n') + f.write(f'Best k_sigma: {search_result.x[1]}\n') + f.write(f'... Statistics of Theta ...\n') + f.write(f'Mean of Theta: {Theta.mean()}\n') + f.write(f'Standard deviation of Theta: {Theta.std()}\n') + +# Save to another file +np.savez( + f'{DataResultsFile}.npz', + n_calls=n_calls, best_error=search_result.fun, + best_parameters=search_result.x, + best_beta=search_result.x[0], + beta_k_sigma=search_result.x[1], + Theta_mean=Theta.mean(), + Theta_std=Theta.std() +) + +# plotting +# Combine both loss functions +plt.figure() +plt.title('Losses') +plt.plot(LOSS_THETA[:], '--o', color='red', label='$\Phi(\Theta)$') +plt.plot(LOSS_PHI[:], '--o', color='green', label='$\Phi(\phi$)') +plt.xlabel('Iteration') +plt.ylabel('Loss') +plt.legend() +plt.grid() +plt.savefig(f'{FigureFolder}/best_losses.pdf', bbox_inches='tight') +# plt.show() +plt.close() + +# Only the phi(theta) loss is plotted +plt.figure() +plt.title('Evolution of entropy loss') +plt.loglog(LOSS_THETA[:], '--o', color='red', label='$\Phi(\Theta)$') +plt.xlabel('log(Iteration)') +plt.ylabel('log($\Phi(\Theta)$)') +plt.grid() +plt.savefig(f'{FigureFolder}/best_loss_theta.pdf', bbox_inches='tight') +# plt.show() +plt.close() + +# Solve with the final Theta +t_vec, h_final = solve_PDE(Theta, T_end, NTime, x, dx, x_Theta, NUMBER_SAMPLES) +h_final = [extract_positions(t_vec[i], h_final[i], x) for i in range(NUMBER_SAMPLES)] +h_final = np.array([h_final[i].T for i in range(NUMBER_SAMPLES)]) + +colors = ['blue', 'red', 'green', 'purple'] +for sample in range(NUMBER_SAMPLES): + plt.figure() + plt.title(f'Predicted vs True - sample {sample+1}') + for i in range(4): + plt.plot([], [], color=colors[i], label=f'x = {x_observed[i]}') + plt.plot(h_final[sample, i, :], color=colors[i]) + plt.plot(u_true[i, :, sample], '--o', color=colors[i]) + plt.plot([], [], color='black', label='Predicted') + plt.plot([], [], '--o', color='black', label='True') + plt.xlabel('Time') + plt.ylabel('u(x,t)') + plt.legend(ncol=4, loc='upper center', bbox_to_anchor=(0.5, -0.1)) + plt.grid() + if NUMBER_SAMPLES == 1: + plt.savefig(f'{FigureFolder}/best_predicted_vs_true_single_sample.pdf', bbox_inches='tight') + else: + plt.savefig(f'{FigureFolder}/best_predicted_vs_true_both_samples_sample_{sample+1}.pdf', bbox_inches='tight') + # plt.show() + plt.close() + +# Plot the final theta -> prediction for k(x) +plt.figure() +plt.title('Prediction for k(x)') +plt.plot(x_Theta, Theta, '--o', color='blue') +plt.xlabel('$x$') +plt.ylabel('$k(x)$') +plt.grid() +plt.savefig(f'{FigureFolder}/best_prediction_kx_ITERATION.pdf', bbox_inches='tight') +# plt.show() +plt.close() \ No newline at end of file diff --git a/Project3/src/InfluenceArtificialDiffusion.py b/Project3/src/InfluenceArtificialDiffusion.py new file mode 100644 index 0000000000000000000000000000000000000000..6977aedbd32addf3b170ea68836859386ab55f6f --- /dev/null +++ b/Project3/src/InfluenceArtificialDiffusion.py @@ -0,0 +1,147 @@ +import numpy as np +import matplotlib.pyplot as plt +from tqdm import tqdm + +from MCMC import * + +ArtificialDiffusion = [1,2,3,4] + +# MCMC and solver parameters +MCMC_STEPS = 500 +MCMC_SUBSTEPS = 20 +NUMBER_SAMPLES = 1 +if NUMBER_SAMPLES == 1: + FigureFolder = 'Figures/ArtificialDiffusion' +else: + raise ValueError('NUMBER_SAMPLES must be 1 for this example') + +# solution vector +Theta_sol = [] +x_Theta_sol = [] +Loss_Theta_sol = [] +Loss_Phi_sol = [] + + +for art_diff in tqdm(ArtificialDiffusion): + print(f'Solving for M = {art_diff}') + Theta, x_Theta, LOSS_THETA, LOSS_PHI, weights_historical = MCMC( + MCMC_STEPS=MCMC_STEPS, + MCMC_SUBSTEPS=MCMC_SUBSTEPS, + tau=tau, + beta=beta, + gamma=gamma, + k_i=k_i, + k_mu=k_mu, + k_sigma=k_sigma, + u_true=u_true, + number_samples=NUMBER_SAMPLES, + M=art_diff, + ) + + # Save the solution + Theta_sol.append(Theta) + x_Theta_sol.append(x_Theta) + Loss_Theta_sol.append(LOSS_THETA) + Loss_Phi_sol.append(LOSS_PHI) + +for i, art_diff in enumerate(ArtificialDiffusion): + Theta = Theta_sol[i] + x_Theta = x_Theta_sol[i] + LOSS_THETA = Loss_Theta_sol[i] + LOSS_PHI = Loss_Phi_sol[i] + + # Plot the loss function + plt.figure() + plt.title(f'Losses - M = {art_diff}') + plt.plot(LOSS_THETA[:], '--o', color='red', label='$\Phi(\Theta)$') + plt.plot(LOSS_PHI[:], '--o', color='green', label='$\Phi(\phi$)') + plt.xlabel('Iteration') + plt.ylabel('Loss') + plt.legend() + plt.grid() + plt.savefig(f'{FigureFolder}/losses_ArtDiff{art_diff}.pdf', bbox_inches='tight') + plt.show() + + # Only the phi(theta) loss is plotted + plt.figure() + plt.title(f'Evolution of entropy loss - M = {art_diff}') + plt.loglog(LOSS_THETA[:], '--o', color='red', label='$\Phi(\Theta)$') + plt.xlabel('log(Iteration)') + plt.ylabel('log($\Phi(\Theta)$)') + plt.grid() + plt.savefig(f'{FigureFolder}/loss_theta_ArtDiff{art_diff}.pdf', bbox_inches='tight') + plt.show() + + # Solve with the final Theta + t_vec, h_final = solve_PDE(Theta, T_end, NTime, x, dx, x_Theta, NUMBER_SAMPLES, M=M) + h_final = [extract_positions(t_vec[i], h_final[i], x) for i in range(NUMBER_SAMPLES)] + h_final = np.array([h_final[i].T for i in range(NUMBER_SAMPLES)]) + + colors = ['blue', 'red', 'green', 'purple'] + for sample in range(NUMBER_SAMPLES): + plt.figure() + plt.title(f'Predicted vs True - M = {art_diff}') + for i in range(4): + plt.plot([], [], color=colors[i], label=f'x = {x_observed[i]}') + plt.plot(times_observed, h_final[sample, i, :], color=colors[i]) + plt.plot(times_observed, u_true[i, :, sample], '--o', color=colors[i]) + plt.plot([], [], color='black', label='Predicted') + plt.plot([], [], '--o', color='black', label='True') + plt.xlabel('Time') + plt.ylabel('u(x,t)') + plt.legend(ncol=4, loc='upper center', bbox_to_anchor=(0.5, -0.1)) + plt.grid() + plt.savefig(f'{FigureFolder}/predicted_vs_true_single_sample_ArtDiff{art_diff}.pdf', bbox_inches='tight') + plt.show() + + # Plot the final theta -> prediction for k(x) + plt.figure() + plt.title(f'Prediction for k(x) - M = {art_diff}') + plt.plot(x_Theta, Theta, '--o', color='blue') + plt.xlabel('$x$') + plt.ylabel('$k(x)$') + plt.grid() + plt.savefig(f'{FigureFolder}/prediction_kx_ArtDiff{art_diff}.pdf', bbox_inches='tight') + plt.show() + +# Compare the loss function for different M +plt.figure() +plt.title('Comparison of the errors for different M') +[plt.plot(Loss_Theta_sol[i][:], '--o', color=colors[i], label=f'M = {ArtificialDiffusion[i]}') for i in range(len(ArtificialDiffusion))] +plt.xlabel('Iteration') +plt.ylabel('Loss') +plt.legend() +plt.grid() +plt.savefig(f'{FigureFolder}/losses_ArtDiffComparison.pdf', bbox_inches='tight') +plt.show() + +# Compare the resistance fucntion k(x) for different M +plt.figure() +plt.title('Comparison of the resistance function k(x) for different M') +[plt.plot(x_Theta_sol[i], Theta_sol[i], '--o', color=colors[i], label=f'M = {ArtificialDiffusion[i]}') for i in range(len(ArtificialDiffusion))] +plt.xlabel('$x$') +plt.ylabel('$k(x)$') +plt.legend() +plt.grid() +plt.savefig(f'{FigureFolder}/prediction_kx_ArtDiffComparison.pdf', bbox_inches='tight') +plt.show() + +# Compare final error over M +plt.figure() +plt.title('Comparison of the final error for different M') +plt.plot(ArtificialDiffusion, np.array(Loss_Theta_sol)[:,-1], '--o', color='black') +plt.xlabel('M') +plt.ylabel('$\Phi(\Theta)$') +plt.legend() +plt.grid() +plt.savefig(f'{FigureFolder}/final_error_ArtDiffComparison.pdf', bbox_inches='tight') +plt.show() + +# Save the results +np.savez( + f'{FigureFolder}/results_ArtDiffComparison.npz', Theta_sol=Theta_sol, + x_Theta_sol=x_Theta_sol, + Loss_Theta_sol=Loss_Theta_sol, + Loss_Phi_sol=Loss_Phi_sol, + ArtificialDiffusion=ArtificialDiffusion +) \ No newline at end of file diff --git a/Project3/src/InfluenceResistance.py b/Project3/src/InfluenceResistance.py new file mode 100644 index 0000000000000000000000000000000000000000..174635173f0e8c07f17b6c6a354840ce8128623c --- /dev/null +++ b/Project3/src/InfluenceResistance.py @@ -0,0 +1,62 @@ +import numpy as np +import scipy.io +import matplotlib.pyplot as plt + +from MCMC import Upwind, solve_PDE, extract_positions + +# Parameters +x0, x1 = 0, 4 + +NTime = 500 +T_end = 10 + +# Upwind viscosity parameter (used in flux computation) +M = 1 + +k_i = 9 +k_mu, k_sigma = 1., 0.25 + +# Load solution +datafile = 'data/TrueData_FluxF.mat' +mat = scipy.io.loadmat(datafile) + +Nx = int(mat['N'].item())+2 +T_end = float(mat['Tend'].item()) +times_observed = mat['time_obs'][0] +n_extraction_points = 4 +x_observed = [float(mat[f'X_{i}'].item()) for i in range(1, n_extraction_points+1)] +u_true = np.array([mat[f'u_true_X{i}'] for i in range(1, n_extraction_points+1)]) + +x = np.linspace(x0, x1, Nx) +dx = x[1] - x[0] + + +# Create 5 different resistance functions to inspect the influence of the resistance function +n_resistance_functions = 15 +for iter_function in range(n_resistance_functions): + Theta = np.random.normal(k_mu, k_sigma, k_i+2) + Theta[0], Theta[-1] = k_mu, k_mu + x_Theta = np.linspace(x0, x1, k_i+2) + t_vec, u_vec = solve_PDE(Theta, T_end, NTime, x, dx, x_Theta) + u_vec = np.array([extract_positions(t_vec[i], u_vec[i], x) for i in range(1)]).T.reshape(n_extraction_points,-1) + + # Plot + colors = ['blue', 'red', 'green', 'purple'] + fig, axs = plt.subplots(ncols=2, figsize=(10, 5)) + axs[0].plot(x_Theta, Theta, 'o-', color='black') + axs[0].set_xlabel('x') + axs[0].set_ylabel('$k(x)$') + for i in range(n_extraction_points): + axs[1].plot([], [], color=colors[i], label=f'x = {x_observed[i]}') + axs[1].plot(times_observed, u_vec[i,:], color=colors[i]) + axs[1].plot(times_observed, u_true[i, :, 0], '--o', color=colors[i]) + plt.plot([], [], color='black', label='Predicted') + plt.plot([], [], '--o', color='black', label='True') + axs[1].set_xlabel('Time') + axs[1].set_ylabel('$u(x,t)$') + axs[1].legend(ncol=4, loc='upper center', bbox_to_anchor=(0.48, -0.1)) + [ax.grid() for ax in axs] + + fig.tight_layout() + fig.savefig(f'figures/InfluenceResistance/sample_{iter_function}.png') + fig.show() diff --git a/Project3/src/MCMC.py b/Project3/src/MCMC.py new file mode 100644 index 0000000000000000000000000000000000000000..6994be3cc7f6df12b82ab00313ce0670d7cfe605 --- /dev/null +++ b/Project3/src/MCMC.py @@ -0,0 +1,403 @@ +import numpy as np +import scipy.io +import matplotlib.pyplot as plt +from tqdm import tqdm + +# MCMC and solver parameters +MCMC_STEPS = 500 +MCMC_SUBSTEPS = 20 +NUMBER_SAMPLES = 1 + +x0, x1 = 0, 4 + +NTime = 500 +T_end = 10 + +# Upwind viscosity parameter (used in flux computation) +M = 1 + +k_i = 9 +k_mu, k_sigma = 1., 0.25 + +# Load solution +datafile = 'data/TrueData_FluxF.mat' +mat = scipy.io.loadmat(datafile) + +Nx = int(mat['N'].item())+2 +T_end = float(mat['Tend'].item()) +NT_obs = int(mat['NT_obs'].item()) +times_observed = mat['time_obs'][0] +n_extraction_points = 4 +x_observed = [float(mat[f'X_{i}'].item()) for i in range(1, n_extraction_points+1)] +u_true = np.array([mat[f'u_true_X{i}'] for i in range(1, n_extraction_points+1)])#[:,:,0] +u_true_flatten = u_true.flatten() + +x = np.linspace(x0, x1, Nx) +dx = x[1] - x[0] + +# MCMC tuning parameters +beta = 0.036442897496557186 # ! best value from optimization 0.05 # initial proposal scale +gamma = 0.03 +tau = 100 # burn in iterations + +# Diagnostics storage for adaptive beta +beta_history = [] +acceptance_history = [] + +# Define f(u) and its derivative +f = lambda u: u * (1 - u) +df = lambda u: 1 - 2*u + +def Upwind(u, M=M): + """ + Compute the numerical flux F_{j+1/2} using: + F_{j+1/2} = 0.5*(f(u_j)+f(u_{j+1})) - (M/2)*(u_{j+1}-u_j) + """ + F = np.zeros_like(u) + F[:-1] = 0.5 * (f(u[:-1]) + f(u[1:])) - (M/2)*(u[1:] - u[:-1]) + F[-1] = f(u[-1]) + return F + +def solve_PDE(Theta, T_end, NTime, x, dx, x_Theta, number_samples=1, CFL=0.5, time_scheme='Euler', M=1): + """ + Solve the PDE + u_t + (k(x) f(u))_x = 0, + using a conservative update: + (u_i^{n+1} - u_i^n)/dt + (1/dx)*(k_{i+1/2} F_{i+1/2} - k_{i-1/2} F_{i-1/2}) = 0. + + k(x) is defined via linear interpolation of Theta at x_Theta. + An adaptive dt is computed using the CFL condition based on the maximum + characteristic speed |k(x)*f'(u)|. + + The option time_scheme can be: + - 'Euler': standard forward Euler (first-order) + - 'Heun': Heun's method (second-order predictor-corrector) + """ + # Define k(x) via interpolation + k = lambda x_val: np.interp(x_val, x_Theta, Theta) + + # Initial condition + u_init_1 = np.where( + x <= 0.5, + 0.2, + np.where( + x <= 1.5, + 0.4, + np.where( + x <= 2.5, + 0.6, + np.where( + x <= 3.5, + 0.7, + 0.4 + ) + ) + ) + ) + + u_init_2 = np.where( + x <= 0.5, + 0.1, + np.where( + x <= 1.5, + 0.3, + np.where( + x <= 2.5, + 0.7, + 0.2 + ) + ) + ) + + def solver(u): + t = 0.0 + u_vec = [u.copy()] + t_vec = [t] + while t < T_end: + # Compute dt using the CFL condition: dt <= CFL*dx / max|k(x) * f'(u)| + speeds = np.abs(k(x) * df(u)) + max_speed = np.max(speeds) + dt_CFL = CFL * dx / (max_speed + 1e-6) + dt = min(dt_CFL, T_end - t) + + # Compute fluxes at interfaces + F = Upwind(u, M) + # Spatial locations of cell interfaces + x_half = (x[:-1] + x[1:]) / 2.0 + k_half = k(x_half) + + if time_scheme == 'Euler': + # Euler update + u_new = u.copy() + # Update interior cells (i = 1,..., len(u)-2) + u_new[1:-1] = u[1:-1] - dt/dx * ( k_half[1:] * F[1:-1] - k_half[:-1] * F[:-2] ) + elif time_scheme == 'Heun': + # Predictor: Euler step + u_predictor = u.copy() + u_predictor[1:-1] = u[1:-1] - dt/dx * ( k_half[1:] * F[1:-1] - k_half[:-1] * F[:-2] ) + # Compute fluxes for the predictor + F_predictor = Upwind(u_predictor, M) + # Average fluxes for a second order update + u_new = u.copy() + # Compute the slope at u and at u_predictor + slope1 = np.zeros_like(u) + slope2 = np.zeros_like(u) + slope1[1:-1] = -1/dx * ( k_half[1:] * F[1:-1] - k_half[:-1] * F[:-2] ) + slope2[1:-1] = -1/dx * ( k_half[1:] * F_predictor[1:-1] - k_half[:-1] * F_predictor[:-2] ) + u_new[1:-1] = u[1:-1] + dt/2.0*(slope1[1:-1] + slope2[1:-1]) + else: + raise ValueError("Unknown time integration scheme.") + + # Boundary conditions: here, we keep the boundary values fixed (Dirichlet) + u_new[0] = u_new[1] # !u[0] + u_new[-1] = u_new[-2] # !u[-1] + + u = u_new.copy() + t += dt + u_vec.append(u.copy()) + t_vec.append(t) + + return np.array(t_vec), np.array(u_vec) + + t_vec_1, u_vec_1 = solver( + u=u_init_1 + ) + if number_samples == 1: + return [t_vec_1], [u_vec_1] + + # number_samples = 2 + t_vec_2, u_vec_2 = solver( + u=u_init_2 + ) + t_vec = [t_vec_1, t_vec_2] + u_vec = [u_vec_1, u_vec_2] + + return t_vec, u_vec + +def extract_positions(t_vec, h_, x): + """ + Extract the solution at the observation times and spatial positions. + """ + h_extracted = [] + for t_obs in times_observed: + idx_t = np.argmin(np.abs(t_vec - t_obs)) + h_extracted.append(h_[idx_t, :]) + # h_extracted = np.array(h_extracted)[:, [np.argmin(np.abs(x - x_obs)) for x_obs in x_observed]] + h_extracted = np.array(h_extracted)[:, [np.argmin(np.abs(x_obs - x)) for x_obs in x_observed]] + return h_extracted + +def MCMC( + MCMC_STEPS=MCMC_STEPS, + MCMC_SUBSTEPS=MCMC_SUBSTEPS, + tau=tau, + beta=beta, + gamma=gamma, + k_i=k_i, + k_mu=k_mu, + k_sigma=k_sigma, + u_true=u_true, + number_samples=1, + M=1 +): + if number_samples == 1: + u_true = u_true[:,:,0] + u_true_flatten = u_true.flatten() + else: + u_true_flatten = u_true.flatten() + # Initial guess for Theta (parameters for k(x)) + Theta = np.random.normal(k_mu, k_sigma, k_i+2).clip(0.8, 1.2)#!.clip(0.95, 1.3) + Theta[0], Theta[-1] = k_mu, k_mu + x_Theta = np.linspace(x0, x1, k_i+2) + + # Solve the PDE with the initial Theta + t_vec, h_Theta = solve_PDE(Theta, T_end, NTime, x, dx, x_Theta, number_samples, M=M) + h_Theta = np.array([extract_positions(t_vec[i], h_Theta[i], x) for i in range(number_samples)]).T + h_Theta = h_Theta.flatten() + dist_Theta = h_Theta - u_true_flatten + + # Initialize weights + weights = np.ones_like(dist_Theta) # 4 is the number of observed points + weights /= np.sum(weights) * (number_samples*4) + nx_observed = u_true.shape[1] + weights_historical = [np.ones(4*number_samples)] + + # Burn-in phase (without adaptive beta for simplicity) + for i in range(tau): + xi = np.random.normal(0, k_sigma, size=Theta.shape) + Phi = np.sqrt(1 - beta**2) * Theta + beta * xi + Phi[0], Phi[-1] = k_mu, k_mu + + t_vec, h_Phi = solve_PDE(Phi, T_end, NTime, x, dx, x_Theta, number_samples, M=M) + h_Phi = np.array([extract_positions(t_vec[i], h_Phi[i], x) for i in range(number_samples)]).T + h_Phi = h_Phi.flatten() + dist_Phi = h_Phi - u_true_flatten + + # loss_Theta = 0.5 * (weights * dist_Theta @ dist_Theta.T) / gamma**2 + # loss_Phi = 0.5 * (weights * dist_Phi @ dist_Phi.T) / gamma**2 + loss_Theta = 0.5 * (dist_Theta @ dist_Theta.T) / gamma**2 + loss_Phi = 0.5 * (dist_Phi @ dist_Phi.T) / gamma**2 + + a = min(1, np.exp(loss_Theta - loss_Phi)) + if np.random.uniform(0, 1) <= a: + Theta = Phi + h_Theta = h_Phi + dist_Theta = dist_Phi + + # Update weights + # L2 = [] + # for i in range(number_samples*4): + # L2.append(np.linalg.norm(dist_Theta[i*nx_observed:(i+1)*nx_observed])) + # L2 = np.array(L2) + # weights = L2/np.sum(L2) *(number_samples*4) + # weights_historical.append(weights) + # weights = np.repeat(weights, nx_observed) + + LOSS_THETA = [] + LOSS_PHI = [] + + print('Starting MCMC with adaptive beta') + # For adaptive beta, track the number of accepted proposals in each block. + target_accept_low = 0.1#0.2 # ! 0.1 + target_accept_high = 0.3#0.5 # ! 0.3 + + for mcmc_iter in tqdm(range(MCMC_STEPS)): + accepted = 0 + for _ in range(MCMC_SUBSTEPS): + xi = np.random.normal(0, k_sigma, size=Theta.shape) + Phi = np.sqrt(1 - beta**2) * Theta + beta * xi + Phi[0], Phi[-1] = k_mu, k_mu + + t_vec, h_Phi = solve_PDE(Phi, T_end, NTime, x, dx, x_Theta, number_samples, M=M) + h_Phi = np.array([extract_positions(t_vec[i], h_Phi[i], x) for i in range(number_samples)]).T + h_Phi = h_Phi.flatten() + dist_Phi = h_Phi - u_true_flatten + + # loss_Theta = 0.5 * (weights * dist_Theta @ dist_Theta.T) / gamma**2 + # loss_Phi = 0.5 * (weights * dist_Phi @ dist_Phi.T) / gamma**2 + loss_Theta = 0.5 * (dist_Theta @ dist_Theta.T) / gamma**2 + loss_Phi = 0.5 * (dist_Phi @ dist_Phi.T) / gamma**2 + + a = min(1, np.exp(loss_Theta - loss_Phi)) + if np.random.uniform(0, 1) <= a: + Theta = Phi + h_Theta = h_Phi + dist_Theta = dist_Phi + accepted += 1 + + # Save losses at the end of each outer step + LOSS_THETA.append(loss_Theta) + LOSS_PHI.append(loss_Phi) + + # Compute acceptance ratio for this block + acc_ratio = accepted / MCMC_SUBSTEPS + acceptance_history.append(acc_ratio) + beta_history.append(beta) + + # # Adapt beta based on acceptance ratio: + # if acc_ratio < target_accept_low: + # beta *= 0.9 + # elif acc_ratio > target_accept_high: + # beta *= 1.1 + + # # Update weights + # L2 = [] + # for i in range(number_samples*4): + # L2.append(np.linalg.norm(dist_Theta[i*nx_observed:(i+1)*nx_observed])) + # L2 = np.array(L2) + # weights = L2/np.sum(L2)*(number_samples*4) + # weights_historical.append(weights) + # weights = np.repeat(weights, nx_observed) + + return Theta, x_Theta, LOSS_THETA, LOSS_PHI, weights_historical + +if __name__ == '__main__': + Theta, x_Theta, LOSS_THETA, LOSS_PHI, weights_historical = MCMC( + MCMC_STEPS=MCMC_STEPS, + MCMC_SUBSTEPS=MCMC_SUBSTEPS, + tau=tau, + beta=beta, + gamma=gamma, + k_i=k_i, + k_mu=k_mu, + k_sigma=k_sigma, + u_true=u_true, + number_samples=NUMBER_SAMPLES + ) + if NUMBER_SAMPLES == 1: + FigureFolder = 'Figures/SingleSample' + else: + FigureFolder = 'Figures/DoubleSample' + # Combine both loss functions + plt.figure() + plt.title('Losses') + plt.plot(LOSS_THETA[:], '--o', color='red', label='$\Phi(\Theta)$') + plt.plot(LOSS_PHI[:], '--o', color='green', label='$\Phi(\phi$)') + plt.xlabel('Iteration') + plt.ylabel('Loss') + plt.legend() + plt.grid() + plt.savefig(f'{FigureFolder}/losses.pdf', bbox_inches='tight') + plt.show() + + # Only the phi(theta) loss is plotted + plt.figure() + plt.title('Evolution of entropy loss') + plt.loglog(LOSS_THETA[:], '--o', color='red', label='$\Phi(\Theta)$') + plt.xlabel('log(Iteration)') + plt.ylabel('log($\Phi(\Theta)$)') + plt.grid() + plt.savefig(f'{FigureFolder}/loss_theta.pdf', bbox_inches='tight') + plt.show() + + # Solve with the final Theta + t_vec, h_final = solve_PDE(Theta, T_end, NTime, x, dx, x_Theta, NUMBER_SAMPLES, M=M) + h_final = [extract_positions(t_vec[i], h_final[i], x) for i in range(NUMBER_SAMPLES)] + h_final = np.array([h_final[i].T for i in range(NUMBER_SAMPLES)]) + + colors = ['blue', 'red', 'green', 'purple'] + for sample in range(NUMBER_SAMPLES): + plt.figure() + plt.title(f'Predicted vs True - sample {sample+1}') + for i in range(4): + plt.plot([], [], color=colors[i], label=f'x = {x_observed[i]}') + plt.plot(times_observed, h_final[sample, i, :], color=colors[i]) + plt.plot(times_observed, u_true[i, :, sample], '--o', color=colors[i]) + plt.plot([], [], color='black', label='Predicted') + plt.plot([], [], '--o', color='black', label='True') + plt.xlabel('Time') + plt.ylabel('u(x,t)') + plt.legend(ncol=4, loc='upper center', bbox_to_anchor=(0.5, -0.1)) + plt.grid() + if NUMBER_SAMPLES == 1: + plt.savefig(f'{FigureFolder}/predicted_vs_true_single_sample.pdf', bbox_inches='tight') + else: + plt.savefig(f'{FigureFolder}/predicted_vs_true_both_samples_sample_{sample+1}.pdf', bbox_inches='tight') + plt.show() + + # Plot the final theta -> prediction for k(x) + plt.figure() + plt.title('Prediction for k(x)') + plt.plot(x_Theta, Theta, '--o', color='blue') + plt.xlabel('$x$') + plt.ylabel('$k(x)$') + plt.grid() + plt.savefig(f'{FigureFolder}/prediction_kx.pdf', bbox_inches='tight') + plt.show() + + # History of weights + plt.figure() + plt.title('History of weights') + marker = [':', '--'] + weights_historical = np.array(weights_historical) + for sample in range(NUMBER_SAMPLES): + for i in range(4*NUMBER_SAMPLES): + plt.plot(weights_historical[:,i], marker[sample], color=colors[i%4]) + plt.plot([], [], ':', color='black', label='Sample 1') + plt.plot([], [], '--', color='black', label='Sample 2') + [plt.plot([], [], color=colors[i], label=f'x = {x_observed[i%4]}') for i in range(4)] + plt.xlabel('Update Iteration') + plt.ylabel('Weight') + plt.legend() + plt.grid() + plt.savefig(f'{FigureFolder}/weights.pdf', bbox_inches='tight') + plt.show() \ No newline at end of file diff --git a/Project3/src/data/TrueData_FluxF.mat b/Project3/src/data/TrueData_FluxF.mat new file mode 100644 index 0000000000000000000000000000000000000000..fc2d2c049794f464371809c96526c9e24dbd6c38 Binary files /dev/null and b/Project3/src/data/TrueData_FluxF.mat differ diff --git a/Project3/src/data/TunerResultsSingleSample.txt.npz b/Project3/src/data/TunerResultsSingleSample.txt.npz new file mode 100644 index 0000000000000000000000000000000000000000..de8700e51cc6da7218361d980f81f66bcffc5e7e Binary files /dev/null and b/Project3/src/data/TunerResultsSingleSample.txt.npz differ diff --git a/Project3/src/data/TunerResultsSingleSample.txt.txt b/Project3/src/data/TunerResultsSingleSample.txt.txt new file mode 100644 index 0000000000000000000000000000000000000000..a178040d66aeba421aed5ea1d6dab4e402b33575 --- /dev/null +++ b/Project3/src/data/TunerResultsSingleSample.txt.txt @@ -0,0 +1,10 @@ +... Tuner Results and Timings ... +... Tuner results ... +n_calls: 25 +Best error: 7.961210545809955 +Best parameters: [0.036442897496557186, 0.24429936306439973] +Best beta: 0.036442897496557186 +Best k_sigma: 0.24429936306439973 +... Statistics of Theta ... +Mean of Theta: 1.013517780964137 +Standard deviation of Theta: 0.19961814808942516