Start() public method

public Start ( ) : double
return double
Exemplo n.º 1
0
        private static double GetSCGas(MarginalGas gas, double prtp, bool equityWeights)
        {
            var parameters = new Parameters();

            parameters.ReadDirectory(@"Data\Base");

            var m = new MarginalDamage3()
            {
                EmissionYear     = Timestep.FromYear(2010),
                Eta              = 1.0,
                Gas              = gas,
                Parameters       = parameters.GetBestGuess(),
                Prtp             = prtp,
                UseEquityWeights = equityWeights
            };

            double scc = m.Start();

            return(scc);
        }
Exemplo n.º 2
0
        private static Tuple <double, double> GetSCGasMonteCarlo(MarginalGas gas, double prtp, bool equityWeights, int monteCarloRuns)
        {
            var parameters = new Parameters();

            parameters.ReadDirectory(@"Data\Base");

            var fm = FundModel.GetModel();

            fm.Run(parameters.GetBestGuess());

            var rand = new jp.takel.PseudoRandom.MersenneTwister();

            var sccs = new System.Collections.Concurrent.ConcurrentBag <double>();

            Parallel.ForEach(parameters.GetRandom(rand, monteCarloRuns), pv =>
            {
                var m = new MarginalDamage3()
                {
                    EmissionYear     = Timestep.FromYear(2010),
                    Eta              = 1.0,
                    Gas              = gas,
                    Parameters       = pv,
                    Prtp             = prtp,
                    UseEquityWeights = equityWeights,
                    YearsToAggregate = 290
                };

                double scc = m.Start();

                sccs.Add(scc);
            });

            var stats = new DescriptiveStatistics(sccs);

            return(Tuple.Create(stats.Mean, Math.Sqrt(stats.Variance) / Math.Sqrt(stats.Count)));
        }
Exemplo n.º 3
0
        private static Tuple<double, double> GetSCGasMonteCarlo(MarginalGas gas, double prtp, bool equityWeights, int monteCarloRuns)
        {
            var parameters = new Parameters();
            parameters.ReadDirectory(@"Data\Base");

            var fm = FundModel.GetModel();
            fm.Run(parameters.GetBestGuess());

            var rand = new jp.takel.PseudoRandom.MersenneTwister();

            var sccs = new System.Collections.Concurrent.ConcurrentBag<double>();

            Parallel.ForEach(parameters.GetRandom(rand, monteCarloRuns), pv =>
            {
                var m = new MarginalDamage3()
                {
                    EmissionYear = Timestep.FromYear(2010),
                    Eta = 1.0,
                    Gas = gas,
                    Parameters = pv,
                    Prtp = prtp,
                    UseEquityWeights = equityWeights,
                    YearsToAggregate = 290
                };

                double scc = m.Start();

                sccs.Add(scc);
            });

            var stats = new DescriptiveStatistics(sccs);

            return Tuple.Create(stats.Mean, Math.Sqrt(stats.Variance) / Math.Sqrt(stats.Count));
        }
Exemplo n.º 4
0
        private static double GetSCGas(MarginalGas gas, double prtp, bool equityWeights)
        {
            var parameters = new Parameters();
            parameters.ReadDirectory(@"Data\Base");

            var m = new MarginalDamage3()
                {
                    EmissionYear = Timestep.FromYear(2010),
                    Eta = 1.0,
                    Gas = gas,
                    Parameters = parameters.GetBestGuess(),
                    Prtp = prtp,
                    UseEquityWeights = equityWeights
                };

            double scc = m.Start();

            return scc;
        }