Module net.finmath.lib
Class MonteCarloConditionalExpectationRegression
java.lang.Object
net.finmath.montecarlo.conditionalexpectation.MonteCarloConditionalExpectationRegression
- All Implemented Interfaces:
ConditionalExpectationEstimator
- Direct Known Subclasses:
MonteCarloConditionalExpectationRegressionLocalizedOnDependents
public class MonteCarloConditionalExpectationRegression extends Object implements ConditionalExpectationEstimator
A service that allows to estimate conditional expectation via regression.
In oder to estimate the conditional expectation, basis functions have to be
specified.
The class can either estimate and predict the conditional expectation within
the same simulation (which will eventually introduce a small foresight bias)
or use a different simulation for estimation (using
basisFunctionsEstimator
)
to predict conditional expectation within another simulation
(using basisFunctionsPredictor
). In the latter case, the
basis functions have to correspond to the same entities, however, generated in
different simulations (number of path, etc., may be different).- Version:
- 1.0
- Author:
- Christian Fries
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static interface
MonteCarloConditionalExpectationRegression.RegressionBasisFunctions
Interface for objects specifying regression basis functions (a vector of random variables).class
MonteCarloConditionalExpectationRegression.RegressionBasisFunctionsGiven
Wrapper to an array of RandomVariable[] implementing RegressionBasisFunctions -
Constructor Summary
Constructors Constructor Description MonteCarloConditionalExpectationRegression()
MonteCarloConditionalExpectationRegression(RandomVariable[] basisFunctions)
Creates a class for conditional expectation estimation.MonteCarloConditionalExpectationRegression(RandomVariable[] basisFunctionsEstimator, RandomVariable[] basisFunctionsPredictor)
Creates a class for conditional expectation estimation. -
Method Summary
Modifier and Type Method Description MonteCarloConditionalExpectationRegression.RegressionBasisFunctions
getBasisFunctionsEstimator()
MonteCarloConditionalExpectationRegression.RegressionBasisFunctions
getBasisFunctionsPredictor()
RandomVariable
getConditionalExpectation(RandomVariable randomVariable)
Return the conditional expectation of a given random variable.double[]
getLinearRegressionParameters(RandomVariable dependents)
Return the solution x of XTX x = XT y for a given y.
-
Constructor Details
-
MonteCarloConditionalExpectationRegression
public MonteCarloConditionalExpectationRegression() -
MonteCarloConditionalExpectationRegression
Creates a class for conditional expectation estimation.- Parameters:
basisFunctions
- A vector of random variables to be used as basis functions.
-
MonteCarloConditionalExpectationRegression
public MonteCarloConditionalExpectationRegression(RandomVariable[] basisFunctionsEstimator, RandomVariable[] basisFunctionsPredictor)Creates a class for conditional expectation estimation.- Parameters:
basisFunctionsEstimator
- A vector of random variables to be used as basis functions for estimation.basisFunctionsPredictor
- A vector of random variables to be used as basis functions for prediction.
-
-
Method Details
-
getConditionalExpectation
Description copied from interface:ConditionalExpectationEstimator
Return the conditional expectation of a given random variable. The definition of the filtration time is part of the object implementing this interface.- Specified by:
getConditionalExpectation
in interfaceConditionalExpectationEstimator
- Parameters:
randomVariable
- Given random variable.- Returns:
- The conditional expectation of
randomVariable
.
-
getLinearRegressionParameters
Return the solution x of XTX x = XT y for a given y.- Parameters:
dependents
- The sample vector of the random variable y.- Returns:
- The solution x of XTX x = XT y.
- To dos:
- Performance upon repeated call can be optimized by caching XTX.
-
getBasisFunctionsEstimator
public MonteCarloConditionalExpectationRegression.RegressionBasisFunctions getBasisFunctionsEstimator() -
getBasisFunctionsPredictor
public MonteCarloConditionalExpectationRegression.RegressionBasisFunctions getBasisFunctionsPredictor()
-