Changeset - c9c22e41130d
[Not reviewed]
0 10 1
Tom Bannink - 8 years ago 2017-06-11 13:29:41
tombannink@gmail.com
Move degree sequence generation to separate file
11 files changed with 153 insertions and 260 deletions:
0 comments (0 inline, 0 general)
cpp/graph_powerlaw.hpp
Show inline comments
 
new file 100644
 
#pragma once
 
#include "graph.hpp"
 
#include "powerlaw.hpp"
 
#include <algorithm>
 
#include <iostream>
 

	
 
template <typename RNG>
 
void generatePowerlawGraph(int n, float tau, Graph& g, DegreeSequence& ds,
 
                           RNG& rng) {
 
    ds.resize(n);
 
    powerlaw_distribution degDist(tau, 1, n);
 

	
 
    // Generate a graph
 
    // might require multiple tries
 
    for (int i = 1;; ++i) {
 
        std::generate(ds.begin(), ds.end(),
 
                      [&degDist, &rng] { return degDist(rng); });
 
        // First make the sum even
 
        unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0);
 
        if (sum % 2) {
 
            continue;
 
            // Can we do this: ??
 
            ds.back()++;
 
        }
 

	
 
        if (g.createFromDegreeSequence(ds))
 
            break;
 

	
 
        // When 10 tries have not worked, output a warning
 
        if (i % 10 == 0) {
 
            std::cerr << "Warning: could not create graph from "
 
                         "degree sequence. Trying again...\n";
 
        }
 
    }
 
}
cpp/switchchain.cpp
Show inline comments
 
@@ -2,8 +2,8 @@
 
#include "exports.hpp"
 
#include "graph.hpp"
 
#include "graph_gcm.hpp"
 
#include "graph_powerlaw.hpp"
 
#include "graph_spectrum.hpp"
 
#include "powerlaw.hpp"
 
#include <algorithm>
 
#include <array>
 
#include <fstream>
 
@@ -65,37 +65,11 @@ int main(int argc, char* argv[]) {
 

	
 
    for (int numVertices = 500; numVertices <= 500; numVertices += 1000) {
 
        for (float tau : tauValues) {
 

	
 
            DegreeSequence ds(numVertices);
 
            powerlaw_distribution degDist(tau, 1, numVertices);
 
            //std::poisson_distribution<> degDist(12);
 

	
 
            // For a single n,tau take samples over several instances of
 
            // the degree distribution.
 
            // 500 samples seems to give reasonable results
 
            for (int degreeSample = 0; degreeSample < 5; ++degreeSample) {
 
                // Generate a graph
 
                // might require multiple tries
 
                for (int i = 1; ; ++i) {
 
                    std::generate(ds.begin(), ds.end(),
 
                                  [&degDist, &rng] { return degDist(rng); });
 
                    // First make the sum even
 
                    unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0);
 
                    if (sum % 2) {
 
                        continue;
 
                        // Can we do this: ??
 
                        ds.back()++;
 
                    }
 

	
 
                    if (g.createFromDegreeSequence(ds))
 
                        break;
 

	
 
                    // When 10 tries have not worked, output a warning
 
                    if (i % 10 == 0) {
 
                        std::cerr << "Warning: could not create graph from "
 
                                     "degree sequence. Trying again...\n";
 
                    }
 
                }
 
                DegreeSequence ds;
 
                generatePowerlawGraph(numVertices, tau, g, ds, rng);
 

	
 
#if 0
 
                //
cpp/switchchain.hpp
Show inline comments
 
#pragma once
 
#include "graph.hpp"
 
#include <iostream>
 
#include <random>
cpp/switchchain_dsp.cpp
Show inline comments
 
#include "exports.hpp"
 
#include "graph.hpp"
 
#include "powerlaw.hpp"
 
#include "graph_powerlaw.hpp"
 
#include "switchchain.hpp"
 
#include <algorithm>
 
#include <fstream>
 
@@ -9,7 +9,7 @@
 
#include <random>
 
#include <vector>
 

	
 
double getProperty(const DegreeSequence& ds) {
 
double getDSTN(const DegreeSequence& ds) {
 
    std::vector<std::vector<double>> vals(ds.size());
 
    for (auto& v : vals) {
 
        v.resize(ds.size(), 0);
 
@@ -38,56 +38,60 @@ double getProperty(const DegreeSequence& ds) {
 
    return result;
 
}
 

	
 
int main() {
 
    // Generate a random degree sequence
 
    std::mt19937 rng(std::random_device{}());
 

	
 
    // Goal:
 
    // Degrees follow a power-law distribution with some parameter tau
 
    // Expect:  #tri = const * n^{ something }
 
    // The goal is to find the 'something' by finding the number of triangles
 
    // for different values of n and tau
 
    float tauValues[] = {2.1f, 2.5f, 2.9f};
 
int main(int argc, char* argv[]) {
 
    // Simulation parameters
 
    const int numVerticesMin = 100;
 
    const int numVerticesMax = 1000;
 
    const int numVerticesStep = 100;
 

	
 
    float tauValues[] = {2.1f, 2.2f, 2.3f, 2.4f, 2.5f, 2.6f, 2.7f, 2.8f, 2.9f};
 

	
 
    const int totalDegreeSamples = 2000;
 

	
 
    auto getMixingTime = [](int n, float tau) {
 
        return int(30.0f * (50.0f - 30.0f * (tau - 2.0f)) * n);
 
    };
 
    constexpr int measurements = 50;
 
    constexpr int measureSkip = 200; // Take a sample every ... steps
 

	
 
    // Output file
 
    std::ofstream outfile;
 
    if (argc >= 2)
 
        outfile.open(argv[1]);
 
    else
 
        outfile.open("graphdata_dsp.m");
 
    if (!outfile.is_open()) {
 
        std::cout << "ERROR: Could not open output file.\n";
 
        return 1;
 
    }
 

	
 
    Graph g;
 
    // Output Mathematica-style comment to indicate file contents
 
    outfile << "(*\n";
 
    outfile << "n from " << numVerticesMin << " to " << numVerticesMax
 
            << " step " << numVerticesStep << std::endl;
 
    outfile << "tauValues: " << tauValues << std::endl;
 
    outfile << "degreeSamples: " << totalDegreeSamples << std::endl;
 
    outfile << "mixingTime: 30 * (50 - 30 (tau - 2)) n\n";
 
    outfile << "data:\n";
 
    outfile << "1: {n,tau}\n";
 
    outfile << "2: avgTriangles\n";
 
    outfile << "3: dstn\n";
 
    outfile << "*)" << std::endl;
 

	
 
    std::ofstream outfile("graphdata_dsp.m");
 
    outfile << '{';
 
    bool outputComma = false;
 

	
 
    for (int numVertices = 1000; numVertices <= 1000; numVertices += 1000) {
 
    std::mt19937 rng(std::random_device{}());
 
    Graph g;
 
    for (int numVertices = numVerticesMin; numVertices <= numVerticesMax;
 
         numVertices += numVerticesStep) {
 
        for (float tau : tauValues) {
 

	
 
            DegreeSequence ds(numVertices);
 
            powerlaw_distribution degDist(tau, 1, numVertices);
 
            //std::poisson_distribution<> degDist(12);
 

	
 
            // For a single n,tau take samples over several instances of
 
            // the degree distribution.
 
            // 500 samples seems to give reasonable results
 
            for (int degreeSample = 0; degreeSample < 2000; ++degreeSample) {
 
                // Generate a graph
 
                // might require multiple tries
 
                for (int i = 1; ; ++i) {
 
                    std::generate(ds.begin(), ds.end(),
 
                                  [&degDist, &rng] { return degDist(rng); });
 
                    // First make the sum even
 
                    unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0);
 
                    if (sum % 2) {
 
                        continue;
 
                        // Can we do this: ??
 
                        ds.back()++;
 
                    }
 

	
 
                    if (g.createFromDegreeSequence(ds))
 
                        break;
 

	
 
                    // When 10 tries have not worked, output a warning
 
                    if (i % 10 == 0) {
 
                        std::cerr << "Warning: could not create graph from "
 
                                     "degree sequence. Trying again...\n";
 
                    }
 
                }
 
            for (int degreeSample = 0; degreeSample < totalDegreeSamples;
 
                 ++degreeSample) {
 
                DegreeSequence ds;
 
                generatePowerlawGraph(numVertices, tau, g, ds, rng);
 

	
 
                SwitchChain chain;
 
                if (!chain.initialize(g)) {
 
@@ -98,12 +102,8 @@ int main() {
 
                std::cout << "Running n = " << numVertices << ", tau = " << tau
 
                          << ". \t" << std::flush;
 

	
 
                int mixingTime = 32*(32.0f - 10.0f*(tau - 2.0f)) * numVertices; //40000;
 
                constexpr int measurements = 50;
 
                constexpr int measureSkip =
 
                    200; // Take a sample every ... steps
 

	
 
                int movesDone = 0;
 
                int mixingTime = getMixingTime(numVertices,tau);
 

	
 
                long long trianglesTotal = 0;
 

	
 
@@ -117,24 +117,25 @@ int main() {
 
                            ++movesDone;
 
                    trianglesTotal += chain.g.countTriangles();
 
                }
 
                float avgTriangles =
 
                    float(trianglesTotal) / float(measurements);
 

	
 
                std::cout << movesDone << '/' << mixingTime + measurements * measureSkip
 
                std::cout << movesDone << '/'
 
                          << mixingTime + measurements * measureSkip
 
                          << " moves succeeded ("
 
                          << 100.0f * float(movesDone) /
 
                                 float(mixingTime + measurements * measureSkip)
 
                          << "%).";
 
                std::cout << std::flush;
 
                //std::cout << std::endl;
 

	
 
                if (outputComma)
 
                    outfile << ',' << '\n';
 
                outputComma = true;
 

	
 
                float avgTriangles =
 
                    float(trianglesTotal) / float(measurements);
 
                outfile << '{' << '{' << numVertices << ',' << tau << '}';
 
                outfile << ',' << avgTriangles;
 
                outfile << ',' << getProperty(ds) << '}' << std::flush;
 
                outfile << ',' << getDSTN(ds);
 
                outfile << '}' << std::flush;
 

	
 
                std::cout << std::endl;
 
            }
cpp/switchchain_exponent.cpp
Show inline comments
 
#include "exports.hpp"
 
#include "graph.hpp"
 
#include "powerlaw.hpp"
 
#include "graph_powerlaw.hpp"
 
#include "switchchain.hpp"
 
#include <algorithm>
 
#include <fstream>
 
@@ -28,37 +28,11 @@ int main() {
 

	
 
    for (int numVertices = 1000; numVertices <= 10000; numVertices += 1000) {
 
        for (float tau : tauValues) {
 

	
 
            DegreeSequence ds(numVertices);
 
            powerlaw_distribution degDist(tau, 1, numVertices);
 
            //std::poisson_distribution<> degDist(12);
 

	
 
            // For a single n,tau take samples over several instances of
 
            // the degree distribution.
 
            // 500 samples seems to give reasonable results
 
            for (int degreeSample = 0; degreeSample < 2000; ++degreeSample) {
 
                // Generate a graph
 
                // might require multiple tries
 
                for (int i = 1; ; ++i) {
 
                    std::generate(ds.begin(), ds.end(),
 
                                  [&degDist, &rng] { return degDist(rng); });
 
                    // First make the sum even
 
                    unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0);
 
                    if (sum % 2) {
 
                        continue;
 
                        // Can we do this: ??
 
                        ds.back()++;
 
                    }
 

	
 
                    if (g.createFromDegreeSequence(ds))
 
                        break;
 

	
 
                    // When 10 tries have not worked, output a warning
 
                    if (i % 10 == 0) {
 
                        std::cerr << "Warning: could not create graph from "
 
                                     "degree sequence. Trying again...\n";
 
                    }
 
                }
 
                DegreeSequence ds;
 
                generatePowerlawGraph(numVertices, tau, g, ds, rng);
 

	
 
                SwitchChain chain;
 
                if (!chain.initialize(g)) {
cpp/switchchain_initialtris.cpp
Show inline comments
 
#include "exports.hpp"
 
#include "graph.hpp"
 
#include "graph_gcm.hpp"
 
#include "powerlaw.hpp"
 
#include "graph_powerlaw.hpp"
 
#include "switchchain.hpp"
 
#include <algorithm>
 
#include <fstream>
 
@@ -29,37 +29,11 @@ int main() {
 

	
 
    for (int numVertices = 200; numVertices <= 2000; numVertices += 400) {
 
        for (float tau : tauValues) {
 

	
 
            DegreeSequence ds(numVertices);
 
            powerlaw_distribution degDist(tau, 1, numVertices);
 
            //std::poisson_distribution<> degDist(12);
 

	
 
            // For a single n,tau take samples over several instances of
 
            // the degree distribution.
 
            // 500 samples seems to give reasonable results
 
            for (int degreeSample = 0; degreeSample < 200; ++degreeSample) {
 
                // Generate a graph
 
                // might require multiple tries
 
                for (int i = 1; ; ++i) {
 
                    std::generate(ds.begin(), ds.end(),
 
                                  [&degDist, &rng] { return degDist(rng); });
 
                    // First make the sum even
 
                    unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0);
 
                    if (sum % 2) {
 
                        continue;
 
                        // Can we do this: ??
 
                        ds.back()++;
 
                    }
 

	
 
                    if (g.createFromDegreeSequence(ds))
 
                        break;
 

	
 
                    // When 10 tries have not worked, output a warning
 
                    if (i % 10 == 0) {
 
                        std::cerr << "Warning: could not create graph from "
 
                                     "degree sequence. Trying again...\n";
 
                    }
 
                }
 
                DegreeSequence ds;
 
                generatePowerlawGraph(numVertices, tau, g, ds, rng);
 

	
 
                std::cout << "Running n = " << numVertices << ", tau = " << tau
 
                          << "." << std::flush;
cpp/switchchain_mixingtime.cpp
Show inline comments
 
#include "exports.hpp"
 
#include "graph.hpp"
 
#include "powerlaw.hpp"
 
#include "graph_powerlaw.hpp"
 
#include "switchchain.hpp"
 
#include <algorithm>
 
#include <array>
 
@@ -43,37 +43,12 @@ int main(int argc, char* argv[]) {
 

	
 
    for (int numVertices = 100; numVertices <= 1000; numVertices += 100) {
 
        for (float tau : tauValues) {
 

	
 
            DegreeSequence ds(numVertices);
 
            powerlaw_distribution degDist(tau, 1, numVertices);
 
            //std::poisson_distribution<> degDist(12);
 

	
 
            // For a single n,tau take samples over several instances of
 
            // the degree distribution.
 
            // 500 samples seems to give reasonable results
 
            for (int degreeSample = 0; degreeSample < 200; ++degreeSample) {
 
                // Generate a graph
 
                // might require multiple tries
 
                for (int i = 1; ; ++i) {
 
                    std::generate(ds.begin(), ds.end(),
 
                                  [&degDist, &rng] { return degDist(rng); });
 
                    // First make the sum even
 
                    unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0);
 
                    if (sum % 2) {
 
                        continue;
 
                        // Can we do this: ??
 
                        ds.back()++;
 
                    }
 
                DegreeSequence ds;
 
                generatePowerlawGraph(numVertices, tau, g, ds, rng);
 

	
 
                    if (g.createFromDegreeSequence(ds))
 
                        break;
 

	
 
                    // When 10 tries have not worked, output a warning
 
                    if (i % 10 == 0) {
 
                        std::cerr << "Warning: could not create graph from "
 
                                     "degree sequence. Trying again...\n";
 
                    }
 
                }
 

	
 
                // Multiple runs from the same degree sequence
 
                for (int i = 0; i < 5; ++i) {
cpp/switchchain_spectrum.cpp
Show inline comments
 
@@ -3,7 +3,7 @@
 
#include "graph.hpp"
 
#include "graph_gcm.hpp"
 
#include "graph_spectrum.hpp"
 
#include "powerlaw.hpp"
 
#include "graph_powerlaw.hpp"
 
#include <algorithm>
 
#include <array>
 
#include <fstream>
 
@@ -42,37 +42,11 @@ int main(int argc, char* argv[]) {
 

	
 
    for (int numVertices = 500; numVertices <= 500; numVertices += 1000) {
 
        for (float tau : tauValues) {
 

	
 
            DegreeSequence ds(numVertices);
 
            powerlaw_distribution degDist(tau, 1, numVertices);
 
            //std::poisson_distribution<> degDist(12);
 

	
 
            // For a single n,tau take samples over several instances of
 
            // the degree distribution.
 
            // 500 samples seems to give reasonable results
 
            for (int degreeSample = 0; degreeSample < 5; ++degreeSample) {
 
                // Generate a graph
 
                // might require multiple tries
 
                for (int i = 1; ; ++i) {
 
                    std::generate(ds.begin(), ds.end(),
 
                                  [&degDist, &rng] { return degDist(rng); });
 
                    // First make the sum even
 
                    unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0);
 
                    if (sum % 2) {
 
                        continue;
 
                        // Can we do this: ??
 
                        ds.back()++;
 
                    }
 

	
 
                    if (g.createFromDegreeSequence(ds))
 
                        break;
 

	
 
                    // When 10 tries have not worked, output a warning
 
                    if (i % 10 == 0) {
 
                        std::cerr << "Warning: could not create graph from "
 
                                     "degree sequence. Trying again...\n";
 
                    }
 
                }
 
                DegreeSequence ds;
 
                generatePowerlawGraph(numVertices, tau, g, ds, rng);
 

	
 
                SwitchChain chain;
 
                if (!chain.initialize(g)) {
cpp/switchchain_successrates.cpp
Show inline comments
 
#include "exports.hpp"
 
#include "graph.hpp"
 
#include "powerlaw.hpp"
 
#include "graph_powerlaw.hpp"
 
#include "switchchain.hpp"
 
#include <algorithm>
 
#include <array>
 
@@ -41,37 +41,11 @@ int main(int argc, char* argv[]) {
 

	
 
    for (int numVertices = 1000; numVertices <= 1000; numVertices += 1000) {
 
        for (float tau : tauValues) {
 

	
 
            DegreeSequence ds(numVertices);
 
            powerlaw_distribution degDist(tau, 1, numVertices);
 
            //std::poisson_distribution<> degDist(12);
 

	
 
            // For a single n,tau take samples over several instances of
 
            // the degree distribution.
 
            // 500 samples seems to give reasonable results
 
            for (int degreeSample = 0; degreeSample < 2000; ++degreeSample) {
 
                // Generate a graph
 
                // might require multiple tries
 
                for (int i = 1; ; ++i) {
 
                    std::generate(ds.begin(), ds.end(),
 
                                  [&degDist, &rng] { return degDist(rng); });
 
                    // First make the sum even
 
                    unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0);
 
                    if (sum % 2) {
 
                        continue;
 
                        // Can we do this: ??
 
                        ds.back()++;
 
                    }
 

	
 
                    if (g.createFromDegreeSequence(ds))
 
                        break;
 

	
 
                    // When 10 tries have not worked, output a warning
 
                    if (i % 10 == 0) {
 
                        std::cerr << "Warning: could not create graph from "
 
                                     "degree sequence. Trying again...\n";
 
                    }
 
                }
 
                DegreeSequence ds;
 
                generatePowerlawGraph(numVertices, tau, g, ds, rng);
 

	
 
                SwitchChain chain;
 
                if (!chain.initialize(g)) {
cpp/switchchain_timeevol.cpp
Show inline comments
 
#include "exports.hpp"
 
#include "graph.hpp"
 
#include "powerlaw.hpp"
 
#include "graph_powerlaw.hpp"
 
#include "switchchain.hpp"
 
#include <algorithm>
 
#include <array>
 
@@ -41,37 +41,11 @@ int main(int argc, char* argv[]) {
 

	
 
    for (int numVertices = 1000; numVertices <= 1000; numVertices += 1000) {
 
        for (float tau : tauValues) {
 

	
 
            DegreeSequence ds(numVertices);
 
            powerlaw_distribution degDist(tau, 1, numVertices);
 
            //std::poisson_distribution<> degDist(12);
 

	
 
            // For a single n,tau take samples over several instances of
 
            // the degree distribution.
 
            // 500 samples seems to give reasonable results
 
            for (int degreeSample = 0; degreeSample < 5; ++degreeSample) {
 
                // Generate a graph
 
                // might require multiple tries
 
                for (int i = 1; ; ++i) {
 
                    std::generate(ds.begin(), ds.end(),
 
                                  [&degDist, &rng] { return degDist(rng); });
 
                    // First make the sum even
 
                    unsigned int sum = std::accumulate(ds.begin(), ds.end(), 0);
 
                    if (sum % 2) {
 
                        continue;
 
                        // Can we do this: ??
 
                        ds.back()++;
 
                    }
 

	
 
                    if (g.createFromDegreeSequence(ds))
 
                        break;
 

	
 
                    // When 10 tries have not worked, output a warning
 
                    if (i % 10 == 0) {
 
                        std::cerr << "Warning: could not create graph from "
 
                                     "degree sequence. Trying again...\n";
 
                    }
 
                }
 
                DegreeSequence ds;
 
                generatePowerlawGraph(numVertices, tau, g, ds, rng);
 

	
 
                // Multiple runs from the same degree sequence
 
                for (int i = 0; i < 5; ++i) {
triangle_etmt_plots.m
Show inline comments
 
@@ -3,7 +3,7 @@
 
Needs["ErrorBarPlots`"]
 

	
 

	
 
gsraw=Import[NotebookDirectory[]<>"data/graphdata_etmt_partial.m"];
 
gsraw=Import[NotebookDirectory[]<>"data/graphdata_etmt.m"];
 
(* gsraw=SortBy[gsraw,{#[[1,1]]&,#[[1,2]]&}]; (* Sort by n and then by tau. The {} forces a *stable* sort because otherwise Mathematica sorts also on triangle count and other things. *) *)
 

	
 

	
 
@@ -14,17 +14,34 @@ gdata=GatherBy[gsraw,{#[[1,2]]&,#[[1,1]]&}];
 
1: {n,tau}
 
2: etmt
 
*)
 
tauvalues=gdata[[All,1,1,1,2]];
 
nlabels=Map["n = "<>ToString[#]&,gdata[[1,All,1,1,1]]];
 
taulabels=Map["\[Tau] = "<>ToString[#]&,gdata[[All,1,1,1,2]]];
 

	
 

	
 
etmtMean=Map[Mean[N[#[[All,2]]]]&,gdata,{2}];
 
etmtSD=Map[StandardDeviation[N[#[[All,2]]]]&,gdata,{2}];
 
etmtQuantile=Map[Quantile[#[[All,2]],99/100]&,gdata,{2}];
 

	
 

	
 
histograms=Map[Histogram[#[[All,2]]]&,gdata,{2}];
 

	
 

	
 
histogramsWithLine=Map[Histogram[#[[All,2]],Epilog->Line[{{Mean[N[#[[All,2]]]]+StandardDeviation[N[#[[All,2]]]],0},{Mean[N[#[[All,2]]]]+StandardDeviation[N[#[[All,2]]]],500}}]]&,gdata,{2}];
 
histogramsWithLines=MapIndexed[
 
Histogram[#[[All,2]],PlotRange->All,
 
Epilog->Line[{
 
{{etmtMean[[#2/.List->Sequence]],0},
 
{etmtMean[[#2/.List->Sequence]],500}},
 
{{etmtMean[[#2/.List->Sequence]]+etmtSD[[#2/.List->Sequence]],0},
 
{etmtMean[[#2/.List->Sequence]]+etmtSD[[#2/.List->Sequence]],500}},
 
{{etmtQuantile[[#2/.List->Sequence]],0},
 
{etmtQuantile[[#2/.List->Sequence]],500}}
 
}]
 
]
 
&,gdata,{2}];
 

	
 

	
 
TableForm[histograms,TableHeadings->{taulabels,nlabels}]
 
TableForm[histogramsWithLines,TableHeadings->{taulabels,nlabels}]
 

	
 

	
 
gdataSwitched=Transpose[gdata];
 
@@ -39,17 +56,37 @@ Export[NotebookDirectory[]<>"plots/ETMTdistribution.pdf",combiHistograms[[9]]]
 

	
 

	
 
mixingTimesBars=Map[{{#[[1,1,1]],Mean[#[[All,2]]]},ErrorBar[StandardDeviation[#[[All,2]]]]}&,gdata,{2}];
 
mixingTimesQuantiles=Map[{#[[1,1,1]],Quantile[#[[All,2]],99/100]}&,gdata,{2}];
 

	
 

	
 
ErrorListPlot[mixingTimesBars[[{1,2,3,5,8}]],Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","ETMT"},PlotLegends->taulabels]
 
plot1=ErrorListPlot[mixingTimesBars[[{1,2,3,5,8}]],Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","ETMT"},PlotLegends->taulabels];
 
plot2=ListPlot[mixingTimesQuantiles[[{1,2,3,5,8}]],Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","ETMT"},PlotLegends->taulabels];
 
Show[plot2,plot1]
 

	
 

	
 
mixingTimesDivN=Map[{#[[1,1]],#[[1,2]]/(#[[1,1]])}&,mixingTimesBars,{2}];
 
mixingTimesDivNlogN=Map[{#[[1,1]],#[[1,2]]/(#[[1,1]]*Log[#[[1,1]]])}&,mixingTimesBars,{2}];
 
etmtQuantileDivN=Map[{#[[1]],#[[2]]/(#[[1]])}&,mixingTimesQuantiles,{2}];
 
etmtQuantileDivNlogN=Map[{#[[1]],#[[2]]/(#[[1]]*Log[#[[1]]])}&,mixingTimesQuantiles,{2}];
 

	
 

	
 
plotN=ListPlot[mixingTimesDivN,Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","\[LeftAngleBracket]ETMT\[RightAngleBracket]/n"},PlotLegends->taulabels,ImageSize->300]
 
plotNlogN=ListPlot[mixingTimesDivNlogN,Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","\[LeftAngleBracket]ETMT\[RightAngleBracket]/(n log n)"},PlotLegends->taulabels,ImageSize->300]
 
plotQuantileN=ListPlot[etmtQuantileDivN,Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","q(ETMT,99%)/n"},PlotLegends->taulabels,ImageSize->300]
 
plotQuantileNlogN=ListPlot[etmtQuantileDivNlogN,Joined->True,PlotMarkers->Automatic,Frame->True,FrameLabel->{"n","q(ETMT,99%)/(n log n)"},PlotLegends->taulabels,ImageSize->300]
 

	
 

	
 
Export[NotebookDirectory[]<>"plots/ETMTdivN.pdf",plotN]
 

	
 

	
 
etmtQuantileDivNmax=Map[Max[#[[All,2]]]&,etmtQuantileDivN];
 
etmtQuantileDivNmax=Transpose[{tauvalues,etmtQuantileDivNmax}];
 

	
 
mixingTimesDivNmax=Map[Max[#[[All,2]]]&,mixingTimesDivN];
 
mixingTimesDivNmax=Transpose[{tauvalues,mixingTimesDivNmax}];
 

	
 

	
 
Show[
 
Plot[{(50-30(tau-2)),32-26(tau-2)},{tau,2,3},AxesOrigin->{2,0}],
 
ListPlot[{etmtQuantileDivNmax,mixingTimesDivNmax},Joined->True,PlotMarkers->Automatic,PlotRange->{{2,3},All}]
 
]
0 comments (0 inline, 0 general)