Why do I get negative coefficients from the "johnsrnd" function in MATLAB R2022b?
3 Ansichten (letzte 30 Tage)
Ältere Kommentare anzeigen
MathWorks Support Team
am 9 Feb. 2023
Beantwortet: MathWorks Support Team
am 16 Feb. 2023
I am using the "johnsrnd" function in MATLAB R2022b to identify the distribution type and estimate the coefficients of the transformation based on my data as follows:
q=[-1.5351,-0.4660,0.5285,1.4536];
[~,type,coef] = johnsrnd(q,0,0);
The obtained coefficients (gamma, eta, epsilon, lambda) are
coef = [36.2084,-13.8186,13.7797,-1.0000]
which is not a valid output since coef(2) = eta and coef(4) = lambda should be strictly positive.
Akzeptierte Antwort
MathWorks Support Team
am 9 Feb. 2023
This is the expected behavior of the function. The primary reference for this function is Slifker, J.F. and S.S. Shapiro (1980) "The Johnson System: Selection and Parameter Estimation", which can be found by executing "edit johnsrnd" in the MATLAB Command Window. According to the primary reference, only two types have no bounds on lambda or eta. This correspond to the following two options of the function: SL (lognormal, which is the identified distribution type based on your provided data) and SN (identity/normal). For both of these types, the sign of 'eta' does not change the results. You can safely set coef(2) = abs(coef(2)) in this scenario if you want to use the magnitude of this coefficient.
0 Kommentare
Weitere Antworten (0)
Siehe auch
Kategorien
Mehr zu Ordinary Differential Equations finden Sie in Help Center und File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!