forked from lawrennd/optimi
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathoptimiDefaultConstraint.m
29 lines (26 loc) · 1.04 KB
/
optimiDefaultConstraint.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
function str = optimiDefaultConstraint(constraint)
% OPTIMIDEFAULTCONSTRAINT Returns function for parameter constraint.
% FORMAT
% DESC returns the current default function for constraining a
% parameter. Formerly (up to version OPTIMI 0.163) this was
% 'negLogLogit' for positive constraints, as this keeps things roughly linear in the
% positive half space, however, it is more standard to use 'exp'
% (i.e. optimise in the log space). This function allows you to
% change the option globally. The defaults are given below.
% ARG constraint : the type of constraint you want to place on the
% parameter, options include 'positive' (gives an 'exp' constraint)
% and 'zeroone' (gives a 'sigmoid' constraint).
% RETURN str : the type of function used to apply the constraint
% from the 'optimi' toolbox.
%
% SEEALSO : expTransform, sigmoidTransform, linearTransform, negLogLogitTransform
% COPYRIGHT : Neil D. Lawrence, 2006
% OPTIMI
switch constraint
case 'positive'
str = 'exp';
case 'zeroone'
str = 'sigmoid';
case 'bounded'
str = 'sigmoidab';
end