Re: [R] least square fit with non-negativity constraints for absorption spectra fitting

From: Dieter Menne <>
Date: Fri 14 Jul 2006 - 22:43:19 EST

Xu, Xiuli (NIH/NHLBI) [E] <xux3 <at>> writes:

> I would really appreciate it if someone can give suggestions on how to
> do spectra fitting in R using ordinary least square fitting and
> non-negativity constraints. The lm() function works well for ordinary
> least square fitting, but how to specify non-negativity constraints? It
> wouldn't make sense if the fitting coefficients coming out as negative
> in absorption spectra deconvolution.

I don't see much reasons to use lm() to fit a spectrum, but if you want to do that, negative coefficients simply mean a shift by pi, sothe sign can be discarded for most practical purposed.

But better look at one of the specialized packages like spectrino.

Dieter mailing list PLEASE do read the posting guide! Received on Fri Jul 14 22:47:38 2006

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.1.8, at Sat 15 Jul 2006 - 00:14:33 EST.

Mailing list information is available at Please read the posting guide before posting to the list.