# Domain attribute

(Redirected from Domain)

Release: 4.6  •  5.0  •  5.1  •  5.2  •  5.3  •  5.4  •  6.0  •  6.1  •  6.2  •  6.3

## What is the Domain Attribute?

The Domain attribute specifies the type or range of valid values for a variable, and how those values should be interpreted -- e.g., as discrete or continuous. ## Continuous vs. Discrete

The possible values for a numeric value may be continuous or discrete. For example, a variable such as Number_of_failures is integer-valued, and is therefore "discrete numeric", while a variable such as Airspeed is real-valued and thus continuous.

When dealing with uncertain numeric quantities, knowing whether a variable is continuous or discrete is necessary for the proper statistical treatment. When expressing uncertainty, we use probability of outcomes for discrete-valued variables, and probability-densities for continuous variables.

### Where is this used

When Analytica computes or graphs statistical results, the appropriate computation changes depending on whether the quantity is discrete or continuous. For example, Pdf returns a 1-D array of probabilities, indexed by a .Possible_Values index, for a discrete variable, but for a continuous variable it returns a two-D array indexed by .Step and DensityIndex. Results of Frequency, GetFract, Pdf, and Cdf are all influenced by this distinction.

The domain also determines the space of options for Slider and self-Choice controls.

### Automatic

When the domain is set to Automatic, Analytica attempts to infer whether a variable is discrete or continuous based on the values that occur. This inference is heuristic -- it is a guess on Analytica's part. Most the time, Analytica will guess correctly. For example, if the data contains a small number of unique integer values, as might result from a Poisson or Geometric distribution, Analytica will usually infer that the domain is discrete, while if many real-valued quantities occur, as with a Normal distribution, it will correctly infer that the quantity is continuous.

However, because the inference is heuristic, it may get it wrong in some cases. When this happens, or proactively to prevent this possibility, you can explicitly set the domain to indicate whether the quantity is discrete or continuous.

### Continuous

Select a Continuous domain if your quantity is real-valued.

### Discrete Numeric

Select this if only certain discrete values are possible, as with an integer-valued quantity. If you can identify the exact set of possible values, consider setting an explicit domain, as either a list of numbers, or as an index-valued domain.

### Categorical

If your variable may have non-numeric values, or you do not wish the value to be interpreted numerically, set the domain to Categorical.

## Explicit Domains

If you can identify a finite set of possible values, you may list these explicitly using a List, List-of-labels, or Index domain.

When your variable contains an explicit domain, it can serve as an index or a value. When an expression occurs in an index context, the domain value is used. Furthermore, the variable can be used to index a DetermTable or Probability Table.

### Index-Domain

An index domain uses the index values of another indicated index variable. If the possible values already exists in another index, or if many variables share the same domain, the values only have to be listed once. Furthermore, with this feature, values can be computed (the evaluated index values are used).

The domain attribute uses the evaluated value of the original index. This, the following two examples do not have equivalent domains:

Example A:

Index I := [1 + 2, cos(45), X]
Domain of D := Index I

Example B:

Domain of D := [1 + 2, cos(45), X]

Assume X = 2.1. In example A, the domain of D is [3, 0.707, 2.1], while in Example B it is a 3-element list with expressions 1 + 2, cos(45), and the varTerm X.

Likewise, the domain of D can be set to a variable that is defined as an expression that returns a list when evaluated.
{"ft_lang_label":"__label__en","ft_lang_prob":0.802227,"math_prob":0.9191509,"size":3939,"snap":"2022-40-2023-06","text_gpt3_token_len":844,"char_repetition_ratio":0.14891995,"word_repetition_ratio":0.015822785,"special_character_ratio":0.20588982,"punctuation_ratio":0.13545817,"nsfw_num_words":0,"has_unicode_error":false,"math_prob_llama3":0.99421555,"pos_list":[0,1,2],"im_url_duplicate_count":[null,3,null],"WARC_HEADER":"{\"WARC-Type\":\"response\",\"WARC-Date\":\"2023-02-07T21:47:25Z\",\"WARC-Record-ID\":\"<urn:uuid:50789a2c-750b-4b3d-93b7-f6f61ca3308b>\",\"Content-Length\":\"26838\",\"Content-Type\":\"application/http; msgtype=response\",\"WARC-Warcinfo-ID\":\"<urn:uuid:ef59b033-6fe4-4380-a1e3-aabb54ccb879>\",\"WARC-Concurrent-To\":\"<urn:uuid:5ef41e17-3ca9-4945-af81-33c46bd6b60e>\",\"WARC-IP-Address\":\"35.215.67.147\",\"WARC-Target-URI\":\"https://docs.analytica.com/index.php/Domain\",\"WARC-Payload-Digest\":\"sha1:IEWHANN6SITMKWMPOIFNL6JXFQM6UNC7\",\"WARC-Block-Digest\":\"sha1:AOOTHXSL5PMNEYNZLM7RYWPG6SB2ZY6J\",\"WARC-Identified-Payload-Type\":\"text/html\",\"warc_filename\":\"/cc_download/warc_2023/CC-MAIN-2023-06/CC-MAIN-2023-06_segments_1674764500641.25_warc_CC-MAIN-20230207201702-20230207231702-00466.warc.gz\"}"}