uncond_imp: Unconditional Imputation

Description Usage Arguments Details Value Author(s)

View source: R/uncond_imp.R

Description

Given the imputation parameters, this function imputes the scores using their distribution conditional on the observed values of the curves. Muliple or mean imputation can be chosen.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
uncond_imp(
  dat,
  workGrid,
  nimps = 10,
  seed = NULL,
  impute_type = "Multiple",
  var_delt = NULL,
  mux = NULL,
  Cx = NULL,
  phi = NULL,
  lam = NULL,
  tol = 1e-05
)

Arguments

dat

An n \times 3 data frame (where N is the number of subjects, each with m_i observations, so that ∑_{i=1}^N m_i = n) expected to have variables 'X','subj', and 'argvals'.

workGrid

A vector of the unique desired grid points on which to evaluate the function. The length of this vector will be called M.

nimps

An integer specifying the number of desired imputations, if impute_type is "Multiple".

seed

A numeric value used to set the seed for reproducibility (useful for multiple imputation).

impute_type

A string used to choose between mean and multiple imputation. Should be one of "Mean" or "Multiple".

var_delt

A number representing σ^2_δ, the variance of the noise.

mux

A numeric vector of length M specifying the mean function for X(t), evaluated at workGrid.

Cx

An M \times M matrix for the covariance function of X(t), evaluated at workGrid.

phi

An M \times J matrix whose columns are the J eigenfunctions of C_X, each evaluate at workGrid.

lam

A length-J numeric vector containing the eigenvalues of C_X.

tol

A (small) numerical value that sets the tolerance for trimming the eigenvalues of the conditional covariance.

Details

The variables of dat should be specified as follows: 'X' specifies the observed values of the curves (no missing values here); 'subj' should contain unique numeric identifiers for each subject, and 'argvals' should indicate the time point at which each observation was made (note that these values should be a subset of workGrid).

Value

Either a N\times J matrix of imputed scores if impute_type is set to "Mean", or a 3-dimensional array of dimension N\times J\times nimps if impute_type is set to "Multiple".

Author(s)

Jusitn Petrovich, jpetrovich02@gmail.com


justin-petrovich/sparsefreg documentation built on Aug. 20, 2020, 9:04 p.m.