Skip to content
Snippets Groups Projects
Commit 5f85c34b authored by freba's avatar freba :call_me:
Browse files

Progress: Clean-ups.

parent 0647ae89
No related branches found
No related tags found
No related merge requests found
#+TITLE: Documentation
* NOTE
This code documentation will be updated throughout the coming weeks (July 2020).
** WAIT Improve project structure :noexport:crypt:
-----BEGIN PGP MESSAGE-----
......@@ -643,7 +641,7 @@ filepath = Plotter.plot_density(stan_results,
#+END_SRC
#+NAME: c1_stan_ppc
#+begin_src python :exports code :results file :tangle ./Scripts/c1_stan_ppc.py :noweb yes :return filepath
#+begin_src python :exports none :results file :tangle ./Scripts/c1_stan_ppc.py :noweb yes :return filepath
import numpy as np
<<paper_plotting_header>>
import arviz as az
......@@ -756,7 +754,7 @@ The code blocks in this section represent the Stan models with increasing comple
- =sindyc_stan_code_1234.stan= :: Stan model with active terms 1, 2, 3 and 4.
#+NAME: sindyc_stan_code_12
#+begin_src stan :exports code :results none :tangle ./Scripts/sindyc_stan_code_12.stan
#+begin_src stan :exports none :results none :tangle ./Scripts/sindyc_stan_code_12.stan
functions {
real[] dy_dt(real t, real[] y, real[] xi, real[] params, int[] ncupoly) {
vector[ncupoly[1]] poly;
......@@ -1337,10 +1335,12 @@ generated quantities {
#+end_src
* TODO General code blocks
** Header :noexport:
** Header
This code block provides defaults to all other code blocks.
#+NAME: paper_simulation_header
#+begin_src python
#+begin_src python :results none :exports none
from collections import OrderedDict
import numpy as np
import pandas as pd
......@@ -1388,7 +1388,7 @@ def read_from_disc(filename="save.pkl"):
** Modeling
*** Prosumer dynamics
*** TODO Prosumer dynamics
Common prosumer response dynamics.
......@@ -1494,10 +1494,10 @@ class Prosumer:
*** TODO SINDyc identification
Identification routines.
#+NAME: code_identification
#+begin_src python
#+begin_src python :exports none :results none
class Identification:
def __init__(self, data, **kwargs):
"""
......@@ -1573,10 +1573,15 @@ class Identification:
#+end_src
#+RESULTS: code_identification
: None
*** TODO Stan identification
Stan related identification routines.
#+NAME: code_stan_fitModel
#+begin_src python :results none :exports code
#+begin_src python :results none :exports none
import pystan
......@@ -1968,12 +1973,10 @@ y_init_rep[1] = normal_rng(z_init[1], sigma[1]);
*** TODO Signal generator
Signal generation:
- ...
Signal generation routines.
#+NAME: code_signal_generator
#+begin_src python
#+begin_src python :results none :exports none
class SignalGenerator:
def __init__(self, random=False, filter=None, **kwargs):
"""
......@@ -2083,12 +2086,10 @@ class SignalGenerator:
*** Evaluation
Model performance evaluation routines:
- ...
Model performance evaluation routines.
#+NAME: code_evaluate_fit
#+begin_src python :exports code :results none
#+begin_src python :exports none :results none
def evaluate(systraj, modeltraj, method='nrmse', n=None, t=5):
"""Evaluate the model trajectory `modeltraj` against the system
trajectory `systraj` using one of the following evaluation metrics:..
......@@ -2183,10 +2184,10 @@ def evaluate(systraj, modeltraj, method='nrmse', n=None, t=5):
** Simulation
A common simulation header:
A common simulation header.
#+NAME: paper_simulation
#+begin_src python :noweb strip-export :exports code
#+begin_src python :noweb strip-export :exports none
<<paper_simulation_header>>
<<code_signal_generator>>
<<code_identification>>
......@@ -2200,12 +2201,10 @@ simulator = Simulator(simspec, mp) # Initialize simulation
*** TODO System simulation
General system simulation routines:
- ...
General system simulation routines.
#+NAME: code_system_simulator
#+begin_src python
#+begin_src python :exports none :results none
class SystemSimulator:
def __init__(self, Tsim, D=None, **kwargs):
......@@ -2554,9 +2553,7 @@ class SystemSimulator:
*** TODO Simulator class
SINDyc system simulation routines:
- ...
SINDyc system simulation routines.
#+NAME: paper_simulation_class
#+begin_src python :noweb strip-export :exports none
......@@ -3541,7 +3538,7 @@ class Simulator(SystemSimulator):
#+end_src
** WAIT Plotting
** Plotting
Common plotting routines:
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment