[Quantproject-developers] QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression LinearRegres
Brought to you by:
glauco_1
|
From: Glauco S. <gla...@us...> - 2012-04-30 23:41:52
|
Update of /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression
In directory vz-cvs-3.sog:/tmp/cvs-serv30408/b7_Scripts/WalkForwardTesting/LinearRegression
Modified Files:
LinearRegressionMain.cs
Log Message:
Some code has been added to the script, to test a linear regression fitness, based on the PRESS statistics (this fitness is much more robust than RSquare to the outliers)
Index: LinearRegressionMain.cs
===================================================================
RCS file: /cvsroot/quantproject/QuantProject/b7_Scripts/WalkForwardTesting/LinearRegression/LinearRegressionMain.cs,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** LinearRegressionMain.cs 22 Sep 2011 19:43:55 -0000 1.6
--- LinearRegressionMain.cs 30 Apr 2012 23:41:50 -0000 1.7
***************
*** 67,73 ****
// uncomment the following instruction in order to test the strategy
// using CSCO as a perfect predictor for MSFT
! this.historicalMarketValueProviderForInSample =
! new LookingAtTheFutureQuoteProvider(
! this.historicalMarketValueProviderForInSample , "MSFT" , "CSCO" );
this.historicalMarketValueProviderForChosingPositionsOutOfSample =
this.historicalMarketValueProviderForInSample;
--- 67,73 ----
// uncomment the following instruction in order to test the strategy
// using CSCO as a perfect predictor for MSFT
! // this.historicalMarketValueProviderForInSample =
! // new LookingAtTheFutureQuoteProvider(
! // this.historicalMarketValueProviderForInSample , "MSFT" , "CSCO" );
this.historicalMarketValueProviderForChosingPositionsOutOfSample =
this.historicalMarketValueProviderForInSample;
***************
*** 140,154 ****
protected override IInSampleChooser getInSampleChooser()
{
! int numberOfBestTestingPositionsToBeReturned = 50;
// uncomment the following line for a faster script
// numberOfBestTestingPositionsToBeReturned = 20;
// numberOfBestTestingPositionsToBeReturned = 6;
! numberOfBestTestingPositionsToBeReturned = 1;
int numberOfTickersForTrading = 1;
int[] numberOfTickersInEachSignalingPortfolio =
! // new int[] { 1 , 1 , 1 };
! new int[] { 1 };
DecoderForLinearRegressionTestingPositions decoderForWeightedPositions =
--- 140,154 ----
protected override IInSampleChooser getInSampleChooser()
{
! int numberOfBestTestingPositionsToBeReturned = 3;
// uncomment the following line for a faster script
// numberOfBestTestingPositionsToBeReturned = 20;
// numberOfBestTestingPositionsToBeReturned = 6;
! // numberOfBestTestingPositionsToBeReturned = 1;
int numberOfTickersForTrading = 1;
int[] numberOfTickersInEachSignalingPortfolio =
! new int[] { 1 , 1 , 1 };
! // new int[] { 1 };
DecoderForLinearRegressionTestingPositions decoderForWeightedPositions =
***************
*** 175,178 ****
--- 175,180 ----
this.fitnessEvaluator =
new LinearRegressionFitnessEvaluator( new LinearRegressionSetupManager() );
+ this.fitnessEvaluator =
+ new PRESSBasedFitnessEvaluator( new LinearRegressionSetupManager() );
// parameters for the genetic optimizer
***************
*** 187,192 ****
populationSizeForGeneticOptimizer = 300;
generationNumberForGeneticOptimizer = 2;
! populationSizeForGeneticOptimizer = 1000;
! generationNumberForGeneticOptimizer = 3;
--- 189,194 ----
populationSizeForGeneticOptimizer = 300;
generationNumberForGeneticOptimizer = 2;
! // populationSizeForGeneticOptimizer = 10000;
! generationNumberForGeneticOptimizer = 6;
***************
*** 272,276 ****
maxTimeSpanToLookAhead );
! double minForecastedReturn = 0.00002F;
IEntryStrategy longAndShortBasedOnAverageExpectedReturn =
new EntryStrategyBasedOnForecastedReturn(
--- 274,278 ----
maxTimeSpanToLookAhead );
! double minForecastedReturn = 0.003F;
IEntryStrategy longAndShortBasedOnAverageExpectedReturn =
new EntryStrategyBasedOnForecastedReturn(
***************
*** 332,338 ****
// lastDateTime = new DateTime( 2006 , 4 , 5 );
firstDateTime = new DateTime( 2004 , 5 , 1 );
! lastDateTime = new DateTime( 2004 , 6 , 30 );
! double maxRunningHours = 1.5;
EndOfDayStrategyBackTester endOfDayStrategyBackTester =
--- 334,340 ----
// lastDateTime = new DateTime( 2006 , 4 , 5 );
firstDateTime = new DateTime( 2004 , 5 , 1 );
! lastDateTime = new DateTime( 2004 , 5 , 31 );
! double maxRunningHours = 2;
EndOfDayStrategyBackTester endOfDayStrategyBackTester =
|