Explicit formula for kstest p value

I want to use the KS test in an optimisation problem and I don't think the default logical output from kstest will do since it's only ever 0 or 1 – not good for an optimisation problem. What command do I use to only get the pvalue so I can use it in my objective function?
Thanks.

댓글 수: 4

Why can't you use this in your objective function?
[~,p] = kstest(___)
Christopher
Christopher 2023년 3월 28일
Can the objective function have a = sign in it? Also, ideally I want the product of several pvalues from separate tests.
Unless you insist on an anonymous function as the objective, then I think your objective function can do anything you want, e.g.
function prod3 = myobjective(xin)
[~,p1] = kstest(___);
[~,p2] = kstest(___);
[~,p3] = kstest(___);
prod3 = p1*p2*p3;
% or whatever
end
Christopher
Christopher 2023년 3월 28일
편집: Christopher 2023년 3월 28일
That's great! Thank you very much for your help.

댓글을 달려면 로그인하십시오.

답변 (0개)

카테고리

도움말 센터File Exchange에서 MATLAB에 대해 자세히 알아보기

제품

릴리스

R2022b

질문:

2023년 3월 27일

편집:

2023년 3월 28일

Community Treasure Hunt

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

Start Hunting!

Translated by