SALPMPE
Class Profit99

java.lang.Object
  extended by SALPMPE.Profit99

public class Profit99
extends java.lang.Object

Defines the single period profit function for the quality ladder competition model.

Version:
2.0

Field Summary
(package private) static double[] gm
          Array of quality levels
 
Constructor Summary
Profit99()
          Defines a new instance of the profit function.
 
Method Summary
 double[] fsolve(int[] s, double Xtol)
          Newton method implementation to solve for equilibrium prices for quality ladder competition model.
static void gaussian(double[][] a, int[] index)
          Method to perform the partial-pivoting Gaussian elimination.
 double[] mshare(int[] s)
          Computes industry equilibrium market shares for the single-period price competition game.
 double[] profit(int[] s)
          Computes industry equilibrium profits for the single-period price competition game.
static double[] solve(double[][] a, double[] b, int[] index)
          Method to solve the equation a[][] x[] = b[] with the partial-pivoting Gaussian elimination scheme.
 double[] surplus(int[] s)
          Computes industry equilibrium consumer surplus for the single-period price competition game.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

gm

static double[] gm
Array of quality levels

Constructor Detail

Profit99

public Profit99()
Defines a new instance of the profit function.

Method Detail

profit

public double[] profit(int[] s)
Computes industry equilibrium profits for the single-period price competition game.

Parameters:
s - Industry state.
Returns:
Profit vector.

mshare

public double[] mshare(int[] s)
Computes industry equilibrium market shares for the single-period price competition game.

Parameters:
s - Industry state.
Returns:
Market share vector.

surplus

public double[] surplus(int[] s)
Computes industry equilibrium consumer surplus for the single-period price competition game.

Parameters:
s - Industry state.
Returns:
Consumer surplus vector.

fsolve

public double[] fsolve(int[] s,
                       double Xtol)
Newton method implementation to solve for equilibrium prices for quality ladder competition model.

Parameters:
s - Industry state.
Xtol - Price tolerance.
Returns:
Vector of equilibrium prices.

solve

public static double[] solve(double[][] a,
                             double[] b,
                             int[] index)
Method to solve the equation a[][] x[] = b[] with the partial-pivoting Gaussian elimination scheme. The code is part of the book, "An Introduction to Computational Physics, 2nd Edition," written by Tao Pang and published by Cambridge University Press on January 19, 2006.

Parameters:
a - Left hand side matrix.
b - Right hand side vector.
Returns:
x Solution to linear system.

gaussian

public static void gaussian(double[][] a,
                            int[] index)
Method to perform the partial-pivoting Gaussian elimination.

Parameters:
index - Records the pivoting order.
a - Left hand side matrix.