Learn R Programming

mdgc (version 0.1.2)

mdgc_start_value: Get Starting Value for the Covariance Matrix Using a Heuristic

Description

Uses a heuristic to get starting values for the covariance matrix. These can be passed e.g. to mdgc_fit.

Usage

mdgc_start_value(object, ...)

# S3 method for mdgc mdgc_start_value(object, ...)

# S3 method for default mdgc_start_value( object, lower, upper, code, multinomial, idx_non_zero_mean, mea, n_threads = 1L, ... )

Arguments

object

mdgc object from get_mdgc. Ignored by the default method.

...

used to pass arguments to S3 methods.

lower

[# variables]x[# observations] matrix with lower bounds for each variable on the normal scale.

upper

[# variables]x[# observations] matrix with upper bounds for each variable on the normal scale.

code

[# variables]x[# observations] matrix integer code for the each variable on the normal scale. Zero implies an observed value (the value in upper), one implies a missing value, and two implies an interval.

multinomial

list where each element is 3x[# multinomial variables] matrix with multinomial outcomes. The first index is the outcome as an integer code, the second index is the number of categories, and the third index is the index of each multinomial variable (this is zero-based).

idx_non_zero_mean

indices for non-zero mean variables. Indices should be sorted.

mea

vector with non-zero mean entries.

n_threads

number of threads to use.

Value

The starting value for the covariance matrix.

Examples

Run this code
# NOT RUN {
# randomly mask data
set.seed(11)
masked_data <- iris
masked_data[matrix(runif(prod(dim(iris))) < .10, NROW(iris))] <- NA

# use the functions in the package
library(mdgc)
obj <- get_mdgc(masked_data)
ptr <- get_mdgc_log_ml(obj)
start_vals <- mdgc_start_value(obj)
start_vals # starting value for the covariance matrix

# }

Run the code above in your browser using DataLab