net.finmath.climate.models.dice.submodels.EvolutionOfProductivity Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of finmath-lib Show documentation
Show all versions of finmath-lib Show documentation
finmath lib is a Mathematical Finance Library in Java.
It provides algorithms and methodologies related to mathematical finance.
package net.finmath.climate.models.dice.submodels;
import java.util.function.Function;
/**
* the evolution of the productivity (economy)
* \(
* A(t_{i+1}) = A(t_{i}) / (1-ga * \exp(- deltaA * t))
* \)
*
* Note: The function depends on the time step size
* TODO Fix time stepping
*
* @author Christian Fries
*/
public class EvolutionOfProductivity implements Function> {
private final double timeStep;
private final double productivityGrowthRate; // ga: Initial TFP rate
private final double productivityGrowthRateDecayRate; // deltaA: TFP increase rate
public EvolutionOfProductivity(double timeStep, double productivityGrowthRate, double productivityGrowthRateDecayRate) {
super();
this.timeStep = timeStep;
this.productivityGrowthRate = productivityGrowthRate;
this.productivityGrowthRateDecayRate = productivityGrowthRateDecayRate;
}
public EvolutionOfProductivity(double timeStep) {
// Parameters from original model: initial productivity growth 0.076 per 5 years, decaying with 0.005 per 5 years, thus 0.001 per 1 year
// TODO The productivityGrowthRateDecayRate calibration needs to be checkes.
// TODO reparametrization to timeStep only approximately correct
this(timeStep, 1-Math.pow(1-0.076,1.0/5.0), 0.005);
}
@Override
public Function apply(Double time) {
return (Double productivity) -> {
return productivity / Math.pow(1 - productivityGrowthRate * Math.exp(-productivityGrowthRateDecayRate * time), timeStep);
};
}
}