A newer version of Max is available. Click here to access the latest version of this document.

anal

Make a histogram of number pairs received

Description

anal takes number pairs and reports how many times they've been received. The output list is designed to serve as input to the prob object, to create a probability matrix of transitions from one number to another (known as a first-order Markov chain).

Arguments

Name Type Opt Description
maximum-input-limit int opt Sets a maximum limit for the values that can be input into anal. Input values are clipped between zero and this value. The default value, when no argument is present, is 128. By supplying an argument, you can change the maximum input value that anal will accept, up to a maximum of 16384. The number of different transition probabilities that anal can keep track of is the square of this maximum input value. A maximum input value of 128 represents a table consisting of 16,384 different pairs; when the maximum limit is set to the maximum input value possible of 16384, anal can keep track of a whopping 268,435,456 unique numerical pairs!

Messages

int number-to-watch-for [int]
Reports how many times this number and the previously received number have occurred in immediate succession. (The first time a number is received, there has been no previous number, so nothing happens.)
clear Erases the memory of the anal object entirely, but retains the most recently received number to use as the next "previous" value.
reset Erases the most recently received number from the memory of the anal object. The next number to be received gets stored in its place, to serve as the next "previous" value (but nothing else happens).

Information for box attributes common to all objects

Output

list: The first two numbers in the list are the two most recently received numbers, and the third number shows how many times that particular succession of two numbers has been received. This list of three numbers is designed to be used as input to the prob object, to create a probability matrix of transitions from one number to another (known as a first-order Markov chain).

Examples

Keep track of number pairs and their relative frequency of occurrence pass the information to prob to generate similar transitions

See Also

Name Description
histo Make a histogram of the numbers received
prob Make a weighted random series of numbers