Discover MakerZone

MATLAB and Simulink resources for Arduino, LEGO, and Raspberry Pi

Learn more

Discover what MATLAB® can do for your career.

Opportunities for recent engineering grads.

Apply Today

Thread Subject:
kstest for lognorm and weibull

Subject: kstest for lognorm and weibull

From: Jeong Yeol

Date: 5 Oct, 2010 05:11:04

Message: 1 of 2

I have a txt. (1 by 79 matrix)

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..???

Subject: kstest for lognorm and weibull

From: Peter Perkins

Date: 5 Oct, 2010 13:46:18

Message: 2 of 2

On 10/5/2010 1:11 AM, Jeong Yeol wrote:
> I have a txt. (1 by 79 matrix)
>
> 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."

Tags for this Thread

No tags are associated with this thread.

What are tags?

A tag is like a keyword or category label associated with each thread. Tags make it easier for you to find threads of interest.

Anyone can tag a thread. Tags are public and visible to everyone.

Contact us