Assets#

Assets definitions.

class osc_physrisk_financial.assets.Asset(value_0: float, dynamics: Dynamic | None = None, name: str | None = None, cash_flows: Sequence | None = None)[source]#

Bases: object

Class for instantiating a general Asset.

Parameters:
  • value_0 (float) – Value of the asset at 0, \(V_{0}\)

  • dynamics (dynamics.Dynamic) – Dynamics assumed for the asset value.

  • name (string, optional) – Name for identification.

  • cash_flows (Sequence, optional) – Sequence of the associated cash flows (for cash flow generating assets only).

References

Methodology, Chapter 4 of Methodology survey (Overleaf).

class osc_physrisk_financial.assets.PowerPlants(dynamics: Dynamic | None = None, name: str | None = None, **kwargs)[source]#

Bases: Asset

Class for instantiating a PowerPlant Asset.

Either production or both capacity and av_rate must be provided. If not directly provided, production, is calculated as:

production = capacity * av_rate * 8760.

Parameters:
  • dynamics (dynamics.Dynamic) – Dynamics assumed for the asset value.

  • name (string, optional) – Name for identification.

  • production (float, optional) – Real annual production of a power plant in Wh.

  • capacity (float, optional) – Capacity of the power plant in W.

  • av_rate (float, optional) – Availability factor of production.

References

Canonical_Example_Power_Generation_Plants_Floods (Overleaf).

Notes

In this case the cash flows are defined through production.

static discount(r: Sequence[float], n: int | None = 1) float[source]#

Compute discount for a given annual evolution of interest rates.

Parameters:
  • r (Sequence[float]) – An array or sequence including the yearly interest rate for the required period.

  • n (int, optional) – By default r is a list containing the yearly interest rates. To consider a constant interest rate, introduce the value of the interest rate in r and n = number of years to be discounted.

Returns:

Float containing the discounting factor calculated as \(\prod_{i} 1/(1+r_i)^n\).

Return type:

float

financial_losses(damages: DiscreteRandomVariable, energy_price: float, r: Sequence[float], n: int | None = 1) DiscreteRandomVariable | float[source]#

Compute financial losses for a PowerPlant asset.

Parameters:
  • damages (DiscreteRandomVariable) – Random Variable with the production loss expressed as a decimal (50% \(\equiv\) 0.5) for each plant.

  • energy_price (float) – Average price in €/Wh of the energy production.

  • r (list[float]) – An array or sequence containing the annual interest rates.

  • n (int, optional) – Number of years to discount.

Returns:

Random Variable containing the financial losses for the asset.

Return type:

DiscreteRandomVariable

Notes

The use of r and n follows the same convention as in discount method.

class osc_physrisk_financial.assets.RealAsset(value_0: float, dynamics: Dynamic, name: str | None = None)[source]#

Bases: Asset

Class for instantiating a Real Asset.

Parameters:
  • value_0 (float) – Value of the asset at 0, \(V_{0}\)

  • dynamics (dynamics.Dynamic) – Dynamics assumed for the asset value.

  • name (string, optional) – Name for identification.

References

Methodology, Chapter 4 of Methodology survey (Overleaf).

financial_losses(dates: DatetimeIndex | list, damage: DiscreteRandomVariable)[source]#

Compute financial losses for a real asset.

Parameters:
  • dates (pandas.DatetimeIndex, list of strings, pandas.Timestamp, or string) – Dates for which we want to compute \(X_t\) of [Methodology]. TODO: Do we want to include t_0 here?

  • damage (random_variables.RandomVariable) – Damage caused to the asset.

Returns:

Random variable representing \(X_{t}\) [Methodology].

Return type:

random_variables.RandomVariable

References

Methodology, Chapter 4 of Methodology survey (Overleaf).

ltv(dates: DatetimeIndex | list, damages: Sequence[DiscreteRandomVariable], loan_amounts: Sequence[float])[source]#

Compute Loan To Value (LTV) for a real asset.

Parameters:
  • dates (pandas.DatetimeIndex, list of strings, pandas.Timestamp, or string) – Dates for which we want to compute \(X_t\) of [Methodology]. Note that :math: t_0 should be included here. # TODO: Do we want to include t_0 here?

  • damages (Sequence[DiscreteRandomVariable]) – Sequence of DiscreteRandomVariable instances representing damage for each asset.

  • loan_amounts (Sequence[float]) – Sequence of floats representing loan amount for each asset.

Returns:

Random variable representing LTV of [Methodology]. It returns a numpy.ndarray of 2 dimensions and shape \((\\# dates, \\# assets)\).

Return type:

random_variables.RandomVariable

References

Methodology, Chapter 4 of Methodology survey (Overleaf).