so i wanna perform kstest for normal and lognormal , weibull.
When i perform normal kstest, it is working well.
but lognormal and weibull kstest is not working.
ex)
- lognormal kstest
log_para=lognfit(txt)
[h,p,k]=kstest(A2,[A2 logncdf(A2,log_para(1),log_para(2))])
- weibull kstest
wbl_para=wblfit(txt)
[h,p,k]=kstest(A2,[A2 wblcdf(A2,wbl_para(1),wbl_para(2))])
click enter key.
the error massage is as below..
"Hypothesized CDF matrix must have 2 columns."
What is the problem..???
It's pretty hard to say with the amount of information you've provided.
What shape is A2, which is to say, what shape are [A2 logncdf(...)]
and [A2 wblcdf(...)]?
One thing that you are (probably) doing wrong is ignoring this warning
in the KSTEST reference page:
"The Kolmogorov-Smirnov test requires that CDF be predetermined. It is
not accurate if CDF is estimated from the data. To test x against a
normal distribution without specifying the parameters, use LILLIETEST
instead."