mynonneg: Non negative least square solution.

Description Usage Arguments Value See Also

Description

This is the function lsqnonneg from the package pracma, I just changed qr.solve into using Moore-Penrose inverse instead (ginv from MASS) as qr.solve crashes for some singular inputs. Now it won't crash but it's sometimes running for very long time (forever?), presumably with those problematic inputs. After too many steps the function halts and lies that the fit was terrible. I don't think this will cause problems.

Usage

1
mynonneg(C, d, iteration_multiplier = 3)

Arguments

C

The matrix.

d

The vector.

iteration_multiplier

The definition of "too many steps". Default value is 3 (times 10 times the matrix height).

Value

A vector (x) and the error (resid.norm).

See Also

lsqnonneg

qr.solve

ginv


admixturegraph documentation built on May 2, 2019, 6:02 a.m.