ALGLIB forum
It is currently Fri Jul 19, 2024 9:32 pm

All times are UTC

Forum rules

1. This forum can be used for discussion of both ALGLIB-related and general numerical analysis questions
2. This forum is English-only - postings in other languages will be removed.

Post new topic Reply to topic  [ 2 posts ] 
Author Message
 Post subject: The least squares problem
PostPosted: Fri Jul 14, 2023 9:38 am 

Joined: Fri Jul 14, 2023 9:18 am
Posts: 1
Dear everyone , dear Sergey :

I have a multi parameter function that needs optimization,

The least squares problem, where F (x, y, z)=ax+by+cz, with coefficients a, b>>c, results in the gradient of z being much smaller than that of a and b. The range of parameters is approximately x [2-5] y [1-3] z [-0.08~0.08]. How to dynamically adjust gradients to improve the accuracy of z

Expand the derivative of z to adjust the scale to be roughly the same as the derivative of x and y?

minbleicstate state;
minbleicreport rep;
double epsg = epsg0 ;
double epsf = epsf0 ;
double epsx = epsx0 ;
ae_int_t maxits = 1000 ; //

minbleiccreate(x, state);
minbleicsetbc(state, bndl, bndu);

//==Is this the order of magnitude for setting parameters related to their coefficients? Is the usage correct here for me?
//real_1d_array xScale;
//int LenS = x.length();
//int nt_num = LenS/5;
//for(int j=0;j<nt_num;j++){
// xScale[0 * nt_num + j] = 100;
// xScale[1*nt_num+j] = 100 ;
// xScale[2 * nt_num + j] = 1;
// xScale[3*nt_num+j] = 0.5 ;
// xScale[4*nt_num+j] = 0.5 ;

minbleicsetcond(state, epsg, epsf, epsx, maxits);
alglib::minbleicoptimize(state, func_grad,NULL,ptr);

const xparams _params = alglib::xdefault;
minbleicresults(state, x, rep);

 Post subject: Re: The least squares problem
PostPosted: Sat Jul 15, 2023 10:16 am 
Site Admin

Joined: Fri May 07, 2010 7:06 am
Posts: 921

This specific example is not a problem for BLEIC. The difference in magnitudes is just 10x, first order optimization algorithms can easily deal with differences up to 10000x.

Most often difference in gradient magnitudes comes from different variable scales, so you did it right when you specified scaling with setscale(). It deals with the most part of ill conditioning, and the rest can be handled by the optimizer.


Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 2 posts ] 

All times are UTC

Who is online

Users browsing this forum: No registered users and 8 guests

You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Search for:
Jump to:  
Powered by phpBB © 2000, 2002, 2005, 2007 phpBB Group