Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Function Parameters within CES & Darcy example #316

Merged
merged 14 commits into from
Oct 4, 2024
Merged

Function Parameters within CES & Darcy example #316

merged 14 commits into from
Oct 4, 2024

Conversation

odunbar
Copy link
Collaborator

@odunbar odunbar commented Aug 20, 2024

Purpose

  • To introduce the Darcy flow example to help validate higher-dimensional methods for Emulation and sampling.

To-do

Closes #323
Closes #324

Content

  • Add the Darcy flow example from EnsembleKalmanProcesses.jl (See here), learning a permeability field from some discrete pressure observations
  • Modify src/MarkovChainMonteCarlo get_posterior( to handle loading the function parameter
  • reduced brittleness of a condition-number test on matrix

Example output

from the calibration:

prior
output_prior
final iteration
output_it_5
truth
output_true

note these are not seeded so the randomness likely will change the result each time.

from the emulate_sample.jl
Emulator check:

ML prediction on true parameters: 
[27.037408018242395, 38.87046139907847, 44.20165141698669, 44.81967460948412, 37.95762890768021, 27.084696766779054, 14.284342254286276, 41.225315659861174, 65.20877142866557, 75.4871734698289, 75.89983759897456, 65.89528866862894, 48.64379706569926, 26.77602042655126, 52.41126175374155, 83.2144993558748, 97.42776407311258, 98.3148676162914, 85.31481608662372, 63.293498366057726, 34.74875453547942, 61.561746712433695, 94.74782841985235, 112.44553354480084, 116.54156132625108, 99.5182177748717, 73.15942728881657, 39.47475688708078, 60.271179410024565, 97.02765814231405, 116.51247982894408, 121.15894751771309, 106.44717126532579, 80.16419988957492, 44.630376135296885, 54.25445794702326, 89.28033820768455, 107.54747440965036, 111.84523353382397, 101.5759088113121, 79.98653047792462, 47.54441991685336, 38.62524359313755, 61.82144722190585, 74.33157261921035, 78.27094847216169, 72.00563201011728, 58.548161131379715, 37.136865856168434]
true data: 
[23.84984138170094, 34.07464189113868, 45.416933138479166, 44.07931284195099, 33.65233298120436, 33.01615021178614, 15.077839776390611, 46.858281713105896, 67.01867480773103, 78.536759250763, 80.4860269350031, 66.12220208826437, 48.72938148448155, 26.687674306444382, 52.68364578726671, 87.6429536245335, 101.59518527623275, 98.06482852584509, 84.48714624938796, 61.315687335509736, 33.372651588657256, 53.66877549346963, 88.99212547729059, 112.40516507316904, 114.08675602624477, 95.55222700277633, 73.39447680369074, 43.254623784078646, 64.2228045937796, 95.41500420534308, 112.70626702034014, 117.75064097762899, 103.06978425812935, 77.76447284695995, 44.869216531401364, 54.90382329022393, 89.94842682627534, 105.36102533892421, 113.34730085341785, 105.18675551571583, 82.26396614996443, 46.369884629910466, 34.33466615937397, 63.802573464988754, 75.41489892667848, 77.25768123625558, 71.50004108831035, 62.207867252294854, 41.076630593780834]
 ML predicted standard deviation
[2.609234092147626, 2.6059894762299933, 2.607473226550132, 2.612071197290017, 2.613743191102169, 2.614594101414251, 2.6135702847721385, 2.600191409539615, 2.600558328408845, 2.6002529606771305, 2.599717195096206, 2.6137828393644242, 2.615427558326809, 2.614288407835236, 2.6135301648397196, 2.61622373875433, 2.616501522987768, 2.6153526510313894, 2.599263431097443, 2.6142356710712096, 2.6150421836682884, 2.6190301454640474, 2.6174928501072725, 2.6184783694424563, 2.619186848031698, 2.615045216646557, 2.6120309645626043, 2.6152856355464835, 2.6153003997900885, 2.6171139124799914, 2.6192066232734224, 2.6192030742448265, 2.6157746075086825, 2.6012162999103468, 2.614387290585893, 2.6007390677078344, 2.6153682904050264, 2.6176116959855107, 2.6176292392538443, 2.615466725101344, 2.6101420829569135, 2.615154402007166, 2.615674479178309, 2.60132642271825, 2.6152681106034272, 2.616475362834447, 2.611383358599127, 2.6146592701107996, 2.61786014770975]
ML MSE (truth): 
9.649540741225902
ML MSE (next ensemble): 
0.013397421420773633

and the UQ check :

post_mean
[0.983561876339554; -0.9581797789308962; 0.9485901106700727; 1.2076572098239085; -0.5724392937657472;;]
post_cov
[0.001240363115299256 0.0007521635791415857 0.0009539072667421793 7.79372640360373e-5 8.636512376624956e-5; 0.0007521635791415857 0.005702149781800616 -0.00041195632220727507 -0.004067959894947535 -0.0005367145219895543; 0.0009539072667421793 -0.00041195632220727507 0.004952320816263619 0.0010380776193430995 -0.0008631261725693903; 7.79372640360373e-5 -0.004067959894947535 0.0010380776193430995 0.029750884482751237 5.5897073597492775e-5; 8.636512376624956e-5 -0.0005367145219895543 -0.0008631261725693903 5.5897073597492775e-5 0.02958700649705789]
D util
4.917659459703968e10

pointwise uq - (mean should be similar to calibrate result, but uncertainty is usually a larger magnitude variance in colourbar). Pushed forward mean permeability to get pressure here for now
GP_posterior_pointwise_uq


  • I have read and checked the items on the review checklist.

@odunbar odunbar changed the title WIP: FunctionParameterDistribution compatability with MCMC & Darcy example WIP: Function Parameters within CES & Darcy example Aug 20, 2024
Copy link

codecov bot commented Aug 20, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 88.66%. Comparing base (acf1051) to head (02cfa99).
Report is 24 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main     #316      +/-   ##
==========================================
+ Coverage   88.17%   88.66%   +0.48%     
==========================================
  Files           8        8              
  Lines        1184     1217      +33     
==========================================
+ Hits         1044     1079      +35     
+ Misses        140      138       -2     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@odunbar odunbar changed the title WIP: Function Parameters within CES & Darcy example Function Parameters within CES & Darcy example Oct 4, 2024
@odunbar odunbar merged commit adced6c into main Oct 4, 2024
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add an example inverse problem (Darcy?) Add any remaining functionality to handle function parameter types
1 participant