Difference between revisions of "Modeling"

From wiki
Jump to navigation Jump to search
Line 11: Line 11:
 
* The state of the model is stored in a Pandas Series too.
 
* The state of the model is stored in a Pandas Series too.
 
* Put other interesting metrics in the state object too.
 
* Put other interesting metrics in the state object too.
 +
* If you use randomness in a function, get the mean values of several runs.
 
* Check the effect of different parameter values using [[Numpy]] [[Numpy#linspace | linspace]].
 
* Check the effect of different parameter values using [[Numpy]] [[Numpy#linspace | linspace]].
 
<syntaxhighlight lang=python>
 
<syntaxhighlight lang=python>

Revision as of 23:54, 19 December 2018

Mostly based on this paper that comes with its own modsim library.

Eyeopeners

  • Store results in a list
for a in range(100):
    funcAresults[a] = functionAcall(bla,bla)
    funcBresults[a] = functionBcall(bla,bla)
ModSimPy is using Series from Pandas to store results. This adds handy functions like.
  • The state of the model is stored in a Pandas Series too.
  • Put other interesting metrics in the state object too.
  • If you use randomness in a function, get the mean values of several runs.
  • Check the effect of different parameter values using Numpy linspace.
funcAresults = pd.Series([])
p1_array = np.linspace(0,1,12)
for p1 in p1_array:
    for a in range(50):
        funcAresults[a] = functionAcall(p1,p2)
    print(funcAresults)