Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views-3.4.csproj
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views-3.4.csproj	(revision 7182)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views-3.4.csproj	(revision 7183)
@@ -50,5 +50,5 @@
     <DebugType>pdbonly</DebugType>
     <Optimize>true</Optimize>
-    <OutputPath>bin\Release\</OutputPath>
+    <OutputPath>..\..\bin\</OutputPath>
     <DefineConstants>TRACE</DefineConstants>
     <ErrorReport>prompt</ErrorReport>
@@ -110,4 +110,10 @@
   </ItemGroup>
   <ItemGroup>
+    <Compile Include="InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView.cs">
+      <SubType>UserControl</SubType>
+    </Compile>
+    <Compile Include="InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView.Designer.cs">
+      <DependentUpon>InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView.cs</DependentUpon>
+    </Compile>
     <Compile Include="Plugin.cs" />
     <Compile Include="SymbolicTimeSeriesPrognosisSolutionView.cs">
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView.cs	(revision 7182)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView.cs	(revision 7183)
@@ -57,7 +57,8 @@
     protected override Dictionary<ISymbolicExpressionTreeNode, double> CalculateReplacementValues(ISymbolicExpressionTree tree) {
       Dictionary<ISymbolicExpressionTreeNode, double> replacementValues = new Dictionary<ISymbolicExpressionTreeNode, double>();
-      foreach (ISymbolicExpressionTreeNode node in tree.Root.GetSubtree(0).GetSubtree(0).IterateNodesPrefix()) {
-        replacementValues[node] = CalculateReplacementValue(node, tree);
-      }
+      foreach (var componentBranch in tree.Root.GetSubtree(0).Subtrees)
+        foreach (ISymbolicExpressionTreeNode node in componentBranch.IterateNodesPrefix()) {
+          replacementValues[node] = CalculateReplacementValue(node, tree);
+        }
       return replacementValues;
     }
@@ -72,9 +73,10 @@
         .ToArray();
       int i = 0;
+      int nTargetVariables = Content.ProblemData.TargetVariables.Count();
       foreach (var targetVariable in Content.ProblemData.TargetVariables) {
         List<ISymbolicExpressionTreeNode> nodes = tree.Root.GetSubtree(0).GetSubtree(i).IterateNodesPostfix().ToList();
         var targetValues = dataset.GetDoubleValues(targetVariable, rows);
         OnlineCalculatorError errorState;
-        double originalR2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, originalOutput.Select(v => v.ElementAt(i)), out errorState);
+        double originalR2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, originalOutput.Skip(i).TakeEvery(nTargetVariables), out errorState);
         if (errorState != OnlineCalculatorError.None) originalR2 = 0.0;
 
@@ -85,5 +87,5 @@
           SwitchNode(parent, node, replacementNode);
           var newOutput = interpreter.GetSymbolicExpressionTreeValues(tree, dataset, Content.ProblemData.TargetVariables.ToArray(), rows, 1);
-          double newR2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, newOutput.Select(v => v.First().ElementAt(i)), out errorState);
+          double newR2 = OnlinePearsonsRSquaredCalculator.Calculate(targetValues, newOutput.Skip(i).TakeEvery(nTargetVariables), out errorState);
           if (errorState != OnlineCalculatorError.None) newR2 = 0.0;
 
@@ -112,6 +114,6 @@
       var rows = Content.ProblemData.TrainingIndizes;
       var allPrognosedValues = interpreter.GetSymbolicExpressionTreeValues(tempTree, Content.ProblemData.Dataset, Content.ProblemData.TargetVariables.ToArray(), rows, 1);
-      
-      return allPrognosedValues.Select(x=>x.First().First()).Median();
+
+      return allPrognosedValues.Median();
     }
 
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/SymbolicTimeSeriesPrognosisSolutionView.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/SymbolicTimeSeriesPrognosisSolutionView.cs	(revision 7182)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis.Views/3.4/SymbolicTimeSeriesPrognosisSolutionView.cs	(revision 7183)
@@ -39,7 +39,7 @@
 
     private void btn_SimplifyModel_Click(object sender, EventArgs e) {
-      //InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView view = new InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView();
-      //view.Content = (SymbolicTimeSeriesPrognosisSolution)this.Content.Clone();
-      //view.Show();
+      InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView view = new InteractiveSymbolicTimeSeriesPrognosisSolutionSimplifierView();
+      view.Content = (SymbolicTimeSeriesPrognosisSolution)this.Content.Clone();
+      view.Show();
     }
   }
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4.csproj
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4.csproj	(revision 7182)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis-3.4.csproj	(revision 7183)
@@ -120,6 +120,8 @@
       <SubType>Code</SubType>
     </Compile>
+    <Compile Include="SingleObjective\SymbolicTimeSeriesPrognosisSingleObjectiveOverfittingAnalyzer.cs" />
     <Compile Include="SingleObjective\SymbolicTimeSeriesPrognosisSingleObjectiveProblem.cs" />
     <Compile Include="SingleObjective\SymbolicTimeSeriesPrognosisSingleObjectiveTrainingBestSolutionAnalyzer.cs" />
+    <Compile Include="SingleObjective\SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer.cs" />
     <Compile Include="SymbolicTimeSeriesPrognosisModel.cs" />
     <Compile Include="SymbolicTimeSeriesPrognosisSolution.cs" />
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveMeanSquaredErrorEvaluator.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveMeanSquaredErrorEvaluator.cs	(revision 7182)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveMeanSquaredErrorEvaluator.cs	(revision 7183)
@@ -93,18 +93,5 @@
         meanCalculator.Add(calc.MeanSquaredError);
       }
-      //int i = 0;
-      //foreach (var targetVariable in problemData.TargetVariables) {
-      //  var predictedContinuations = allPredictedContinuations.Select(v => v.ElementAt(i));
-      //  for (int h = 0; h < horizon; h++) {
-      //    OnlineCalculatorError errorState;
-      //    meanCalculator.Add(OnlineMeanSquaredErrorCalculator.Calculate(predictedContinuations
-      //                                                                    .Select(x => x.ElementAt(h))
-      //                                                                    .LimitToRange(lowerEstimationLimit,
-      //                                                                                  upperEstimationLimit),
-      //                                                                  actualContinuations.Select(x => x.ElementAt(h)),
-      //                                                                  out errorState));
-      //    if (errorState != OnlineCalculatorError.None) return double.NaN;
-      //  }
-      //}
+
       return meanCalculator.MeanErrorState == OnlineCalculatorError.None ? meanCalculator.Mean : double.MaxValue;
     }
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveProblem.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveProblem.cs	(revision 7182)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveProblem.cs	(revision 7183)
@@ -76,20 +76,12 @@
     private void InitializeOperators() {
       Operators.Add(new SymbolicTimeSeriesPrognosisSingleObjectiveTrainingBestSolutionAnalyzer());
-      //Operators.Add(new SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer());
-      //Operators.Add(new SymbolicTimeSeriesPrognosisSingleObjectiveOverfittingAnalyzer());
+      Operators.Add(new SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer());
+      Operators.Add(new SymbolicTimeSeriesPrognosisSingleObjectiveOverfittingAnalyzer());
       ParameterizeOperators();
     }
 
     private void UpdateEstimationLimits() {
-      //if (ProblemData.TrainingIndizes.Any()) {
-      //  var targetValues = ProblemData.Dataset.GetDoubleValues(ProblemData.TargetVariables, ProblemData.TrainingIndizes).ToList();
-      //  var mean = targetValues.Average();
-      //  var range = targetValues.Max() - targetValues.Min();
-      //  EstimationLimits.Upper = mean + PunishmentFactor * range;
-      //  EstimationLimits.Lower = mean - PunishmentFactor * range;
-      //} else {
       EstimationLimits.Upper = double.MaxValue;
       EstimationLimits.Lower = double.MinValue;
-      //}
     }
 
@@ -106,6 +98,5 @@
           op.EstimationLimitsParameter.ActualName = EstimationLimitsParameter.Name;
         }
-        foreach (var op in operators.OfType<SymbolicTimeSeriesPrognosisSingleObjectiveTrainingBestSolutionAnalyzer>())
-        {
+        foreach (var op in operators.OfType<SymbolicTimeSeriesPrognosisSingleObjectiveTrainingBestSolutionAnalyzer>()) {
           op.MaximizationParameter.ActualName = MaximizationParameter.Name;
           op.ProblemDataParameter.ActualName = ProblemDataParameter.Name;
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveTrainingBestSolutionAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveTrainingBestSolutionAnalyzer.cs	(revision 7182)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveTrainingBestSolutionAnalyzer.cs	(revision 7183)
@@ -76,5 +76,5 @@
 
     protected override ISymbolicTimeSeriesPrognosisSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) {
-      var model = new SymbolicTimeSeriesPrognosisModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, ProblemDataParameter.ActualValue.TargetVariables.ToArray());
+      var model = new SymbolicTimeSeriesPrognosisModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, ProblemDataParameter.ActualValue.TargetVariables.ToArray(), EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper);
       if (ApplyLinearScaling.Value)
         SymbolicTimeSeriesPrognosisModel.Scale(model, ProblemDataParameter.ActualValue);
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer.cs	(revision 7182)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SingleObjective/SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer.cs	(revision 7183)
@@ -20,4 +20,5 @@
 #endregion
 
+using System.Linq;
 using HeuristicLab.Common;
 using HeuristicLab.Core;
@@ -33,9 +34,7 @@
   [Item("SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer", "An operator that analyzes the validation best symbolic time-series prognosis solution for single objective symbolic time-series prognosis problems.")]
   [StorableClass]
-  public sealed class SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<ISymbolicTimeSeriesPrognosisSolution, ISymbolicTimeSeriesPrognosisSingleObjectiveEvaluator, ITimeSeriesPrognosisProblemData>,
-    ISymbolicDataAnalysisBoundedOperator {
+  public sealed class SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer : SymbolicDataAnalysisSingleObjectiveValidationBestSolutionAnalyzer<ISymbolicTimeSeriesPrognosisSolution, ISymbolicTimeSeriesPrognosisSingleObjectiveEvaluator, ITimeSeriesPrognosisProblemData>, ISymbolicDataAnalysisBoundedOperator {
     private const string EstimationLimitsParameterName = "EstimationLimits";
     private const string ApplyLinearScalingParameterName = "ApplyLinearScaling";
-
     #region parameter properties
     public IValueLookupParameter<DoubleLimit> EstimationLimitsParameter {
@@ -61,5 +60,4 @@
       Parameters.Add(new ValueParameter<BoolValue>(ApplyLinearScalingParameterName, "Flag that indicates if the produced symbolic regression solution should be linearly scaled.", new BoolValue(true)));
     }
-
     public override IDeepCloneable Clone(Cloner cloner) {
       return new SymbolicTimeSeriesPrognosisSingleObjectiveValidationBestSolutionAnalyzer(this, cloner);
@@ -67,5 +65,5 @@
 
     protected override ISymbolicTimeSeriesPrognosisSolution CreateSolution(ISymbolicExpressionTree bestTree, double bestQuality) {
-      var model = new SymbolicTimeSeriesPrognosisModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicTimeSeriesPrognosisInterpreterParameter.ActualValue);
+      var model = new SymbolicTimeSeriesPrognosisModel((ISymbolicExpressionTree)bestTree.Clone(), SymbolicDataAnalysisTreeInterpreterParameter.ActualValue, ProblemDataParameter.ActualValue.TargetVariables.ToArray(), EstimationLimitsParameter.ActualValue.Lower, EstimationLimitsParameter.ActualValue.Upper);
       if (ApplyLinearScaling.Value)
         SymbolicTimeSeriesPrognosisModel.Scale(model, ProblemDataParameter.ActualValue);
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SymbolicTimeSeriesPrognosisModel.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SymbolicTimeSeriesPrognosisModel.cs	(revision 7182)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.TimeSeriesPrognosis/3.4/SymbolicTimeSeriesPrognosisModel.cs	(revision 7183)
@@ -39,4 +39,8 @@
       get { return HeuristicLab.Common.Resources.VSImageLibrary.Function; }
     }
+    [Storable(DefaultValue = double.MinValue)]
+    private double lowerEstimationLimit;
+    [Storable(DefaultValue = double.MaxValue)]
+    private double upperEstimationLimit;
 
     #region properties
@@ -72,6 +76,8 @@
       this.targetVariables = new string[original.targetVariables.Length];
       Array.Copy(original.targetVariables, this.targetVariables, this.targetVariables.Length);
-    }
-    public SymbolicTimeSeriesPrognosisModel(ISymbolicExpressionTree tree, ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter interpreter, IEnumerable<string> targetVariables)
+      this.lowerEstimationLimit = original.lowerEstimationLimit;
+      this.upperEstimationLimit = original.upperEstimationLimit;
+    }
+    public SymbolicTimeSeriesPrognosisModel(ISymbolicExpressionTree tree, ISymbolicTimeSeriesPrognosisExpressionTreeInterpreter interpreter, IEnumerable<string> targetVariables, double lowerLimit = double.MinValue, double upperLimit = double.MaxValue)
       : base() {
       this.name = ItemName;
@@ -79,4 +85,6 @@
       this.symbolicExpressionTree = tree;
       this.interpreter = interpreter; this.targetVariables = targetVariables.ToArray();
+      this.lowerEstimationLimit = lowerLimit;
+      this.upperEstimationLimit = upperLimit;
     }
 
@@ -95,5 +103,5 @@
           for (int c = 0; c < components.Length; c++) {
             enumerator.MoveNext();
-            components[c] = enumerator.Current;
+            components[c] = Math.Min(upperEstimationLimit, Math.Max(lowerEstimationLimit, enumerator.Current));
           }
           l.Add(components);
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 7182)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Symbolic.Views/3.4/InteractiveSymbolicDataAnalysisSolutionSimplifierView.cs	(revision 7183)
@@ -107,4 +107,6 @@
         if (tree.Root.SubtreeCount > 1)
           this.treeChart.Tree = new SymbolicExpressionTree(tree.Root); // RPB + ADFs
+        else if (tree.Root.GetSubtree(0).SubtreeCount > 1)
+          this.treeChart.Tree = new SymbolicExpressionTree(tree.Root); // RPB 
         else
           this.treeChart.Tree = new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0)); // 1st child of RPB
@@ -139,4 +141,6 @@
             if (tree.Root.SubtreeCount > 1)
               this.treeChart.Tree = new SymbolicExpressionTree(tree.Root); // RPB + ADFs
+            else if (tree.Root.GetSubtree(0).SubtreeCount > 1)
+              this.treeChart.Tree = new SymbolicExpressionTree(tree.Root); // RPB 
             else
               this.treeChart.Tree = new SymbolicExpressionTree(tree.Root.GetSubtree(0).GetSubtree(0)); // 1st child of RPB
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/TimeSeriesPrognosisSolutionView.Designer.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/TimeSeriesPrognosisSolutionView.Designer.cs	(revision 7182)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/TimeSeriesPrognosisSolutionView.Designer.cs	(revision 7183)
@@ -75,9 +75,9 @@
       // itemsListView
       // 
-      this.itemsListView.Size = new System.Drawing.Size(244, 240);
+      this.itemsListView.Size = new System.Drawing.Size(244, 153);
       // 
       // detailsGroupBox
       // 
-      this.detailsGroupBox.Size = new System.Drawing.Size(266, 248);
+      this.detailsGroupBox.Size = new System.Drawing.Size(266, 161);
       // 
       // addButton
@@ -91,5 +91,5 @@
       // viewHost
       // 
-      this.viewHost.Size = new System.Drawing.Size(254, 223);
+      this.viewHost.Size = new System.Drawing.Size(254, 136);
       // 
       // horizonTextBox
@@ -99,4 +99,5 @@
       this.horizonTextBox.Size = new System.Drawing.Size(100, 20);
       this.horizonTextBox.TabIndex = 1;
+      this.horizonTextBox.KeyDown += new System.Windows.Forms.KeyEventHandler(this.horizonTextBox_KeyDown);
       this.horizonTextBox.Validating += new System.ComponentModel.CancelEventHandler(this.horizonTextBox_Validating);
       this.horizonTextBox.Validated += new System.EventHandler(this.horizonTextBox_Validated);
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/TimeSeriesPrognosisSolutionView.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/TimeSeriesPrognosisSolutionView.cs	(revision 7182)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/TimeSeriesPrognosisSolutionView.cs	(revision 7183)
@@ -73,4 +73,14 @@
       Content.Horizon = val;
     }
+
+    private void horizonTextBox_KeyDown(object sender, KeyEventArgs e) {
+      if (e.KeyCode == Keys.Enter) {
+        e.Handled = true;
+        this.Focus();
+      } else {
+        e.Handled = false;
+      }
+    }
+
   }
 }
Index: anches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/TimeSeriesPrognosisSolutionView.resx
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis.Views/3.4/Solution Views/TimeSeriesPrognosisSolutionView.resx	(revision 7182)
+++ 	(revision )
@@ -1,129 +1,0 @@
-﻿<?xml version="1.0" encoding="utf-8"?>
-<root>
-  <!-- 
-    Microsoft ResX Schema 
-    
-    Version 2.0
-    
-    The primary goals of this format is to allow a simple XML format 
-    that is mostly human readable. The generation and parsing of the 
-    various data types are done through the TypeConverter classes 
-    associated with the data types.
-    
-    Example:
-    
-    ... ado.net/XML headers & schema ...
-    <resheader name="resmimetype">text/microsoft-resx</resheader>
-    <resheader name="version">2.0</resheader>
-    <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader>
-    <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader>
-    <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data>
-    <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data>
-    <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64">
-        <value>[base64 mime encoded serialized .NET Framework object]</value>
-    </data>
-    <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64">
-        <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value>
-        <comment>This is a comment</comment>
-    </data>
-                
-    There are any number of "resheader" rows that contain simple 
-    name/value pairs.
-    
-    Each data row contains a name, and value. The row also contains a 
-    type or mimetype. Type corresponds to a .NET class that support 
-    text/value conversion through the TypeConverter architecture. 
-    Classes that don't support this are serialized and stored with the 
-    mimetype set.
-    
-    The mimetype is used for serialized objects, and tells the 
-    ResXResourceReader how to depersist the object. This is currently not 
-    extensible. For a given mimetype the value must be set accordingly:
-    
-    Note - application/x-microsoft.net.object.binary.base64 is the format 
-    that the ResXResourceWriter will generate, however the reader can 
-    read any of the formats listed below.
-    
-    mimetype: application/x-microsoft.net.object.binary.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter
-            : and then encoded with base64 encoding.
-    
-    mimetype: application/x-microsoft.net.object.soap.base64
-    value   : The object must be serialized with 
-            : System.Runtime.Serialization.Formatters.Soap.SoapFormatter
-            : and then encoded with base64 encoding.
-
-    mimetype: application/x-microsoft.net.object.bytearray.base64
-    value   : The object must be serialized into a byte array 
-            : using a System.ComponentModel.TypeConverter
-            : and then encoded with base64 encoding.
-    -->
-  <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata">
-    <xsd:import namespace="http://www.w3.org/XML/1998/namespace" />
-    <xsd:element name="root" msdata:IsDataSet="true">
-      <xsd:complexType>
-        <xsd:choice maxOccurs="unbounded">
-          <xsd:element name="metadata">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" />
-              </xsd:sequence>
-              <xsd:attribute name="name" use="required" type="xsd:string" />
-              <xsd:attribute name="type" type="xsd:string" />
-              <xsd:attribute name="mimetype" type="xsd:string" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="assembly">
-            <xsd:complexType>
-              <xsd:attribute name="alias" type="xsd:string" />
-              <xsd:attribute name="name" type="xsd:string" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="data">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-                <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" />
-              <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" />
-              <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" />
-              <xsd:attribute ref="xml:space" />
-            </xsd:complexType>
-          </xsd:element>
-          <xsd:element name="resheader">
-            <xsd:complexType>
-              <xsd:sequence>
-                <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" />
-              </xsd:sequence>
-              <xsd:attribute name="name" type="xsd:string" use="required" />
-            </xsd:complexType>
-          </xsd:element>
-        </xsd:choice>
-      </xsd:complexType>
-    </xsd:element>
-  </xsd:schema>
-  <resheader name="resmimetype">
-    <value>text/microsoft-resx</value>
-  </resheader>
-  <resheader name="version">
-    <value>2.0</value>
-  </resheader>
-  <resheader name="reader">
-    <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <resheader name="writer">
-    <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value>
-  </resheader>
-  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>120, 17</value>
-  </metadata>
-  <metadata name="toolTip.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>120, 17</value>
-  </metadata>
-  <metadata name="imageList.TrayLocation" type="System.Drawing.Point, System.Drawing, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a">
-    <value>17, 17</value>
-  </metadata>
-</root>
Index: /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionBase.cs
===================================================================
--- /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionBase.cs	(revision 7182)
+++ /branches/HeuristicLab.TimeSeries/HeuristicLab.Problems.DataAnalysis/3.4/Implementation/TimeSeriesPrognosis/TimeSeriesPrognosisSolutionBase.cs	(revision 7183)
@@ -20,4 +20,5 @@
 #endregion
 
+using System;
 using System.Collections.Concurrent;
 using System.Collections.Generic;
@@ -195,4 +196,31 @@
     private void AfterDeserialization() {
       if (horizon == 0) horizon = 1;
+      bool anyNewResult = false;
+      if (!ContainsKey(TrainingTheilsUStatisticLastResultName)) {
+        Add(new Result(TrainingTheilsUStatisticLastResultName, "The average Theil's U statistic (reference: previous value) of the forecasts of the model on the training partition", new DoubleArray()));
+        anyNewResult = true;
+      }
+      if (!ContainsKey(TestTheilsUStatisticLastResultName)) {
+        Add(new Result(TestTheilsUStatisticLastResultName, "The average Theil's U statistic (reference: previous value) of the forecasts of the model on the test partition", new DoubleArray()));
+        anyNewResult = true;
+      }
+      if (!ContainsKey(TrainingTheilsUStatisticMeanResultName)) {
+        Add(new Result(TrainingTheilsUStatisticMeanResultName, "The average Theil's U statistic (reference: mean value) of the forecasts of the model on the training partition", new DoubleArray()));
+        anyNewResult = true;
+      }
+      if (!ContainsKey(TestTheilsUStatisticMeanResultName)) {
+        Add(new Result(TestTheilsUStatisticMeanResultName, "The average Theil's U statistic (reference: mean value) of the forecasts of the model on the test partition", new DoubleArray()));
+        anyNewResult = true;
+      }
+      if (!ContainsKey(TrainingTheilsUStatisticMAResultName)) {
+        Add(new Result(TrainingTheilsUStatisticMAResultName, "The average Theil's U statistic (reference: moving average) of the forecasts of the model on the training partition", new DoubleArray()));
+        anyNewResult = true;
+      }
+      if (!ContainsKey(TestTheilsUStatisticMAResultName)) {
+        Add(new Result(TestTheilsUStatisticMAResultName, "The average Theil's U statistic (reference: moving average) of the forecasts of the model on the test partition", new DoubleArray()));
+        anyNewResult = true;
+      }
+      if (anyNewResult)
+        RecalculateResults();
     }
 
@@ -240,4 +268,15 @@
       //double[] trainingTheilsU = new double[targetVariables.Length];
       //double[] testTheilsU = new double[targetVariables.Length];
+
+      var trainingMseCalculators = new OnlineMeanSquaredErrorCalculator[targetVariables.Length];
+      var testMseCalculators = new OnlineMeanSquaredErrorCalculator[targetVariables.Length];
+      var trainingMaeCalculators = new OnlineMeanAbsoluteErrorCalculator[targetVariables.Length];
+      var testMaeCalculators = new OnlineMeanAbsoluteErrorCalculator[targetVariables.Length];
+      var trainingRSquaredCalculators = new OnlinePearsonsRSquaredCalculator[targetVariables.Length];
+      var testRSquaredCalculators = new OnlinePearsonsRSquaredCalculator[targetVariables.Length];
+      var trainingRelErrorCalculators = new OnlineMeanAbsolutePercentageErrorCalculator[targetVariables.Length];
+      var testRelErrorCalculators = new OnlineMeanAbsolutePercentageErrorCalculator[targetVariables.Length];
+      var trainingNmseCalculators = new OnlineNormalizedMeanSquaredErrorCalculator[targetVariables.Length];
+      var testNmseCalculators = new OnlineNormalizedMeanSquaredErrorCalculator[targetVariables.Length];
 
       var trainingDsCalculators = new OnlineDirectionalSymmetryCalculator[targetVariables.Length];
@@ -252,4 +291,15 @@
       var testTheilsUMovingAverageCalculators = new OnlineTheilsUStatisticCalculator[targetVariables.Length];
       for (int i = 0; i < targetVariables.Length; i++) {
+        trainingMseCalculators[i] = new OnlineMeanSquaredErrorCalculator();
+        testMseCalculators[i] = new OnlineMeanSquaredErrorCalculator();
+        trainingMaeCalculators[i] = new OnlineMeanAbsoluteErrorCalculator();
+        testMaeCalculators[i] = new OnlineMeanAbsoluteErrorCalculator();
+        trainingRSquaredCalculators[i] = new OnlinePearsonsRSquaredCalculator();
+        testRSquaredCalculators[i] = new OnlinePearsonsRSquaredCalculator();
+        trainingRelErrorCalculators[i] = new OnlineMeanAbsolutePercentageErrorCalculator();
+        testRelErrorCalculators[i] = new OnlineMeanAbsolutePercentageErrorCalculator();
+        trainingNmseCalculators[i] = new OnlineNormalizedMeanSquaredErrorCalculator();
+        testNmseCalculators[i] = new OnlineNormalizedMeanSquaredErrorCalculator();
+
         trainingDsCalculators[i] = new OnlineDirectionalSymmetryCalculator();
         testDsCalculators[i] = new OnlineDirectionalSymmetryCalculator();
@@ -286,4 +336,17 @@
             trainingTheilsUMeanCalculators[t].Add(startValue, actualContinuation.Select(x => mean), actualContinuation, prognosedContinuation);
             trainingTheilsUMovingAverageCalculators[t].Add(startValue, movingAverageContinuation, actualContinuation, prognosedContinuation);
+
+            var actualContinuationEnumerator = actualContinuation.GetEnumerator();
+            var prognosedContinuationEnumerator = prognosedContinuation.GetEnumerator();
+            while (actualContinuationEnumerator.MoveNext() & prognosedContinuationEnumerator.MoveNext()) {
+              trainingMseCalculators[t].Add(actualContinuationEnumerator.Current, prognosedContinuationEnumerator.Current);
+              trainingMaeCalculators[t].Add(actualContinuationEnumerator.Current, prognosedContinuationEnumerator.Current);
+              trainingRelErrorCalculators[t].Add(actualContinuationEnumerator.Current, prognosedContinuationEnumerator.Current);
+              trainingRSquaredCalculators[t].Add(actualContinuationEnumerator.Current, prognosedContinuationEnumerator.Current);
+              trainingNmseCalculators[t].Add(actualContinuationEnumerator.Current, prognosedContinuationEnumerator.Current);
+            }
+            if (actualContinuationEnumerator.MoveNext() | prognosedContinuationEnumerator.MoveNext())
+              throw new ArgumentException(
+                "Different number of elements in Actual continuation and prognosed continuation.");
           }
         }
@@ -312,8 +375,43 @@
             testTheilsUMeanCalculators[t].Add(startValue, actualContinuation.Select(x => mean), actualContinuation, prognosedContinuation);
             testTheilsUMovingAverageCalculators[t].Add(startValue, movingAverageContinuation, actualContinuation, prognosedContinuation);
+
+            var actualContinuationEnumerator = actualContinuation.GetEnumerator();
+            var prognosedContinuationEnumerator = prognosedContinuation.GetEnumerator();
+            while (actualContinuationEnumerator.MoveNext() & prognosedContinuationEnumerator.MoveNext()) {
+              testMseCalculators[t].Add(actualContinuationEnumerator.Current, prognosedContinuationEnumerator.Current);
+              testMaeCalculators[t].Add(actualContinuationEnumerator.Current, prognosedContinuationEnumerator.Current);
+              testRelErrorCalculators[t].Add(actualContinuationEnumerator.Current, prognosedContinuationEnumerator.Current);
+              testRSquaredCalculators[t].Add(actualContinuationEnumerator.Current, prognosedContinuationEnumerator.Current);
+              testNmseCalculators[t].Add(actualContinuationEnumerator.Current, prognosedContinuationEnumerator.Current);
+            }
+            if (actualContinuationEnumerator.MoveNext() | prognosedContinuationEnumerator.MoveNext())
+              throw new ArgumentException(
+                "Different number of elements in Actual continuation and prognosed continuation.");
           }
         }
       }
 
+
+      TrainingMeanSquaredError = trainingMseCalculators.Select(c => c.ErrorState == OnlineCalculatorError.None ? c.Value : double.PositiveInfinity)
+        .ToArray();
+      TestMeanSquaredError = testMseCalculators.Select(c => c.ErrorState == OnlineCalculatorError.None ? c.Value : double.PositiveInfinity)
+        .ToArray();
+      TrainingMeanAbsoluteError = trainingMaeCalculators.Select(c => c.ErrorState == OnlineCalculatorError.None ? c.Value : double.PositiveInfinity)
+        .ToArray();
+      TestMeanAbsoluteError = testMaeCalculators.Select(c => c.ErrorState == OnlineCalculatorError.None ? c.Value : double.PositiveInfinity)
+        .ToArray();
+      TrainingRelativeError = trainingRelErrorCalculators.Select(c => c.ErrorState == OnlineCalculatorError.None ? c.Value : double.PositiveInfinity)
+        .ToArray();
+      TestRelativeError = testRelErrorCalculators.Select(c => c.ErrorState == OnlineCalculatorError.None ? c.Value : double.PositiveInfinity)
+        .ToArray();
+      TrainingRSquared = trainingRSquaredCalculators.Select(c => c.ErrorState == OnlineCalculatorError.None ? c.Value : 0.0)
+        .ToArray();
+      TestRSquared = testRSquaredCalculators.Select(c => c.ErrorState == OnlineCalculatorError.None ? c.Value : 0.0)
+        .ToArray();
+      TrainingNormalizedMeanSquaredError = trainingNmseCalculators.Select(c => c.ErrorState == OnlineCalculatorError.None ? c.Value : double.PositiveInfinity)
+        .ToArray();
+      TestNormalizedMeanSquaredError = testNmseCalculators.Select(c => c.ErrorState == OnlineCalculatorError.None ? c.Value : double.PositiveInfinity)
+        .ToArray();
+
       TrainingDirectionalSymmetry = trainingDsCalculators.Select(c => c.ErrorState == OnlineCalculatorError.None ? c.Value : 0.0)
         .ToArray();
