Free cookie consent management tool by TermsFeed Policy Generator

Ignore:
Timestamp:
11/19/21 16:07:45 (3 years ago)
Author:
mkommend
Message:

#2521: Merged trunk changes into branch.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • branches/2521_ProblemRefactoring/HeuristicLab.Problems.Instances.DataAnalysis/3.3/Regression/Friedman/FriedmanRandomFunction.cs

    r17226 r18086  
    8686      var y = GenerateRandomFunction(random, data);
    8787
    88       var targetSigma = y.StandardDeviation();
    89       var noisePrng = new NormalDistributedRandom(random, 0, targetSigma * Math.Sqrt(noiseRatio / (1.0 - noiseRatio)));
     88      //var targetSigma = y.StandardDeviation();
     89      //var noisePrng = new NormalDistributedRandom(random, 0, targetSigma * Math.Sqrt(noiseRatio / (1.0 - noiseRatio)));
    9090
    91       data.Add(y.Select(t => t + noisePrng.NextDouble()).ToList());
     91      //data.Add(y.Select(t => t + noisePrng.NextDouble()).ToList());
     92
     93      data.Add(ValueGenerator.GenerateNoise(y, random, noiseRatio));
    9294
    9395      return data;
     
    121123      // mu is generated from same distribution as x
    122124      double[] mu = Enumerable.Range(0, nl).Select(_ => random.NextDouble() * 2 - 1).ToArray();
    123       double[,] v = new double[nl, nl];
    124125      var condNum = 4.0 / 0.01; // as given in the paper for max and min eigen values
    125126
     
    128129      alglib.math.rndobject = new System.Random(random.Next());
    129130
    130       alglib.matgen.spdmatrixrndcond(nl, condNum, ref v);
     131      alglib.spdmatrixrndcond(nl, condNum, out var v);
    131132      // restore
    132133      alglib.math.rndobject = curRand;
     
    137138      for (int i = 0; i < nRows; i++) {
    138139        for (int j = 0; j < nl; j++) z[j] = xs[j][i] - mu[j];
    139         alglib.ablas.rmatrixmv(nl, nl, v, 0, 0, 0, z, 0, ref y, 0);
     140        alglib.rmatrixmv(nl, nl, v, 0, 0, 0, z, 0, ref y, 0);
    140141
    141142        // dot prod
Note: See TracChangeset for help on using the changeset viewer.