You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardexpand all lines: README.md
+22
Original file line number
Diff line number
Diff line change
@@ -55,6 +55,28 @@ some utility scripts that convert Stan output to ROOT trees and vice versa.
55
55
line to your .bashrc:
56
56
`export PYTHONPATH=$PYTHONPATH:<your path to meson_deca>/meson_deca/lib/py_lib`
57
57
58
+
59
+
### Usage
60
+
61
+
*Main idea.* This module is designed to generate and fit the data according to some distribution
62
+
`f_model(y, theta)`.
63
+
64
+
1. First, you need a `.stan` model that says: "Please generate/fit me some data according to `f_model`".
65
+
A template of such a file you can find in `lib/stan_lib`. Go ahead and take a look at
66
+
`lib/stan_lib/STAN_data_generator.stan`! (For some other examples, browse `models` folder for `.stan` files.)
67
+
68
+
2. Each time you will build the `.stan` model, it will look for the function `f_model` in the file
69
+
`lib/c_lib/model.hpp`. Make sure that this function is suited to your needs. For details, see the
70
+
example below, user guide, or browse the `models/*/backup/model.hpp`.
71
+
72
+
3. If you think about it, the step 2) above is much more complicated and important than the step 1).
73
+
Therefore, when you write your own model, I suggest you proceed as follows.
74
+
1. Adjust the function `f_model` in the file `lib/c_lib/model.hpp`.
75
+
2. Call `./initialize_model FOLDER_NAME` from the `meson_deca` folder. This script will copy the templates of
76
+
the `*.stan` files to `models/FOLDER_NAME` and place a backup copy of `model.hpp` in `models/FOLDER_NAME/backup`.
77
+
After that, adjust the `*.stan` files and build them into executables (the script `build.sh` may save you some time).
78
+
3. You can use the executables to sample/fit to your hearts desire. There are some python scripts in `utils/` you may use to convert STAN output to .root files and vice versa.
79
+
58
80
### Example
59
81
60
82
(You may want to read `docs/user_guide.pdf` first to get acquainted with the
0 commit comments