72 this =
this@error.lipfun.Base(bellfcn);
78 copy = error.lipfun.ImprovedLocalSecantLipschitz(this.
bellfcn);
95 if isempty(this.oldrs) || any(isnan(this.oldrs)) || size(this.oldrs,2) ~= size(di,2)
96 this.oldrs= r0+.2*sign(r0-di);
102 rs = this.CachedModifiedNewton(di);
104 rs = b.ModifiedNewton(this.oldrs,di);
106 ci = abs(b.evaluateD1(rs));
109 rs = ones(size(di))*r0;
110 update = abs(di-r0) < C;
115 rs(update) = this.CachedModifiedNewton(di(update));
117 rs(update) = b.ModifiedNewton(this.oldrs(update),di(update));
119 this.oldrs(update) = rs(update);
121 left = di + C - rs < 0;
122 right = di - C - rs > 0;
123 center = ~left & ~right;
127 ci(left | right) = abs(b.evaluateD1(di(left | right)));
129 ci(left) = (b.evaluateScalar((di(left))) - b.evaluateScalar((di(left)+C))) / C;
130 ci(right) = (b.evaluateScalar((di(right)-C)) - b.evaluateScalar((di(right)))) / C;
132 ci(center) = abs(b.evaluateD1(rs(center)));
139 di = linspace(0,maxDistance,num);
142 fprintf(
" Precomputing %d max local secants for BellFunction(Gamma=%f,r0=%f) in range [0, %f] ..\n ",num,this.Gamma,this.x0,maxDistance);
144 rs = this.
bellfcn.ModifiedNewton(start,di);
147 fprintf(
" Building tree data structure..\n ");
158 function rs = CachedModifiedNewton(s) {
161 [
l,u] =
t.FindClosest(s);
167 error(" When using cached secants the method
precompMaxSecants has to be run first. ");
function precompMaxSecants(maxDistance, num)
BinTree: A weighted binary tree.
function prepareConstants()
nothing to do here!
function registerProps(varargin)
Call this method at any class that defines DPCM observed properties.
ImprovedLocalSecantLipschitz(bellfcn)
Global configuration class for all KerMor run-time settings.
function ci = evaluate(di, C)
Evaluates the local lipschitz estimation function.
static function KerMor theinstance = App()
The singleton KerMor instance.
ImprovedLocalSecantLipschitz: