Examples of Gaussian


Examples of com.oltpbenchmark.util.RandomDistribution.Gaussian

                AuctionMarkConstants.ITEM_INITIAL_PRICE_MIN,
                AuctionMarkConstants.ITEM_INITIAL_PRICE_MAX,
                AuctionMarkConstants.ITEM_INITIAL_PRICE_SIGMA);
       
        // Random time difference in a second scale
        this.randomTimeDiff = new Gaussian(this.rng,
                AuctionMarkConstants.ITEM_PRESERVE_DAYS * 24 * 60 * 60 * -1,
                AuctionMarkConstants.ITEM_DURATION_DAYS_MAX * 24 * 60 * 60);
       
        this.randomDuration = new Gaussian(this.rng,
                AuctionMarkConstants.ITEM_DURATION_DAYS_MIN,
                AuctionMarkConstants.ITEM_DURATION_DAYS_MAX);
       
        this.randomPurchaseDuration = new Zipf(this.rng,
                AuctionMarkConstants.ITEM_PURCHASE_DURATION_DAYS_MIN,
View Full Code Here

Examples of edu.brown.rand.RandomDistribution.Gaussian

            this.acctsTable = CatalogUtil.getVoltTable(catalogContext.getTableByName(SmallBankConstants.TABLENAME_ACCOUNTS));
            this.savingsTable = CatalogUtil.getVoltTable(catalogContext.getTableByName(SmallBankConstants.TABLENAME_SAVINGS));
            this.checkingTable = CatalogUtil.getVoltTable(catalogContext.getTableByName(SmallBankConstants.TABLENAME_CHECKING));
            this.start = start;
            this.stop = stop;
            this.randBalance = new Gaussian(this.rand,
                                            SmallBankConstants.MIN_BALANCE,
                                            SmallBankConstants.MAX_BALANCE);
        }
View Full Code Here

Examples of edu.brown.rand.RandomDistribution.Gaussian

            Collection<String> all_airlines = profile.getAirlineCodes();
            Histogram<String> histogram = new ObjectHistogram<String>();
            histogram.put(all_airlines);
           
            // Embed a Gaussian distribution
            Gaussian gauss_rng = new Gaussian(rng, 0, all_airlines.size());
            this.airlines = new FlatHistogram<String>(gauss_rng, histogram);
           
            // Flights Per Airport
            histogram = profile.getHistogram(SEATSConstants.HISTOGRAM_FLIGHTS_PER_AIRPORT)
            this.airports = new FlatHistogram<String>(rng, histogram);
            for (String airport_code : histogram.values()) {
                histogram = profile.getFightsPerAirportHistogram(airport_code);
                assert(histogram != null) : "Unexpected departure airport code '" + airport_code + "'";
                this.flights_per_airport.put(airport_code, new FlatHistogram<String>(rng, histogram));
            } // FOR
           
            // Flights Per Departure Time
            histogram = profile.getHistogram(SEATSConstants.HISTOGRAM_FLIGHTS_PER_DEPART_TIMES)
            this.flight_times = new FlatHistogram<String>(rng, histogram);
           
            // Figure out how many flights that we want for each day
            this.today = new TimestampType();
           
            // Sometimes there are more flights per day, and sometimes there are fewer
            int flightsPerDayMin = (int)Math.round(SEATSConstants.FLIGHTS_PER_DAY_MIN * getScaleFactor());
            int flightsPerDayMax = (int)Math.round(SEATSConstants.FLIGHTS_PER_DAY_MAX * getScaleFactor());
            Gaussian gaussian = new Gaussian(rng, flightsPerDayMin, flightsPerDayMax);
           
            this.total = 0;
            boolean first = true;
            for (long t = this.today.getTime() - (days_past * SEATSConstants.MICROSECONDS_PER_DAY);
                 t < this.today.getTime(); t += SEATSConstants.MICROSECONDS_PER_DAY) {
                TimestampType timestamp = new TimestampType(t);
                if (first) {
                    this.start_date = timestamp;
                    first = false;
                }
                int num_flights = gaussian.nextInt();
                this.flights_per_day.put(timestamp, num_flights);
                this.total += num_flights;
            } // FOR
            if (this.start_date == null) this.start_date = this.today;
            profile.setFlightStartDate(this.start_date);
           
            // This is for upcoming flights that we want to be able to schedule
            // new reservations for in the benchmark
            profile.setFlightUpcomingDate(this.today);
            for (long t = this.today.getTime(), last_date = this.today.getTime() + (days_future * SEATSConstants.MICROSECONDS_PER_DAY);
                 t <= last_date; t += SEATSConstants.MICROSECONDS_PER_DAY) {
                TimestampType timestamp = new TimestampType(t);
                int num_flights = gaussian.nextInt();
                this.flights_per_day.put(timestamp, num_flights);
                this.total += num_flights;
            } // FOR
           
            // Update profile
View Full Code Here

Examples of edu.brown.rand.RandomDistribution.Gaussian

        this.randomInitialPrice = new Zipf(this.rng, AuctionMarkConstants.ITEM_MIN_INITIAL_PRICE,
                                                     AuctionMarkConstants.ITEM_MAX_INITIAL_PRICE, 1.001);
       
        // Random time difference in a second scale
        this.randomTimeDiff = new Gaussian(this.rng, -AuctionMarkConstants.ITEM_PRESERVE_DAYS * 24 * 60 * 60,
                                                     AuctionMarkConstants.ITEM_MAX_DURATION_DAYS * 24 * 60 * 60);
        this.randomDuration = new Gaussian(this.rng, 1, AuctionMarkConstants.ITEM_MAX_DURATION_DAYS);
        this.randomPurchaseDuration = new Zipf(this.rng, 0, AuctionMarkConstants.ITEM_MAX_PURCHASE_DURATION_DAYS, 1.001);
        this.randomNumImages = new Zipf(this.rng,   AuctionMarkConstants.ITEM_MIN_IMAGES,
                                                    AuctionMarkConstants.ITEM_MAX_IMAGES, 1.001);
        this.randomNumAttributes = new Zipf(this.rng, AuctionMarkConstants.ITEM_MIN_GLOBAL_ATTRS,
                                                    AuctionMarkConstants.ITEM_MAX_GLOBAL_ATTRS, 1.001);
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Gaussian

                                                    currentLearning);

        final int currentNeighbourhood = neighbourhoodSize.value(numCalls);
        // The farther away the neighbour is from the winning neuron, the
        // smaller the learning rate will become.
        final Gaussian neighbourhoodDecay
            = new Gaussian(currentLearning,
                           0,
                           1d / currentNeighbourhood);

        if (currentNeighbourhood > 0) {
            // Initial set of neurons only contains the winning neuron.
            Collection<Neuron> neighbours = new HashSet<Neuron>();
            neighbours.add(best);
            // Winning neuron must be excluded from the neighbours.
            final HashSet<Neuron> exclude = new HashSet<Neuron>();
            exclude.add(best);

            int radius = 1;
            do {
                // Retrieve immediate neighbours of the current set of neurons.
                neighbours = net.getNeighbours(neighbours, exclude);

                // Update all the neighbours.
                for (Neuron n : neighbours) {
                    updateNeighbouringNeuron(n, features, neighbourhoodDecay.value(radius));
                }

                // Add the neighbours to the exclude list so that they will
                // not be update more than once per training step.
                exclude.addAll(neighbours);
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Gaussian

    @Test
    public void testNormalDistributionWithLargeSigma() {
        final double sigma = 1000;
        final double mean = 0;
        final double factor = 1 / (sigma * FastMath.sqrt(2 * FastMath.PI));
        final UnivariateFunction normal = new Gaussian(factor, mean, sigma);

        final double tol = 1e-2;
        final IterativeLegendreGaussIntegrator integrator =
            new IterativeLegendreGaussIntegrator(5, tol, tol);

View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Gaussian

                                                    currentLearning);

        final int currentNeighbourhood = neighbourhoodSize.value(numCalls);
        // The farther away the neighbour is from the winning neuron, the
        // smaller the learning rate will become.
        final Gaussian neighbourhoodDecay
            = new Gaussian(currentLearning,
                           0,
                           1d / currentNeighbourhood);

        if (currentNeighbourhood > 0) {
            // Initial set of neurons only contains the winning neuron.
            Collection<Neuron> neighbours = new HashSet<Neuron>();
            neighbours.add(best);
            // Winning neuron must be excluded from the neighbours.
            final HashSet<Neuron> exclude = new HashSet<Neuron>();
            exclude.add(best);

            int radius = 1;
            do {
                // Retrieve immediate neighbours of the current set of neurons.
                neighbours = net.getNeighbours(neighbours, exclude);

                // Update all the neighbours.
                for (Neuron n : neighbours) {
                    updateNeighbouringNeuron(n, features, neighbourhoodDecay.value(radius));
                }

                // Add the neighbours to the exclude list so that they will
                // not be update more than once per training step.
                exclude.addAll(neighbours);
View Full Code Here

Examples of org.apache.commons.math3.analysis.function.Gaussian

    @Test
    public void testGaussian() {
        FiniteDifferencesDifferentiator differentiator =
                new FiniteDifferencesDifferentiator(9, 0.02);
        UnivariateDifferentiableFunction gaussian = new Gaussian(1.0, 2.0);
        UnivariateDifferentiableFunction f =
                differentiator.differentiate(gaussian);
        double[] expectedError = new double[] {
            6.939e-18, 1.284e-15, 2.477e-13, 1.168e-11, 2.840e-9, 7.971e-8
        };
       double[] maxError = new double[expectedError.length];
        for (double x = -10; x < 10; x += 0.1) {
            DerivativeStructure dsX  = new DerivativeStructure(1, maxError.length - 1, 0, x);
            DerivativeStructure yRef = gaussian.value(dsX);
            DerivativeStructure y    = f.value(dsX);
            Assert.assertEquals(f.value(dsX.getValue()), f.value(dsX).getValue(), 1.0e-15);
            for (int order = 0; order <= yRef.getOrder(); ++order) {
                maxError[order] = FastMath.max(maxError[order],
                                        FastMath.abs(yRef.getPartialDerivative(order) -
View Full Code Here

Examples of org.cspoker.ai.bots.util.Gaussian

          throw new IllegalStateException("Rounding error is too big.");
        }
        EVVar = 0;
      }
     
      this.EVGaussian = new Gaussian(EV,EVVar);
    }
View Full Code Here

Examples of org.cspoker.ai.bots.util.Gaussian

     
      ImmutableList<INode> children = node.getChildren();
      Gaussian[] gaussians = new Gaussian[children.size()];
      for (int i = 0; i < children.size(); i++) {
        INode child = children.get(i);
        gaussians[i] = new Gaussian(child.getEV(),child.getEVVar());
      }
      EVGaussian = Gaussian.maxOf(gaussians);
    }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.