Path: news.mathworks.com!not-for-mail
From: <HIDDEN>
Newsgroups: comp.soft-sys.matlab
Subject: Re: Best fit line with constrained coefficients
Date: Tue, 11 May 2010 14:50:19 +0000 (UTC)
Organization: Xoran Technologies
Lines: 7
Message-ID: <hsbqrb$22n$1@fred.mathworks.com>
References: <hs9pck$618$1@fred.mathworks.com> <hs9r4t$2ko$1@fred.mathworks.com> <hsa4fg$7fv$1@fred.mathworks.com>
Reply-To: <HIDDEN>
NNTP-Posting-Host: webapp-02-blr.mathworks.com
Content-Type: text/plain; charset=UTF-8; format=flowed
Content-Transfer-Encoding: 8bit
X-Trace: fred.mathworks.com 1273589419 2135 172.30.248.37 (11 May 2010 14:50:19 GMT)
X-Complaints-To: news@mathworks.com
NNTP-Posting-Date: Tue, 11 May 2010 14:50:19 +0000 (UTC)
X-Newsreader: MATLAB Central Newsreader 1440443
Xref: news.mathworks.com comp.soft-sys.matlab:634612

"Nathan " <ndn3@georgetown.edu.remove.this> wrote in message <hsa4fg$7fv$1@fred.mathworks.com>...
> I should have been more specific.  While m and b are important, I'd also like to get the MSE, p, and r values for the fit.  Ideally, I was looking for a model option for regstats that let me add constraints to the coefficients.  Something like regstats(X,Y,[>0]).
=================

Well, once you have m and b, you can certainly calculate residuals, their norm, and any other function based on the residuals that you like. If you have simulated ground truth values, then you can also compute MSE and the like by numerical simulation.

The reason that you're not going to find a turn-the-crank method/code for doing error analysis is that, with the slope constrained positive, the parameter estimator is no longer linear/unbiased. The statistical distribution of the estimate is therefore much harder to calculate analytically.