Hi Nikolas,
According to what I understand, you want to use Monte Carlo simulation to create synthetic data using the provided time series data in a normally distributed manner.
Here are the steps that you need to take:
- Determine the mean and standard deviation of your original time series data.
- Using the mean and standard deviation, you can generate new data points that follow a normal distribution. This can be done using the function “normrnd”, which produces numbers that follow the pattern of a normal distribution.
Here is a workaround that can be followed:
load_demand_1 = [0.20, 0.23, 0.25, 0.18, 0.22, 0.45, 0.68, 1.02, 0.68, 0.20, 0.34, 0.37, 0.52, 0.54, 0.75, 0.84, 2.40, 1.80];
mean_load = mean(load_demand_1); %calculate mean of the data
std_load = std(load_demand_1); %calculate standard deviation of the data
% Generate synthetic data using Monte Carlo simulation
num_samples = 20000; % Number of synthetic data points to generate
synthetic_data = normrnd(mean_load, std_load, [4, num_samples]); %creates 4 set of 20,000 data points
Also, "histfit" function can be used to confirm whether or not the obtained data follows a normal distribution.
To confirm the result generated, try the code below:
histfit(synthetic_data(1,:));
You can refer to the following documentation to learn more about the functions “normrnd” and “histfit”:
- https://www.mathworks.com/help/releases/R2023b/stats/normrnd.html
- https://www.mathworks.com/help/releases/R2023b/stats/histfit.html
I hope this helps, Thanks!