Formulas¶
This module provides the framework for formulas. All formulas should inherit from the Formula class in this module. Formula sources must include a formula importer, or can subclass one of the formula importers here.
Formula Parameter¶
Formula Registry¶
-
class
simkit.core.formulas.
FormulaRegistry
[source]¶ A registry for formulas. The meta names are
islinear
,args
,units
andisconstant
.-
register
(new_formulas, *args, **kwargs)[source]¶ Register formula and meta data.
islinear
-True
if formula is linear,False
if non-linear.args
- position of argumentsunits
- units of returns and arguments as pair of tuplesisconstant
- constant arguments not included in covariance
- Parameters
new_formulas – new formulas to add to registry.
-
Formula Importers¶
-
class
simkit.core.formulas.
FormulaImporter
(parameters, meta=None)[source]¶ A class that imports formulas.
- Parameters
parameters (dict) – Parameters used to import formulas.
meta (Meta) – Options for formulas and formula inporters
-
import_formulas
()[source]¶ This method must be implemented by each formula importer.
- Returns
formulas
- Return type
- Raises
NotImplementedError
-
meta
= None¶ options for importer
-
parameters
= None¶ parameters to be read by reader
Python Module Importer¶
Numerical Expression Importer¶
Formula¶
-
class
simkit.core.formulas.
Formula
[source]¶ A class for formulas.
Specify
formula_importer
which must subclassFormulaImporter
to import formula source files as class. If noformula_importer
is specified, the default isPyModuleImporter
.Specify
formula_path
andformula_file
that contains formulas in string form or parameters used to import the formula source file.This is the required interface for all source files containing formulas used in SimKit.
-
args
= None¶ positional arguments
-
formulas
= None¶ formulas loaded by the importer using specified parameters
-
isconstant
= None¶ constant arguments that are not included in covariance calculation
-
islinear
= None¶ linearity determined by each data source?
-
units
= None¶ expected units of returns and arguments as pair of tuples
-