Free cookie consent management tool by TermsFeed Policy Generator

Changeset 5377


Ignore:
Timestamp:
01/25/11 18:09:47 (14 years ago)
Author:
mkommend
Message:

ticket #1256 - Changed SymbolicSimplifier to handle lagged variables correctly.

Location:
trunk/sources
Files:
2 edited

Legend:

Unmodified
Added
Removed
  • trunk/sources/HeuristicLab.Problems.DataAnalysis.Regression/3.3/Symbolic/SymbolicRegressionSolution.cs

    r5373 r5377  
    9898      var laggedTreeNode = node as ILaggedTreeNode;
    9999      if (laggedTreeNode != null) lag += laggedTreeNode.Lag;
    100       if (node.Symbol is Derivative) lag -= 4;
     100      else if (node.Symbol is Derivative) lag -= 4;
    101101
    102102      int subtreeLag = 0;
  • trunk/sources/HeuristicLab.Problems.DataAnalysis/3.3/Symbolic/SymbolicSimplifier.cs

    r5108 r5377  
    354354      while (sum.SubTrees.Count > 0) sum.RemoveSubTree(0);
    355355      var groupedVarNodes = from node in subtrees.OfType<VariableTreeNode>()
    356                             group node by node.VariableName into g
     356                            let lag = (node is LaggedVariableTreeNode) ? ((LaggedVariableTreeNode)node).Lag : 0
     357                            group node by node.VariableName + lag into g
    357358                            select g;
     359
    358360      var unchangedSubTrees = subtrees.Where(t => !(t is VariableTreeNode));
    359361
     
    429431      while (prod.SubTrees.Count > 0) prod.RemoveSubTree(0);
    430432      var groupedVarNodes = from node in subtrees.OfType<VariableTreeNode>()
    431                             group node by node.VariableName into g
     433                            let lag = (node is LaggedVariableTreeNode) ? ((LaggedVariableTreeNode)node).Lag : 0
     434                            group node by node.VariableName + lag into g
    432435                            orderby g.Count()
    433436                            select g;
Note: See TracChangeset for help on using the changeset viewer.