R/logis.noise.R

Defines functions logis.noise

Documented in logis.noise

logis.noise <-
function(model,intensity=25) {
  lg<-nrow(model$model)
  int<-min(abs(model$resid))/intensity
  noise<-rnorm(lg,0,int)
  fit<-model$fitted.values
  values<-integer(lg)
  for (i in 1:lg) {
    if (fit[i]+noise[i]>1 | fit[i]+noise[i]<0) {
	values[i]<-fit[i]-noise[i]
    } else {
	values[i]<-fit[i]+noise[i]
    }
  }
  return(values)
}

Try the RVAideMemoire package in your browser

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

RVAideMemoire documentation built on Nov. 6, 2023, 5:07 p.m.