GithubHelp home page GithubHelp logo

mcon's People

Contributors

bredelings avatar

Watchers

 avatar

mcon's Issues

Comment lines?

For TSV files, it seems common enough to add comment lines starting with # and perhaps [.
MCON doesn't allow these.
We can make a "comment": <string> field in the header.
Should there be any convention for how this is structured?

How to handle quoting when exporting to TSV?

We can always separate JSON values by a tab character, since JSON never contains unescaped tabs. Lets call such a format "TSJ".

However, this isn't necessarily valid TSV -- a JSON string would need to be mangled by TSV-quoting in order to be valid TSV.

How should we handle this?

Data types and special summaries

MCMC diagnostics for some objects may depend on what the object means. Similarly, it may be possible to perform visualizations for objects of a certain type.

Examples:

  • suppose we approximate a function on [0,1] using a piecewise-linear form with an unknown number of pieces. We should be able to generate posterior credible intervals for {f(x)| x in [0,1]}.
  • the JSON value for variable N might describe a population size history through time for a coalescent model.
  • the JSON value could describe a discrete distribution with a weighted list of values. If the number of values is constant, we want to sort by both values and weight by the values. If the number of values is not constant, we can still compute the median, variance, etc.

In order to represent more complex objects than arrays and objects, we introduce a special notation.

If a field value contains the keys @$record and @$value then we consider it to represent a record type.
The value for the key @$value must be an object, and its keys represent the fields for that object.

Thus if we have::

    "rates": {"@$record": "DiscreteDistribution",
              "@$value":  {"weights": [0.2, 0.3, 0.5],
                           "values": [0.2, 1.1, 3.4] } }

Then we consider this to represent a record shape DiscreteDistribution with fields weights and values.
In order to multiple record shapes to be part of the same data type, we allow an additional key @$type.
In languages like C++ or Java, the record shape would be considered a type.
However, in languages with algebraic data types (such as Rust), a data type can include multiple record shapes.

The purpose of this feature is to indicate the meaning of the values in each Monte Carlo sample so that appropriate summary measures can be computed.

JSON for Infinity, -Infinity, NaN

JSON doesn't allow for Inf, -Inf, or NaN.

Python's implementation of JSON allows reading (Infinity,-Infinity,NaN) which is how javascript represents these values but is not valid according to the JSON spec.

Boost.JSON writes (1e99999, -1e99999, null) by default, but allows writing (Infinity,-Infinity,NaN). It can read both versions.

Some packages (i.e. nlohmann:json) write null for these values.

See boostorg/json#397

Specifying meta-data about the sample, such as generation number, chain number, particle number, etc. etc.

Q1. How should we flag keys like generation number and related indices in the header field?

For MCMC, the "iteration" or "generation" field is different than other fields. It is always increasing, and is meta-data about the sample, not part of the sample itself. Currently we can arrange to place that field first when converting to TSV, but it is otherwise not identified in the header.

If there are multiple MCMC chains, we could combine the samples by marking the sample with which chain it comes from.

For SMC, the "generation" field might indicate which distribution the sample is from, and we'd also need a "particle" number to distinguish samples.

Q2. We could have additional meta-information that is continuous. For example, with multiple heated chains, we could annotate each chain with a temperature.

Modify MCMC software to write MCON

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.