- fitdist: https://in.mathworks.com/help/stats/fitdist.html
- normrnd: https://in.mathworks.com/help/stats/normrnd.html
I would like to know how to get coefficients from a norm plot.
조회 수: 1 (최근 30일)
이전 댓글 표시
I am supposed to do a box-cox transformation but instead of using the function I have to do an anova1 test grab the residuals then plot the residuals and take the coefficients from the normal distribution plot.
댓글 수: 0
답변 (1개)
Moksh
2023년 9월 29일
Hi Carlos,
I understand that you are performing the transformation without using built-in functions and would like to fetch the normal distribution coefficients from a plot. I am assuming that by the normal distribution coefficients, you are referring to the “mean” and “standard deviation” for the distribution.
You can utilize the 'fitdist' function in MATLAB for plotting the residuals. By passing the 'Normal' parameter along with the data as input, this function will return the best fitting normal distribution object for the data.
Please refer to the following code snippet for using the “fitdist” function:
%% Generating random data (Data you will fetch after plotting the residuals)
data = normrnd(0, 1, 1000, 1);
% Add noise to the data for more randomization of the parameters
data = data + normrnd(0, 0.1, size(data));
% Fit the data to a normal distribution
pd = fitdist(data, 'Normal');
% Get the mean and standard deviation coefficients
mu = pd.mu;
sigma = pd.sigma;
% Display the coefficients
disp(mu);
disp(sigma);
For more information about the above-mentioned functions, please refer to the documentation below:
Hope this information helps in solving the issue you were facing.
Best Regards,
Moksh Aggarwal
댓글 수: 0
참고 항목
카테고리
Help Center 및 File Exchange에서 Probability Distributions에 대해 자세히 알아보기
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!