So i found a solution. But not within Matlab. I had to use R to plot it. Is there nothing comparable in Matlab?
Plot a cumulative distribution with a symmetric logarithmic scale centred at 50%
6 visualizzazioni (ultimi 30 giorni)
Mostra commenti meno recenti
Nikolai B.
il 15 Set 2022
Modificato: Nikolai B.
il 19 Set 2022
I have a cumulative distribution for wind speeds. From this graph I have estimated a normal distribution. In order to compare the estimation with the original graph, I would like to create exactly the same kind of graph plotting. The x-axis is mirrored logarithmically at the probability of 50% in the given figure. However, I have not found a way to do this in Matlab. A figure is included to visualize the desired outcome. I already calculated an approximated function:
% Approximated coefficients for cumulative distribution function (CDF)
a1 = 0.1194;
a2 = -0.000102;
mu = 1.5;
% Range of CS-AWO wind speeds in "probability of exceedene plot"
x = linspace(-30,30);
% Calculate values from approximated function of CDF from CS-AWO
for i = 1:length(x)
cdf_app(i) = exp(2*(a1*(x(i)-mu)*(1+a2*(x(i)-mu)^2)))/(1+exp(2*(a1*(x(i)-mu)*(1+a2*(x(i)-mu)^2))));
end
% Plot result
plot(cdf_app*100,x)
Risposta accettata
Jeff Miller
il 17 Set 2022
Not sure if I really understand what you want but maybe something like this:
z_app = norminv(cdf_app); % find the normal Z scores corresponding to each CDF value
plot(z_app,x); % this plot may have the x-axis spacing you want
% Now set the xticks & labels to show the cumulative probabilities at
% various x points. You will want more ticks I am sure.
xticks([-0.25335 0 0.25335]); % the CDFs of these three Z values are 0.40, 0.50, and 0.60, from norminv
xticklabels({'40' '50' '60'})
Is this close to what you have in mind?
1 Commento
Più risposte (0)
Vedere anche
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!