R/b_modelexpansions_updateModel.R

Defines functions updateModel

updateModel <- function(x, model, updateMatrices = FALSE){
  # New model:
  newMod <- model
  # Overwrite the current estimates:
  for (i in seq_along(x)){
    newMod@parameters$est[newMod@parameters$par==i] <- x[i]
  }

  # Add implied too:
  if (updateMatrices){
    newMod@modelmatrices <- impliedModel(newMod, model@types, all = TRUE)  
  }
  
    
  newMod
}

Try the psychonetrics package in your browser

Any scripts or data that you put into this service are public.

psychonetrics documentation built on Oct. 3, 2023, 5:09 p.m.