A little while ago, I looked at this group and the web for an implementation of the NNLS algorithm, but all I found was a post in this group from 1997 from somebody also looking for an implementation, so I had to do it myself. The problem: Given a matrix A (usually more rows than columns) and vector f, find vector x such that: 1) All elements of x are non-negative 2) subject to contraint (1), the Euclidian norm (2-norm) of vector (A.x-f) is minimized. (Note that the unconstrained problem - find x to minimize (A.x-f) - is a simple application of QR decomposition.) The NNLS algo...

Hi Folks, does somebody have a working implementation of the NNLS and can kindly provide this? Cheers CR A generalization of NNLS is available at http://www-astro.physics.ox.ac.uk/~mxc/idl/bvls.pro --Wayne On Nov 3, 3:21=A0pm, chris <rog...@googlemail.com> wrote: > Hi Folks, > does somebody have a working implementation of the NNLS and can kindly > provide this? For simple problems, you might also consider running the MPFIT family of functions with parameter constraints that force the parameters to be non-negative. Craig ...

All non-negative linear least squares algorithms that I've seen, including lsqnonneg, require an explicit representation of the matrix. I'm looking for a large scale version that allows me to specify function handles instead. Help! "Gordon Wetzstein" <gordon.wetzstein@gmail.com> wrote in message <i7u6am$2ue$1@fred.mathworks.com>... > All non-negative linear least squares algorithms that I've seen, including lsqnonneg, require an explicit representation of the matrix. I'm looking for a large scale version that allows me to specify function handles ins...

Hi, I have a sparse matrix of size ~750,000x10,000, and I am looking to find the non-negative least-squares solution of the problem Ax = b. I have tried using lsqnonneg but after about 30 minutes it spit out an error saying out of memory (I guess this is because the matrix is too large?). I don't have the optimization toolbox but I would like to try lsqlin with only specifying the lower bound. I would consider buying it if I was sure it would solve my problem, so does anyone know if it will work on a matrix of the size with reasonable speed? If not does anyone have any other solution in...

Hello All! Any one know where can I find some php code (or "php-able" code) implementing least squares method? Thx in advance and pls excuse my poor eng J.SanTanA schreef: > Hello All! > Any one know where can I find some php code (or "php-able" code) > implementing least squares method? > > Thx in advance and pls excuse my poor eng http://www.google.nl/search?hl=nl&q=php+least+squares JW On 13 Feb, 12:42, Janwillem Borleffs <j...@jwscripts.com> wrote: > J.SanTanA schreef: > > > Hello All! > > Any one know where can I find s...

I saw in some previous posts people mentioned about it. I've looked into it from the decision tree - it is very old and there is no documentation, no tutorial, etc., only Fortran code. I don't know how to use it. If anybody know where to find the user guide or documentation, it would be great! If there is Matlab interface floating around, that's even greater... Moreover, I would appreciate if anybody can give me some pointers about non-linearly inequality constrainted non-linear least square solvers that more modern? Thanks a lot! On Sep 2, 7:12 pm, "Gino Linus&qu...

hi, I am working about genetic algorithms. I want to solve y = q(1)*exp(q(2)*t) equation.(Nonlinear) In this eq. %problem discription% y is a data q(1) and q(2) are parameters that we want to estimate and than t is a time %my purpose is minimize this function% S=sum[ydata - yestimate]^2 with this equation (nonlinear least squares), I want to estimate q(1) and q(2). how can I solve this poblem with genetic algorithm in MATLAB. please help me Thank you ...

Hi I have been trying to use 'lsqnonlin' function to solve a nonlinear least squares problem with Matlab educational copy. But matlab is gerneating an error of unknown function. Let me know on how one uses this function to estimate parameters for a nonlinear function which bounds estimated parameters in upper and lower bound. Thanks in advance. Ganesh Ganesh Lolge wrote: > Hi > I have been trying to use 'lsqnonlin' function to solve a nonlinear > least squares problem with Matlab educational copy. But matlab is > gerneating an error of unknown function. > >...

Hi all, I need a non linear least square minimization routine for correlated data (PCR or partial least square perhaps) but I don't know how I can download it (probably because I didn't know the name of my problem and its solution). You know where I can find it? Best regards, Dr. G. Pileio ...

I'm trying to perform least squares regression to a simple x,y data set, and to get the regression statistics so that I can model the data set using Monte-Carlo techniques. The regression is non-linear (ax^b power function). I've been successful doing this using nlinfit and related functions for the case where a constant variance is assumed (as is common for least squares). However, the data set would be better modeled using a non-constant variance and I'm having some difficulty getting the regression statistics for this case. Specifically, I would like to perform weighted ...

Hi I hope that someone can help me on this. Any help would be apreciated. I need to use the equation below as a model function, to estimated ka and ks by the non-linear least squares method. k = (ka*ks*f )/ (ka + ks*f) % some measured values that I have are H = [100, 200,250,300, 320] kind regards, Armindo "Armindo" wrote in message <lerbf3$1br$1@newscl01ah.mathworks.com>... > Hi > > I hope that someone can help me on this. Any help would be apreciated. > > I need to use the equation below as a model function, to estimated > ka a...

Hi, I've searched this group and the web, and it seems like there is no solution to this yet for MATLAB. Given y = n x 1 X = n x k We want b = k x 1 that minimizes sum(y - Xb)^2 Suppose X is non-singular, possibly rectangular and not symmetric. X is also sparse with at most 2n elements. To fix ideas, n is about 1 000 000 and k is about 10 000. This is just a ordinary least squares regression. In MATLAB, this is b = X\y How about b = k x 1 that minimizes sum(y - Xb)^2 SUBJECT to Rb = 0? R is a r x k matrix of linear constraints on solution b. There is a closed form solution for it give ...

Hi, I am trying to run a non-linear least squares regression on some data. As part of the fitted function, I want to include a coefficient that is itself a step (ie. dichotomous variable) function of one of the dependent variables. That is, say my non-linear function is y = A * B(x) * exp(x) where A and B are coefficients, and a sample of data is (made up on the spot): x = 0 0 0 1 1 1 2 3 4 5 y = 1 2 3 5 6 8 2 5 8 13 So, the estimator A is common to all points but the estimator B varies depending on x. In this case, there are really 7 coefficients to estimate: A, B(0), B(1), ... , B(5). ...

i'm trying to fit a curve using the lsqcurvefit. I have experimental data over the time. I need to estimate the following parameters f(1), f(2), f(3), f(4) and M. I have a constante k = 9.8 I established this initial guess parameters x0=[1,1,1,1,1]; I call the function f=lsqcurvefit(@myfun, x0, t, F); And I get this f (t) = exp(-f(1).*t).*(f(2).*cos(f(3).*t)+f(4).*sin(f(3).*t)) + M*9.8 If I dont use the last parameteres (+ M * 9.8 ) the fit is ok but when I add this I get problems. This is possible to performe with this function? If yes can any one help me please? If not The...

Hey I finally want to enjoy at least some time of the weekend, but I am stuck a= t one problem tonight for which I still would like to find a solution.=20 I have a bunch of measurements in an array y which depending basically on a= nother variable x. I want to do a least-squares fit to a non-linear functio= n, which would be very easy if I just wanted e.g. a polynomial fit. My prob= lem is now that there is another parameter coming into play (here: k), so t= he function I want to fit in the end looks like this (though the order shou= ld be variable in the end which in this example ...

hi all, I am confused about the concept of maximum likelihood estimation (MLE) and non-linear least squares. I am using lsnonlin in matlab what seems to me to be a straight forward non linear least squares estimation. However, the book I used to find the cost function (i.e. objective error function) for the non linear least square estimation referred to thefinal solution ofthe unknown parameters as the maximum likelihood solution and thus a MLE.But did not provide an explanation. If anyone can share some light, I would be grateful. cheers aiden can anyone suggest a possible explanation? ...

Hi, I am trying to get p-value for non-negtive least square with three dependent variables using the "lsqnonneg" function. But Matlab only have coefficients and residuals. Is there any way to get the p-values corresponding to all of the dependent variables? I have checked the glmfit functions - but that's for regular regression not for "lsqnonneg". I just want to get p-value for each dependent variable and see how important they are for the independent variable, respectively. Thanks! ...

Hello everybody For a specific application, I need to solve the problem min_x || r(x) ||_"2" where r(x) is a (non-linear) function from R^n -> R^m, m > n. Now, had the norm been the usual euclidean norm, I am aware of the range of methods available for solving this problem (e.g. Levenberg-Marquardt). However, for this application, only the positive residuals for any given x should be considered. Thus, the problem could probably be expressed as min_x || W(x) r(x) ||_2 With W(x) a diagonal matrix with W_i=1 if r_i>0, else W_i=0. Do any of you have any id...

i'm doing curve fitting using nonlinear square technique basic Matlab help says: *Step 1: Write an M-file myfun.m that computes the objective function values. function F=myfun(x) k=0:0.1:150; F=x(1)*x(2)*(x(3)+1)*(((k-x(4))./x(5)).^(x(3))).*exp(-x(2)*(((k-x(4))./x(5)).^(x(3)+1)))+(1-x(1))*x(6)*(x(7)+1)*(((k-x(4))./x(8)).^(x(7))).*exp(-x(6)*(((k-x(4))./x(8)).^(x(7)+1))); Step 2: Call the nonlinear least-squares routine. x0=[0.5 5 2 -4 10 6 1 80]; [x,resnorm]=lsqnonlin(@myfun,x0) i'm getting as a result: Optimization terminated: first-order optimality less than OPTIONS.TolFun, and...

Hi all, I am working in Wireless communications. I need to design Equalizer using Recursive Least Square Algorithm for Wireless Communications. I need help how to start. So please send Suggestions or if any one had sample code please send it to me. Thanks in advance Chowdary, ...

I would like to conduct the following three-stage least squares: (eq.1) lnY= a0 + a1*lnX + a2* lnB (eq.2) lnX = b0 + b1*lnY + b2* lnC I need to put a restriction on coefficients as: a1>b1 I would like to seek advice on how to code it using MATLAB. Thanks in advance. "MAY Chew" <fukumoto_may@yahoo.co.jp> wrote in message <i2e1d8$mci$1@fred.mathworks.com>... > I would like to conduct the following three-stage least squares: > > (eq.1) lnY= a0 + a1*lnX + a2* lnB > (eq.2) lnX = b0 + b1*lnY + b2* lnC > > I need to put a restrict...

Hello! I have a question concerning a non-linear least square optimization problem using lsqnonlin. Unfortunately, I am not able to optimize integers, although rational number are not a problem. Is there a way to constrain optimization parameters as integers? Example: Consider the optimization criterium as: min sum {FUN(X).^2} a b Then it can be implemented in Matlab using lsqnonlin as: a0 = 0.3; % Rational integer b0 = 20; % INTEGER!!! % Boundary conditions: LB = [0.3; 1]; % lower bound UB = [0.9; 25]; % upper bound param = lsqnonlin(@FUN,[a0;b0],LB,UB,X,...); a = param...

hi any ideas about the global separable non linear least square method "yem " <yamnagea@hotmail.fr> wrote in message <m7h083$80m$1@newscl01ah.mathworks.com>... > hi any ideas about the global separable non linear least square method Sure. I have ideas. How about you? ...

I need some assitance trying to determine the proper fitting technique to fit a wide range of data to 3 peicewise polynomials. (i.e I need to fit 1000 points in each of three continous intervals to 3 seperate, but continous functions). I want to use least squares fitting with splines to have a continous derivativative at the inner interval boundaries. Should i only use breaks/knots at the beginning/end of the intervals. Would this cause the polynomials to be interpolated at the value corresponding to the breaks/knots or will it apply a least squares fit to the boundary? "Joseph "...

Does anyone know a free fortran code similar to the Matlab lsqnonlin function ? I have seen MINPACK but I don't want to calculate the Jacobian Matrix and so on... I want to minimize the system of 2 parameters: f(x,y) - fo g(x,y)-go (with f and g non linear functions) with x> xmin y>ymin In Matlab, I use to do: Ko = [x_init; y_init]; K = lsqnonlin('mymatrixfuntion',[xmin xmax; ymin ymax],Ko); with my function defined as below: ____________ function rest = mymatrixfunction(K) x=K(1); y=K(2); rest = [f(x,y) - fo; g(x,y)-go]; ______________ In a previous ar...