-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
example evaluating TMCMC samples with umbridge
- Loading branch information
Showing
14 changed files
with
39,760 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,68 @@ | ||
project (UQTk) | ||
|
||
SET(copy_FILES | ||
tmcmc_getLL.sh | ||
tmcmc_getLP.sh | ||
tmcmc_moveIntermediateFiles.sh | ||
tmcmc_prior_samples.dat | ||
tmcmc_umbridge.py | ||
minimal-umbridge-model.py | ||
README | ||
) | ||
|
||
link_directories(${CMAKE_SUNDIALS_DIR}/lib) | ||
|
||
add_executable (umbridge_model.x umbridge_model.cpp) | ||
add_executable (tmcmc_umbridge.x tmcmc_umbridge.cpp) | ||
|
||
target_link_libraries (tmcmc_umbridge.x uqtk ) | ||
target_link_libraries (tmcmc_umbridge.x depdsfmt ) | ||
target_link_libraries (tmcmc_umbridge.x depslatec) | ||
target_link_libraries (tmcmc_umbridge.x deplbfgs ) | ||
|
||
|
||
# Link fortran libraries | ||
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "GNU") | ||
# using GCC | ||
target_link_libraries (tmcmc_umbridge.x gfortran expat stdc++) | ||
elseif ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Intel") | ||
# using Intel | ||
if ("${IntelLibPath}" STREQUAL "") | ||
target_link_libraries (tmcmc_umbridge.x ifcore ifport) | ||
else() | ||
target_link_libraries (tmcmc_umbridge.x ${IntelLibPath}/libifcore.a) | ||
target_link_libraries (tmcmc_umbridge.x ${IntelLibPath}/libifport.a) | ||
endif() | ||
elseif (CMAKE_CXX_COMPILER_ID MATCHES "Clang") | ||
# using Clang | ||
if ("${ClangLibPath}" STREQUAL "") | ||
target_link_libraries (tmcmc_umbridge.x gfortran stdc++) | ||
else() | ||
target_link_libraries (tmcmc_umbridge.x ${ClangLibPath}/libgfortran.dylib ${ClangLibPath}/libstdc++.dylib) | ||
endif() | ||
endif() | ||
|
||
target_link_libraries (tmcmc_umbridge.x m lapack) | ||
target_link_libraries (tmcmc_umbridge.x m blas) | ||
|
||
include_directories(../../examples/tmcmc_umbridge) | ||
|
||
include_directories(../../cpp/lib/pce ) | ||
include_directories(../../cpp/lib/array ) | ||
include_directories(../../cpp/lib/include) | ||
include_directories(../../cpp/lib/quad ) | ||
include_directories(../../cpp/lib/tools ) | ||
include_directories(../../cpp/lib/mcmc ) | ||
include_directories(../../cpp/lib/tmcmc ) | ||
|
||
include_directories(../../dep/dsfmt) | ||
include_directories(../../dep/slatec) | ||
include_directories(../../dep/lbfgs) | ||
|
||
|
||
INSTALL(TARGETS tmcmc_umbridge.x DESTINATION examples/tmcmc_umbridge) | ||
INSTALL(TARGETS umbridge_model.x DESTINATION examples/tmcmc_umbridge) | ||
|
||
INSTALL(FILES ${copy_FILES} | ||
PERMISSIONS OWNER_EXECUTE OWNER_WRITE OWNER_READ | ||
DESTINATION examples/tmcmc_umbridge) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
tmcmc_bimodal example | ||
|
||
|
||
contains example for sampling of 3-dimensional bimodal posterior probability density using TMCMC. The C++ libraries are called directly from the driver program. | ||
By changing the likelihood function and the prior function in bimodal.cpp, this program can be tailored to other inference problems. | ||
|
||
================================================================================ | ||
Files | ||
|
||
tmcmc_bimodal.py: main scripts | ||
|
||
tmcmc_bimodal.cpp: C++ code that produces some of the needed functions - | ||
sets up the MCMC class object, specifying the | ||
dimensionality of the problem, number of | ||
samples required, number of processes for | ||
parallel evaluation of likelihood and prior | ||
|
||
bimodal.cpp: C++ code for evaluating the likelihood and prior pdfs - | ||
the corresponding executable is invoked | ||
multiple times for parallel evaluation | ||
of likelihood and prior pdfs | ||
|
||
tmcmc_prior_samples.dat: samples from prior pdf (as required by TMCMC) - | ||
3D Normal prior for this example with 5000 | ||
samples | ||
|
||
tmcmc_getLL.sh: Shell script that spawns multiple processes for parallel | ||
evaluation of likelihood function | ||
tmcmc_getLP.sh Shell script that spawns multiple processes for parallel | ||
evaluation of prior PDF | ||
tmcmc_moveIntermediateFiles.sh: Shell script used for moving all | ||
artifacts of TMCMC into a subdirectory |
Oops, something went wrong.