trans: Transformation function - DM

Description Usage Arguments Details Value

View source: R/General_functions.R

Description

The transformation function transforms a non-restricted parameter vector into a restricted Delta, Gamma and Theta output.

Usage

1

Arguments

factor

vector of unrestricted parameters

m

number of Likelihoods

Details

In the direct maximisation the nlminb()- minimisation function can not directly implement the constraints of the parameter values. This function ensures that the estimated parameters of the direct optimisation still fullfill their requirements. The requirements are that all probabilities are between zero and one and that the rows of Gamma (as well as the vector Delta) sum up to one. For this transformation the logit model is used.

From the input vector factor, the elements are extracted as follows and used for transformation:

Delta vector (1 x m): The logit transformation requires (m-1) elements, thus the first (m-1) elements of the factor vector are used.

Gamma matrix (m x m): The logit transformation requires per row (m-1) elements thus in total m(m-1) elements required. Accordingly the elements from index m til (m+1)(m-1) are extracted from the factor vector.

Theta vector: Due to the fact that the trans() function can be used both from the single and multifactor Direct Maximisation the Theta vector has no pre- defined lenght, but needs to have at least the length of m (thus each likelihood has at least one parameter).

The resulting Delta, Gamma and Theta values are returned as a single list.

Value

List of Delta, Gamma, Theta


pneff93/HMM documentation built on Oct. 26, 2019, 8:16 a.m.