MATLAB Answers

Linear regression with a minimum intercept value

5 views (last 30 days)
Brian Scannell
Brian Scannell on 15 Feb 2018
Edited: Brian Scannell on 15 Feb 2018
I am using linear regression to compute the coefficients for both y = B0 + B1*x and y = B0 + B1*x + B3*x^3. I know that the measurement technique has a minimum instrument noise level, Nmin, so I have a minimum value for B0. But the actual noise value for a set of measurements can be higher than Nmin, so B0 is not fixed - just constrained to be >= Nmin.
I can execute the regression with B0 unconstrained and test for B0 < Nmin, but if that is the case, is it then reasonable to assume that the best constrained least squares solution is achieved by fixing B0 as Nmin (i.e. just deduct Nmin from all my x values and repeat the regression with a zero intercept)?
Or is it possible that the same set of data points that give B0 < Nmin when B0 is unconstrained, could result in an intercept higher than the Nmin given the constraint that B0 >= Nmin?
I appreciate that this is more of a maths question than a Matlab question per se, but I'm hoping there might be a Matlab solution I can implement without too high a processing cost as I need to execute millions of these regressions per dataset (hence I am currently using mldivide (B = x\y) rather than regress or fitlm).
Thanks, Brian

  0 Comments

Sign in to comment.

Accepted Answer

Matt J
Matt J on 15 Feb 2018
Edited: Matt J on 15 Feb 2018
just deduct Nmin from all my x values and repeat the regression with a zero intercept
I think you mean deduct Nmin from all your y-values. Yes, you could do that. Or, just use a solver that handles bounds, e.g.,
B=lsqlin(x,y,[],[],[],[],[Nmin,inf])

  1 Comment

Brian Scannell
Brian Scannell on 15 Feb 2018
Thanks Matt - yes, I did mean my y vales. Thanks for pointer towards lsqlin; not one I’ve used before. Appreciated. Brian

Sign in to comment.

More Answers (0)

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!