Fundamentals#

class pams.Fundamentals(prng)[ソース]#

Fundamental generator for simulator.

add_market(market_id, initial, drift, volatility, start_at=0)[ソース]#

add a market whose fundamental prices are generated in this class.

パラメータ:
  • market_id (int) -- market ID to add.

  • initial (float) -- initial value.

  • drift (float) -- drifts.

  • volatility (float) -- volatility.

  • start_at (int) -- time step to start simulation (default 0).

戻り値の型:

None

戻り値:

None

change_drift(market_id, drift, time=0)[ソース]#

change drift.

パラメータ:
  • market_id (int) -- market ID.

  • drift (float) -- drift.

  • time (int) -- time step to apply the change (default 0).

戻り値の型:

None

戻り値:

None

change_volatility(market_id, volatility, time=0)[ソース]#

change volatility.

パラメータ:
  • market_id (int) -- market ID.

  • volatility (float) -- volatility.

  • time (int) -- time step to apply the change(default 0).

戻り値の型:

None

戻り値:

None

get_fundamental_price(market_id, time)[ソース]#

get a fundamental price.

パラメータ:
  • market_id (int) -- market ID.

  • time (int) -- time step to get the price.

戻り値:

fundamental price at the specified time step.

戻り値の型:

float

get_fundamental_prices(market_id, times)[ソース]#

get some fundamental prices.

パラメータ:
  • market_id (int) -- market ID.

  • times (Iterable[int]) -- time steps to get the price.

戻り値:

fundamental prices in specified range of time steps.

戻り値の型:

List[float]

remove_correlation(market_id1, market_id2, time=0)[ソース]#

remove correlation.

パラメータ:
  • market_id1 (int) -- one of the market IDs to remove correlation.

  • market_id2 (int) -- the other of the market IDs to remove correlation.

  • time (int) -- time step to apply the correlation (default 0).

戻り値の型:

None

戻り値:

None

remove_market(market_id)[ソース]#

remove a market from the list of markets whose fundamental prices are generated in this class.

パラメータ:

market_id (int) -- market ID to remove.

戻り値の型:

None

戻り値:

None

set_correlation(market_id1, market_id2, corr, time=0)[ソース]#

set correlation between fundamental prices of markets.

パラメータ:
  • market_id1 (int) -- one of the market IDs to set correlation.

  • market_id2 (int) -- the other of the market IDs to set correlation.

  • corr (float) -- correlation.

  • time (int) -- time step to apply the correlation (default 0).

戻り値の型:

None

戻り値:

None