Overview
Comment:Now ceases if |error|<criterion
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | origin/master | trunk
Files: files | file ages | folders
SHA3-256: 3300f687234780f3c60f44e4093e6e235939bbba57555398c509e6e3f7286289
User & Date: gawthrop@users.sourceforge.net on 1999-12-08 06:42:31.000
Other Links: branch diff | manifest | tags
Context
1999-12-13
22:26:03
*** empty log message *** check-in: d380c79cb3 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
1999-12-08
06:42:31
Now ceases if |error|<criterion check-in: 3300f68723 user: gawthrop@users.sourceforge.net tags: origin/master, trunk
06:32:40
Iterations now counts function evaluations - so minimum is 2. check-in: e506e8acbd user: gawthrop@users.sourceforge.net tags: origin/master, trunk
Changes
51
52
53
54
55
56
57
58

59
60
61
62
63
64
65
51
52
53
54
55
56
57

58
59
60
61
62
63
64
65







-
+







  error_old = inf;
  error=1e50;
  theta = theta_0;
  Theta = [];
  Error = [];
  Y = [];
  iterations = 0;
  while (abs(error_old-error)>criterion)&&(iterations<max_iterations)
  while (abs(error_old-error)>criterion)&&(abs(error)>criterion)&&(iterations<max_iterations)
    iterations = iterations + 1;
    error_old_old = error_old;
    error_old = error;
    eval(sprintf("[t,y,y_theta] = \
	mtt_s%s(system_name,theta,free);",method)); # Simulate system

    if View
86
87
88
89
90
91
92
93

94
95
96
97
98
99
100
86
87
88
89
90
91
92

93
94
95
96
97
98
99
100







-
+







    if error<(error_old+criterion) # Save some diagnostics
      Error = [Error error];	# Save error
      Theta = [Theta theta];	# Save parameters
      Y = [Y y];		# Save output
    endif

    ## Update the estimate if we are not done yet.
    if (abs(error_old-error)>criterion)&&(iterations<max_iterations)
    if (abs(error_old-error)>criterion)&&(abs(error)>criterion)&&(iterations<max_iterations)
      if error>(error_old+criterion) # Reduce step size and try again
        factor = 10;
	disp(sprintf("%2.2f*step",alpha));
	error = error_old;	# Go back to previous error value
	error_old = inf;	# Don't let it think its converged
	theta(free) = theta(free)  + step; # Reverse step
	step = alpha*step;	# new stepsize

MTT: Model Transformation Tools
GitHub | SourceHut | Sourceforge | Fossil RSS ]