model.interpolation
Implements different interoplation methods
- linear
- 2nd order polynomial
- 3rd order polynomial
- exponential
This Python file does not correspond to one of the modules in the original Excel implementation of the models. It provides the implementation for interpolation methods used in the Adoption Data and TAM Data modules.
Linear trend model. Provides implementation for 'Adoption Data'!BY50:CA96 & 'TAM Data' columns BX:BZ Arguments: data is a pd.Series used to provide the x+y for curve fitting.
2nd degree polynomial trend model. Provides implementation for 'Adoption Data'!CF50:CI96 & 'TAM Data' columns CE:CH Arguments: data is a pd.Series used to provide the x+y for curve fitting.
3rd degree polynomial trend model. Provides implementation for 'Adoption Data'!CN50:CR96 & 'TAM Data' columns CM:CQ Arguments: data is a pd.Series used to provide the x+y for curve fitting.
exponential trend model. Provides implementation for 'Adoption Data'!CW50:CY96 & 'TAM Data' columns CV:CX Arguments: data is a pd.Series used to provide the x+y for curve fitting.
Single source model. Returns the data from the single source, packaged into a DataFrame compatible with the other trend algorithms.
Fit of data via one of several trend interpolation algorithms.
Return a list of data sources which match name. If name is a group, return all data sources which are part of that group. If name is an individual case and groups_only=False, return it by itself. If groups_only=True and name is not a group, return all sources.
Arguments
data_sources: a dict() of group names which contain dicts of data source names. Used for Total Addressable Market and adoption calculations. For example: { 'Ambitious Cases': {'Study Name A': 'filename A', 'Study Name B': 'filename B', ...}, 'Baseline Cases': {'Study Name C': 'filename C', 'Study Name D': 'filename D', ...}, 'Conservative Cases': {'Study Name E': 'filename E', ...}, 'Region: OECD90': { 'Ambitious Cases': {'Study Name F': 'filename F', 'Study Name A': 'filename A'} } } name: a name of an individual data source, or the name of a group like 'Ambitious Cases' groups_only: only return a group, or all columns if no group is found. This is typically useful for stddev calculations, which are never done (and are nonsensical) on an individual data source only on a single group or over all sources. region_key: if present, will consider only a subset of the data_sources matching that region. The region_key argument is expected to match the key in data_sources (i.e. pass in 'Region: OECD90' not just 'OECD90') If a given region_key does not have an entry in data_sources, we continue on with the sources in the top level of data_sources. This may seem odd but it really is what we want, the common case is a single set of sources which have a column for each region. Having a distinct set of sources for a given region is the uncommon case. If region_key is None, we consider only the top level sources.
Return True if name is a group in data_sources.