help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Independent parameters in nonlin_residmin


From: Olaf Till
Subject: Re: Independent parameters in nonlin_residmin
Date: Wed, 19 Dec 2018 22:01:13 +0100
User-agent: NeoMutt/20170113 (1.7.2)

On Wed, Dec 19, 2018 at 02:16:50PM +0100, Pavel Hofman wrote:
> Hi,
> 
> Please is there a way to tell nonlin_residmin that some parameters are
> related to some items in the residua vector only and do not affect the other
> residual vector items? In other words I would like to run single
> nonlin_residmin call for fitting multiple parameter sets with independent
> results.
> 
> The reason is my function takes rather long but can provide results for all
> the parameter sets at once.

Hi Pavel,

nonlin_residmin can't prevent your function from computing all
residuals, your function itself has to prevent unnecessary
computations. Your function needs some information for this -- this
information is passed to it by nonlin_residmin. The following
explanation assumes that you use the default gradient function of
nonlin_residmin (the feature is not yet implemented for complex step
derivatives).

In your function, check (e.g. with nargin()) if it is called with a
second argument. This will be the case if the function is called for
gradient determination. The second argument will be a structure with a
field "plabels". plabels{1}{1} should be the number of the parameter
(its index in the parameter vector) whose partial derivative is
currently computed. Your function doesn't need to compute residuals
which are unaffected by this parameter, it can return a constant value
for them.

Olaf

-- 
public key id EAFE0591, e.g. on x-hkp://pool.sks-keyservers.net

Attachment: signature.asc
Description: PGP signature


reply via email to

[Prev in Thread] Current Thread [Next in Thread]