All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.meliorbis.economics.aggregate.derivagg.DerivAggCalcState Maven / Gradle / Ivy

Go to download

A library for solving economic models, particularly macroeconomic models with heterogeneous agents who have model-consistent expectations

There is a newer version: 1.1
Show newest version
/**
 * 
 */
package com.meliorbis.economics.aggregate.derivagg;

import com.meliorbis.economics.infrastructure.simulation.DiscretisedDistribution;
import com.meliorbis.economics.model.ModelConfig;
import com.meliorbis.economics.model.State;
import com.meliorbis.numerics.generic.primitives.DoubleArray;


/**
 * A calculation state that holds the necessary values to perform derivative aggregation
 * 
 * @author Tobias Grasl
 * 
 * @param  The Config type
 */
public interface DerivAggCalcState extends State
{
	/**
	 * @param shockLevels_ The indexes in the discrete shock ranges being processed, and which a distribution
	 * is required for
	 *
	 * @return The distribution to use as a starting point, given the shock levels, to determine the aggregate 
	 * forecast rule
	 */
	DiscretisedDistribution getDistributionForState(int[] shockLevels_);
	
	/**
	 * Used by the Derivative Aggregation Solver, sets the derivatives calculated
	 * by the solver.
	 * 
	 * Default does nothing
	 * 
	 * @param exoStates_ The exogenous state grid index these derivatives are for
	 * @param currentAggs_ The aggregate states under the distribution for which the derivation was performed
	 * @param futureAggs_ The future aggregate states under the distribution for which the derivation was performed
	 * @param derivatives_ The derivatives - one array for each order
	 */
	default void setDerivatives( int[] exoStates_, DoubleArray currentAggs_, DoubleArray futureAggs_, DoubleArray... derivatives_) {};
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy