meanVarLocalFit: Fit Mean-Variance Trend by Local Regression

View source: R/fitMeanVarCurve.R

meanVarLocalFitR Documentation

Fit Mean-Variance Trend by Local Regression

Description

meanVarLocalFit fits a mean-variance curve by applying a robust, gamma-family local regression.

Usage

meanVarLocalFit(
  x,
  y,
  weight,
  range.residual = c(1e-04, 15),
  max.iter = 50,
  args.lp = list(),
  args.locfit = list(),
  verbose = TRUE
)

Arguments

x, y

Two numeric vectors of (sample) means and sample variances, respectively.

weight

An optional vector of weights to be used in the fitting procedure. It's typically used when sample variances in y are associated with different numbers of degrees of freedom.

range.residual

A length-two vector specifying the range of residuals of non-outliers.

max.iter

Maximum number of iteration times allowed during the fitting procedure.

args.lp

A named list of extra arguments to lp.

args.locfit

A named list of extra arguments to locfit.

verbose

Whether to print processing messages about iteratively fitting the mean-variance curve?

Details

meanVarLocalFit iteratively detects outliers and applies the local regression procedure to non-outliers. The procedure converges as soon as the set of outlier points fixes.

Value

A prediction function which accepts a vector of means and returns the predicted variances.

Note

Due to the internal implementation, the argument subset to locfit mustn't be specified in args.locfit.

See Also

meanVarParaFit for parametrically fitting a mean-variance curve; fitMeanVarCurve for an interface to modeling the mean-variance dependence on bioCond objects; plotMeanVarCurve for plotting a mean-variance curve.


MAnorm2 documentation built on Oct. 29, 2022, 1:12 a.m.