$MIX

Marks the beginning of the abbreviated code for the MIX routine.

1
2
3
4
5
6
7
8
 $MIX
 abbreviated code

;# Example
 $MIX
 NSPOP=2
 P(1)=THETA(5)
 P(2)=1-THETA(5)

Discussion

The $MIX record is used to describe the mixture probabilities of a mixture model. It is evaluated with individual records.

$MIX block may not include EXIT, CALL , DO WHILE / ENDDO statements, or COMRES, CALLFL options.

Assignment and conditional statements

Left-hand quantities

  • NSPOP: the number of sub-populations (mixture components). It must be defined during problem initialization (when ICALL=1 ).
  • P(m), m=1..., NSPOP, the probability of certain subject belonging to subpopulation m. Thus P(m)'s must sum to 1. P has alias MIXP in the $MIX block.

Right-hand quantities and conditionals:

  • THETA.
  • MIX-defined variables.
  • ICALL.
  • Data items listed in DATA option of the $CONTR record, e.g.,

    1
    2
    
     $INPUT ... STDY ...
     $CONTR DATA=(STDY)

    so that STDY can be used in $MIX. STDY(j) refers to the value of STDY on the j'th observation record of the individual record. TEMPLT may be used;

  • MIXNUM: global variable for subpopulation index. During ICALL=4 (simulation), MIXNUM is randomly selected. During ICALL=3 (estimation) and the PASS subroutine used, or when ICALL=5 or ICALL=6, MIXNUM equals to MIXEST.
  • MIXEST: global variable for the estimated index. when ICALL=3,5,6, and at ICALL=2 when COMACT \= 0, MIXEST is the the estimated index m of the subpopulation with highest P(m) for the individual. This can be seen as the subpopulation to which the individual is classified. In NM73+, when ICALL=4, MIXEST equals to MIXNUM. At other times the variable is not meaningful.
  • MIXP: global array of probabilities of the mixture components, as the internal storage of the P variable. MIXP may be encoded in one of the three ways below:

    1
    2
    3
    
      MIXP(MIXNUM)
      MIXP                            ! index default to MIXNUM
      MIXP(m)

    The third encoding requires that the index m not exceed the value of MMX in SIZES.

  • Some global Variables in addition to MIXNUM, MIXEST, and MIXP.
  • Reserved variable NEWIND, ETA, EPS, ERR, COM.

Variables defined in $MIX are not stored in module NMPRD4 for output thus may not be specified in $TABLE.

Record order

Follows $SUBROUTINES.

See also: COMACT;