mean_load = (load_high + load_low) / 2;
std_load = (load_high - load_low) / 6;
load_range = (load_low-3*std_load):(load_high+3*std_load);
load_pdf = normpdf(load_range, mean_load, std_load);
plot(load_range, load_pdf);
ylabel('Probability Density');
title('Normal Distribution of Load');
ci_low = norminv((1-confidence_level)/2, mean_load, std_load);
ci_high = norminv(1-(1-confidence_level)/2, mean_load, std_load);
fprintf('The 95%% confidence interval for the load is from %.2f to %.2f.\n', ci_low, ci_high);
The 95% confidence interval for the load is from 86.93 to 113.07.
In this code snippet:
- The high and low estimates are set to 120 and 80, respectively.
- The mean and standard deviation are computed based on these estimates.
- The normpdf function generates the normal distribution for the given range.
- The norminv function calculates the 95% confidence interval bounds based on the mean and standard deviation.
- The result is printed to the MATLAB console, and the distribution is plotted for visualization.
Remember, the two-point estimate method is a simple approximation and may not always be suitable, especially if the actual distribution of the parameter is not well approximated by a normal distribution or if the estimates do not correspond to ±3 standard deviations.
------------------------------------------------------------------------------------------------------------------------------------------------
If you find the solution helpful and it resolves your issue, it would be greatly appreciated if you could accept the answer. Also, leaving an upvote and a comment are also wonderful ways to provide feedback.