diff options
author | Michaël Baudin <michael.baudin@scilab.org> | 2009-10-08 15:01:35 +0200 |
---|---|---|
committer | Michaël Baudin <michael.baudin@scilab.org> | 2009-10-08 15:01:35 +0200 |
commit | ebf3fce946fe67578de034fcc89e69f5b740a385 (patch) | |
tree | 1b78e7ae51ece31e9998da168fb298b64b345444 /scilab_doc | |
parent | 86f041dd374fb593a4f345659d3d19395dd0dc52 (diff) | |
download | scilab-ebf3fce946fe67578de034fcc89e69f5b740a385.zip scilab-ebf3fce946fe67578de034fcc89e69f5b740a385.tar.gz |
Added manual for plotting functions
Diffstat (limited to 'scilab_doc')
-rw-r--r-- | scilab_doc/neldermead/fminsearch-so.pdf | bin | 226589 -> 239703 bytes | |||
-rw-r--r-- | scilab_doc/neldermead/fminsearch.tex | 35 | ||||
-rw-r--r-- | scilab_doc/neldermead/scripts/fminsearch_demo.m | 9 | ||||
-rw-r--r-- | scilab_doc/neldermead/testFminsearchOptimplotfunccountScilab.png | bin | 0 -> 5164 bytes | |||
-rw-r--r-- | scilab_doc/neldermead/testFminsearchOptimplotxMatlab.png | bin | 0 -> 5533 bytes | |||
-rw-r--r-- | scilab_doc/neldermead/testFminsearchOptimplotxScilab.png | bin | 0 -> 4448 bytes |
6 files changed, 33 insertions, 11 deletions
diff --git a/scilab_doc/neldermead/fminsearch-so.pdf b/scilab_doc/neldermead/fminsearch-so.pdf index 5973dce8..22f5123 100644 --- a/scilab_doc/neldermead/fminsearch-so.pdf +++ b/scilab_doc/neldermead/fminsearch-so.pdf | |||
Binary files differ | |||
diff --git a/scilab_doc/neldermead/fminsearch.tex b/scilab_doc/neldermead/fminsearch.tex index 191541b..4545f5e 100644 --- a/scilab_doc/neldermead/fminsearch.tex +++ b/scilab_doc/neldermead/fminsearch.tex | |||
@@ -301,12 +301,6 @@ precision is both these softwares is $\epsilon \approx 10^{-16}$. | |||
301 | That implies that there are approximately 16 significant digits. | 301 | That implies that there are approximately 16 significant digits. |
302 | Therefore, the relative error on $x$, which is equivalent to 15 | 302 | Therefore, the relative error on $x$, which is equivalent to 15 |
303 | significant digits, is acceptable. | 303 | significant digits, is acceptable. |
304 | If we now consider the relative error on $f$, which is equivalent | ||
305 | to only 8 significant digits, that may sound as a problem. | ||
306 | This corresponds to the square root of the relative precision, | ||
307 | because $\sqrt{\epsilon} = \approx 10^{-8}$. | ||
308 | In fact, this is the best that we can expect from an optimization | ||
309 | algorithm (\cite{Brent73algorithmsfor,Gill81MurrayWright}). | ||
310 | 304 | ||
311 | Therefore, the result is as close as possible to the result produced | 305 | Therefore, the result is as close as possible to the result produced |
312 | by Matlab. More specifically : | 306 | by Matlab. More specifically : |
@@ -666,3 +660,32 @@ The comparison between the figures \ref{fig-fminsearch-matlab-optimplotfval} and | |||
666 | very similar plots. Notice that Scilab's \scifunction{fminsearch} does not | 660 | very similar plots. Notice that Scilab's \scifunction{fminsearch} does not |
667 | provide the "Stop" and "Pause" buttons. | 661 | provide the "Stop" and "Pause" buttons. |
668 | 662 | ||
663 | The figures \ref{fig-fminsearch-scilab-optimplotx} and \ref{fig-fminsearch-scilab-optimplotfunccount} | ||
664 | present the results of Scilab's \scifunction{optimplotx} and \scifunction{optimplotfunccount} | ||
665 | functions. | ||
666 | |||
667 | \begin{figure} | ||
668 | \begin{center} | ||
669 | \includegraphics[width=10cm]{testFminsearchOptimplotxScilab.png} | ||
670 | \end{center} | ||
671 | \caption{Plot produced by Scilab's fminsearch, with the \scifunction{optimplotx} function.} | ||
672 | \label{fig-fminsearch-scilab-optimplotx} | ||
673 | \end{figure} | ||
674 | |||
675 | \begin{figure} | ||
676 | \begin{center} | ||
677 | \includegraphics[width=10cm]{testFminsearchOptimplotfunccountScilab.png} | ||
678 | \end{center} | ||
679 | \caption{Plot produced by Scilab's fminsearch, with the \scifunction{optimplotfunccount} function.} | ||
680 | \label{fig-fminsearch-scilab-optimplotfunccount} | ||
681 | \end{figure} | ||
682 | |||
683 | \section{Conclusion} | ||
684 | |||
685 | The current version of Scilab's \scifunction{fminsearch} provides the same algorithm | ||
686 | as Matlab's \scifunction{fminsearch}. The numerical precision is the same. | ||
687 | The \scifunction{optimset} and \scifunction{optimget} functions allows to configure the optimization, | ||
688 | as well as the output and plotting function. | ||
689 | Pre-defined plotting function allows to get a fast and nice plot of the optimization. | ||
690 | |||
691 | |||
diff --git a/scilab_doc/neldermead/scripts/fminsearch_demo.m b/scilab_doc/neldermead/scripts/fminsearch_demo.m index 41f8365..4b72498 100644 --- a/scilab_doc/neldermead/scripts/fminsearch_demo.m +++ b/scilab_doc/neldermead/scripts/fminsearch_demo.m | |||
@@ -60,19 +60,18 @@ opt = optimset('Display','iter' , 'MaxIter' , 10 ); | |||
60 | % Sample use of an output function | 60 | % Sample use of an output function |
61 | options = optimset('OutputFcn', @outfun); | 61 | options = optimset('OutputFcn', @outfun); |
62 | hold on | 62 | hold on |
63 | objfun=@(x) exp(x(1))*(4*x(1)^2+2*x(2)^2+x(1)*x(2)+2*x(2)); | 63 | [x fval] = fminsearch(objfun, [-1.2, 1], options) |
64 | [x fval] = fminsearch(objfun, [-1 1], options) | ||
65 | hold off | 64 | hold off |
66 | 65 | ||
67 | % Sample use of a plot function : optimplotfval | 66 | % Sample use of a plot function : optimplotfval |
68 | options = optimset('PlotFcns',@optimplotfval); | 67 | options = optimset('PlotFcns',@optimplotfval); |
69 | [x ffinal] = fminsearch(@onehump,[2,1],options) | 68 | [x ffinal] = fminsearch(banana,[-1.2, 1],options) |
70 | 69 | ||
71 | % Sample use of a plot function : optimplotx | 70 | % Sample use of a plot function : optimplotx |
72 | options = optimset('PlotFcns',@optimplotx); | 71 | options = optimset('PlotFcns',@optimplotx); |
73 | [x ffinal] = fminsearch(@onehump,[2,1],options) | 72 | [x ffinal] = fminsearch(banana,[-1.2, 1],options) |
74 | 73 | ||
75 | % Sample use of a plot function : optimplotfunccount | 74 | % Sample use of a plot function : optimplotfunccount |
76 | options = optimset('PlotFcns',@optimplotfunccount); | 75 | options = optimset('PlotFcns',@optimplotfunccount); |
77 | [x ffinal] = fminsearch(@onehump,[2,1],options) | 76 | [x ffinal] = fminsearch(banana,[-1.2, 1],options) |
78 | 77 | ||
diff --git a/scilab_doc/neldermead/testFminsearchOptimplotfunccountScilab.png b/scilab_doc/neldermead/testFminsearchOptimplotfunccountScilab.png new file mode 100644 index 0000000..28ca428 --- /dev/null +++ b/scilab_doc/neldermead/testFminsearchOptimplotfunccountScilab.png | |||
Binary files differ | |||
diff --git a/scilab_doc/neldermead/testFminsearchOptimplotxMatlab.png b/scilab_doc/neldermead/testFminsearchOptimplotxMatlab.png new file mode 100644 index 0000000..9ef102a --- /dev/null +++ b/scilab_doc/neldermead/testFminsearchOptimplotxMatlab.png | |||
Binary files differ | |||
diff --git a/scilab_doc/neldermead/testFminsearchOptimplotxScilab.png b/scilab_doc/neldermead/testFminsearchOptimplotxScilab.png new file mode 100644 index 0000000..7697c0e --- /dev/null +++ b/scilab_doc/neldermead/testFminsearchOptimplotxScilab.png | |||
Binary files differ | |||