# Noise Generator

Masks values in numeric columns. Adds or multiplies the original value by random noise.

The additive noise generator draws noise from an interval around 0 scaled to the magnitude of original value. For example, the default scale is 10% of the underlying value. The larger the value, the larger the amount of noise that is added.

The multiplicative noise generator multiplies the original value by a random scaling factor that falls within a specified range.

## Characteristics <a href="#noise-characteristics" id="noise-characteristics"></a>

<table data-header-hidden><thead><tr><th valign="top"></th><th valign="top"></th></tr></thead><tbody><tr><td valign="top"><strong>Consistency</strong></td><td valign="top">Yes, can be made self-consistent or consistent with another column.</td></tr><tr><td valign="top"><strong>Linking</strong></td><td valign="top">No, cannot be linked.</td></tr><tr><td valign="top"><strong>Differential privacy</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Data-free</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Allowed for primary keys</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Allowed for unique columns</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Uses format-preserving encryption (FPE)</strong></td><td valign="top">No</td></tr><tr><td valign="top"><strong>Privacy ranking</strong></td><td valign="top"><ul><li>3 if not consistent</li><li>4 if consistent</li></ul></td></tr><tr><td valign="top"><strong>Generator ID (for the API)</strong></td><td valign="top"><a href="../../../api/quick-start-guide/tonic-api-generator-assignment/generator-api-reference/generator-api-ref-noise-generator"><code>NoiseGenerator</code></a></td></tr></tbody></table>

## How to configure <a href="#noise-configure" id="noise-configure"></a>

You can use either the additive noise generator or the multiplicative noise generator, then set the other generator settings.

### Using the additive noise generator <a href="#noise-configure-additive" id="noise-configure-additive"></a>

To use the additive noise generator:

1. From the dropdown list, choose **Additive**.
2. In the **Relative noise scale** field, type the percentage of the underlying value to scale the noise to. The default value is `10`.
3. In the decimal places field, set the number of decimal places to use. The default value is `2`.

Tonic samples the additive noise from a range between `[-{`*`scale`*`/100} * |`*`value`*`|, {`*`scale`*`/ 100} * |`*`value`*`|)`, where *`scale`* is the noise scale, and *`value`* is the original data value.

The lower value of the range is inclusive, and the upper value of the range is exclusive.

For example, for the default noise scale of `10`, and a data value of `20`, the additive noise range would be `[-.1 * 20, .1 * 20)`. In other words, between -2 (inclusive) and 2 (exclusive).

### Using the multiplicative noise generator <a href="#noise-configure-multiplicative" id="noise-configure-multiplicative"></a>

To use the multiplicative noise generator:

1. From the dropdown list, choose **Multiplicative**.
2. In the **Min** field, type the minimum value for the scaling factor. The minimum value is inclusive. The default value is `0.5`.
3. In the **Max** field, type the maximum value for the scaling factor. The maximum value is exclusive. The default value is `5`.
4. In the decimal places field, set the number of decimal places to use. The defalt value is `2`.

Tonic scales the original value from a range between `[`*`min`*`,`` `*`max`*`)`, where *`min`* is the minimum scaling factor, and *`max`* is the maximum scaling factor.

For example, for the default values of `0.5` and `5`, Tonic multiplies the original data value by a value from between 0.5 (inclusive) and 5 (exclusive).

### Other generator configuration <a href="#noise-configure-other" id="noise-configure-other"></a>

To configure the generator consistency and data encryption:

1. Toggle the **Consistency** setting to indicate whether to make the column consistent.\
   \
   By default, the consistency is disabled.
2. If you enable consistency, then by default the generator is self-consistent.\
   \
   To make the generator consistent with another column, from the **Consistent to** dropdown list, select the column.\
   \
   If the generator is self-consistent, then a given value in the source database is masked in exactly the same way to produce the value in the destination database.\
   \
   If the generator is consistent with another column, then for a given value in that other column, the column that is assigned the Noise generator is always masked in exactly the same way in the destination database. For example, a field containing a salary value is assigned the Noise Generator and is consistent with the username field. For each instance of User1, the Noise Generator masks the salary value in exactly the same way.
3. If [Structural data encryption](https://docs.tonic.ai/app/generation/generators-assign-config/generators-data-encryption-config) is enabled, then to use it for this column, in the advanced options section, toggle **Use data encryption process** to the on position.


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.tonic.ai/app/generation/generators/generator-reference/noise-generator.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
