How to makedisk for a three parameter weibull distribution

Everytime I run my code with below lines, it displays "Error using makedist (line 101). Invalid parameter name: t0"
t0 = 0.5;
b = 1:5;
T = 1:5;
dist = makedist('weibull','a',T,'b',b,'c',t0)
[h,p,adstat,cv] = adtest(data,'Distribution',dist)
How can I integrate a three parameter weibull distribution into "makedist"?

 Respuesta aceptada

MATLAB's Weibull distribution only allows 2 parameters, so you must handle the offset separately. Try this:
t0 = 0.5; %
b = 1.5; % you are using vector
T = 1.5; % same here too
dist = makedist('weibull','a',T,'b',b)
dataAdjusted = data - t0;
[h,p,adstat,cv] = adtest(dataAdjusted,'Distribution',dist)

3 comentarios

Mustafa Vural
Mustafa Vural el 13 de Sept. de 2020
Editada: Mustafa Vural el 17 de Sept. de 2020
I am generating random numbers of a three parameter weibull distribution. I want to run the Anderson Darling test on my generated results. so "data" are my generated result. How can I do this in this case?
clear all;
n = 100;
t0 = 0.5;
b = 1:5;
T = 1:5;
for v_T= T
for v_b= b
data(:,v_b,v_T) = wblrnd(v_b,v_T, [n,1]) + t0;
end
end
VBBV
VBBV el 13 de Sept. de 2020
Editada: VBBV el 13 de Sept. de 2020
%if true
% code
%end
clear all;
n = 100;
t0 = 0.5;
b = 1:5;
T = 1:5;
for v_T= 1:length(T)
for v_b= 1:length(b)
Use the for loop as shown above or as below
%if true
% code
%end
for v_T = [T]
for v_b = [b]
Mustafa Vural
Mustafa Vural el 13 de Sept. de 2020
Editada: Mustafa Vural el 17 de Sept. de 2020
So like this? Sry I am very noob in matlab.
clear all;
n = 100;
t0 = 0.5;
b = 1:5;
T = 1:5;
for v_T= 1:length(T)
for v_b= 1:length(b)
data(:,v_b,v_T) = wblrnd(v_b,v_T, [n,1]) + t0;
end
end
for v_T= 1:length(T)
for v_b= 1:length(b)
dist = makedist('weibull','a',v_T,'b',v_b)
dataAdjusted = data - t0;
[h,p,adstat,cv] = adtest(dataAdjusted,'Distribution',dist)
end
end

Iniciar sesión para comentar.

Más respuestas (1)

VBBV
VBBV el 12 de Sept. de 2020
Editada: VBBV el 12 de Sept. de 2020
you are using vector of values for 2 parameters and scalar value for other parameter ... try this
%if true
% code
%end
t0 = 0.5; %
b = 1.5; % you are using vector
T = 1.5; % same here too
dist = makedist('weibull','a',T,'b',b,'c',t0)
[h,p,adstat,cv] = adtest(data,'Distribution',dist)

1 comentario

VBBV
VBBV el 12 de Sept. de 2020
Editada: VBBV el 12 de Sept. de 2020
Standard matlab weibull only allows 2 parameter dist as Jeff said But you can use mle to fit a custom distribution Here is the resource below how to do it

Iniciar sesión para comentar.

Categorías

Etiquetas

Preguntada:

el 12 de Sept. de 2020

Editada:

el 17 de Sept. de 2020

Community Treasure Hunt

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

Start Hunting!

Translated by