How to compare 2 very complex functions on Matlab
5 次查看(过去 30 天)
显示 更早的评论
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
0 个评论
回答(1 个)
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
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.
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Calculus 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!