Class NNGenFirm

java.lang.Object
  |
  +--Firm
        |
        +--NNGenFirm

public class NNGenFirm
extends Firm

NNGenFirm.java
Copyright (c) Murat Yildizoglu, 2000-2001
Permission to use, copy, modify, and distribute this
software and its documentation for NON-COMMERCIAL purposes
and without fee is hereby granted provided that this
copyright notice appears in all copies.
*************************************************************
An evolutionnary firm inspired by Nelson and Winter (1982) but enriched by genetic algorithm and artificial neural network based R&D investment

Version:
1 August 2001
Author:
Murat Yildizoglu
See Also:
Firm, genetic, ANN

Fields inherited from class Firm
type
 
Constructor Summary
NNGenFirm(double K0, double prod0, double cost0, double d0, double sigma_in0, double delta0, double rd0, int g0, int c0, double xover0, double mutate0, int nxover0, boolean elitism0, double r0, double rd_min0, int numInputs0, int numHiddens0, int numOutputs0, int numEpochs0, int numPeriods0)
          Initializes and computes the firm's caracteristics given the caracteristics of the industry to which it belongs.
 
Method Summary
 void clean()
          Frees the Genetic algorithm and the ANN for garbage collection
 int getChrDecode(int cc)
          Decodes the actual chromosome in order to obtain the corresponding RD ratio.
 double getChrFitness(int cd)
          Provies the fitness of a particular chromosome
 double getDFittness()
          Returns the variation of the profit rate
 double getProfit()
          Total profit of the firm profit_rate*K
 void learn(int date)
          Train the Neural Network with new inputs and observed outputs.
 void setenv(java.lang.String S)
           
 void setrd(int t)
          Compute RD following a GA rule where the fittness is provided by the expected profit rate given by the ANN.
 java.lang.String showFirm()
          Formats the output for one GenFirm.
 
Methods inherited from class Firm
computeprofit, getdprim, getdprin, getinvestRD, getKapital, getprod, getProfitRate, getrd, imitate, innovate, investK, investRD, isactive, saveprofit, supply
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

NNGenFirm

public NNGenFirm(double K0,
                 double prod0,
                 double cost0,
                 double d0,
                 double sigma_in0,
                 double delta0,
                 double rd0,
                 int g0,
                 int c0,
                 double xover0,
                 double mutate0,
                 int nxover0,
                 boolean elitism0,
                 double r0,
                 double rd_min0,
                 int numInputs0,
                 int numHiddens0,
                 int numOutputs0,
                 int numEpochs0,
                 int numPeriods0)
Initializes and computes the firm's caracteristics given the caracteristics of the industry to which it belongs.
Parameters:
K0 - Initial capital of the firm
prod0 - Initial productivity of the firm
cost0 - Unit using cost of capital
d0 - Calibration parameter for the innovation process
sigma_in0 - Standard deviation of innovative draws
delta0 - Depreciation rate of capital
rd0 - NA
g0 - Number of genes
c0 - Number of chromosomes
xover0 - Crossover rate
mutate0 - Mutations rate
nxover0 - Number of crossover points
elitism0 - Elitist GA (true) or not (false)
r0 - Interest rate in the economy
rd_min0 - Minimal RD invetment rate
numInputs0 - number of the inputs nodes
numHiddens0 - number of the hidden nodes
numOutputs0 - number of the outputs nodes
numEpochs0 - Number of training periods (ANN) in each time period
numPeriods0 - Number of periods of the simulation
Method Detail

learn

public void learn(int date)
Train the Neural Network with new inputs and observed outputs. The variables that will bu used as inputs and outputs for the ANN must be fixed in this method.
Overrides:
learn in class Firm
Parameters:
date - The index of the last active element of observations used during training
See Also:
NNeco

setrd

public void setrd(int t)
Compute RD following a GA rule where the fittness is provided by the expected profit rate given by the ANN. To evaluate the fittness of each rule, a new inputs vector with this value is sent to the ANN to get the corresponding expectation. When all rules are evaluated, the GA is used to generate a new population of rules for the next period. The rule with the highest expectation is used in the actual period.
Overrides:
setrd in class Firm
Parameters:
t - : the time period

getProfit

public double getProfit()
Total profit of the firm profit_rate*K
Overrides:
getProfit in class Firm

getChrDecode

public int getChrDecode(int cc)
Decodes the actual chromosome in order to obtain the corresponding RD ratio.
Overrides:
getChrDecode in class Firm
Parameters:
cc - The chromosome to decode

getDFittness

public double getDFittness()
Returns the variation of the profit rate
Overrides:
getDFittness in class Firm
Following copied from class: Firm
See Also:
GenFirm

getChrFitness

public double getChrFitness(int cd)
Provies the fitness of a particular chromosome
Overrides:
getChrFitness in class Firm
Parameters:
cd - The chromosome for which the fitness is asked

clean

public void clean()
Frees the Genetic algorithm and the ANN for garbage collection
Overrides:
clean in class Firm
See Also:
genetic

showFirm

public java.lang.String showFirm()
Formats the output for one GenFirm. It is used in LearnInd.
Overrides:
showFirm in class Firm

setenv

public void setenv(java.lang.String S)
Overrides:
setenv in class Firm