Clear Filters
Clear Filters

How to compare 2 very complex functions on Matlab

3 views (last 30 days)
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

Answers (1)

John D'Errico
John D'Errico on 8 Mar 2015
Edited: John D'Errico on 8 Mar 2015
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 Comments
John D'Errico
John D'Errico on 9 Mar 2015
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 on 9 Mar 2015
Edited: Yellow Canary on 9 Mar 2015
Thanks. I ran the code for all combinations and got 18500 output and all the differences are positive.

Sign in to comment.

Categories

Find more on Contour Plots in Help Center and File Exchange

Community Treasure Hunt

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

Start Hunting!