Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

StochasticProcesses.h

Go to the documentation of this file.
00001 /* WARANTY NOTICE AND COPYRIGHT
00002 This program is free software; you can redistribute it and/or
00003 modify it under the terms of the GNU General Public License
00004 as published by the Free Software Foundation; either version 2
00005 of the License, or (at your option) any later version.
00006 
00007 This program is distributed in the hope that it will be useful,
00008 but WITHOUT ANY WARRANTY; without even the implied warranty of
00009 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00010 GNU General Public License for more details.
00011 
00012 You should have received a copy of the GNU General Public License
00013 along with this program; if not, write to the Free Software
00014 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00015 
00016 Copyright (C) Michael J. Meyer
00017 
00018 matmjm@mindspring.com
00019 spyqqqdia@yahoo.com
00020 
00021 */
00022 
00023 #ifndef martingale_stochasticprocesses_h
00024 #define martingale_stochasticprocesses_h
00025 
00026 #include "TypedefsMacros.h"
00027 #include "StochasticProcess.h"          // base class
00028 #include "Array.h"
00029 
00030 MTGL_BEGIN_NAMESPACE(Martingale)
00031 
00032 
00033 // we are using
00034 class FactorLoading;                     // FactorLoading.h
00035 class UTRRealMatrix;
00036 // class BrownianScalarProcess
00037 
00038 
00039 
00047 /********************************************************************************************
00048  *
00049  *                   Brownian motion
00050  * 
00051  ********************************************************************************************/
00052 
00053 
00056 class ScalarBrownianMotion : public BrownianScalarProcess {
00057         
00058         Real sqrtdt; 
00059         
00060 public:
00061         
00066         ScalarBrownianMotion(int T, Real dt, Real x0=0.0);
00067         
00069         void timeStep(int t);
00070                 
00071 }; // end ScalarBrownianMotion
00072 
00073 
00074 
00077 class VectorBrownianMotion : public BrownianVectorProcess {
00078         
00079         Real sqrtdt; 
00080         
00081 public:
00082         
00088         VectorBrownianMotion(int dim, int T, Real dt);
00089         
00090         
00096         VectorBrownianMotion(int dim, int T, Real dt, RealVector& x0);
00097         
00099         void timeStep(int t);
00100         
00101 // A SMALL TEST PROGRAM
00102    
00111      static void testPathFunctional(int t, int T, int nPath);
00112          
00113 }; // end VectorBrownianMotion
00114 
00115 
00116 
00117 /********************************************************************************************
00118  *
00119  *                    Gaussian martingales
00120  * 
00121  ********************************************************************************************/
00122 
00130 class GaussianMartingale : public BrownianVectorProcess {
00131         
00132         // size of time step
00133         Real dt; 
00134         // covariationMatrixRoots[t] is the Cholesky root of the covariation matric C, 
00135         // C_ij=integral_{t*dt}^{(t+1)*dt}nu_i(s).nu_j(s)ds, i,j>=0; t=0,...,T-1.
00136         // this drives the time step t->t+1
00137         Array1D<const UTRRealMatrix*> covariationMatrixRoots;
00138         
00139         FactorLoading* factorLoading;   // the factor loading
00140         
00141 public:
00142         
00149         GaussianMartingale(int dim, int T, int ds, RealVector& x0, FactorLoading* fl);
00150 
00151         ~GaussianMartingale();
00152 
00154         void timeStep(int t);
00155                         
00156                         
00157 }; // end GaussianMartingale
00158 
00159 
00160 
00161 
00162 MTGL_END_NAMESPACE(Martingale)
00163 
00164 #endif
00165 

Generated on Mon Sep 22 02:16:32 2003 for Libor-Library by doxygen1.3-rc3