How is DataStructure designed? #371
-
Hi @enekomartinmartinez, I am trying to write a function that translates external data (timeseries vector) into stan function block using similar trick of linear interpolation for lookup function. So if you can briefly explain how pysd handles this it would be helpful! Thank you.
|
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 1 reply
-
There are a lot of kinds of functios that require interpolation, the equivalence is given in the following section https://pysd.readthedocs.io/en/master/structure/vensim_translation.html#supported-functions-and-features. Here a brief summary with some models with examples of each tipes
Note, all the lookup functions need to be called always with an argument, except WITH LOOKUP (Inline Lookup) where the argument is provided as the first argument of the function. Data types don't take arguments, they are interpolated using the current time of the model. Several interpolation methods can be defined as keyword (:RAW:, :INTERPOLATE:, :LOOK FORWARD:, :HOLD BACKWARD:) There are some functions that allow shifting the time for a Data object (not implemented yet in PySD). For XMILE models Data types are not defined only as Lookups, they are called graphical functions (GF) in XMILE. These functions could directly take an argument to define the interpolation method (implemented but not tested in PySD as I don't have Stella). |
Beta Was this translation helpful? Give feedback.
There are a lot of kinds of functios that require interpolation, the equivalence is given in the following section https://pysd.readthedocs.io/en/master/structure/vensim_translation.html#supported-functions-and-features. Here a brief summary with some models with examples of each tipes
GetDataStructure and GetLookupsStructure are used for Vensim's GET XLS/DIRECT DATA/LOOKUPS, where all the data is read from an Excel file. These create
External
objects which are initialized before the Statefuls -> test-models/tests/get_lookups_data_3d_xlsDataStructure is used for regular Data definitions from Vensim (sub-type Normal, second figure). In this definition the variable's RHS is empty and t…