misoreg: Apply isotonic regression to each line of a matrix

Description Usage Arguments Details Value Author(s) References Examples

Description

This function calculates the isotonic regression (assuming an upward trend) for each line of a given matrix with a given vector of weights. It does so by using the C implementation of the pool adjacent violators algorithm provided in the package <fdrtool>, looping over the lines of the matrix in compiled C++ code. This implementation is approximately 2 orders of magnitude faster than using apply in R.

Usage

1

Arguments

data

a numeric matrix, for the lines of which we want to calculate the isotonic regression

weights

a vector of same length as the columns of data defining the weights

Details

misoreg takes a matrix of values for the lines of which a weighted isotonic regression is to be computed. The weights are assumed to be equal for each line.

Value

result

matrix with lines giving the isotonic regression fit for each line of the input matrix assuming an upward trend

weights

vector with original weights

Author(s)

Florian Klinglmueller <float_at_lefant.net> Part of this function is C code that has been ported by Korbinian Strimmer from R code originally written by Kaspar Rufibach. Many thanks also to Romain Francois and Dirk Eddelbuettel for helping moving the code to the new Rcpp API.

References

Barlow, R. E., Bartholomew, D. J., Bremner, J. M., and Brunk, H. D. (1972) "Statistical inference under order restrictions"; Wiley, London.

Robertson, T., Wright,F. T. and Dykstra, R. L. (1988) "Order Restricted Statistical Inference"; Wiley, New York.

Examples

1
2
3
x <- matrix(rnorm(4000),nc=4)
w <- c(3,6,3,6)/18
out <- misoreg(x,w)

floatofmath/orQA documentation built on May 16, 2019, 1:21 p.m.