experimentII.m

Calculates the Probit-based static entry thresholds and profits per consumer presented in Table II of Abbring and Campbell's ''Last-In First-Out Oligopoly Dynamics.''

Contents

Set grid of innovation variances examined.

sigmaG=[0 0.05 0.1 0.15];

Set remaining parameters.

This section creates the structures with all parameters required for the model's solution. Some of these are replaced later when cycling through the grid points.

% Parameters for approximating the innovation distribution
approximateARG.F=@(x) (1+erf(x/sqrt(2)))./2;
approximateARG.Frange=4.0;
approximateARG.k=51;

% Parameters for approximating the Markov chain.
markovARG.approximateARG=approximateARG;
markovARG.rho=1.0;
markovARG.sigma=0.30;       %Placeholder value
markovARG.omegaCenter=0.0;
markovARG.omegaStep=0.005;
markovARG.omegaWidth=3;

% Parameters describing profits and discounting.
k=4;
piF = @(x) k*ones(size(x));
kappa=1.75;
beta=1.05^(-1);             %5 percent annual interest rate.
phi = @(N) 0.25*beta/(1-beta);

Equilibrium and parameter calculation

% Mark cpu time for efficiency calculations.
tstart=cputime;

% Cycle through the parameter values and calculate the statistics of interest.
nPoints=size(sigmaG,2);
probitThresholds=NaN(nPoints,1);

for iter=1:nPoints;

    markovARG.sigma=sigmaG(iter);

    [nPrime,nPrimeIndex,vFuncs,minN,maxN,Pi,omega,nCstates] = bellman(piF,kappa,beta,phi,markovARG);
    [overlineC,underlineC] = thresholds(maxN,vFuncs,phi,omega);
    [ PiCN,v ] = ergodic(Pi,nPrime,nPrimeIndex,minN,maxN,nCstates,omega);
    [mProbitC,mProbitSigma] = probit(maxN,minN,omega,nCstates,overlineC,underlineC,v);

    probitThresholds(iter,1:maxN)=mProbitC';
    if maxN<size(probitThresholds,2)
        probitThresholds(iter,maxN+1:end)=NaN;
    end

    clear Pi %This triggers the recalculation of the approximating Markov chain on the next trip through this loop.

end

Calculate implied rate of decline for \pi(N)

temp=probitThresholds./(ones(length(sigmaG),1)*(minN+1:1:minN+size(probitThresholds,2)));
PiRatio = temp(:,1:end-1)./temp(:,2:end);

%Convert these into the level of profit per customer relative to its monopoly level.
PiRatio=cumprod(PiRatio,2);
PiRatio=[ones(size(PiRatio,1),1) PiRatio];

Create Table II by writing results to a LaTeX file.

latextableII;

%Write the two panels to a LaTeX file
f1=fopen('ac2aExperimentII.tex','w');
for i=1:1:size(tablestra,1)
    fprintf(f1,'%s \n',tablestra(i,:));
end
fprintf(f1,'\n \\bigskip \n \n');

for i=1:1:size(tablestrb,1)
    fprintf(f1,'%s \n',tablestrb(i,:));
end

fclose(f1);

Write table elements referenced in the text to LaTeX macros.

This automation creates an audit trail for these numbers.

f1=fopen('ac2aExperimentIIText.tex','w');
fprintf(f1,'\\def\\piRatioFourTwo{$%3.2f$}\n',PiRatio(4,2));
fclose(f1);

Display computation time.

disp(['Experiment took ' num2str(cputime-tstart,'%6.2f') ' seconds']);
Experiment took 84.27 seconds

Quit Matlab

We only wish to quit if we are running this from the makefile. To detect this,import the make level. If we are running this from within make, this will be nonempty. For extra security, we don't even bother with this step if we are not running within unix or mac.

if isunix || ismac

    makelevel=getenv('MAKELEVEL');

    if ~strcmp(makelevel,'')
        quit
    end

end