user_constraint function

Formalize User-Specified Constraint of fmx Object

Formalize User-Specified Constraint of fmx Object

Formalize user-specified constraint of fmx object

user_constraint(x, distname, K)

Arguments

  • x: character vector , constraint(s) to be imposed. For example, for a two-component Tukey gg-&-hh

    mixture, c('g1', 'h2') indicates g1=h2=0g_1=h_2=0 given A1<A2A_1 < A_2, i.e., the gg-parameter for the first component (with smaller location value) and the hh-parameter for the second component (with larger mean value) are to be constrained as 0.

  • distname: character scalar, name of distribution

  • K: integer scalar, number of components

Returns

Function user_constraint() returns the indices of internal parameters (only applicable to Tukey's gg-&-hh mixture distribution, yet) to be constrained, based on the type of distribution distname, number of components K

and a user-specified string (e.g., c('g2', 'h1')).

Examples

(d0 = fmx('GH', A = c(1,4), g = c(.2,.1), h = c(.05,.1), w = c(1,1))) (c0 = fmx_constraint(d0)) user_constraint(distname = 'GH', K = 2L, x = character()) # equivalent (d1 = fmx('GH', A = c(1,4), g = c(.2,0), h = c(0,.1), w = c(1,1))) (c1 = fmx_constraint(d1)) user_constraint(distname = 'GH', K = 2L, x = c('g2', 'h1')) # equivalent (d2 = fmx('GH', A = c(1,4), g = c(.2,0), h = c(.15,.1), w = c(1,1))) (c2 = fmx_constraint(d2)) user_constraint(distname = 'GH', K = 2L, x = 'g2') # equivalent
  • Maintainer: Tingting Zhan
  • License: GPL-2
  • Last published: 2025-03-15

Useful links