# pyFTS.models.nonstationary package — pyFTS 1.4 documentation

# pyFTS.models.nonstationary package

## Submodules

## pyFTS.models.nonstationary.common module

Non Stationary Fuzzy Sets

GARIBALDI, Jonathan M.; JAROSZEWSKI, Marcin; MUSIKASUWAN, Salang. Nonstationary fuzzy sets. IEEE Transactions on Fuzzy Systems, v. 16, n. 4, p. 1072-1086, 2008.

class `pyFTS.models.nonstationary.common.``FuzzySet`(name, mf, parameters, **kwargs)

  Bases: `pyFTS.common.FuzzySet.FuzzySet`

  Non Stationary Fuzzy Sets

  `get_lower`(t)
  `get_midpoint`(t)
  `get_upper`(t)
  `location` = None

    Pertubation function that affects the location of the membership function

  `location_params` = None

    Parameters for location pertubation function

  `membership`(x, t)

    Calculate the membership value of a given input

    Parameters:

    - x – input value
    - t – time displacement or perturbation parameters

    Returns: | membership value of x at this fuzzy set

  `noise` = None

    Pertubation function that adds noise on the membership function

  `noise_params` = None

    Parameters for noise pertubation function

  `perform_location`(t, param)
  `perform_width`(t, param)
  `perturbate_parameters`(t)
  `width` = None

    Pertubation function that affects the width of the membership function

  `width_params` = None

    Parameters for width pertubation function

`pyFTS.models.nonstationary.common.``check_bounds`(data, partitioner, t)

`pyFTS.models.nonstationary.common.``check_bounds_index`(data, partitioner, t)

`pyFTS.models.nonstationary.common.``fuzzify`(inst, t, fuzzySets)

  Calculate the membership values for a data point given nonstationary fuzzy sets

  Parameters:

  - inst – data points
  - t – time displacement of the instance
  - fuzzySets – list of fuzzy sets

  Returns: | array of membership values

`pyFTS.models.nonstationary.common.``fuzzySeries`(data, fuzzySets, ordered_sets, window_size=1, method='fuzzy', const_t=None)

`pyFTS.models.nonstationary.common.``window_index`(t, window_size)

## pyFTS.models.nonstationary.cvfts module

class `pyFTS.models.nonstationary.cvfts.``ConditionalVarianceFTS`(**kwargs)

  Bases: `pyFTS.models.hofts.HighOrderFTS`

  `forecast`(ndata, **kwargs)

    Point forecast one step ahead

    Parameters:

    - data – time series data with the minimal length equal to the max_lag of the model
    - kwargs – model specific parameters

    Returns: | a list with the forecasted values

  `forecast_interval`(ndata, **kwargs)

    Interval forecast one step ahead

    Parameters:

    - data – time series data with the minimal length equal to the max_lag of the model
    - kwargs – model specific parameters

    Returns: | a list with the prediction intervals

  `generate_flrg`(flrs, **kwargs)
  `perturbation_factors`(data, **kwargs)
  `perturbation_factors__old`(data)
  `train`(ndata, **kwargs)

    Method specific parameter fitting

    Parameters:

    - data – training time series data
    - kwargs – Method specific parameters

class `pyFTS.models.nonstationary.cvfts.``HighOrderNonstationaryFLRG`(order, **kwargs)

  Bases: `pyFTS.models.hofts.HighOrderFTS`

  Conventional High Order Fuzzy Logical Relationship Group

  `append_lhs`(c)
  `append_rhs`(c, **kwargs)

## pyFTS.models.nonstationary.flrg module

class `pyFTS.models.nonstationary.flrg.``NonStationaryFLRG`(LHS, **kwargs)

  Bases: `pyFTS.common.flrg.FLRG`

  `get_key`()

    Returns a unique identifier for this FLRG

  `get_lower`(*args)

    Returns the lower bound value for the RHS fuzzy sets

    Parameters: | sets – fuzzy sets
    Returns: | lower bound value

  `get_membership`(data, *args)

    Returns the membership value of the FLRG for the input data

    Parameters:

    - data – input data
    - sets – fuzzy sets

    Returns: | the membership value

  `get_midpoint`(*args)

    Returns the midpoint value for the RHS fuzzy sets

    Parameters: | sets – fuzzy sets
    Returns: | the midpoint value

  `get_upper`(*args)

    Returns the upper bound value for the RHS fuzzy sets

    Parameters: | sets – fuzzy sets
    Returns: | upper bound value

  `unpack_args`(*args)

## pyFTS.models.nonstationary.honsfts module

class `pyFTS.models.nonstationary.honsfts.``HighOrderNonStationaryFLRG`(order, **kwargs)

  Bases: `pyFTS.models.nonstationary.flrg.NonStationaryFLRG`

  First Order NonStationary Fuzzy Logical Relationship Group

  `append_lhs`(c)
  `append_rhs`(c, **kwargs)

class `pyFTS.models.nonstationary.honsfts.``HighOrderNonStationaryFTS`(name, **kwargs)

  Bases: `pyFTS.models.hofts.HighOrderFTS`

  NonStationaryFTS Fuzzy Time Series

  `forecast`(ndata, **kwargs)

    Point forecast one step ahead

    Parameters:

    - data – time series data with the minimal length equal to the max_lag of the model
    - kwargs – model specific parameters

    Returns: | a list with the forecasted values

  `forecast_interval`(ndata, **kwargs)

    Interval forecast one step ahead

    Parameters:

    - data – time series data with the minimal length equal to the max_lag of the model
    - kwargs – model specific parameters

    Returns: | a list with the prediction intervals

  `generate_flrg`(data, **kwargs)
  `train`(data, **kwargs)

    Method specific parameter fitting

    Parameters:

    - data – training time series data
    - kwargs – Method specific parameters

## pyFTS.models.nonstationary.nsfts module

class `pyFTS.models.nonstationary.nsfts.``ConventionalNonStationaryFLRG`(LHS, **kwargs)

  Bases: `pyFTS.models.nonstationary.flrg.NonStationaryFLRG`

  First Order NonStationary Fuzzy Logical Relationship Group

  `append_rhs`(c, **kwargs)
  `get_key`()

    Returns a unique identifier for this FLRG

class `pyFTS.models.nonstationary.nsfts.``NonStationaryFTS`(**kwargs)

  Bases: `pyFTS.common.fts.FTS`

  NonStationaryFTS Fuzzy Time Series

  `conditional_perturbation_factors`(data, **kwargs)
  `forecast`(ndata, **kwargs)

    Point forecast one step ahead

    Parameters:

    - data – time series data with the minimal length equal to the max_lag of the model
    - kwargs – model specific parameters

    Returns: | a list with the forecasted values

  `forecast_interval`(ndata, **kwargs)

    Interval forecast one step ahead

    Parameters:

    - data – time series data with the minimal length equal to the max_lag of the model
    - kwargs – model specific parameters

    Returns: | a list with the prediction intervals

  `generate_flrg`(flrs, **kwargs)
  `train`(data, **kwargs)

    Method specific parameter fitting

    Parameters:

    - data – training time series data
    - kwargs – Method specific parameters

## pyFTS.models.nonstationary.partitioners module

class `pyFTS.models.nonstationary.partitioners.``PolynomialNonStationaryPartitioner`(data, part, **kwargs)

  Bases: `pyFTS.partitioners.partitioner.Partitioner`

  Non Stationary Universe of Discourse Partitioner

  `build`(data)

    Perform the partitioning of the Universe of Discourse

    Parameters: | data – training data
    Returns: |

  `get_polynomial_perturbations`(data, **kwargs)
  `poly_width`(par1, par2, rng, deg)
  `scale_down`(x, pct)
  `scale_up`(x, pct)

class `pyFTS.models.nonstationary.partitioners.``SimpleNonStationaryPartitioner`(data, part, **kwargs)

  Bases: `pyFTS.partitioners.partitioner.Partitioner`

  Non Stationary Universe of Discourse Partitioner

  `build`(data)

    Perform the partitioning of the Universe of Discourse

    Parameters: | data – training data
    Returns: |

`pyFTS.models.nonstationary.partitioners.``simplenonstationary_gridpartitioner_builder`(data, npart, transformation)

## pyFTS.models.nonstationary.perturbation module

Pertubation functions for Non Stationary Fuzzy Sets

`pyFTS.models.nonstationary.perturbation.``exponential`(x, parameters)

`pyFTS.models.nonstationary.perturbation.``linear`(x, parameters)

`pyFTS.models.nonstationary.perturbation.``periodic`(x, parameters)

`pyFTS.models.nonstationary.perturbation.``polynomial`(x, parameters)

## pyFTS.models.nonstationary.util module

`pyFTS.models.nonstationary.util.``plot_sets`(partitioner, start=0, end=10, step=1, tam=[5, 5], colors=None, save=False, file=None, axes=None, data=None, window_size=1, only_lines=False)

`pyFTS.models.nonstationary.util.``plot_sets_conditional`(model, data, step=1, size=[5, 5], colors=None, save=False, file=None, axes=None, fig=None)

## Module contents

Fuzzy time series with nonstationary fuzzy sets, for heteroskedastic data