brightwind.analyse.correlation.OrdinaryLeastSquares

class brightwind.analyse.correlation.OrdinaryLeastSquares(ref_spd, target_spd, averaging_prd='1H', coverage_threshold=0.9, preprocess=True)

Accepts two DataFrames with timestamps as indexes and averaging period.

Parameters
  • ref_spd (pandas.Series) – Series containing reference speed as a column, timestamp as the index.

  • target_spd (pandas.Series) – DataFrame containing target speed as a column, timestamp as the index.

  • averaging_prd (string or pandas.DateOffset) –

    Groups data by the period specified by period.

    • 2T, 2 min for minutely average

    • Set period to 1D for a daily average, 3D for three hourly average, similarly 5D, 7D, 15D etc.

    • Set period to 1H for hourly average, 3H for three hourly average and so on for 5H, 6H etc.

    • Set period to 1MS for monthly average

    • Set period to 1AS fo annual average

  • coverage_threshold (float) – Minimum coverage to include for correlation

  • preprocess (bool) – To average and check for coverage before correlating

Returns

An object representing ordinary least squares fit model

__init__(ref_spd, target_spd, averaging_prd='1H', coverage_threshold=0.9, preprocess=True)

Initialize self. See help(type(self)) for accurate signature.

Methods

__init__(ref_spd, target_spd[, …])

Initialize self.

get_error_metrics()

get_r2()

Returns the r2 score of the model

linear_func(p, x)

plot([title])

For plotting

run([show_params])

show_params()

Show the dictionary of parameters

synthesize([ext_input])