필터 지우기
필터 지우기

How to compare 2 very complex functions on Matlab

조회 수: 3 (최근 30일)
Yellow Canary
Yellow Canary 2015년 3월 8일
편집: Yellow Canary 2015년 3월 9일
Hello,
I have 2 functions and each functions has 8 variables. I run a matlab code and get outputs of both functions for different values of these variables. I assumed 3 of them as constant because the combinations are too many. Anyway, I plot the results and I can see that one function is much better than the other. But I need to compare these functions mathematically. I need to show some proof. Has anyone any idea what should I do? Is there a way to prove it on Matlab.
By better, I mean higher output value. I want to show one function gives higher output for all the values of variables. The functions are:
ProfitB = [Pb*(p-w)/(1-Pb)-c]*Hb+w*(Pb*(1-Pa)*Hb+Pa*Pb*Hb)+wu*Pa*(1-Pb)*Ha
ProfitC = [Pa*(wu-w+Pb*(p-wu))/(1-Pa)-c]*(Ha+Hb)+w*[Pa*(1-Pb)*Ha+Pb*(1-Pa)*Hb+Pa*Pb*(Ha+Hb)]
c=0.1, w=0.5, p=1,
Pb= 0:0.025:0.25 (Probability values and can take values from 0 up to 0.25 by 0.025 increments)
Pa = 0:0.025: (Hb - 0.25) (Probability values and can take values from 0 up to 0.25 by 0.025 increments but always less than Pb)
Hb:0:5:50 (These are quantities and can take values from 0 up to 50 by 5 increments)
Ha=0:5:(Hb-5) (These are quantities and can take values from 0 up to 50 by 5 increments, but always less than Hb)
wu=0.5:0.1:1 (Take values from 0.5 up to 1 by 0.1 increments)
Pa<Pb and Ha<Hb
p≥wu>w≥c
Thanks

답변 (1개)

John D'Errico
John D'Errico 2015년 3월 8일
편집: John D'Errico 2015년 3월 8일
Prove what? Define "better". Without such definition, such "proof" has no meaning.
You might consider some variety of integral over the domain of the two functions, but an 8-dimensional integral is a fools task, that would essentially never terminate in the lifetime of your computer.
You should probably consider some variety of Monte Carlo comparison, essentially a Monte Carlo integration. Since you have posed such an incomplete question, this is the best answer I can offer.
  댓글 수: 2
John D'Errico
John D'Errico 2015년 3월 9일
Given the additional information you have provided, I'm sorry, but you cannot easily prove that one function of 8 variables is universally greater than another. There may easily be some tiny corner where the two change places.
You CAN subtract the two, and then generate random samples over the domain. If the difference is always positive, then you can at least limit the size of the possible region where f is not greater than g. Again, this is essentially a Monte Carlo integration.
Yellow Canary
Yellow Canary 2015년 3월 9일
편집: Yellow Canary 2015년 3월 9일
Thanks. I ran the code for all combinations and got 18500 output and all the differences are positive.

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

카테고리

Help CenterFile Exchange에서 Contour Plots에 대해 자세히 알아보기

Community Treasure Hunt

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

Start Hunting!

Translated by