Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
S
SINDyc And MCMC Framework
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
freba
SINDyc And MCMC Framework
Commits
3a394dce
Commit
3a394dce
authored
Sep 21, 2020
by
freba
Browse files
Options
Downloads
Patches
Plain Diff
Added code block captions.
parent
1b434670
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
Documentation.org
+59
-6
59 additions, 6 deletions
Documentation.org
with
59 additions
and
6 deletions
Documentation.org
+
59
−
6
View file @
3a394dce
...
...
@@ -241,6 +241,7 @@ def select_Xi_parsimony_sweep(msindyc):
#+end_src
#+NAME: c0
#+CAPTION: This code block is associated with the upper subplot in Figure 1.
#+begin_src python :noweb strip-export :exports both :tangle ./Scripts/c0.py :results file :return filepath
cluster=0
...
...
@@ -265,6 +266,7 @@ filepath = plot_clusterModels(
#+end_src
#+NAME: c1
#+CAPTION: This code block is associated with the lower subplot in Figure 1.
#+begin_src python :noweb strip-export :exports both :tangle ./Scripts/c1.py :results file :return filepath
cluster=1
<<sindyc_header>>
...
...
@@ -298,7 +300,9 @@ filepath = plot_clusterModels(
#+end_src
#+NAME: cosimulate_ID_c0
#+CAPTION: This code block is associated with Figure 2.
#+begin_src python :results file :exports both :return filename :tangle ./Scripts/cosimulate_ID_c0.py :noweb yes
import copy
import numpy as np
...
...
@@ -362,6 +366,7 @@ filename = plot_sns(
#+end_src
#+NAME: one_step_prediction_surface
#+CAPTION: This code block is associated with Figure 3.
#+begin_src python :tangle ./Scripts/one_step_prediction_surface.py :exports both :results file :return filepath :noweb yes
<<paper_simulation_header>>
<<paper_simulation_class>>
...
...
@@ -479,7 +484,8 @@ filepath = plot_one_step_prediction_map(mp, xs, us, cluster=[0])
* TODO Markov Chain Monte Carlo
#+NAME: c0_stan
#+begin_src python :noweb strip-export :exports none :results file :tangle ./Scripts/c0_stan.py :return filepath
#+CAPTION: This code block is associated with subfigure (a) in Figure 4.
#+begin_src python :noweb strip-export :exports both :results file :tangle ./Scripts/c0_stan.py :return filepath
cluster=0
<<sindyc_header>>
<<code_stan_fitModel>>
...
...
@@ -529,10 +535,9 @@ filepath = Plotter.plot_density(
#+end_src
#+NAME: c0_stan_ppc
#+CAPTION:
Posterior-Predictive check
.
#+begin_src python :exports
none
:results file :tangle ./Scripts/c0_stan_ppc.py :noweb yes :return filepath
#+CAPTION:
This code block is associated with subfigure (a) in Figure 5
.
#+begin_src python :exports
both
:results file :tangle ./Scripts/c0_stan_ppc.py :noweb yes :return filepath
import numpy as np
<<paper_plotting_header>>
import arviz as az
...
...
@@ -581,9 +586,57 @@ filepath = Plotter.plot_ppc(
#+end_src
#+NAME: c1_stan
#+CAPTION: This code block is associated with subfigure (b) in Figure 4.
#+begin_src python :noweb strip-export :exports both :results file :tangle ./Scripts/c1_stan.py :return filepath
cluster=1
<<simo_IDCL_sindy_header>>
<<code_stan_fitModel>>
<<paper_simulation_header>>
data = read_from_disc('data_simo_IDCL_c1.pkl')
msindy = data['msindy']
Xistar = select_Xi_parsimony_sweep(msindy)
print(Xistar)
df = data['df'][0]
obs = df
sigma_y_init = df.filter(regex='y').iloc[0, :].std()
stan_results = Simulator.identify_stan(obs,
Xistar,
sigma_y_init=sigma_y_init,
name='c1',
fitnewmodel=True)
var_names = {'plot_labels': [], 'labels': []}
nXi = Xistar[Xistar != 0].shape[0]
for n in range(nXi):
subscript = f'{n+2}' # Only valid for this scenario
# var_names.append(r'\xi_' + subscript)
var_names['plot_labels'].append(r'$\xi_' + subscript + r'$')
var_names['labels'].append(f'Xi[{n+1}]')
filename = 'simo_IDCL_c1_stan.pdf'
filepath = os.path.join(PLOTPATH, filename)
filepath = Plotter.plot_density(stan_results,
var_names=var_names,
var_prior=Xistar,
labels=[[
'True parameter', 'Posterior',
'SINDyc (prior mean)',
r'95% confidence interval',
'MAP'
], None],
original_model_obj=mp,
show=False,
save=True,
filename=filepath)
#+END_SRC
#+NAME: c1_stan_ppc
#+CAPTION:
Posterior-Predictive check
.
#+CAPTION:
This code block is associated with subfigure (b) in Figure 5
.
#+begin_src python :exports none :results file :tangle ./Scripts/c1_stan_ppc.py :noweb yes :return filepath
import numpy as np
<<paper_plotting_header>>
...
...
@@ -632,8 +685,8 @@ filepath = Plotter.plot_ppc(
#+end_src
#+NAME: stan_cosimulate_ID_c0
#+CAPTION: This code block is associated with Figure 6.
#+begin_src python :results file :exports results :return filename :tangle ./Scripts/stan_cosimulate_ID_c0.py :noweb yes
from collections import OrderedDict
import numpy as np
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment