R/Reduce_estimate.R

#' @title Estimate a latent variable model with linear predictors (LP)
#' @name estimate.lvm.reduced
#' @description Add columns corresponding to the LPs in the dataset (filled with 0) so that LPs are not treated as a latent variable
#' 
#' @param x \code{lvm.reduced}-object
#' @param data \code{data.frame}
#' @param estimator \code{character}
#' @param ... additional arguments to be passed to the low level functions
#' 
#' @example 
#' R/examples/EX_reducedModel.R
#' @export
estimate.lvm.reduced <- function(x, data, estimator = "gaussian", ...){
  
  ####  add columns
  name.LP <- lp(x)
  data <- cbind(data,
                matrix(0,nrow = NROW(data), ncol = length(name.LP), dimnames = list(NULL,name.LP))
  )
  
  return(callS3methodParent(x, FUN = "estimate", class = "lvm.reduced", data=data, estimator = estimator, ...))
}
bozenne/lava.reduce documentation built on May 13, 2019, 1:41 a.m.