function to model each curve of a dataset using a local regression

FuncDetectPointOutlierLocFit(datain, myparam, mytime, myid, mylevel, mylocfit)

Arguments

datain

input dataframe. This dataframe contains a set of time courses

myparam

character, name of the variable to model in datain (for example, Biomass, PH or LA and so on)

mytime

character, name of the time variable in datain which must be numeric

myid

character, name of the id variable in datain

mylevel

numeric, factor to calculate the confidence interval

mylocfit

numeric, The constant component of the smoothing parameter. (see the locfit())

Value

a data.frame with outlier containing the following columns:

Ref

the id variable

mytime

name of the time variable in datain

myparam

name of the modeled variable in datain

ypred

the locfit prediction

sd_ypred

standard deviation of the prediction

lwr

lower bound of the confidence interval

upr

upper bound of the confidence interval

outlier

flag of detected outlier (0 is outlier, 1 is not)

Details

see locfit() help function from the locfit R library The user can act on:

mylocfit

the constant of the smoothing parameter. Increase mylocfit to have a very smooth curve

mylevel

the level to calculate the confidence interval. Increase mylevel to exclude less outliers

to produce the grahics of the prediction and detected outliers, please use plotDetectPointOutlierLocFit() function.

Examples

# \donttest{ data(plant1) library(locfit)
#> locfit 1.5-9.4 2020-03-24
selec<-c("manip1_1_1_WW","manip1_1_2_WW","manip1_1_3_WW", "manip1_1_4_WW","manip1_1_5_WW") mydata<-plant1[plant1[,"Ref"] %in% selec,] resu<-FuncDetectPointOutlierLocFit(datain=mydata, myparam="biovolume",mytime="thermalTime", myid="Ref",mylevel=5,mylocfit=70) # }