Using fminbnd to determine best response. What am i doing wrong?

2 views (last 30 days)
I am trying to attain profit equilibrium between two entering, competing firms in a single-service, single-use (consumers will only purchase this service once) Market. This means that in an optimal situation, the prices and profits of the two firms must be such that no individual firm would want to alter their prices, as they would lose profit.
The services are homogeneous, the total cost for each firm is normalized to zero, and both firms can alter their prices until they are satisfied. Prices can range between zero and the Monopoly Price of 50.
Afterwards, consumers choose which firm to join.
A total of 100 consumers exist in this Market: -50 of these consumers are informed: they will always join whichever firm sets the lowest price, assuming that the lowest price is not greater than the Monopoly Price. In both prices are equal, each firm gets 25 informed consumers, -the remaining 50 consumers are uninformed: if both firms set prices equal or lower than the Monopoly Price, each firm gets 25 uninformed consumers.
I am attempting to use fminbnd to minimize the (-profit) function of firm 1 in order to find a price that increases profits for firm 1, then plug the obtained price into the value of firm 1's price and use fminbnd to minimize the (-profit) function of firm 2 to find their best price response. Using this process in repeted sucessing, it would be in theory possible to attain profit equilibrium.
What I am doing in Matlab is:
#Monopoly Price
MP=50
#Prices for firm 1 and firm 2 (P2 is just a placeholder for now)
P1=linspace(0,50)
P2=25
#Informed and Uninformed Consumers
IC=50
UC=50
#IC1
if(or(P1>MP,P1<0))
IC1=0
elseif(P1>P2)
IC1=0
elseif(P1<P2)
IC1=IC
elseif(P1==P2)
IC1=IC/2
end
#UC1
if(or(P1>MP,P1<0))
UC1=0
else UC1=UC/2
end
#IC2
if(or(P2>MP,P2<0))
IC2=0
elseif(P1<P2)
IC2=0
elseif(P1>P2)
IC2=IC
elseif(P1==P2)
IC2=IC/2
end
#UC2
if(or(P2>MP,P2<0))
UC2=0
else UC2=UC/2
end
#Profits for both Firms
Profit1=@(P1)P1*(IC1+UC1)
Profit2=P2*(IC2+UC2)
#The "negative profit function for Firm 1". Its abs minimized value is the maximized profit for Firm 1
NProfit1=@(P1)-P1*(IC1+UC1)
#Using fminbnd we would get the optimal P1
[OptimalP1,NegativeProfit1]=fminbnd(NProfit1,0,MP)
fminbnd does not take into account any alterations in IC1 and UC1 and just sets OpP1 as its highest possible value. How could I solve this?
Thank you very much in advance.

Answers (1)

Matt J
Matt J on 24 Sep 2018
Edited: Matt J on 24 Sep 2018
Your objective function should be written something like
NProfit1=@(P1)-P1*(IC1(P1)+UC1(P1))
Note that IC1 and UC1 need to be functions of P1, not previously defined variables. Otherwise, Matlab will just treat them as constants with whatever value they happened to carry at the time you defined NProfit1.

Categories

Find more on Statistics and Machine Learning Toolbox in Help Center and File Exchange

Tags

Community Treasure Hunt

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

Start Hunting!