Normal Distribution approach

Hello World

ND(x, t) = \frac{e^{-0.5 \frac{\left(x - t\right)^2}{\sigma^2}}}{\sqrt{2 \cdot \pi} \cdot \sigma}

integration is

NDI(x, t) = \frac{erf((x + 0.5 - t) / (\sigma \cdot \sqrt{2})) - erf((x - 0.5 - t) / (\sigma \cdot \sqrt{2}))}{2}

P_{new}^t = P_{original}^t \cdot \sum_{i=t-4 \cdot \lfloor\sigma+0.5\rceil}^{t+4 \cdot \lfloor\sigma+0.5\rceil} NDI(i, t)

An example code is shown below:

../../examples/example_normal_distribution.py
 1"""
 2example python scripts for the normal distribution method
 3"""
 4from tssm import TimeSeriesScalingModule as tssm
 5
 6
 7def main() -> None:
 8    """
 9    main function to show normal distribution scaling examples
10    """
11    # initialize class with a number of buildings of 202 with a simultaneity factor of 0.786
12    scaling: tssm = tssm(1, 0.786, one_2_many=False)
13    # read profile from data.csv file and use the Electricity column
14    scaling.data.read_profile_from_csv("./test.csv", "0")
15    # calculate normal distribution with the variance for the given simultaneity factor
16    normal_distributed_values = scaling.calculate_using_normal_distribution()
17    # print results
18    print(f"normal_distributed_values: {normal_distributed_values}")
19    # calculate normal distribution with a given variance
20    #normal_distributed_values_with_given_variance = scaling.calculate_using_normal_distribution(sigma=5.25)
21    # print results
22    #print(f"normal_distributed_values_with_given_variance: {normal_distributed_values_with_given_variance}")
23
24    scaling.save_2_csv()
25
26    # initialize class with a number of buildings of 202 with a simultaneity factor of 0.786
27    scaling = tssm(202)
28    # read profile from data.csv file and use the Electricity column
29    scaling.data.read_profile_from_csv_with_date("./data_flex_time_step_short.csv", "Heating", "Date")
30    # calculate normal distribution with a given variance
31    normal_distributed_values_with_given_variance = scaling.calculate_using_normal_distribution(sigma=1.2)
32    # print results
33    print(f"normal_distributed_values_with_given_variance: {normal_distributed_values_with_given_variance}")
34
35
36if __name__ == "__main__":
37    main()