I would like to know how to get coefficients from a norm plot.

7 次查看(过去 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.

回答(1 个)

Moksh
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);
-0.0057
disp(sigma);
1.0118
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

标签

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by