R/step5.R

Defines functions step5

step5 <-
function(Wold, Wnew, tol, converged, convCrit){
  if(convCrit=="relative") diff <- abs((Wold-Wnew)/Wnew) # used
  if(convCrit=="square") diff <- (Wold-Wnew)^2
  
  if (all(diff[!is.nan(diff)] < tol)) converged <- TRUE
  else Wold <- Wnew
  return(list(Wold=Wold, converged=converged))
}

Try the semPLS package in your browser

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

semPLS documentation built on May 2, 2019, 9:34 a.m.