Main Content

ttdata

Transition function data

Since R2021b

Description

ttdata evaluates the transition function for observations of the threshold variable. To plot transition functions of threshold transitions, use ttplot.

T = ttdata(tt,z) returns transition function data T for the threshold transitions in tt at values of the threshold variable z.

example

T = ttdata(tt,z,UseZeroLevels=tf) returns transformation function data with all levels set to 0 when tf is true.

example

Examples

collapse all

Create logistic threshold transitions at levels 0 and 5.

t = [0 5];
tt = threshold(t,Type="logistic");

tt is a threshold object. By default, the rate of each logistic transition function is 1.

Evaluate the transition function at a sequence of transition variable data from -10 to 10.

z = -10:0.01:10;
F = ttdata(tt,z);
size(F)
ans = 1×2

        2001           2

F is a 2001-by-2 vector of transition function data. Each column is the transition function data for the corresponding threshold in tt.Levels.

To facilitate comparisons among transition rates, the Type="graph" option of ttplot graphs all transition functions at the same level. This example shows how to graph transition functions each at their respective level.

Create normal threshold transitions at levels 0 and 5 with rates 0.5 and 1.5, respectively.

tt = threshold([0 5],Type="normal",Rates=[0.5 1.5]);

Evaluate the transition functions at their respective level (the default), and then evaluate them each relative to level 0. Specify a sequence of transition variable data from -10 to 10.

z = -10:0.01:10;  
n = numel(z);

T0 = ttdata(tt,z);
T1 = ttdata(tt,z,UseZeroLevels=true);

T0 is an n-by-1 vector of raw transition function data evaluated at the grid of transition variable data. T1 is an n-by-1 vector of transition function data translated to be centered at level 0.

Plot both sets of transition functions separately.

% Raw transition functions
figure
plot(z,T0,LineWidth=2)
xline(tt.Levels,'--')
grid on
xlabel("Level")
legend(["Level 0, Rate 0.5" "Level 5, Rate 1.5"],Location="northwest")

Figure contains an axes object. The axes object with xlabel Level contains 4 objects of type line, constantline. These objects represent Level 0, Rate 0.5, Level 5, Rate 1.5.

% Shifted transition functions
figure
plot(z,T1,LineWidth=2)
grid on
xlabel("Distance from Level")
legend(["Level 0, Rate 0.5" "Level 5, Rate 1.5"],Location="northwest")

Figure contains an axes object. The axes object with xlabel Distance from Level contains 2 objects of type line. These objects represent Level 0, Rate 0.5, Level 5, Rate 1.5.

Input Arguments

collapse all

Threshold transitions, with NumStates states, specified as a threshold object. tt must be fully specified (no NaN entries).

Threshold variable data, specified as a numeric vector.

Data Types: double

Flag indicating whether to compute data with all levels set to 0, specified as a value in this table:

ValueDescription
trueComputes transformation function data with all levels set to 0. This setting is useful for comparing transition rates.
falseComputes raw transformation function data.

Example: UseZeroLevels=true

Data Types: logical

Output Arguments

collapse all

Transition function data F(z,tt.Levels,tt.Rates), returned as a numeric matrix. F is specified by tt.TransitionFunctionData.

Data in T gives transition function values relative to each level in tt.Levels. The number of rows of T is equal to the length of z and the number of columns is equal to the number of levels. For details, see threshold.

Version History

Introduced in R2021b