initialise_auxiliary_traits: Initialise Auxiliary Traits

View source: R/cavi_auxiliary_traits.R

initialise_auxiliary_traitsR Documentation

Initialise Auxiliary Traits

Description

Initialise auxiliary traits in a PLVM given manifest traits and metadata.

Usage

initialise_auxiliary_traits(
  n_traits,
  manifest_trait_df,
  trait_names,
  trait_type,
  trait_levels,
  manifest_trait_index,
  auxiliary_trait_index,
  inverse_link_functions,
  auxiliary_traits = NULL,
  perform_checks = TRUE
)

Arguments

n_traits

A natural number. The number of manifest traits.

manifest_trait_df

The data frame of manifest traits. If included allows for a non-exhaustive series of checks comparing metadata provided to that implicit in the manifest traits.

trait_names

A P-dimensional character vector. The manifest trait names.

trait_type

A P-dimensional vector of unordered factors belonging to one of 4 levels. The trait type corresponding to each of the named manifest traits. Ordinal traits are denoted ord, nominal are nom, scalar-valued continuous are con, and function-valued traits are fvt.

trait_levels

A P-dimensional vector. The number of levels associated with each manifest trait. NA for continuous traits.

manifest_trait_index

A P-dimensional list. columns of manifest_trait_df associated with each trait. List elements will be scalar valued for ordinal, nominal, and scalar-valued continuous traits. Function-valued traits are multi-variate and indexed by a vector of values.

auxiliary_trait_index

A P-dimensional list. Columns of the auxiliary trait matrix to be associated with each trait. List elements will be scalar valued for ordinal, nominal, and scalar-valued continuous traits. Function-valued traits are multi-variate and indexed by a vector of values.

inverse_link_functions

A P-dimensional list. Functions mapping manifest traits to auxiliary traits. For traits taking continuous values these must be specified by the user and can be the identity function.

auxiliary_traits

An NxD' matrix of real numbers. The initial matrix of auxiliary traits. When non null checks that the auxiliary trait matrix is of the correct type and size.

perform_checks

Logical. Check if function inputs are specified correctly.

Value

An NxD' matrix of real numbers. The initial matrix of auxiliary traits.


jpmeagher/vbar documentation built on Nov. 22, 2022, 5:48 a.m.