- 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.
6 views (last 30 days)
Show older comments
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 Comments
Answers (1)
Moksh
on 29 Sep 2023
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 Comments
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!