# Create Data with Identical Statistics

Creates data with identical statistics (metamers) using an iterative algorithm proposed by Matejka & Fitzmaurice (2017) .

Implements the algorithm proposed by Matejka & Fitzmaurice (2017) to create metamers (datasets with identical statistical properties but very different graphs).

In colour theory, metamers are colours that have very different wavelength distribution but are perceived as equal by out visual system. This happens because out eyes essentially summarise a continuous distribution of wavelength by just 3 numbers: the amount that each type of cone cell is exited. Colour metamerism is how artists can reproduce so many colours with a few pigments, or how PC monitors use only 3 lights to show colourful pictures.

(from the excellent Color: From Hexcodes to Eyeballs by Jamie Wong)

Statistical transformations such as mean, standard deviation and correlation behave very similarly in that they summarise data with just a few numbers for the benefit of our limited cognitive capacity. Thus, statistical metamers are sets of data that share some statistical properties.

## Installation

You can install the development version of metamer with:

## Example

You can construct metamers from a starting dataset and a vector of statistical properties to remain constant (by default, up to 2 significant figures).

We found 12782 metamers. Let's see the final one, with the starting dataset as background.

We can check that the statistical properties have been preserved up to 2 significant figures:

However, a semi random cloud of points is not that interesting, so we can specify a minimizing function so that the result is similar to another dataset. `metamerize` will start from the last metamer of the previous run if the `data` argument is a list of metamers and append the result.

Now the result is a bit more impressive.

We can animate the whole thing. Since 19030 metamers is overkill, first we keep only 200 of them.

You can freehand your own starting or target data with the `draw_data()` utility, that will open a shiny interface. You might need to install `shiny` and `miniUI` with `install.packages(c("shiny", "miniUI"))`.

Metamerizing operations can be chained while changing the minimizing function.

And the full sequence

# metamer 0.1.0

• First release
• Added a `NEWS.md` file to track changes to the package.

# Reference manual

install.packages("metamer")

0.2.0 by Elio Campitelli, 2 years ago

https://github.com/eliocamp/metamer

Report a bug at https://github.com/eliocamp/metamer/issues

Browse source code at https://github.com/cran/metamer

Authors: Elio Campitelli [cre, aut]

Documentation:   PDF Manual