diff options
author | Rafael Laboissière <rafael@debian.org> | 2022-03-02 03:24:21 -0300 |
---|---|---|
committer | Rafael Laboissière <rafael@debian.org> | 2022-03-02 03:24:21 -0300 |
commit | 0284edf4ab02cb81d952781df5a60766268acba5 (patch) | |
tree | d807255ce73a0fbef41bdd1c4ac5055fbe1d2c75 | |
parent | ae332abdc19f1e56c5c509b16c8ed9ef37acb79a (diff) | |
parent | 0f92462973665e0f2d2293455b821d9b4c5ba266 (diff) |
Merge tag 'upstream/2.7.0' into debian/latest
Upstream version 2.7.0
491 files changed, 2622 insertions, 2142 deletions
@@ -2,18 +2,18 @@ To cite this release of STK in publications use: - Julien Bect, Emmanuel Vazquez and others (2019). - STK: a Small (Matlab/Octave) Toolbox for Kriging. Release 2.6. - URL http://kriging.sourceforge.net + Julien Bect, Emmanuel Vazquez and others (2022). + STK: a Small (Matlab/Octave) Toolbox for Kriging. Release 2.7. + URL https://github.com/stk-kriging/stk/ A BibTeX entry for LaTeX users is: @misc{, author = {Bect, Julien and Vazquez, Emmanuel and others}, title = {{STK}: a {S}mall ({M}atlab/{O}ctave) {T}oolbox - for {K}riging. {R}elease 2.6}, - year = {2019}, - url = {http://kriging.sourceforge.net} + for {K}riging. {R}elease 2.7}, + year = {2022}, + url = {https://github.com/stk-kriging/stk/} } We have invested a lot of time and effort in the development of STK. @@ -1,5 +1,662 @@ +2022-02-23 Julien Bect <julien.bect@centralesupelec.fr> + + stk_init.m: Update the list of functions that contain persistents + + * stk_init.m (stk_init__clear_persistents): Update the list of + functions that contain persistent variables. + +2022-02-15 Julien Bect <julien.bect@centralesupelec.fr> + + README.md: Explain how to initialize STK when using the PCT + + * README.md: Explain how to initialize STK when using the Parallel + Computing Toolbox in Matlab, by means of the `pctRunOnAll` function. + * NEWS.md: Advertise the change. + + Remove two deprecated functions + + * misc/optim/stk_optim_hasfmincon.m: Remove deprecated function. + * misc/optim/stk_select_optimizer.m: Remove deprecated function. + * admin/octpkg/INDEX: Update Octave package index. + * admin/build_tools/build_octpkg.m: Update build process. + * NEWS.md: Advertise the removal. + + stk_init.m: Call stk_options_set with the 'default' argument + + * stk_init.m: Call stk_options_set with the 'default' argument. + This can make a different in situations where stk_init is called + during a Matlab/Octave session where STK was previously + initialized. + + stk_options_set.m: Fix copyright notice + + * misc/options/stk_options_set.m: Fix copyright notice. + +2022-02-14 Julien Bect <julien.bect@centralesupelec.fr> + + .gitattributes: Convert CRLF to LF automatically for text files + + * .gitattributes: Convert CRLF to LF automatically for text files. + +2022-02-11 Julien Bect <julien.bect@centralesupelec.fr> + + run-tests.yml: Test the all purpose release on ubuntu-latest + + * .github/workflows/run-tests.yml: Test the all purpose release on + ubuntu-latest + +2022-02-10 Julien Bect <julien.bect@centralesupelec.fr> + + run-tests.yml: Test Octage package tarball on ubuntu-latest + + * .github/workflows/run-tests.yml: Test Octage package tarball on + Ubuntu latest. + +2022-02-05 Julien Bect <julien.bect@centralesupelec.fr> + + Rename github action: run-unit-tests.yml -> run-tests.yml + + * .github/workflows/run-unit-tests.yml: Rename from. + * .github/workflows/run-tests.yml: Rename to. + * README.md: Update badge. + + build_octpkg.m: Exclude misc/mole entirely + + * admin/build_tools/build_octpkg.m: Exclude misc/mole entirely. + * admin/octpkg/patches/stk-init-mole-delete.patch: Simplify patch. + + startup.m: Run stk_init automatically for in-place use + + * startup.m: New script that runs stk_init automatically for + in-place use. + * admin/build_tools/build_octpkg.m: Do not include startup.m in + the Octave package release. + * NEWS.md: Advertise new script. + +2022-02-04 Julien Bect <julien.bect@centralesupelec.fr> + + Remove old (hg) release instructions + + * admin/RELEASE.md: Deleted + +2022-02-03 Julien Bect <julien.bect@centralesupelec.fr> + + stk_predict_leaveoneout.m: Avoid complex-valued norm_res + + * model/@stk_model_gpposterior/stk_predict_leaveoneout.m: Prevent + norm_res from being complex-valued by cancelling negative elements + in dR. + + stk_plot_histnormres.m: Ensure non-zero binsize + + * utils/stk_plot_histnormres.m: Introduce a safety net for samples + with small (possibly zero) IQR. + +2022-01-31 Julien Bect <julien.bect@centralesupelec.fr> + + stk_plot_histnormres.m: Ensure non-zero number of bins + + * utils/stk_plot_histnormres.m: Make sure that we have a non-zero + number of bins using Sturges' rule. + +2022-01-28 Julien Bect <julien.bect@centralesupelec.fr> + + Remove the MOLE from the Octave package entirely + + * stk_init.m: Update comments. + * admin/octpkg/patches/stk-init-mole-cleanup.patch: Rename from. + * admin/octpkg/patches/stk-init-mole-delete.patch: Rename to. + Delete everything related to the MOLE inside stk_init. + * admin/octpkg/patches/series: Refresh. + * admin/octpkg/post_install.m: Delete (no longer needed). + * admin/build_tools/build_octpkg.m: Refresh. + + Raise required Octave version number to 4.0.0 + + * README.md: Raise required Octave version number to 4.0.0. + * admin/build_tools/build_octpkg.m: Iem. + * admin/CODING_GUIDELINES: Update. + * arrays/@stk_hrect/stk_hrect.m: Refer to CG#08. + * misc/test/stk_runtests.m: Remove reference to 3.8.2. + + Avoid using isrow + + * admin/CODING_GUIDELINES: Explain why. + * misc/mole/isrow/isrow.m: Delete. + * stk_init.m: isrow removed from the MOLE. + * misc/mole/README: Minor update. + * admin/octpkg/patches/stk-init-mole-cleanup.patch: Refresh patch. + * arrays/@stk_dataframe/plot.m: Don't use isrow. + * misc/pareto/stk_dominatedhv.m: Don't use isrow. + +2022-01-26 Julien Bect <julien.bect@centralesupelec.fr> + + MOLE: linsolve is no longer needed + + * misc/mole/linsolve/linsolve.m: Deleted. + * admin/octpkg/patches/stk-init-mole-cleanup.patch: Refresh patch. + * misc/mole/README: Remove linsolve. + * stk_init.m: Remove linsolve. + + build: Fix path issue + + * admin/build.m: Do not add root dir to the path. + * admin/build_tools/check_index_file.m: Remove unused portion. + * admin/build_tools/get_public_mfile_list.m: Take extra precautions. + * admin/build_tools/get_version_number.m: Add root dir to the path. + + build: Makefile: Remove reference to Mercurial + + * Makefile: Remove reference to Mercurial + + build: New patch for stk_init + + * admin/octpkg/patches/stk-init-mole-cleanup.patch: New patch to + trim some Matlab-related things out of stk_init. + * admin/octpkg/patches/series: Add the patch to the series. + + build: Wrap system calls in asserts + + * admin/build_tools/build_allpurpose.m: Wrap system calls in asserts. + * admin/build_tools/build_octpkg.m: Idem. + * admin/build_tools/generate_htmldoc.m: Idem. + + admin/octpkg/patches: Refresh patches + + * admin/octpkg/patches/matlab-graphics-axis-Axes.patch: Refresh. + * admin/octpkg/patches/remove-buildmex.patch: Refresh. + * admin/octpkg/patches/stk-init-rmpath-cleanup.patch: Refresh. + + Refresh README.md + + * README.md: Update sourceforge -> github + other changes. + +2022-01-25 Julien Bect <julien.bect@centralesupelec.fr> + + Add missing 'hold off' in some plotting functions + + * utils/stk_plot_histnormres.m: Add missing 'hold off'. + * utils/stk_plot_predvsobs.m: Idem. + + stk_example_kb10.m: Fix typo. + + * stk_example_kb10.m: Fix typo. + +2022-01-23 Julien Bect <julien.bect@centralesupelec.fr> + + Makefile: sourceforge -> github in variable names & targets + + * Makefile: sourceforge -> github in variable names & targets. + +2022-01-20 Julien Bect <julien.bect@centralesupelec.fr> + + stk_generate_samplepaths.m: Fix copyright notice + + * utils/stk_generate_samplepaths.m: Fix copyright notice. + +2022-01-10 Julien Bect <julien.bect@centralesupelec.fr> + + Calling stk_model with a function handle is better + + * core/stk_make_matcov.m: Call stk_model with a function handle. + * core/stk_model_update.m: Idem. + * core/stk_predict.m: Idem. + * core/stk_predict_leaveoneout.m: Idem. + * covfcs/stk_discretecov.m: Idem. + * examples/01_kriging_basics/stk_example_kb01.m: Idem. + * examples/01_kriging_basics/stk_example_kb01n.m: Idem. + * examples/01_kriging_basics/stk_example_kb02.m: Idem. + * examples/01_kriging_basics/stk_example_kb02n.m: Idem. + * examples/01_kriging_basics/stk_example_kb03.m: Idem. + * examples/01_kriging_basics/stk_example_kb05.m: Idem. + * examples/01_kriging_basics/stk_example_kb06.m: Idem. + * examples/01_kriging_basics/stk_example_kb07.m: Idem. + * examples/01_kriging_basics/stk_example_kb08.m: Idem. + * examples/01_kriging_basics/stk_example_kb09.m: Idem. + * examples/02_design_of_experiments/stk_example_doe03.m: Idem. + * examples/02_design_of_experiments/stk_example_doe04.m: Idem. + * examples/02_design_of_experiments/stk_example_doe05.m: Idem. + * examples/02_design_of_experiments/stk_example_doe06.m: Idem. + * examples/03_miscellaneous/stk_example_misc02.m: Idem. + * examples/03_miscellaneous/stk_example_misc03.m: Idem. + * examples/03_miscellaneous/stk_example_misc04.m: Idem. + * examples/03_miscellaneous/stk_example_misc05.m: Idem. + * iago/crit/stk_optim_crit_EI.m: Idem. + * iago/crit/stk_optim_crit_SUR.m: Idem. + * iago/crit/stk_optim_crit_iago.m: Idem. + * iago/utils/stk_optim_init.m: Idem. + * misc/benchmarks/stk_benchmark_logdet.m: Idem. + * misc/benchmarks/stk_benchmark_loocv.m: Idem. + * misc/benchmarks/stk_benchmark_paramestim.m: Idem. + * misc/benchmarks/stk_benchmark_predict.m: Idem. + * model/@stk_model_gpposterior/get.m: Idem. + * model/@stk_model_gpposterior/set.m: Idem. + * model/@stk_model_gpposterior/stk_model_gpposterior.m: Idem. + * model/@stk_model_gpposterior/stk_model_update.m: Idem. + * model/@stk_model_gpposterior/stk_predict_.m: Idem. + * model/@stk_model_gpposterior/stk_predict_leaveoneout.m: Idem. + * model/noise/@stk_gaussiannoise_het0/set.m: Idem. + * model/prior_struct/stk_covmat_noise.m: Idem. + * model/prior_struct/stk_model.m: Idem. + * model/prior_struct/stk_ortho_func.m: Idem. + * param/estim/stk_param_estim.m: Idem. + * param/estim/stk_param_gls.m: Idem. + * param/estim/stk_param_init.m: Idem. + * param/estim/stk_param_init_lnv.m: Idem. + * param/estim/stk_param_loomse.m: Idem. + * param/estim/stk_param_loopvc.m: Idem. + * param/estim/stk_param_relik.m: Idem. + * sampling/stk_sampcrit_akg_eval.m: Idem. + * sampling/stk_sampcrit_ei_eval.m: Idem. + * utils/stk_conditioning.m: Idem. + * utils/stk_generate_samplepaths.m: Idem. + + Source formatting: Space after function name + + * iago/crit/stk_optim_crit_EI.m: Space after function name. + * iago/crit/stk_optim_crit_SUR.m: Idem. + * model/prior_struct/stk_model.m: Idem. + * param/estim/stk_param_loomse.m: Idem. + * param/estim/stk_param_relik.m: Idem. + * sampling/stk_sampcrit_akg_eval.m: Idem. + * sampling/stk_sampcrit_ei_eval.m: Idem. + +2022-01-03 Julien Bect <julien.bect@centralesupelec.fr> + + Fix some linter messages + + * admin/stk_mlint_all.m: Make some linter errors 'critical', which + means that the corresponding github action will fail if one of + these reappears. + * .github/workflows/run-linter.yml: Let the github fail if the + linter status flag is false. + * README.md: Display linter action badge. + * admin/build_tools/generate_htmldoc.m: Fix some linter messages. + * admin/octpkg/post_install.m: Idem. + * misc/benchmarks/stk_benchmark_uppertriangular.m: Idem. + * misc/mole/linsolve/linsolve.m: Idem. + * misc/mole/matlab/index.m: Idem. + * misc/optim/@stk_optim_fmincon/stk_optim_fmincon.m: Idem. + * misc/optim/@stk_optim_octavesqp/private/sqp_quadprog.m: Idem. + * misc/test/stk_test.m: Idem. + * param/estim/stk_param_relik.m: Idem. + * stk_init.m: Idem. + +2021-12-08 Julien Bect <julien.bect@centralesupelec.fr> + + github: Run linter + + * admin/stk_mlint_all.m: A function to run the linter on + all the M-files of the toolbox. + * .github/workflows/run-linter.yml: Github action. + +2021-11-20 Julien Bect <julien.bect@centralesupelec.fr> + + github: Run unit tests in Octave too + + * .github/workflows/run-unit-tests.yml: Run unit tests in Octave + too (in Ubuntu). + + tests: Deal with expected failures + + * misc/test/stk_test.m: Expected failures are no longer reported + as successes. + * misc/test/stk_runtests.m: Deal with expected failures. + * .github/workflows/run-unit-tests.yml: Do not fail when all + failures were expected. + + iago: Remove 'showprogress' option + + * iago/crit/stk_optim_crit_SUR.m: Remove 'showprogress' option. + * iago/crit/stk_optim_crit_iago.m: Idem + * iago/stk_optim.m: Idem + * iago/stk_optimscript.m: Idem + * iago/utils/stk_optim_init.m: Idem + +2021-11-14 Julien Bect <julien.bect@centralesupelec.fr> + + README.md: Use default style for licence badge + + * README.md: Use default style for licence badge. + + .github/workflows/run-unit-tests.yml: Rename last step + + * .github/workflows/run-unit-tests.yml: Rename last step + + stk_parallel_engine_parfor.m: Remove unit test + + * misc/parallel/@stk_parallel_engine_parfor/stk_parallel_engine_parfor.m: + Remove unit test, which was creating problems for continuous + integration using Github Actions. Not a very interesting test anyway. + +2021-11-13 Julien Bect <julien.bect@centralesupelec.fr> + + github: Run unit tests in MATLAB with Github Actions + + * .github/workflows/run-unit-tests.yml: Run unit tests in MATLAB + with Github Actions on several recent releases. Save the logs as + artifacts. + * README.md: Add a few badges. + +2021-06-14 Julien Bect <julien.bect@centralesupelec.fr> + + stk_example_kb07.m: Add a second figure + + * examples/01_kriging_basics/stk_example_kb07.m: Add a second + figure where nu is fixed to 5/2 and rho varies. + +2021-03-28 Julien Bect <julien.bect@centralesupelec.fr> + + Deprecate CG#07 + + * admin/CODING_GUIDELINES: Deprecated CG#07. + * arrays/@stk_factorialdesign/private/plot_surfmeshcontour.m: Use ~. + * iago/rep/stk_gather_repetitions.m: Use ~. + * misc/optim/@stk_optim_octavesqp/private/sqp_quadprog.m: Use ~. + * misc/optim/@stk_optim_octavesqp/stk_minimize_boxconstrained.m: Use ~. + * misc/text/stk_disp_getformat.m: Use ~. + * misc/text/stk_disp_isloose.m: Use ~. + * param/estim/stk_param_init_remlgls.m: Use ~. + * sampling/stk_sampcrit_akg_eval.m: Use ~. + * sampling/stk_sampling_maximinlhs.m: Use ~. + * sampling/stk_sampling_nesteddesign.m: Use ~. + * sampling/stk_sampling_nestedlhs.m: Use ~. + * utils/stk_generate_samplepaths.m: Use ~. + + README.md: Raise minimal Matlab version to R2009b + + * README.md: Raise minimal Matlab version to R2009b (we are in + 2021 after all...). + + stk_param_gls.m: Rely on mldivide + + * param/estim/stk_param_gls.m: Rely on mldivide to do the job, + instead of writing the normal equations explicitely. + +2021-15-01 Julien Bect <julien.bect@centralesupelec.fr> + + stk_param_gls.m: Use linsolve to solve triangular systems + + * param/estim/stk_param_gls.m: Use linsolve to solve triangular + systems. + +2021-14-01 Julien Bect <julien.bect@centralesupelec.fr> + + stk_test_critgrad.m: New function to check partial derivatives + + * misc/test/stk_test_critgrad.m: New function to check partial + derivatives of parameter selection criteria. + * param/estim/stk_param_loomse.m: More unit tests. + * param/estim/stk_param_loopvc.m: Idem. + * param/estim/stk_param_relik.m: Idem. + * misc/test/stk_test_class.m: Internal function warning. + * misc/test/stk_test_dfbinaryop.m: Idem. + * admin/octpkg/INDEX: Update index. + +2020-09-16 Julien Bect <julien.bect@centralesupelec.fr> + + @stk_dataframe/plot.m: Fix argument parsing + + * arrays/@stk_dataframe/plot.m: Fix argument parsing. + +2020-09-10 Julien Bect <julien.bect@centralesupelec.fr> + + stk_sampcrit_emmi_eval.m: Fix bibliography + + * sampling/stk_sampcrit_emmi_eval.m: Cite the published paper of + Svenson and Santner instead of the technical report. + +2020-06-20 Julien Bect <julien.bect@centralesupelec.fr> + + INDEX: Add dedicated category for simulation functions + + * admin/octpkg/INDEX: Create a dedicated category for + simulation-related functions. + +2020-05-29 Julien Bect <julien.bect@centralesupelec.fr> + + stk_*cov_iso.m: Check param length + + * covfcs/stk_expcov_iso.m: Check param length, add unit test. + * covfcs/stk_gausscov_iso.m: Idem. + * covfcs/stk_materncov32_iso.m: Idem. + * covfcs/stk_materncov52_iso.m: Idem. + * covfcs/stk_materncov_iso.m: Idem. + * covfcs/stk_sphcov_iso.m: Idem. + +2020-04-26 Julien Bect <julien.bect@centralesupelec.fr> + + stk_example_doe06.m: New example script + + * examples/02_design_of_experiments/stk_example_doe06.m: New script. + * examples/02_design_of_experiments/stk_example_doe03.m: Minor changes. + * admin/octpkg/INDEX: Add new script to the index. + +2020-04-21 Julien Bect <julien.bect@centralesupelec.fr> + + examples/02_design_of_experiments: Fix comments in two scripts + + * examples/02_design_of_experiments/stk_example_doe03.m: Fix comment. + * examples/02_design_of_experiments/stk_example_doe05.m: Idem. + +2020-04-13 Julien Bect <julien.bect@centralesupelec.fr> + + Remove some deprecated functions + + * model/@stk_model_gpposterior/get_input_data.m: Remove deprecated function. + * model/@stk_model_gpposterior/get_output_data.m: Idem. + * model/@stk_model_gpposterior/get_prior_model.m: Idem. + * model/prior_struct/@struct/README: Remove no-longer-needed explanation. + * model/prior_struct/@struct/get_input_data.m: Idem. + * model/prior_struct/@struct/get_output_data.m: Idem. + * model/prior_struct/@struct/get_prior_model.m: Idem. + * admin/octpkg/INDEX: Update index. + +2020-04-11 Julien Bect <julien.bect@centralesupelec.fr> + + Delete unused internal function @stk_kreq_qr/stk_update.m + + * core/@stk_kreq_qr/stk_update.m: Delete unused internal function. + * model/@stk_model_gpposterior/stk_model_update.m: Remove comment. + * admin/octpkg/INDEX: Update index. + +2020-02-20 Julien Bect <julien.bect@centralesupelec.fr> + + stk_example_doe05.m: Fix comments + + * examples/02_design_of_experiments/stk_example_doe05.m: Fix comments. + + stk_example_doe05.m: Various minor improvements + + * examples/02_design_of_experiments/stk_example_doe05.m: Various + minor improvements. + +2020-02-19 Julien Bect <julien.bect@centralesupelec.fr> + + Remove deprecated CG#12 marks + + * examples/02_design_of_experiments/stk_example_doe03.m: Remove + deprecated CG#12 mark. + * examples/02_design_of_experiments/stk_example_doe05.m: Idem. + + stk_example_doe05.m: Fix figure title + + * examples/02_design_of_experiments/stk_example_doe05.m: Fix + figure title to reflect the actual name of the example. + + * examples/02_design_of_experiments/stk_example_doe05.m: Fix the + final display for the case where the algorithm stops prematurely, + and add a warning too. + + stk_example_doe05.m: Make it possible to use the exact KG + + * examples/02_design_of_experiments/stk_example_doe05.m: Make it + possible to use the exact KG criterion instead of Scott's + approximation (previously, only the latter was proposed). + + @stk_sampcrit_akg/set.m: Remove replicated input points in xr + + * sampling/@stk_sampcrit_akg/set.m: Remove replicated input points + when the AKG reference grid is construted using Scott's original + method. + +2020-02-07 Julien Bect <julien.bect@centralesupelec.fr> + + stk_param_estim_optim.m: Generate a warning instead of an error + + * param/estim/stk_param_estim_optim.m: Generate a warning instead + of an error when the optimization algorithms returns a points that + is not better than the starting point. + +2020-01-08 Julien Bect <julien.bect@centralesupelec.fr> + + Re-organise prediction code + + * core/stk_predict.m: Now reduced to a simple gateway that + processes all possible calling syntaxes and then delegates to + `stk_predict` for the actual computations, for all types of + models. The shorter calling syntax is now documented. + * model/@stk_model_/stk_predict_.m: New function, that simply + raises an error message. Derived classes must implement it. + * model/@stk_model_gpposterior/stk_predict.m: Renamed from. + * model/@stk_model_gpposterior/stk_predict_.m: Renamed to. + * model/prior_struct/stk_predict_.m: New function, which computes + a trivial prediction for prior models. + * model/noise/@stk_gaussiannoise_/stk_predict_.m: New function, + which computes a trivial prediction for noise models. + * admin/octpkg/INDEX: Update index. + + @stk_gaussiannoise_het0/stk_variance_eval.m: Fix empty x case + + * model/noise/@stk_gaussiannoise_het0/stk_variance_eval.m: Return + the correct output when x is empty. + + stk_gaussiannoise_het0.m: Provide a default constructor + + * model/noise/@stk_gaussiannoise_het0/stk_gaussiannoise_het0.m: + Provide a default constructor. + +2020-01-07 Julien Bect <julien.bect@centralesupelec.fr> + + Minor changes relative to `stk_isnoisy`. + + * admin/octpkg/INDEX: Classify as model property getter. + * model/prior_struct/stk_isnoisy.m: Polish help text. + + Use `sample_size` property + + * iago/crit/private/stk_optim_crit_fig02.m: Use `sample_size` property. + * iago/crit/private/view_samplingcrit_2d.m: Idem. + * iago/crit/stk_optim_crit_EI.m: Idem. + * iago/crit/stk_optim_crit_SUR.m: Idem. + * iago/crit/stk_optim_crit_iago.m: Idem. + * iago/rep/stk_gather_repetitions.m: Idem. + * iago/stk_optim.m: Idem. + * iago/stk_optimscript2.m: Idem. + * iago/utils/stk_optim_init.m: Idem. + * param/estim/stk_param_estim.m: Idem. + * param/estim/stk_param_init.m: Idem. + * param/estim/stk_param_init_lnv.m: Idem. + * sampling/@stk_sampcrit_eqi/feval.m: Idem. + * model/@stk_model_gpposterior/stk_model_update.m: Idem. + * model/@stk_model_gpposterior/stk_predict.m: Idem. + * model/@stk_model_gpposterior/stk_predict_leaveoneout_direct.m: Idem. + + Add `sample_size` property to models + + * model/@stk_model_gpposterior/fieldnames.m: Add `sample_size` to + the list of field names. Fix output orientation for consistency + with the base function. + * model/@stk_model_gpposterior/get.m: Implement `sample_size` + property. + * model/@stk_model_gpposterior/disp.m: Display `sample_size` + property. + * model/@stk_model_gpposterior/stk_get_sample_size.m: Fast getter. + * model/@stk_model_/stk_get_prior_model.m: Update design note. + * model/@stk_model_/stk_get_input_data.m: Idem. + * model/@stk_model_/stk_get_observation_variances.m: Idem. + * model/@stk_model_/stk_get_output_data.m: Idem. + * admin/octpkg/INDEX: Update index. + + Add `sample_size` property to arrays + + * arrays/@stk_dataframe/private/reserved_field_names.m: Add + `sample_size` to the list of field names. Return a column. + * arrays/@stk_dataframe/get.m: Implement `sample_size` property. + * arrays/@stk_dataframe/private/get_column_number.c: Idem. + * arrays/@stk_dataframe/stk_get_sample_size.m: Fast getter. + * arrays/generic/stk_get_sample_size.m: Idem for generic arrays. + * arrays/@stk_dataframe/fieldnames.m: Fix output orientation for + consistency with the base function. Fix unit test. + * arrays/@stk_factorialdesign/fieldnames.m: Idem. + * arrays/@stk_dataframe/stk_length.m: Deprecate. + * arrays/generic/stk_length.m: Deprecate. + * admin/octpkg/INDEX: Update index. + +2020-01-06 Julien Bect <julien.bect@centralesupelec.fr> + + admin/octpkg/patches: Update patches + + * admin/octpkg/patches/remove-buildmex.patch: Update patch. + * admin/octpkg/patches/remove-testprivatemex.patch: Update patch. + +2020-01-03 Julien Bect <julien.bect@centralesupelec.fr> + + stk_make_matcov.m: Do not convert inputs to double + + * core/stk_make_matcov.m: Do not convert inputs to double. Each + particular covariance function should be able to decide what kind + of input it accepts. + + @stk_model_gpposterior/stk_model_update.m: Improve clarity + + * model/@stk_model_gpposterior/stk_model_update.m: Add comments + and rename a variable for clarity. + + @stk_model_gpposterior/stk_{set,get}_optimizable_parameters.m: Fix bug + + * model/@stk_model_gpposterior/stk_get_optimizable_parameters.m: + Fix erroneous property name. + * model/@stk_model_gpposterior/stk_set_optimizable_parameters.m: + Idem. + +2020-01-02 Julien Bect <julien.bect@centralesupelec.fr> + + stk_generate_samplepaths.m: Remove outdated comment + + * utils/stk_generate_samplepaths.m: Remove outdated comment. + +2019-12-04 Julien Bect <julien.bect@centralesupelec.fr> + + 01_kriging_basics/stk_example_kb03.m: Fix comment + + * examples/01_kriging_basics/stk_example_kb03.m: Fix comment about + "numerical noise". + + 01_kriging_basics/stk_example_kb03.m: Source formatting + + * examples/01_kriging_basics/stk_example_kb03.m: Source formatting. + +2019-12-03 Julien Bect <julien.bect@centralesupelec.fr> + + Make STK startup faster + + * stk_init.m: Make STK startup faster using a better way of + checking if -silent is supported by mex. + 2019-10-12 Julien Bect <julien.bect@centralesupelec.fr> + Polish/uniformize one-line help for deprecated functions + + * covfcs/rbf/stk_sf_gausscorr.m: Polish one-line help text. + * covfcs/rbf/stk_sf_matern.m: Idem. + * covfcs/rbf/stk_sf_matern32.m: Idem. + * covfcs/rbf/stk_sf_matern52.m: Idem. + * covfcs/stk_noisecov.m: Idem. + * misc/optim/stk_optim_hasfmincon.m: Idem. + * misc/optim/stk_select_optimizer.m: Idem. + * model/prior_struct/stk_ortho_func.m: Idem. + stk_factorialdesign.m: Provide missing help text (ticket #91) * arrays/@stk_factorialdesign/stk_factorialdesign.m: Provide @@ -13,6 +670,14 @@ * model/noise/@stk_gaussiannoise_/stk_gaussiannoise_.m: Mark as internal. + RELEASE.md: Fix release instructions + + * admin/RELEASE.md: Fix release instructions. + + CITATION: Make bibtex reference year configurable + + * CITATION: Make bibtex reference year configurable. + 2019-09-03 Julien Bect <julien.bect@centralesupelec.fr> Makefile: Use ${OCTAVE} from environment if defined diff --git a/DESCRIPTION b/DESCRIPTION index 39168e9..27a516a 100644 --- a/DESCRIPTION +++ b/DESCRIPTION @@ -1,8 +1,8 @@ Name: STK # -Version: 2.6.1 +Version: 2.7.0 # -Date: 2019-10-12 +Date: 2022-02-23 # Title: STK: A Small Toolbox for Kriging # @@ -23,8 +23,8 @@ Description: The STK is a (not so) Small Toolbox for Kriging. Its primary # License: GPLv3+ # -Url: https://sourceforge.net/projects/kriging/ +Url: https://github.com/stk-kriging/stk/ # -Depends: octave (>= 3.8.0) +Depends: octave (>= 4.0.0) # Autoload: no @@ -2,7 +2,7 @@ stk >> STK, a Small Toolbox for Kriging ## Copyright Notice ## -## Copyright (C) 2015-2019 CentraleSupelec +## Copyright (C) 2015-2021 CentraleSupelec ## Copyright (C) 2014 SUPELEC ## ## Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -12,7 +12,7 @@ stk >> STK, a Small Toolbox for Kriging ## This file is part of ## ## STK: a Small (Matlab/Octave) Toolbox for Kriging -## (http://sourceforge.net/projects/kriging) +## (https://github.com/stk-kriging/stk/) ## ## STK is free software: you can redistribute it and/or modify it under ## the terms of the GNU General Public License as published by the Free @@ -59,14 +59,11 @@ Core STK functions stk_predict stk_predict_leaveoneout stk_pmisclass - stk_conditioning - stk_generate_samplepaths - stk_simulate_noise - stk_isnoisy #stk_ortho_func [deprecated] #stk_cholcov [internal] #stk_model_fixlm [internal] #stk_covmat_noise [internal] +#stk_predict_ [internal] Parameter estimation stk_param_estim @@ -81,12 +78,19 @@ Parameter estimation #stk_get_optimizable_parameters [internal] #stk_set_optimizable_parameters [internal] +Simulations + stk_conditioning + stk_generate_samplepaths + stk_simulate_noise + ## Base class for model objects #@stk_model_/stk_model_ [internal] +#@stk_model_/stk_predict_ [internal] #@stk_model_/stk_covmat_noise [overload STK] #@stk_model_/stk_get_input_data [overload STK] #@stk_model_/stk_get_output_data [overload STK] #@stk_model_/stk_get_prior_model [overload STK] +#@stk_model_/stk_get_sample_size [overload STK] #@stk_model_/stk_get_observation_variances [overload STK] #@stk_model_/cat [overload base] #@stk_model_/disp [overload base] @@ -103,21 +107,15 @@ Get/set model properties stk_get_output_data stk_get_prior_model stk_get_observation_variances -#@struct/get_input_data [deprecated] -#@struct/get_output_data [deprecated] -#@struct/get_prior_model [deprecated] + stk_isnoisy #stk_set_optimizable_model_parameters [internal] #stk_get_optimizable_model_parameters [internal] #stk_get_optimizable_noise_parameters [internal] Posterior model objects @stk_model_gpposterior/stk_model_gpposterior - @stk_model_gpposterior/stk_predict @stk_model_gpposterior/stk_predict_leaveoneout @stk_model_gpposterior/stk_model_update -#@stk_model_gpposterior/get_input_data [deprecated] -#@stk_model_gpposterior/get_output_data [deprecated] -#@stk_model_gpposterior/get_prior_model [deprecated] #@stk_model_gpposterior/stk_covmat_noise [overload STK] #@stk_model_gpposterior/stk_isnoisy [overload STK] #@stk_model_gpposterior/stk_generate_samplepaths [overload STK] @@ -128,7 +126,9 @@ Posterior model objects #@stk_model_gpposterior/stk_get_input_data [overload STK] #@stk_model_gpposterior/stk_get_output_data [overload STK] #@stk_model_gpposterior/stk_get_prior_model [overload STK] +#@stk_model_gpposterior/stk_get_sample_size [overload STK] #@stk_model_gpposterior/stk_make_kreq [internal] +#@stk_model_gpposterior/stk_predict_ [internal] #@stk_model_gpposterior/stk_predict_leaveoneout_direct [internal] #@stk_model_gpposterior/disp [overload base] #@stk_model_gpposterior/fieldnames [overload base] @@ -144,7 +144,6 @@ Posterior model objects #@stk_kreq_qr/stk_kreq_qr [internal] #@stk_kreq_qr/stk_set_righthandside [internal] #@stk_kreq_qr/stk_squared_seminorm [internal] -#@stk_kreq_qr/stk_update [internal] Model components: covariance functions stk_expcov_aniso @@ -198,6 +197,7 @@ Model components: linear model objects #@stk_gaussiannoise_/stk_covmat_noise [overload STK] #@stk_gaussiannoise_/stk_isnoisy [overload STK] #@stk_gaussiannoise_/stk_covmat [internal] +#@stk_gaussiannoise_/stk_predict_ [internal] #@stk_gaussiannoise_het0/stk_gaussiannoise_het0 [experimental] #@stk_gaussiannoise_het0/stk_variance_eval [experimental] #@stk_gaussiannoise_het0/disp [overload base] @@ -220,9 +220,9 @@ Design of experiments (non-sequential): sampling stk_sampling_regulargrid stk_sampling_vdc_rr2 -Design of experiments (non-sequential): criterions +Design of experiments (non-sequential): criteria ## note: some are in misc/design, others in misc/dist... -## Shouldn't they all be in sampling/criterions ? +## Shouldn't they all be in sampling/criteria ? stk_filldist #stk_filldist_discretized [internal] #stk_filldist_exact [internal] @@ -288,6 +288,7 @@ Examples: design of experiments stk_example_doe03 stk_example_doe04 stk_example_doe05 + stk_example_doe06 Examples: miscellaneous stk_example_misc01 @@ -314,19 +315,20 @@ Examples: test functions, datasets, etc. #stk_distrib_bivnorm_cdf [internal] ## A first step towards supporting more than nomal priors... -#stk_distrib_logpdf [internal] -#stk_distrib_logpdf_grad [internal] +#stk_distrib_logpdf [internal] +#stk_distrib_logpdf_grad [internal] Miscellaneous: arrays stk_boundingbox stk_feval - stk_length + stk_get_sample_size stk_normalize stk_rescale @stk_dataframe/stk_dataframe @stk_factorialdesign/stk_factorialdesign @stk_factorialdesign/ndgrid @stk_hrect/stk_hrect +#stk_length [deprecated] Miscellaneous: Pareto optimality stk_dominatedhv @@ -346,7 +348,8 @@ Miscellaneous: validation of models #@stk_dataframe/stk_boundingbox [overload STK] #@stk_dataframe/stk_conditioning [overload STK] -#@stk_dataframe/stk_length [overload STK] +#@stk_dataframe/stk_get_sample_size [overload STK] +#@stk_dataframe/stk_length [deprecated] #@stk_dataframe/stk_normalize [overload STK] #@stk_dataframe/stk_rescale [overload STK] #@stk_dataframe/apply [internal] @@ -494,7 +497,6 @@ Miscellaneous: optimizers for parameter estimation #@stk_optim_octavesqp/stk_minimize_unconstrained [overload STK] #stk_optim_testmin_box [internal] #stk_optim_testmin_unc [internal] -#stk_select_optimizer [deprecated] #@stk_optim_optimizer_/stk_optim_optimizer_ [internal] #@stk_optim_optimizer_/stk_optim_isavailable [overload STK] @@ -539,6 +541,7 @@ Miscellaneous: unit tests #stk_is_lhs [internal] #stk_test_class [internal] #stk_test_dfbinaryop [internal] +#stk_test_critgrad [internal] ## misc/text #stk_disp_examplewelcome [internal] @@ -1,3 +1,83 @@ +# Changes in version 2.7.0 + +## Required Matlab/Octave version + +* Required Matlab version number has been raised to R2009b. + +* Required Octave version number has been raised to 4.0.0. + +## Prediction + +* `stk_predict.m` now officially supports a shorter calling syntax: + + [zp, ...] = skt_predict (model, x_prd) + + that can be used either to compute predictions from any type of + model (proper prior model structures, posterior model object, + (experimental) noise model objects, etc.). + +* `@stk_model_gpposterior/stk_predict.m`: no longer exists. The base + `stk_predict` function now provides the recommended interface for + all possible types of models, and then dispatches to the (new) + internal function `stk_predict_` to do the actual computations (but + do not rely on it directly, since this is an internal function). + +## Models + +* `get_input_data`, `get_output_data`, `get_prior_model`: Removed + (these getters were already deprecated, cf. STK 2.6.0 release notes). + +## Arrays + +* `stk_dataframe` arrays now possess a `sample_size` property, which + can be read using the usual dot-indexing notation or through the + (slightly faster) getter `stk_get_sample_size`. + +* `stk_model_gpposterior` objects also have a `sample_size` property, + which corresponds to the sample size of the underlying data set and + can be read similarly. + +* `stk_length`: deprecated (use `stk_get_sample_size` instead). + +* `@stk_model_gpposterior/stk_{set,get}_optimizable_parameters.m`: Fix + a bug (erroneous property name). + +## Sequential design of experiments + +* `@stk_sampcrit_akg/set.m`: Remove replicated input points when the AKG + reference grid is construted using Scott's original method (i.e., taking + past observations points plus the candidate point). + +## Examples + +* `stk_example_kb07.m`: Add a second figure where nu is fixed to 5/2 + and rho varies. + +* `stk_example_doe05.m`: Make it possible to use the exact KG criterion + instead of Scott's approximation (previously, only the latter was + proposed). + +* `stk_example_doe06.m`: New example script, which illustrates a + simple sequential design strategy to estimate an excursion set + (failure region) and its volume (probability of failure). + +## Miscellaneous + +* `stk_init.m`: Make STK startup faster. + +* `startup.m`: Run `stk_init` automatically for in-place use. + +* `stk_select_optimizer.m`, `stk_optim_hasfmincon.m`: Removed + (had been deprecated since 2015, and were never part of the public API). + +* `README.md`: Explain how to initialize STK when using the Parallel + Computing Toolbox in Matlab, by means of the `pctRunOnAll` function. + +* Internal: source formatting, comments, etc. + +----- + + # Changes in version 2.6.1 ## Documentation diff --git a/doc/AUTHORS.md b/doc/AUTHORS.md index f1fd4d5..805fbce 100644 --- a/doc/AUTHORS.md +++ b/doc/AUTHORS.md @@ -17,6 +17,7 @@ The following people have helped develop the toolbox in various ways * DUTRIEUX Héloïse * FELIOT Paul * FRASNEDO Sophie + * GEORG Niklas * JAN Benoit * KETTANI Othmane * KRAUTH Alexandra diff --git a/doc/README.md b/doc/README.md index 551b591..8fb364f 100644 --- a/doc/README.md +++ b/doc/README.md @@ -1,10 +1,14 @@ - # STK: a Small (Matlab/Octave) Toolbox for Kriging +[![license](https://img.shields.io/github/license/stk-kriging/stk)](COPYING) +[![last commit](https://img.shields.io/github/last-commit/stk-kriging/stk/master)](https://github.com/stk-kriging/stk/commits/main) +[![unit tests](https://github.com/stk-kriging/stk/actions/workflows/run-tests.yml/badge.svg)](https://github.com/stk-kriging/stk/actions/workflows/run-tests.yml) +[![run-linter](https://github.com/stk-kriging/stk/actions/workflows/run-linter.yml/badge.svg)](https://github.com/stk-kriging/stk/actions/workflows/run-linter.yml) + This README file is part of *STK: a Small (Matlab/Octave) Toolbox for Kriging* -<http://sourceforge.net/projects/kriging> +<https://github.com/stk-kriging/stk/> STK is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free @@ -22,7 +26,7 @@ along with STK. If not, see <http://www.gnu.org/licenses/>. ## General information - Version: 2.6.1 (2019-10-12) + Version: 2.7.0 (2022-02-23) Authors: See AUTHORS.md file @@ -43,13 +47,13 @@ along with STK. If not, see <http://www.gnu.org/licenses/>. Non-parametric Regression, etc.). Copyright: Large portions are Copyright (C) 2011-2014 SUPELEC - and Copyright (C) 2015-2019 CentraleSupelec. + and Copyright (C) 2015-2022 CentraleSupelec. See individual copyright notices for more details. License: GNU General Public License, version 3 (GPLv3). See COPYING for the full license. - URL: <http://sourceforge.net/projects/kriging> + URL: <https://github.com/stk-kriging/stk/> ## One toolbox, two flavours @@ -58,7 +62,7 @@ The STK toolbox comes in two flavours: * an "all purpose" release, which is suitable for use both with [GNU Octave](http://www.gnu.org/software/octave/) - and with [Matlab](www.mathworks.com/products/matlab/). + and with [Matlab](https://www.mathworks.com/products/matlab/). * an Octave package, for people who want to install and use STK as a regular [Octave package](http://www.gnu.org/software/octave/doc/interpreter/Packages.html#Packages). @@ -74,12 +78,19 @@ Hint: if you're not sure about the version that you have... ### Quick start with the "all purpose" release (Matlab/Octave) -Download and unpack an archive of the "all purpose" release from the -[STK project](https://sourceforge.net/projects/kriging/) -[file release system](https://sourceforge.net/projects/kriging/files/) -on SourceForge. +Download and unpack an archive of the "all purpose" +[release](https://github.com/stk-kriging/stk/releases). -Run `stk_init.m` in either Octave or Matlab. +Run `stk_init` in either Octave or Matlab. One way to do so is to navigate +to the root directory of STK and then simply type: +``` +stk_init +``` +Alternatively, if you don't want to change the current directory, you can use: +``` +run /path/to/stk/stk_init.m +``` +Note that this second approach is suitable for inclusion in your `startup` script. After that, you should be able to run the examples located in the `examples` directory. All of them are scripts, the file name of which starts with @@ -88,11 +99,18 @@ the `stk_example_` prefix. For instance, type `stk_example_kb03` to run the third example in the "Kriging basics" series. +Remark: when using STK with Mathworks' Parallel Computing Toolbox, it is +important to run `stk_init` within each worker. This can be achieved using: +``` +pctRunOnAll run /path/to/stk/stk_init.m +``` + + ### Quick start with the Octave package release (Octave only) Assuming that you have a working Internet connection, typing `pkg install -forge stk` (from within Octave) will automatically download the latest STK package tarball from the -[Octave Forge](http://octave.sourceforge.net/stk/index.html) +[Octave Forge](http://octave.sourceforge.net/) [file release system](https://sourceforge.net/projects/octave/files/) on SourceForge and install it for you. @@ -114,17 +132,14 @@ the third example in the "Kriging basics" series. ### Requirements and recommendations for use with GNU Octave - The STK is tested to work with GNU Octave 3.8.2 or newer, but - should probably also work with Octave 3.8.0 and 3.8.1. - - Older versions of Octave (<= 3.6.2) are no longer supported, and - are known to contain bugs that prevent some STK functions from - working properly. + The STK is tested to work with + [GNU Octave 4.0.0 or newer](https://wiki.octave.org/Release_History). ### Requirements and recommendations for use with Matlab - The STK works with Matlab R2007a or newer. + The STK is tested to work with + [Matlab R2009b or newer](https://en.wikipedia.org/wiki/MATLAB#Release_history). The Optimization Toolbox is recommended. @@ -176,10 +191,14 @@ DOI: 10.1007/s11222-011-9241-4. Use the "help" mailing-list: <kriging-help@lists.sourceforge.net> - <https://sourceforge.net/p/kriging/mailman> + (register/browse the archives: [here](https://sourceforge.net/p/kriging/mailman)) to ask for help on STK, and the ticket manager: - <https://sourceforge.net/p/kriging/tickets> + <https://github.com/stk-kriging/stk/issues> + + to report bugs or ask for new features (do not hesitate to do so!). - to report bugs or ask for new features. + If you use STK in Octave, you can also have a look there: + + <https://octave.sourceforge.io/support-help.php> diff --git a/inst/arrays/@stk_dataframe/abs.m b/inst/arrays/@stk_dataframe/abs.m index 5a76b7c..f795e50 100644 --- a/inst/arrays/@stk_dataframe/abs.m +++ b/inst/arrays/@stk_dataframe/abs.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/acos.m b/inst/arrays/@stk_dataframe/acos.m index 5047cdf..96596d7 100644 --- a/inst/arrays/@stk_dataframe/acos.m +++ b/inst/arrays/@stk_dataframe/acos.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/acosd.m b/inst/arrays/@stk_dataframe/acosd.m index 46b4cbc..330b8ef 100644 --- a/inst/arrays/@stk_dataframe/acosd.m +++ b/inst/arrays/@stk_dataframe/acosd.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/acosh.m b/inst/arrays/@stk_dataframe/acosh.m index 84d7e51..1b1d76e 100644 --- a/inst/arrays/@stk_dataframe/acosh.m +++ b/inst/arrays/@stk_dataframe/acosh.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/and.m b/inst/arrays/@stk_dataframe/and.m index 28dfacf..c2a98c1 100644 --- a/inst/arrays/@stk_dataframe/and.m +++ b/inst/arrays/@stk_dataframe/and.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/apply.m b/inst/arrays/@stk_dataframe/apply.m index fbb3b44..a3e303e 100644 --- a/inst/arrays/@stk_dataframe/apply.m +++ b/inst/arrays/@stk_dataframe/apply.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/asin.m b/inst/arrays/@stk_dataframe/asin.m index bc11204..1c0a760 100644 --- a/inst/arrays/@stk_dataframe/asin.m +++ b/inst/arrays/@stk_dataframe/asin.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/asind.m b/inst/arrays/@stk_dataframe/asind.m index cc5ad7d..06ef78c 100644 --- a/inst/arrays/@stk_dataframe/asind.m +++ b/inst/arrays/@stk_dataframe/asind.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/asinh.m b/inst/arrays/@stk_dataframe/asinh.m index de7c66d..edefd1c 100644 --- a/inst/arrays/@stk_dataframe/asinh.m +++ b/inst/arrays/@stk_dataframe/asinh.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/atan.m b/inst/arrays/@stk_dataframe/atan.m index efbf6a1..35f86c2 100644 --- a/inst/arrays/@stk_dataframe/atan.m +++ b/inst/arrays/@stk_dataframe/atan.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/atand.m b/inst/arrays/@stk_dataframe/atand.m index 91406b8..90ce089 100644 --- a/inst/arrays/@stk_dataframe/atand.m +++ b/inst/arrays/@stk_dataframe/atand.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/atanh.m b/inst/arrays/@stk_dataframe/atanh.m index 8da129b..da42559 100644 --- a/inst/arrays/@stk_dataframe/atanh.m +++ b/inst/arrays/@stk_dataframe/atanh.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/bsxfun.m b/inst/arrays/@stk_dataframe/bsxfun.m index 37a3a02..e48eaf1 100644 --- a/inst/arrays/@stk_dataframe/bsxfun.m +++ b/inst/arrays/@stk_dataframe/bsxfun.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/cat.m b/inst/arrays/@stk_dataframe/cat.m index 8f2a367..f6a9617 100644 --- a/inst/arrays/@stk_dataframe/cat.m +++ b/inst/arrays/@stk_dataframe/cat.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/cos.m b/inst/arrays/@stk_dataframe/cos.m index a85340b..caa70f4 100644 --- a/inst/arrays/@stk_dataframe/cos.m +++ b/inst/arrays/@stk_dataframe/cos.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/cosd.m b/inst/arrays/@stk_dataframe/cosd.m index ce2150f..7dd4174 100644 --- a/inst/arrays/@stk_dataframe/cosd.m +++ b/inst/arrays/@stk_dataframe/cosd.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/cosh.m b/inst/arrays/@stk_dataframe/cosh.m index b376a1f..a60f0ac 100644 --- a/inst/arrays/@stk_dataframe/cosh.m +++ b/inst/arrays/@stk_dataframe/cosh.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/ctranspose.m b/inst/arrays/@stk_dataframe/ctranspose.m index 6f8a98e..4a12520 100644 --- a/inst/arrays/@stk_dataframe/ctranspose.m +++ b/inst/arrays/@stk_dataframe/ctranspose.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/diff.m b/inst/arrays/@stk_dataframe/diff.m index 41a9846..79cf3d5 100644 --- a/inst/arrays/@stk_dataframe/diff.m +++ b/inst/arrays/@stk_dataframe/diff.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/disp.m b/inst/arrays/@stk_dataframe/disp.m index 36080a0..1bcda23 100644 --- a/inst/arrays/@stk_dataframe/disp.m +++ b/inst/arrays/@stk_dataframe/disp.m @@ -18,7 +18,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/display.m b/inst/arrays/@stk_dataframe/display.m index adeb7d0..6e4c0be 100644 --- a/inst/arrays/@stk_dataframe/display.m +++ b/inst/arrays/@stk_dataframe/display.m @@ -17,7 +17,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/double.m b/inst/arrays/@stk_dataframe/double.m index d6e1e7b..cead70b 100644 --- a/inst/arrays/@stk_dataframe/double.m +++ b/inst/arrays/@stk_dataframe/double.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/end.m b/inst/arrays/@stk_dataframe/end.m index d9143b2..07cfefc 100644 --- a/inst/arrays/@stk_dataframe/end.m +++ b/inst/arrays/@stk_dataframe/end.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/eq.m b/inst/arrays/@stk_dataframe/eq.m index 22fde62..f916077 100644 --- a/inst/arrays/@stk_dataframe/eq.m +++ b/inst/arrays/@stk_dataframe/eq.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/exp.m b/inst/arrays/@stk_dataframe/exp.m index f0e572b..fdcabe3 100644 --- a/inst/arrays/@stk_dataframe/exp.m +++ b/inst/arrays/@stk_dataframe/exp.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/expm1.m b/inst/arrays/@stk_dataframe/expm1.m index 48e3018..3a65083 100644 --- a/inst/arrays/@stk_dataframe/expm1.m +++ b/inst/arrays/@stk_dataframe/expm1.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/fieldnames.m b/inst/arrays/@stk_dataframe/fieldnames.m index 0bf8a12..40de575 100644 --- a/inst/arrays/@stk_dataframe/fieldnames.m +++ b/inst/arrays/@stk_dataframe/fieldnames.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2017 CentraleSupelec +% Copyright (C) 2017, 2020 CentraleSupelec % Copyright (C) 2013 SUPELEC % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -31,26 +31,26 @@ function fn = fieldnames (x) % Non-empty column names cn = x.colnames; -cn = cn(~ cellfun (@isempty, cn)); +cn = cn(~ cellfun (@isempty, cn))'; % Non-empty row names rn = x.rownames; -rn = rn(~ cellfun (@isempty, rn))'; +rn = rn(~ cellfun (@isempty, rn)); -fn = [cn rn reserved_field_names()]; +fn = [cn; rn; reserved_field_names()]; end % function %!test %! x = stk_dataframe (rand (3, 2), {'u' 'v'}); -%! s1 = sort (fieldnames (x)); -%! s2 = {'colnames' 'data' 'info' 'rownames' 'u' 'v'}; -%! assert (all (strcmp (s1, s2))); +%! assert (isequal (sort (fieldnames (x)), ... +%! {'colnames'; 'data'; 'info'; 'rownames'; 'sample_size'; 'u'; 'v'})); %!test %! x = stk_dataframe (rand (3, 2)); %! x.rownames(2:3) = {'aa', 'bb'}; %! x.colnames{2} = 'toto'; %! assert (isequal (fieldnames (x), ... -%! {'toto' 'aa' 'bb' 'data' 'info' 'rownames' 'colnames'})); +%! {'toto'; 'aa'; 'bb'; 'data'; 'info'; ... +%! 'rownames'; 'colnames'; 'sample_size'})); diff --git a/inst/arrays/@stk_dataframe/find.m b/inst/arrays/@stk_dataframe/find.m index 67277fb..c3cc6fe 100644 --- a/inst/arrays/@stk_dataframe/find.m +++ b/inst/arrays/@stk_dataframe/find.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/ge.m b/inst/arrays/@stk_dataframe/ge.m index f660005..5d91ad8 100644 --- a/inst/arrays/@stk_dataframe/ge.m +++ b/inst/arrays/@stk_dataframe/ge.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/get.m b/inst/arrays/@stk_dataframe/get.m index cb76750..d45f809 100644 --- a/inst/arrays/@stk_dataframe/get.m +++ b/inst/arrays/@stk_dataframe/get.m @@ -2,6 +2,7 @@ % Copyright Notice % +% Copyright (C) 2020 CentraleSupelec % Copyright (C) 2013 SUPELEC % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -31,16 +32,19 @@ function value = get (x, propname) icol = __get_column_number__ (x.colnames, propname); switch icol - case -4 % 'info' + case -5 % 'sample_size' + value = size (x.data, 1); + + case -4 % 'info' value = x.info; - case -3 % 'rownames' + case -3 % 'rownames' value = x.rownames; - case -2 % 'colnames' + case -2 % 'colnames' value = x.colnames; - case -1 % get entire array + case -1 % Get entire array value = x.data; otherwise diff --git a/inst/arrays/@stk_dataframe/gt.m b/inst/arrays/@stk_dataframe/gt.m index 146e751..df5e8b8 100644 --- a/inst/arrays/@stk_dataframe/gt.m +++ b/inst/arrays/@stk_dataframe/gt.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/horzcat.m b/inst/arrays/@stk_dataframe/horzcat.m index ccb2187..4cf0928 100644 --- a/inst/arrays/@stk_dataframe/horzcat.m +++ b/inst/arrays/@stk_dataframe/horzcat.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/isempty.m b/inst/arrays/@stk_dataframe/isempty.m index 0510618..9466de4 100644 --- a/inst/arrays/@stk_dataframe/isempty.m +++ b/inst/arrays/@stk_dataframe/isempty.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/isfinite.m b/inst/arrays/@stk_dataframe/isfinite.m index 56e1004..4e3d822 100644 --- a/inst/arrays/@stk_dataframe/isfinite.m +++ b/inst/arrays/@stk_dataframe/isfinite.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/isinf.m b/inst/arrays/@stk_dataframe/isinf.m index d094fbf..325ff7e 100644 --- a/inst/arrays/@stk_dataframe/isinf.m +++ b/inst/arrays/@stk_dataframe/isinf.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/ismember.m b/inst/arrays/@stk_dataframe/ismember.m index ad6af44..2c634f4 100644 --- a/inst/arrays/@stk_dataframe/ismember.m +++ b/inst/arrays/@stk_dataframe/ismember.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/isnan.m b/inst/arrays/@stk_dataframe/isnan.m index f1b4e7c..9b64c0e 100644 --- a/inst/arrays/@stk_dataframe/isnan.m +++ b/inst/arrays/@stk_dataframe/isnan.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/ldivide.m b/inst/arrays/@stk_dataframe/ldivide.m index 85796c0..ef4138e 100644 --- a/inst/arrays/@stk_dataframe/ldivide.m +++ b/inst/arrays/@stk_dataframe/ldivide.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/le.m b/inst/arrays/@stk_dataframe/le.m index 965c459..e722d38 100644 --- a/inst/arrays/@stk_dataframe/le.m +++ b/inst/arrays/@stk_dataframe/le.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/length.m b/inst/arrays/@stk_dataframe/length.m index 12ae6fe..a75022c 100644 --- a/inst/arrays/@stk_dataframe/length.m +++ b/inst/arrays/@stk_dataframe/length.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/log.m b/inst/arrays/@stk_dataframe/log.m index 0b31b1e..6bbddd4 100644 --- a/inst/arrays/@stk_dataframe/log.m +++ b/inst/arrays/@stk_dataframe/log.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/log10.m b/inst/arrays/@stk_dataframe/log10.m index 4d4b4ce..05c6707 100644 --- a/inst/arrays/@stk_dataframe/log10.m +++ b/inst/arrays/@stk_dataframe/log10.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/log1p.m b/inst/arrays/@stk_dataframe/log1p.m index 866ffb5..1b1c468 100644 --- a/inst/arrays/@stk_dataframe/log1p.m +++ b/inst/arrays/@stk_dataframe/log1p.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/log2.m b/inst/arrays/@stk_dataframe/log2.m index b0817dc..c6f990f 100644 --- a/inst/arrays/@stk_dataframe/log2.m +++ b/inst/arrays/@stk_dataframe/log2.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/logical.m b/inst/arrays/@stk_dataframe/logical.m index e19b8fd..6a62aca 100644 --- a/inst/arrays/@stk_dataframe/logical.m +++ b/inst/arrays/@stk_dataframe/logical.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/lt.m b/inst/arrays/@stk_dataframe/lt.m index f532d92..7a4e52d 100644 --- a/inst/arrays/@stk_dataframe/lt.m +++ b/inst/arrays/@stk_dataframe/lt.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/max.m b/inst/arrays/@stk_dataframe/max.m index 780ee76..df8d9ce 100644 --- a/inst/arrays/@stk_dataframe/max.m +++ b/inst/arrays/@stk_dataframe/max.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/mean.m b/inst/arrays/@stk_dataframe/mean.m index 9094acb..e9e5b24 100644 --- a/inst/arrays/@stk_dataframe/mean.m +++ b/inst/arrays/@stk_dataframe/mean.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/median.m b/inst/arrays/@stk_dataframe/median.m index 5557a5c..0f0f4bc 100644 --- a/inst/arrays/@stk_dataframe/median.m +++ b/inst/arrays/@stk_dataframe/median.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/min.m b/inst/arrays/@stk_dataframe/min.m index 6b84602..2e32eeb 100644 --- a/inst/arrays/@stk_dataframe/min.m +++ b/inst/arrays/@stk_dataframe/min.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/minus.m b/inst/arrays/@stk_dataframe/minus.m index c0024bc..3c45c50 100644 --- a/inst/arrays/@stk_dataframe/minus.m +++ b/inst/arrays/@stk_dataframe/minus.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/mldivide.m b/inst/arrays/@stk_dataframe/mldivide.m index b9cdb43..9a9392d 100644 --- a/inst/arrays/@stk_dataframe/mldivide.m +++ b/inst/arrays/@stk_dataframe/mldivide.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/mode.m b/inst/arrays/@stk_dataframe/mode.m index 50f2e6a..7c8f259 100644 --- a/inst/arrays/@stk_dataframe/mode.m +++ b/inst/arrays/@stk_dataframe/mode.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/mrdivide.m b/inst/arrays/@stk_dataframe/mrdivide.m index cce9738..214e9a9 100644 --- a/inst/arrays/@stk_dataframe/mrdivide.m +++ b/inst/arrays/@stk_dataframe/mrdivide.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/mtimes.m b/inst/arrays/@stk_dataframe/mtimes.m index b584e09..79a9124 100644 --- a/inst/arrays/@stk_dataframe/mtimes.m +++ b/inst/arrays/@stk_dataframe/mtimes.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/ne.m b/inst/arrays/@stk_dataframe/ne.m index 24c376c..bbe285f 100644 --- a/inst/arrays/@stk_dataframe/ne.m +++ b/inst/arrays/@stk_dataframe/ne.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/not.m b/inst/arrays/@stk_dataframe/not.m index 72c178b..0e38236 100644 --- a/inst/arrays/@stk_dataframe/not.m +++ b/inst/arrays/@stk_dataframe/not.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/openvar.m b/inst/arrays/@stk_dataframe/openvar.m index 0017151..318e70d 100644 --- a/inst/arrays/@stk_dataframe/openvar.m +++ b/inst/arrays/@stk_dataframe/openvar.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/or.m b/inst/arrays/@stk_dataframe/or.m index 497fe11..efd610d 100644 --- a/inst/arrays/@stk_dataframe/or.m +++ b/inst/arrays/@stk_dataframe/or.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/plot.m b/inst/arrays/@stk_dataframe/plot.m index d976dc0..aad45aa 100644 --- a/inst/arrays/@stk_dataframe/plot.m +++ b/inst/arrays/@stk_dataframe/plot.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2015-2017 CentraleSupelec +% Copyright (C) 2015-2017, 2020, 2022 CentraleSupelec % Copyright (C) 2013, 2014 SUPELEC % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -72,24 +72,33 @@ end %--- Deal with various forms for x and z ---------------------------------- if isempty (x) % Special: x not provided - + + [n, d] = size (z); + % Tolerate row vector for z - if isrow (z), z = z'; end - + if (d > 1) && (isequal (size (z), [1 d])) % isrow CG#08 + n = d; + z = z'; + end + % Create a default x - x = (1:(size (z, 1)))'; - + x = (1:n)'; + else % General case - + + [n, d] = size (x); + % Tolerate row vector for x - if isrow (x), x = x'; end - - % Number of points - n = size (x, 1); - + if (d > 1) && (isequal (size (x), [1 d])) % isrow CG#08 + n = d; + x = x'; + end + % Tolerate row vector for z - if isequal (size (z), [1 n]), z = z'; end - + if isequal (size (z), [1 n]) % isrow CG#08 + z = z'; + end + end %--- Plot and set labels -------------------------------------------------- @@ -166,13 +175,13 @@ end % Then, process remaining arguments recursively if isempty (varargin) - + % Special case: x has been omitted, and there are no additional args plot_elem = struct ('x', [], 'z', {arg1}, 'S', []); keyval_pairs = {}; - + elseif ischar (varargin{1}) - + % Special case: x has been omitted, and there *are* additional args if mod (length (varargin), 2) S = []; @@ -182,12 +191,12 @@ elseif ischar (varargin{1}) keyval_pairs = parse_keyval_ (varargin{2:end}); end plot_elem = struct ('x', [], 'z', {arg1}, 'S', {S}); - + else - + % General case [plot_elem, keyval_pairs] = parse_args__ (arg1, varargin{:}); - + end end % function @@ -202,67 +211,100 @@ if ischar (x) || ischar (z) end if isempty (varargin) - + plot_elem = struct ('x', {x}, 'z', {z}, 'S', []); keyval_pairs = {}; - + elseif ~ ischar (varargin{1}) % expect another (x, z) pair after this one - + plot_elem = struct ('x', {x}, 'z', {z}, 'S', []); [plot_elem_, keyval_pairs] = parse_args__ (varargin{:}); plot_elem = [plot_elem plot_elem_]; - + elseif length (varargin) == 1 % S - + plot_elem = struct ('x', {x}, 'z', {z}, 'S', varargin(1)); keyval_pairs = {}; - -elseif ischar (varargin{2}) % S, key, val, ... - - plot_elem = struct ('x', {x}, 'z', {z}, 'S', varargin(1)); - keyval_pairs = parse_keyval_ (varargin{2:end}); - -elseif length (varargin) == 2 % key, val - - plot_elem = struct ('x', {x}, 'z', {z}, 'S', []); - keyval_pairs = varargin; - -elseif ~ ischar (varargin{3}) % S, x, z, ... - - plot_elem = struct ('x', {x}, 'z', {z}, 'S', varargin(1)); - [plot_elem_, keyval_pairs] = parse_args__ (varargin{2:end}); - plot_elem = [plot_elem plot_elem_]; - -else % key, val, key, val, ... - + +elseif length (varargin) == 2 % key, val OR x2, z2 ? + plot_elem = struct ('x', {x}, 'z', {z}, 'S', []); - keyval_pairs = parse_keyval_ (varargin{:}); - + + if ischar (varargin{1}) + keyval_pairs = parse_keyval_ (varargin{:}); + else + plot_elem_ = struct ('x', varargin(1), 'z', varargin(2), 'S', []); + plot_elem = [plot_elem plot_elem_]; + keyval_pairs = {}; + end + +else % Three or more remaining arguments + % 1) S, key, val, ... ? + % 2) S, x2, z2, ... ? + % 3) key, val, key, val, ... ? + % 4) x2, z2, ... ? + + if ~ ischar (varargin{1}) % x2, z2, ... + + plot_elem = struct ('x', {x}, 'z', {z}, 'S', []); + [plot_elem_, keyval_pairs] = parse_args__ (varargin); + plot_elem = [plot_elem plot_elem_]; + + elseif ~ ischar (varargin{2}) % S, x2, z2, ... OR key, val, key, val, ... + + if ~ ischar (varargin{3}) % S, x2, z2, ... + + plot_elem = struct ('x', {x}, 'z', {z}, 'S', varargin(1)); + [plot_elem_, keyval_pairs] = parse_args__ (varargin{2:end}); + plot_elem = [plot_elem plot_elem_]; + + else % key, val, key, val, ... + + plot_elem = struct ('x', {x}, 'z', {z}, 'S', []); + keyval_pairs = parse_keyval_ (varargin{:}); + + end + + else % S, key, val, ... OR key, val, key, val, ... + + if mod (length (varargin), 2) == 1 % S, key, val, ... + + plot_elem = struct ('x', {x}, 'z', {z}, 'S', varargin(1)); + keyval_pairs = parse_keyval_ (varargin{2:end}); + + else % key, val, key, val, ... + + plot_elem = struct ('x', {x}, 'z', {z}, 'S', []); + keyval_pairs = parse_keyval_ (varargin{:}); + + end + end end end % function + function keyval_pairs = parse_keyval_ (key, val, varargin) if nargin == 0 - + keyval_pairs = {}; - + elseif nargin == 1 - + errmsg = 'Syntax error. Incomplete key-value pair'; stk_error (errmsg, 'NotEnoughInputArgs'); - + elseif ~ ischar (key) - + display (key); stk_error (['Syntax error. At his point, we were expecting a ' ... 'key-value pair, but key is not a string.'], 'TypeMismatch'); - + else - + keyval_pairs = [{key, val} parse_keyval_(varargin{:})]; - + end end % function diff --git a/inst/arrays/@stk_dataframe/plotmatrix.m b/inst/arrays/@stk_dataframe/plotmatrix.m index c397acd..128056a 100644 --- a/inst/arrays/@stk_dataframe/plotmatrix.m +++ b/inst/arrays/@stk_dataframe/plotmatrix.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/plus.m b/inst/arrays/@stk_dataframe/plus.m index 2a41e85..dae7020 100644 --- a/inst/arrays/@stk_dataframe/plus.m +++ b/inst/arrays/@stk_dataframe/plus.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/power.m b/inst/arrays/@stk_dataframe/power.m index f9fc615..784090a 100644 --- a/inst/arrays/@stk_dataframe/power.m +++ b/inst/arrays/@stk_dataframe/power.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/private/get_column_number.m b/inst/arrays/@stk_dataframe/private/get_column_number.m index 9acf805..9d071e6 100644 --- a/inst/arrays/@stk_dataframe/private/get_column_number.m +++ b/inst/arrays/@stk_dataframe/private/get_column_number.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/private/names_errmsg.m b/inst/arrays/@stk_dataframe/private/names_errmsg.m index b7caa09..11348b0 100644 --- a/inst/arrays/@stk_dataframe/private/names_errmsg.m +++ b/inst/arrays/@stk_dataframe/private/names_errmsg.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/private/process_cell_indices.m b/inst/arrays/@stk_dataframe/private/process_cell_indices.m index 8578082..c0d4f9f 100644 --- a/inst/arrays/@stk_dataframe/private/process_cell_indices.m +++ b/inst/arrays/@stk_dataframe/private/process_cell_indices.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/private/process_char_indices.m b/inst/arrays/@stk_dataframe/private/process_char_indices.m index e09b8c4..6d65739 100644 --- a/inst/arrays/@stk_dataframe/private/process_char_indices.m +++ b/inst/arrays/@stk_dataframe/private/process_char_indices.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/private/reserved_field_names.m b/inst/arrays/@stk_dataframe/private/reserved_field_names.m index 4660232..8d462d0 100644 --- a/inst/arrays/@stk_dataframe/private/reserved_field_names.m +++ b/inst/arrays/@stk_dataframe/private/reserved_field_names.m @@ -2,6 +2,7 @@ % Copyright Notice % +% Copyright (C) 2020 CentraleSupelec % Copyright (C) 2013, 2014 SUPELEC % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -28,6 +29,6 @@ function c = reserved_field_names () -c = {'data', 'info', 'rownames', 'colnames'}; +c = {'data'; 'info'; 'rownames'; 'colnames'; 'sample_size'}; end % function diff --git a/inst/arrays/@stk_dataframe/prod.m b/inst/arrays/@stk_dataframe/prod.m index b38e813..6da6a01 100644 --- a/inst/arrays/@stk_dataframe/prod.m +++ b/inst/arrays/@stk_dataframe/prod.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/quantile.m b/inst/arrays/@stk_dataframe/quantile.m index 8085061..a18b417 100644 --- a/inst/arrays/@stk_dataframe/quantile.m +++ b/inst/arrays/@stk_dataframe/quantile.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/rdivide.m b/inst/arrays/@stk_dataframe/rdivide.m index ec9a45c..2abda1f 100644 --- a/inst/arrays/@stk_dataframe/rdivide.m +++ b/inst/arrays/@stk_dataframe/rdivide.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/realpow.m b/inst/arrays/@stk_dataframe/realpow.m index f18a39e..e05138d 100644 --- a/inst/arrays/@stk_dataframe/realpow.m +++ b/inst/arrays/@stk_dataframe/realpow.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/reshape.m b/inst/arrays/@stk_dataframe/reshape.m index 9f70286..c761f1c 100644 --- a/inst/arrays/@stk_dataframe/reshape.m +++ b/inst/arrays/@stk_dataframe/reshape.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/set.m b/inst/arrays/@stk_dataframe/set.m index 8104b03..41e6a2b 100644 --- a/inst/arrays/@stk_dataframe/set.m +++ b/inst/arrays/@stk_dataframe/set.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/set_data.m b/inst/arrays/@stk_dataframe/set_data.m index 0f64270..a772b78 100644 --- a/inst/arrays/@stk_dataframe/set_data.m +++ b/inst/arrays/@stk_dataframe/set_data.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/sin.m b/inst/arrays/@stk_dataframe/sin.m index e3cdc3f..bacf5fe 100644 --- a/inst/arrays/@stk_dataframe/sin.m +++ b/inst/arrays/@stk_dataframe/sin.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/sind.m b/inst/arrays/@stk_dataframe/sind.m index 08d0c3a..3773779 100644 --- a/inst/arrays/@stk_dataframe/sind.m +++ b/inst/arrays/@stk_dataframe/sind.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/sinh.m b/inst/arrays/@stk_dataframe/sinh.m index 1e2f782..d27ab8e 100644 --- a/inst/arrays/@stk_dataframe/sinh.m +++ b/inst/arrays/@stk_dataframe/sinh.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/size.m b/inst/arrays/@stk_dataframe/size.m index 685b9c6..fb8b069 100644 --- a/inst/arrays/@stk_dataframe/size.m +++ b/inst/arrays/@stk_dataframe/size.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/sort.m b/inst/arrays/@stk_dataframe/sort.m index 934776a..d4e1f7a 100644 --- a/inst/arrays/@stk_dataframe/sort.m +++ b/inst/arrays/@stk_dataframe/sort.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/sqrt.m b/inst/arrays/@stk_dataframe/sqrt.m index 108b444..9417c7a 100644 --- a/inst/arrays/@stk_dataframe/sqrt.m +++ b/inst/arrays/@stk_dataframe/sqrt.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/std.m b/inst/arrays/@stk_dataframe/std.m index 5caf4d4..bae44b6 100644 --- a/inst/arrays/@stk_dataframe/std.m +++ b/inst/arrays/@stk_dataframe/std.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/stk_boundingbox.m b/inst/arrays/@stk_dataframe/stk_boundingbox.m index 56e938c..4447ee2 100644 --- a/inst/arrays/@stk_dataframe/stk_boundingbox.m +++ b/inst/arrays/@stk_dataframe/stk_boundingbox.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/stk_conditioning.m b/inst/arrays/@stk_dataframe/stk_conditioning.m index 806e3e4..e3a7d76 100644 --- a/inst/arrays/@stk_dataframe/stk_conditioning.m +++ b/inst/arrays/@stk_dataframe/stk_conditioning.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/stk_dataframe.m b/inst/arrays/@stk_dataframe/stk_dataframe.m index b5b51dd..79c20b8 100644 --- a/inst/arrays/@stk_dataframe/stk_dataframe.m +++ b/inst/arrays/@stk_dataframe/stk_dataframe.m @@ -57,7 +57,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/stk_get_sample_size.m b/inst/arrays/@stk_dataframe/stk_get_sample_size.m new file mode 100644 index 0000000..6265fc2 --- /dev/null +++ b/inst/arrays/@stk_dataframe/stk_get_sample_size.m @@ -0,0 +1,40 @@ +% STK_GET_SAMPLE_SIZE [overload STK function] + +% Copyright Notice +% +% Copyright (C) 2020 CentraleSupelec +% Copyright (C) 2014 SUPELEC +% +% Authors: Julien Bect <julien.bect@centralesupelec.fr> +% Emmanuel Vazquez <emmanuel.vazquez@centralesupelec.fr> + +% Copying Permission Statement +% +% This file is part of +% +% STK: a Small (Matlab/Octave) Toolbox for Kriging +% (https://github.com/stk-kriging/stk/) +% +% STK is free software: you can redistribute it and/or modify it under +% the terms of the GNU General Public License as published by the Free +% Software Foundation, either version 3 of the License, or (at your +% option) any later version. +% +% STK is distributed in the hope that it will be useful, but WITHOUT +% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +% License for more details. +% +% You should have received a copy of the GNU General Public License +% along with STK. If not, see <http://www.gnu.org/licenses/>. + +function n = stk_get_sample_size (x) + +n = size (x.data, 1); + +end % function + + +%!test +%! x = stk_dataframe ([1 2; 3 4; 5 6]); +%! assert (isequal (stk_get_sample_size (x), 3)); diff --git a/inst/arrays/@stk_dataframe/stk_length.m b/inst/arrays/@stk_dataframe/stk_length.m index ed5a13d..bf1cec4 100644 --- a/inst/arrays/@stk_dataframe/stk_length.m +++ b/inst/arrays/@stk_dataframe/stk_length.m @@ -1,7 +1,10 @@ -% STK_LENGTH [overload STK function] +% STK_LENGTH [deprecated] +% +% See also: stk_get_sample_size % Copyright Notice % +% Copyright (C) 2020 CentraleSupelec % Copyright (C) 2014 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -12,7 +15,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -27,13 +30,13 @@ % You should have received a copy of the GNU General Public License % along with STK. If not, see <http://www.gnu.org/licenses/>. -function l = stk_length (x) +function n = stk_length (x) -l = size (x.data, 1); +n = size (x.data, 1); end % function + %!test %! x = stk_dataframe ([1 2; 3 4; 5 6]); %! assert (isequal (stk_length (x), 3)); - diff --git a/inst/arrays/@stk_dataframe/stk_normalize.m b/inst/arrays/@stk_dataframe/stk_normalize.m index 58a6782..16f381a 100644 --- a/inst/arrays/@stk_dataframe/stk_normalize.m +++ b/inst/arrays/@stk_dataframe/stk_normalize.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/stk_rescale.m b/inst/arrays/@stk_dataframe/stk_rescale.m index 6c8cd18..b54ae5f 100644 --- a/inst/arrays/@stk_dataframe/stk_rescale.m +++ b/inst/arrays/@stk_dataframe/stk_rescale.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/stk_sprintf.m b/inst/arrays/@stk_dataframe/stk_sprintf.m index 29a035c..c009e15 100644 --- a/inst/arrays/@stk_dataframe/stk_sprintf.m +++ b/inst/arrays/@stk_dataframe/stk_sprintf.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/stk_sprintf_colnames.m b/inst/arrays/@stk_dataframe/stk_sprintf_colnames.m index 408b568..5fbbd7b 100644 --- a/inst/arrays/@stk_dataframe/stk_sprintf_colnames.m +++ b/inst/arrays/@stk_dataframe/stk_sprintf_colnames.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/stk_sprintf_rownames.m b/inst/arrays/@stk_dataframe/stk_sprintf_rownames.m index bc43af2..671c077 100644 --- a/inst/arrays/@stk_dataframe/stk_sprintf_rownames.m +++ b/inst/arrays/@stk_dataframe/stk_sprintf_rownames.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/stk_sprintf_sizetype.m b/inst/arrays/@stk_dataframe/stk_sprintf_sizetype.m index 882e4a0..0fcc148 100644 --- a/inst/arrays/@stk_dataframe/stk_sprintf_sizetype.m +++ b/inst/arrays/@stk_dataframe/stk_sprintf_sizetype.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/subsasgn.m b/inst/arrays/@stk_dataframe/subsasgn.m index eee72ab..93a9d01 100644 --- a/inst/arrays/@stk_dataframe/subsasgn.m +++ b/inst/arrays/@stk_dataframe/subsasgn.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/subsref.m b/inst/arrays/@stk_dataframe/subsref.m index 6575d21..955f1bc 100644 --- a/inst/arrays/@stk_dataframe/subsref.m +++ b/inst/arrays/@stk_dataframe/subsref.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/sum.m b/inst/arrays/@stk_dataframe/sum.m index 3f07c55..09b67c3 100644 --- a/inst/arrays/@stk_dataframe/sum.m +++ b/inst/arrays/@stk_dataframe/sum.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/tan.m b/inst/arrays/@stk_dataframe/tan.m index 47f084a..bc90855 100644 --- a/inst/arrays/@stk_dataframe/tan.m +++ b/inst/arrays/@stk_dataframe/tan.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/tand.m b/inst/arrays/@stk_dataframe/tand.m index 8b008ea..aef04b7 100644 --- a/inst/arrays/@stk_dataframe/tand.m +++ b/inst/arrays/@stk_dataframe/tand.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/tanh.m b/inst/arrays/@stk_dataframe/tanh.m index 34e1ff9..49b40ec 100644 --- a/inst/arrays/@stk_dataframe/tanh.m +++ b/inst/arrays/@stk_dataframe/tanh.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/times.m b/inst/arrays/@stk_dataframe/times.m index 5504819..a4c2273 100644 --- a/inst/arrays/@stk_dataframe/times.m +++ b/inst/arrays/@stk_dataframe/times.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/transpose.m b/inst/arrays/@stk_dataframe/transpose.m index 1adbc68..6bd0077 100644 --- a/inst/arrays/@stk_dataframe/transpose.m +++ b/inst/arrays/@stk_dataframe/transpose.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/uminus.m b/inst/arrays/@stk_dataframe/uminus.m index d8d1eb3..1cc2c03 100644 --- a/inst/arrays/@stk_dataframe/uminus.m +++ b/inst/arrays/@stk_dataframe/uminus.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/unique.m b/inst/arrays/@stk_dataframe/unique.m index cf9143f..db8d005 100644 --- a/inst/arrays/@stk_dataframe/unique.m +++ b/inst/arrays/@stk_dataframe/unique.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/uplus.m b/inst/arrays/@stk_dataframe/uplus.m index a31ea67..7c95b52 100644 --- a/inst/arrays/@stk_dataframe/uplus.m +++ b/inst/arrays/@stk_dataframe/uplus.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/var.m b/inst/arrays/@stk_dataframe/var.m index 206caaf..5f669bb 100644 --- a/inst/arrays/@stk_dataframe/var.m +++ b/inst/arrays/@stk_dataframe/var.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/vertcat.m b/inst/arrays/@stk_dataframe/vertcat.m index 4e53b46..902da9f 100644 --- a/inst/arrays/@stk_dataframe/vertcat.m +++ b/inst/arrays/@stk_dataframe/vertcat.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/xlim.m b/inst/arrays/@stk_dataframe/xlim.m index 6ee6353..74794c9 100644 --- a/inst/arrays/@stk_dataframe/xlim.m +++ b/inst/arrays/@stk_dataframe/xlim.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/xor.m b/inst/arrays/@stk_dataframe/xor.m index e935f7f..402dca3 100644 --- a/inst/arrays/@stk_dataframe/xor.m +++ b/inst/arrays/@stk_dataframe/xor.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_dataframe/ylim.m b/inst/arrays/@stk_dataframe/ylim.m index 66c5c15..ad9e8d4 100644 --- a/inst/arrays/@stk_dataframe/ylim.m +++ b/inst/arrays/@stk_dataframe/ylim.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/contour.m b/inst/arrays/@stk_factorialdesign/contour.m index 6c5f501..949e151 100644 --- a/inst/arrays/@stk_factorialdesign/contour.m +++ b/inst/arrays/@stk_factorialdesign/contour.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/fieldnames.m b/inst/arrays/@stk_factorialdesign/fieldnames.m index 8136bcf..ef4bef1 100644 --- a/inst/arrays/@stk_factorialdesign/fieldnames.m +++ b/inst/arrays/@stk_factorialdesign/fieldnames.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2015 CentraleSupelec +% Copyright (C) 2015, 2020 CentraleSupelec % Copyright (C) 2014 SUPELEC % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -30,13 +30,14 @@ function fn = fieldnames (x) fn = fieldnames (x.stk_dataframe); -fn = [{'levels' 'stk_dataframe'} fn]; +fn = [{'levels'; 'stk_dataframe'}; fn]; end % function + %!test %! x = stk_factorialdesign ({0:1, 3:5}, {'u' 'v'}); %! fn1 = sort (fieldnames (x)); -%! fn2 = {'colnames', 'data', 'info', 'levels', ... -%! 'rownames', 'stk_dataframe', 'u', 'v'}; +%! fn2 = {'colnames'; 'data'; 'info'; 'levels'; ... +%! 'rownames'; 'sample_size'; 'stk_dataframe'; 'u'; 'v'}; %! assert (isequal (fn1, fn2)); diff --git a/inst/arrays/@stk_factorialdesign/get.m b/inst/arrays/@stk_factorialdesign/get.m index e0164c8..fe6b638 100644 --- a/inst/arrays/@stk_factorialdesign/get.m +++ b/inst/arrays/@stk_factorialdesign/get.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/ismember.m b/inst/arrays/@stk_factorialdesign/ismember.m index 3b3a693..f4947a6 100644 --- a/inst/arrays/@stk_factorialdesign/ismember.m +++ b/inst/arrays/@stk_factorialdesign/ismember.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/mesh.m b/inst/arrays/@stk_factorialdesign/mesh.m index 831ab6e..5623cfd 100644 --- a/inst/arrays/@stk_factorialdesign/mesh.m +++ b/inst/arrays/@stk_factorialdesign/mesh.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/meshc.m b/inst/arrays/@stk_factorialdesign/meshc.m index eb66c9c..bc6e696 100644 --- a/inst/arrays/@stk_factorialdesign/meshc.m +++ b/inst/arrays/@stk_factorialdesign/meshc.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/meshz.m b/inst/arrays/@stk_factorialdesign/meshz.m index 85fae2f..683e9c8 100644 --- a/inst/arrays/@stk_factorialdesign/meshz.m +++ b/inst/arrays/@stk_factorialdesign/meshz.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/ndgrid.m b/inst/arrays/@stk_factorialdesign/ndgrid.m index f731f3a..c832fad 100644 --- a/inst/arrays/@stk_factorialdesign/ndgrid.m +++ b/inst/arrays/@stk_factorialdesign/ndgrid.m @@ -22,7 +22,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/pcolor.m b/inst/arrays/@stk_factorialdesign/pcolor.m index 320472a..960469a 100644 --- a/inst/arrays/@stk_factorialdesign/pcolor.m +++ b/inst/arrays/@stk_factorialdesign/pcolor.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/private/plot_surfmeshcontour.m b/inst/arrays/@stk_factorialdesign/private/plot_surfmeshcontour.m index 755916d..c7d38fc 100644 --- a/inst/arrays/@stk_factorialdesign/private/plot_surfmeshcontour.m +++ b/inst/arrays/@stk_factorialdesign/private/plot_surfmeshcontour.m @@ -1,8 +1,8 @@ -% PLOT_SURFMESHCONTOUR [STK internal] +% PLOT_SURFMESHCONTOUR [STK internal] % Copyright Notice % -% Copyright (C) 2016, 2017 CentraleSupelec +% Copyright (C) 2016, 2017, 2021 CentraleSupelec % Copyright (C) 2013 Valentin Resseguier % Copyright (C) 2012-2014 SUPELEC % @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -121,8 +121,8 @@ try % in particular when options are provided. Let's try that first. if strcmp (func2str (plotfun), 'contour') - [ignd, h_plot] = contour ... - (h_axes, x, y, z, varargin{:}); %#ok<ASGLU> CG#07 + [~, h_plot] = contour ... + (h_axes, x, y, z, varargin{:}); else h_plot = plotfun (h_axes, x, y, z, varargin{:}); end @@ -149,7 +149,7 @@ catch %#ok<CTCH> try if strcmp (func2str (plotfun), 'contour') - [ignd, h_plot] = contour (x, y, z, numarg{:}); %#ok<ASGLU> CG#07 + [~, h_plot] = contour (x, y, z, numarg{:}); else h_plot = plotfun (x, y, z, numarg{:}); end diff --git a/inst/arrays/@stk_factorialdesign/set.m b/inst/arrays/@stk_factorialdesign/set.m index 6fae3ce..b7dfdfd 100644 --- a/inst/arrays/@stk_factorialdesign/set.m +++ b/inst/arrays/@stk_factorialdesign/set.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/stk_boundingbox.m b/inst/arrays/@stk_factorialdesign/stk_boundingbox.m index 8137b8f..0db36f8 100644 --- a/inst/arrays/@stk_factorialdesign/stk_boundingbox.m +++ b/inst/arrays/@stk_factorialdesign/stk_boundingbox.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/stk_dataframe.m b/inst/arrays/@stk_factorialdesign/stk_dataframe.m index 2111342..9e855d9 100644 --- a/inst/arrays/@stk_factorialdesign/stk_dataframe.m +++ b/inst/arrays/@stk_factorialdesign/stk_dataframe.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/stk_factorialdesign.m b/inst/arrays/@stk_factorialdesign/stk_factorialdesign.m index 7a39f84..55cf52f 100644 --- a/inst/arrays/@stk_factorialdesign/stk_factorialdesign.m +++ b/inst/arrays/@stk_factorialdesign/stk_factorialdesign.m @@ -28,7 +28,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/stk_normalize.m b/inst/arrays/@stk_factorialdesign/stk_normalize.m index f0705ef..20c1c54 100644 --- a/inst/arrays/@stk_factorialdesign/stk_normalize.m +++ b/inst/arrays/@stk_factorialdesign/stk_normalize.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/stk_rescale.m b/inst/arrays/@stk_factorialdesign/stk_rescale.m index c454e7b..09e7c10 100644 --- a/inst/arrays/@stk_factorialdesign/stk_rescale.m +++ b/inst/arrays/@stk_factorialdesign/stk_rescale.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/stk_sprintf.m b/inst/arrays/@stk_factorialdesign/stk_sprintf.m index 553c0b8..65631bf 100644 --- a/inst/arrays/@stk_factorialdesign/stk_sprintf.m +++ b/inst/arrays/@stk_factorialdesign/stk_sprintf.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/stk_sprintf_levels.m b/inst/arrays/@stk_factorialdesign/stk_sprintf_levels.m index 3fdf0f5..bdaabb3 100644 --- a/inst/arrays/@stk_factorialdesign/stk_sprintf_levels.m +++ b/inst/arrays/@stk_factorialdesign/stk_sprintf_levels.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/subsasgn.m b/inst/arrays/@stk_factorialdesign/subsasgn.m index 4271973..f339d81 100644 --- a/inst/arrays/@stk_factorialdesign/subsasgn.m +++ b/inst/arrays/@stk_factorialdesign/subsasgn.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/surf.m b/inst/arrays/@stk_factorialdesign/surf.m index 68c8ba7..1ef9b8e 100644 --- a/inst/arrays/@stk_factorialdesign/surf.m +++ b/inst/arrays/@stk_factorialdesign/surf.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_factorialdesign/uminus.m b/inst/arrays/@stk_factorialdesign/uminus.m index 655f52d..6cf1617 100644 --- a/inst/arrays/@stk_factorialdesign/uminus.m +++ b/inst/arrays/@stk_factorialdesign/uminus.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_hrect/axis.m b/inst/arrays/@stk_hrect/axis.m index 6fcd918..96c9cc6 100644 --- a/inst/arrays/@stk_hrect/axis.m +++ b/inst/arrays/@stk_hrect/axis.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_hrect/disp.m b/inst/arrays/@stk_hrect/disp.m index 97c06ac..cbc480f 100644 --- a/inst/arrays/@stk_hrect/disp.m +++ b/inst/arrays/@stk_hrect/disp.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_hrect/display.m b/inst/arrays/@stk_hrect/display.m index 08904e6..442f277 100644 --- a/inst/arrays/@stk_hrect/display.m +++ b/inst/arrays/@stk_hrect/display.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_hrect/get.m b/inst/arrays/@stk_hrect/get.m index f94e427..8959965 100644 --- a/inst/arrays/@stk_hrect/get.m +++ b/inst/arrays/@stk_hrect/get.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_hrect/horzcat.m b/inst/arrays/@stk_hrect/horzcat.m index 02cf21e..cd504fb 100644 --- a/inst/arrays/@stk_hrect/horzcat.m +++ b/inst/arrays/@stk_hrect/horzcat.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_hrect/ismember.m b/inst/arrays/@stk_hrect/ismember.m index 420f9b3..45a6c85 100644 --- a/inst/arrays/@stk_hrect/ismember.m +++ b/inst/arrays/@stk_hrect/ismember.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_hrect/stk_boundingbox.m b/inst/arrays/@stk_hrect/stk_boundingbox.m index 0a26901..fd3c520 100644 --- a/inst/arrays/@stk_hrect/stk_boundingbox.m +++ b/inst/arrays/@stk_hrect/stk_boundingbox.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_hrect/stk_dataframe.m b/inst/arrays/@stk_hrect/stk_dataframe.m index 440a475..29c208e 100644 --- a/inst/arrays/@stk_hrect/stk_dataframe.m +++ b/inst/arrays/@stk_hrect/stk_dataframe.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_hrect/stk_hrect.m b/inst/arrays/@stk_hrect/stk_hrect.m index 700d1e4..488c0a3 100644 --- a/inst/arrays/@stk_hrect/stk_hrect.m +++ b/inst/arrays/@stk_hrect/stk_hrect.m @@ -33,7 +33,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -62,11 +62,8 @@ elseif isa (arg1, 'stk_hrect') % arg1 is already an stk_hrect object: copy else % create a new stk_hrect object - % NOTE: the following test uses (prod (size (arg1)) == 1) instead of - % isscalar because isscalar (x) means (numel (x) == 1) in Octave 3.8.2 - % and therefore always returns true for stk_dataframe objects. - - if (prod (size (arg1)) == 1) % arg1 is the dimension of the input space + if (prod (size (arg1)) == 1) % isscalar CG#08 + % arg1 is the dimension of the input space % => create a default hyper-rectangle [0; 1]^d, with d = arg1 d = arg1; diff --git a/inst/arrays/@stk_hrect/stk_normalize.m b/inst/arrays/@stk_hrect/stk_normalize.m index dae3f5b..03b6aa9 100644 --- a/inst/arrays/@stk_hrect/stk_normalize.m +++ b/inst/arrays/@stk_hrect/stk_normalize.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_hrect/stk_rescale.m b/inst/arrays/@stk_hrect/stk_rescale.m index 7ada8e6..f5598d4 100644 --- a/inst/arrays/@stk_hrect/stk_rescale.m +++ b/inst/arrays/@stk_hrect/stk_rescale.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_hrect/subsasgn.m b/inst/arrays/@stk_hrect/subsasgn.m index 3bf191c..180c5d8 100644 --- a/inst/arrays/@stk_hrect/subsasgn.m +++ b/inst/arrays/@stk_hrect/subsasgn.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_hrect/subsref.m b/inst/arrays/@stk_hrect/subsref.m index d921a4b..c42c684 100644 --- a/inst/arrays/@stk_hrect/subsref.m +++ b/inst/arrays/@stk_hrect/subsref.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/@stk_hrect/vertcat.m b/inst/arrays/@stk_hrect/vertcat.m index 5e053d1..b570f41 100644 --- a/inst/arrays/@stk_hrect/vertcat.m +++ b/inst/arrays/@stk_hrect/vertcat.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/generic/stk_boundingbox.m b/inst/arrays/generic/stk_boundingbox.m index 19dd251..47fd6e3 100644 --- a/inst/arrays/generic/stk_boundingbox.m +++ b/inst/arrays/generic/stk_boundingbox.m @@ -21,7 +21,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/generic/stk_commonsize.m b/inst/arrays/generic/stk_commonsize.m index 4a40927..b94af4e 100644 --- a/inst/arrays/generic/stk_commonsize.m +++ b/inst/arrays/generic/stk_commonsize.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/generic/stk_feval.m b/inst/arrays/generic/stk_feval.m index a57d7bb..dd07d7b 100644 --- a/inst/arrays/generic/stk_feval.m +++ b/inst/arrays/generic/stk_feval.m @@ -72,7 +72,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_gpposterior/get_output_data.m b/inst/arrays/generic/stk_get_sample_size.m index 4cb1d66..86177f1 100644 --- a/inst/model/@stk_model_gpposterior/get_output_data.m +++ b/inst/arrays/generic/stk_get_sample_size.m @@ -1,8 +1,13 @@ -% GET_OUTPUT_DATA [deprecated] +% STK_GET_SAMPLE_SIZE returns the size of a sample +% +% CALL: N = stk_get_sample_size (X) +% +% returns the size N of the sample represented by the array X, in other +% words, the number of rows. % Copyright Notice % -% Copyright (C) 2015, 2016 CentraleSupelec +% Copyright (C) 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +16,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -26,8 +31,11 @@ % You should have received a copy of the GNU General Public License % along with STK. If not, see <http://www.gnu.org/licenses/>. -function output_data = get_output_data (model) +function n = stk_get_sample_size (x) -output_data = model.output_data; +n = size (x, 1); end % function + + +%!assert (stk_get_sample_size ([1 2; 3 4; 5 6]) == 3); diff --git a/inst/arrays/generic/stk_length.m b/inst/arrays/generic/stk_length.m index e895d4d..7f0f14d 100644 --- a/inst/arrays/generic/stk_length.m +++ b/inst/arrays/generic/stk_length.m @@ -1,17 +1,10 @@ -% STK_LENGTH return the "length" of an array +% STK_LENGTH [deprecated] % -% CALL: L = stk_length (X) -% -% returns the "length" of the data array X. -% -% NOTE: -% -% Currently, the length of a data array (numeric array or stk_dataframe -% object) is defined as SIZE (X, 1) but this might change in future -% versions of STK. Note that this is not the same as length (X). +% See also: stk_get_sample_size % Copyright Notice % +% Copyright (C) 2020 CentraleSupelec % Copyright (C) 2014 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -22,7 +15,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -37,9 +30,9 @@ % You should have received a copy of the GNU General Public License % along with STK. If not, see <http://www.gnu.org/licenses/>. -function l = stk_length (x) +function n = stk_length (x) -l = size (x, 1); +n = size (x, 1); end % function diff --git a/inst/arrays/generic/stk_normalize.m b/inst/arrays/generic/stk_normalize.m index a3b34ae..9cb4b0b 100644 --- a/inst/arrays/generic/stk_normalize.m +++ b/inst/arrays/generic/stk_normalize.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/generic/stk_rescale.m b/inst/arrays/generic/stk_rescale.m index ea02190..a55d187 100644 --- a/inst/arrays/generic/stk_rescale.m +++ b/inst/arrays/generic/stk_rescale.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/generic/stk_sprintf.m b/inst/arrays/generic/stk_sprintf.m index 39f1b5f..e63ee9f 100644 --- a/inst/arrays/generic/stk_sprintf.m +++ b/inst/arrays/generic/stk_sprintf.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/generic/stk_sprintf_colnames.m b/inst/arrays/generic/stk_sprintf_colnames.m index 118d425..761b583 100644 --- a/inst/arrays/generic/stk_sprintf_colnames.m +++ b/inst/arrays/generic/stk_sprintf_colnames.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/generic/stk_sprintf_rownames.m b/inst/arrays/generic/stk_sprintf_rownames.m index c98a39f..485448b 100644 --- a/inst/arrays/generic/stk_sprintf_rownames.m +++ b/inst/arrays/generic/stk_sprintf_rownames.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/arrays/generic/stk_sprintf_sizetype.m b/inst/arrays/generic/stk_sprintf_sizetype.m index 27966cd..76671e8 100644 --- a/inst/arrays/generic/stk_sprintf_sizetype.m +++ b/inst/arrays/generic/stk_sprintf_sizetype.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/core/@stk_kreq_qr/disp.m b/inst/core/@stk_kreq_qr/disp.m index d412a50..f60a825 100644 --- a/inst/core/@stk_kreq_qr/disp.m +++ b/inst/core/@stk_kreq_qr/disp.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/core/@stk_kreq_qr/display.m b/inst/core/@stk_kreq_qr/display.m index 59782cc..2a004be 100644 --- a/inst/core/@stk_kreq_qr/display.m +++ b/inst/core/@stk_kreq_qr/display.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/core/@stk_kreq_qr/get.m b/inst/core/@stk_kreq_qr/get.m index 13825c8..ed9fa0d 100644 --- a/inst/core/@stk_kreq_qr/get.m +++ b/inst/core/@stk_kreq_qr/get.m @@ -1,4 +1,4 @@ -% GET [STK internal] +% GET [overload base function] % % CALL: value = get (kreq, propname) % @@ -17,7 +17,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/core/@stk_kreq_qr/linsolve.m b/inst/core/@stk_kreq_qr/linsolve.m index e01ca60..664a54b 100644 --- a/inst/core/@stk_kreq_qr/linsolve.m +++ b/inst/core/@stk_kreq_qr/linsolve.m @@ -1,4 +1,4 @@ -% LINSOLVE [STK internal] +% LINSOLVE [STK internal] % % CALL: w = linsolve (kreq, rs) % @@ -16,7 +16,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/core/@stk_kreq_qr/private/compute_P_scaling.m b/inst/core/@stk_kreq_qr/private/compute_P_scaling.m index ffefbcc..7dcd04c 100644 --- a/inst/core/@stk_kreq_qr/private/compute_P_scaling.m +++ b/inst/core/@stk_kreq_qr/private/compute_P_scaling.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/core/@stk_kreq_qr/stk_kreq_qr.m b/inst/core/@stk_kreq_qr/stk_kreq_qr.m index 43243c0..5ceb2fa 100644 --- a/inst/core/@stk_kreq_qr/stk_kreq_qr.m +++ b/inst/core/@stk_kreq_qr/stk_kreq_qr.m @@ -1,4 +1,4 @@ -% STK_KREQ_QR [STK internal] +% STK_KREQ_QR [STK internal] % % CALL: kreq = stk_kreq_qr (model, xi, xt) % @@ -16,7 +16,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/core/@stk_kreq_qr/stk_set_righthandside.m b/inst/core/@stk_kreq_qr/stk_set_righthandside.m index d103c45..2507440 100644 --- a/inst/core/@stk_kreq_qr/stk_set_righthandside.m +++ b/inst/core/@stk_kreq_qr/stk_set_righthandside.m @@ -1,4 +1,4 @@ -% STK_SET_RIGHTHANDSIDE [STK internal] +% STK_SET_RIGHTHANDSIDE [STK internal] % % CALL: kreq = stk_set_righthandside (kreq, Kti, Pt) % @@ -15,7 +15,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/core/@stk_kreq_qr/stk_squared_seminorm.m b/inst/core/@stk_kreq_qr/stk_squared_seminorm.m index 0b71fbe..febc451 100644 --- a/inst/core/@stk_kreq_qr/stk_squared_seminorm.m +++ b/inst/core/@stk_kreq_qr/stk_squared_seminorm.m @@ -1,4 +1,4 @@ -% STK_SQUARED_SEMINORM [STK internal] +% STK_SQUARED_SEMINORM [STK internal] % % CALL: s = stk_squared_seminorm (kreq, zi) % @@ -16,7 +16,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/core/@stk_kreq_qr/stk_update.m b/inst/core/@stk_kreq_qr/stk_update.m deleted file mode 100644 index 346ed41..0000000 --- a/inst/core/@stk_kreq_qr/stk_update.m +++ /dev/null @@ -1,87 +0,0 @@ -% STK_UPDATE [STK internal] -% -% CALL: kreq = stk_update (kreq, Kjj, Kji, Pj, Ktj) -% -% Experimental... - -% Copyright Notice -% -% Copyright (C) 2015 CentraleSupelec -% Copyright (C) 2013, 2014 SUPELEC -% -% Author: Julien Bect <julien.bect@centralesupelec.fr> - -% Copying Permission Statement -% -% This file is part of -% -% STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) -% -% STK is free software: you can redistribute it and/or modify it under -% the terms of the GNU General Public License as published by the Free -% Software Foundation, either version 3 of the License, or (at your -% option) any later version. -% -% STK is distributed in the hope that it will be useful, but WITHOUT -% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -% License for more details. -% -% You should have received a copy of the GNU General Public License -% along with STK. If not, see <http://www.gnu.org/licenses/>. - -function kreq = stk_update (kreq, Kjj, Kji, Pj, Ktj) - -% Poor man's update... -% TODO: implement efficient update equations (use qrinsert) - -LS = kreq.LS_Q * kreq.LS_R; -Kii = LS(1:kreq.n, 1:kreq.n); -Pi = bsxfun (@rdivide, LS(1:kreq.n, (kreq.n + 1):end), kreq.P_scaling); - -Kii = [[Kii Kji']; [Kji Kjj]]; -Pi = [Pi; Pj]; - -old_scaling = kreq.P_scaling; -kreq.P_scaling = compute_P_scaling (Kii, Pi); -Pi = bsxfun (@times, Pi, kreq.P_scaling); - -LS = [[Kii Pi]; [Pi' zeros(kreq.r)]]; -[kreq.LS_Q, kreq.LS_R] = qr (LS); - -if ~ isempty (kreq.RS) - Kti = kreq.RS(1:kreq.n, :)'; - Pt = bsxfun (@rdivide, kreq.RS((kreq.n + 1):end, :)', old_scaling); - kreq = stk_set_righthandside (kreq, [Kti Ktj], Pt); -elseif nargin > 4 - stk_error ('Too many input arguments: no RS to update', 'TooManyInputArgs'); -end - -kreq.n = kreq.n + size (Kjj, 1); - -end % function - - -%!shared model, x, y -%! model = stk_model ('stk_materncov32_iso', 1); -%! model.param = log ([1.0; 2.8]); -%! x = [1.2; 0.3; -1.9]; -%! y = 0.0; - -%!test -%! kreqA = stk_kreq_qr (model, x); -%! [Kii, Pi] = stk_make_matcov (model, x); -%! kreqB = stk_kreq_qr (model, x(1)); -%! kreqB = stk_update (kreqB, Kii(2, 2), Kii(2, 1), Pi(2)); -%! kreqB = stk_update (kreqB, Kii(3, 3), Kii(3, [1 2]), Pi(3)); -%! assert (stk_isequal_tolabs (kreqA, kreqB, 3 * eps)) - -%!test -%! kreqA = stk_kreq_qr (model, x, y); -%! [Kii, Pi] = stk_make_matcov (model, x); -%! [Kti, Pt] = stk_make_matcov (model, y, x); -%! kreqB = stk_kreq_qr (model, x(1), y); -%! kreqB = stk_update (kreqB, Kii(2, 2), Kii(2, 1), Pi(2), Kti(2)); -%! kreqB = stk_update (kreqB, Kii(3, 3), Kii(3, [1 2]), Pi(3), Kti(3)); -%! assert (stk_isequal_tolabs (kreqA, kreqB, 3 * eps)) diff --git a/inst/core/@stk_kreq_qr/subsref.m b/inst/core/@stk_kreq_qr/subsref.m index 78376ba..41df0fd 100644 --- a/inst/core/@stk_kreq_qr/subsref.m +++ b/inst/core/@stk_kreq_qr/subsref.m @@ -1,4 +1,4 @@ -% SUBSREF [STK internal] +% SUBSREF [overload base function] % % CALL: value = subsref (kreq, idx) % @@ -17,7 +17,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/core/stk_cholcov.m b/inst/core/stk_cholcov.m index f752629..96ac479 100644 --- a/inst/core/stk_cholcov.m +++ b/inst/core/stk_cholcov.m @@ -1,4 +1,4 @@ -% STK_CHOLCOV [STK internal] +% STK_CHOLCOV [STK internal] % % CALL: C = stk_cholcov (A, ...) % @@ -31,7 +31,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/core/stk_make_matcov.m b/inst/core/stk_make_matcov.m index 00ba38b..eeb597a 100644 --- a/inst/core/stk_make_matcov.m +++ b/inst/core/stk_make_matcov.m @@ -33,7 +33,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -59,10 +59,7 @@ end %=== process input arguments -x0 = double (x0); - if (nargin > 2) && (~ isempty (x1)) - x1 = double (x1); make_matcov_auto = false; else x1 = x0; @@ -92,7 +89,7 @@ end % function %!shared model, model2, x0, x1, n0, n1, d, Ka, Kb, Kc, Pa, Pb, Pc %! n0 = 20; n1 = 10; d = 4; -%! model = stk_model ('stk_materncov52_aniso', d); +%! model = stk_model (@stk_materncov52_aniso, d); %! model.lm = stk_lm_affine; %! model.param = log ([1.0; 2.1; 2.2; 2.3; 2.4]); %! model2 = model; model2.lognoisevariance = log(0.01); diff --git a/inst/core/stk_model_update.m b/inst/core/stk_model_update.m index 2ea3597..a26f132 100644 --- a/inst/core/stk_model_update.m +++ b/inst/core/stk_model_update.m @@ -18,7 +18,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -45,7 +45,7 @@ end % function %! xt = (linspace (1, 2, 15))'; zt = sin (xt); %! %! % Prior model -%! M0 = stk_model ('stk_materncov32_iso'); +%! M0 = stk_model (@stk_materncov32_iso); %! M0.param = log ([1.0; 2.1]); %! %! M1 = stk_model_update (M0, x1, z1); diff --git a/inst/core/stk_predict.m b/inst/core/stk_predict.m index e91aff7..abda5ae 100644 --- a/inst/core/stk_predict.m +++ b/inst/core/stk_predict.m @@ -1,11 +1,20 @@ -% STK_PREDICT performs a kriging prediction from data +% STK_PREDICT performs a kriging prediction % +% CALL: ZP = stk_predict (MODEL, XP) % CALL: ZP = stk_predict (MODEL, XI, ZI, XP) % -% performs a kriging prediction at the points XP, given the observations -% (XI, ZI) and the prior MODEL. The input arguments XI, ZI, and XP can be -% either numerical matrices or dataframes. More precisely, on a factor space -% of dimension DIM, +% performs a kriging prediction at the points XP, given the MODEL and, +% if available, the data (XI, ZI). +% +% The MODEL argument can be either a prior model structure (as provided +% by stk_model) or a model object (for instance, a posterior model +% represented by an stk_model_gpposterior object). If MODEL is already +% a posterior object and some additional data (XI, ZI) is provided, the +% model is first updated with the data before the prediction is actually +% carried out. +% +% The input arguments XI, ZI, and XP can be either numerical matrices or +% dataframes. More precisely, on an input space of dimension DIM, % % * XI must have size NI x DIM, % * ZI must have size NI x 1, @@ -14,8 +23,8 @@ % where NI is the number of observations and NP the number of prediction % points. The output ZP is a dataframe of size NP x 2, with: % -% * the kriging predictor in the first column (ZP.mean), and -% * the kriging variance in the second column (ZP.var). +% * the prediction mean in the first column (ZP.mean), and +% * the prediction variance in the second column (ZP.var). % % From a Bayesian point of view, ZP.mean and ZP.var are respectively the % posterior mean and variance of the Gaussian process prior MODEL given the @@ -23,12 +32,12 @@ % (posterior) variance of the latent Gaussian process, not the variance of a % future noisy observation at location XP. % -% CALL: [ZP, LAMBDA, MU] = stk_predict (MODEL, XI, ZI, XP) +% CALL: [ZP, LAMBDA, MU] = stk_predict (MODEL, ...) % % also returns the matrix of kriging weights LAMBDA and the matrix of % Lagrange multipliers MU. % -% CALL: [ZP, LAMBDA, MU, K] = stk_predict (MODEL, XI, ZI, XP) +% CALL: [ZP, LAMBDA, MU, K] = stk_predict (MODEL, ...) % % also returns the posterior covariance matrix K at the locations XP (this is % an NP x NP covariance matrix). From a frequentist point of view, K can be @@ -42,7 +51,7 @@ % Copyright Notice % -% Copyright (C) 2015, 2016, 2018 CentraleSupelec +% Copyright (C) 2015, 2016, 2018, 2020 CentraleSupelec % Copyright (C) 2011-2014 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -53,7 +62,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -68,12 +77,31 @@ % You should have received a copy of the GNU General Public License % along with STK. If not, see <http://www.gnu.org/licenses/>. -function varargout = stk_predict (M_prior, x_obs, z_obs, x_prd) +function varargout = stk_predict (model, varargin) -M_post = stk_model_gpposterior (M_prior, x_obs, z_obs); +% Support for several syntaxes +switch nargin + + case {0, 1} + stk_error ('Not enough input arguments.', 'NotEnoughInputArgs'); + + case 2 % CALL: [...] = stk_predict (MODEL, X_PRD) + x_prd = varargin{1}; + + case 3 % CALL: [...] = stk_predict (MODEL, DATA, X_PRD) + stk_error ('This syntax is not implemented yet.', 'NotImplemented'); + model = stk_model_gpposterior (model, varargin{1}); + x_prd = varargin{2}; + + case 4 % CALL: [...] = stk_predict (MODEL, X_OBS, Z_OBS, X_PRD) + model = stk_model_gpposterior (model, varargin{1}, varargin{2}); + x_prd = varargin{3}; + + +end % switch varargout = cell (1, max (1, nargout)); -[varargout{:}] = stk_predict (M_post, x_prd); +[varargout{:}] = stk_predict_ (model, x_prd); end % function @@ -93,13 +121,13 @@ end % function %! z_obs = sin (double (x_obs)); %! x_prd = x0(idx_prd); %! -%! model = stk_model ('stk_materncov32_iso'); +%! model = stk_model (@stk_materncov32_iso); %! model.param = log ([1.0; 2.1]); %!error y_prd1 = stk_predict (); %!error y_prd1 = stk_predict (model); -%!error y_prd1 = stk_predict (model, x_obs); -%!error y_prd1 = stk_predict (model, x_obs, z_obs); +%!test y_prd1 = stk_predict (model, x_prd); +%!error y_prd1 = stk_predict (model, data, x_prd); %!test y_prd1 = stk_predict (model, x_obs, z_obs, x_prd); %!error y_prd1 = stk_predict (model, [x_obs; x_obs], [z_obs; z_obs], x_prd); diff --git a/inst/core/stk_predict_leaveoneout.m b/inst/core/stk_predict_leaveoneout.m index 0dcffcf..7ee8d6b 100644 --- a/inst/core/stk_predict_leaveoneout.m +++ b/inst/core/stk_predict_leaveoneout.m @@ -43,7 +43,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -81,7 +81,7 @@ end % function %! n = 20; %! x_obs = stk_sampling_regulargrid (n, 1, [0; 2*pi]); %! z_obs = stk_feval (@sin, x_obs); -%! model = stk_model ('stk_materncov32_iso'); +%! model = stk_model (@stk_materncov32_iso); %! model.param = log ([1; 5]); %!test % one output diff --git a/inst/covfcs/rbf/stk_rbf_exponential.m b/inst/covfcs/rbf/stk_rbf_exponential.m index a7c5425..fd98c5b 100644 --- a/inst/covfcs/rbf/stk_rbf_exponential.m +++ b/inst/covfcs/rbf/stk_rbf_exponential.m @@ -39,7 +39,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/covfcs/rbf/stk_rbf_gauss.m b/inst/covfcs/rbf/stk_rbf_gauss.m index 735d5ba..e46943f 100644 --- a/inst/covfcs/rbf/stk_rbf_gauss.m +++ b/inst/covfcs/rbf/stk_rbf_gauss.m @@ -35,7 +35,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/covfcs/rbf/stk_rbf_matern.m b/inst/covfcs/rbf/stk_rbf_matern.m index 64356cf..5918e61 100644 --- a/inst/covfcs/rbf/stk_rbf_matern.m +++ b/inst/covfcs/rbf/stk_rbf_matern.m @@ -28,7 +28,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/covfcs/rbf/stk_rbf_matern32.m b/inst/covfcs/rbf/stk_rbf_matern32.m index ba91564..75c144d 100644 --- a/inst/covfcs/rbf/stk_rbf_matern32.m +++ b/inst/covfcs/rbf/stk_rbf_matern32.m @@ -27,7 +27,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/covfcs/rbf/stk_rbf_matern52.m b/inst/covfcs/rbf/stk_rbf_matern52.m index c12c0ba..323e303 100644 --- a/inst/covfcs/rbf/stk_rbf_matern52.m +++ b/inst/covfcs/rbf/stk_rbf_matern52.m @@ -27,7 +27,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/covfcs/rbf/stk_rbf_spherical.m b/inst/covfcs/rbf/stk_rbf_spherical.m index 1062d81..289b93e 100644 --- a/inst/covfcs/rbf/stk_rbf_spherical.m +++ b/inst/covfcs/rbf/stk_rbf_spherical.m @@ -33,7 +33,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/covfcs/rbf/stk_sf_gausscorr.m b/inst/covfcs/rbf/stk_sf_gausscorr.m index a8584cd..6d6d096 100644 --- a/inst/covfcs/rbf/stk_sf_gausscorr.m +++ b/inst/covfcs/rbf/stk_sf_gausscorr.m @@ -1,4 +1,4 @@ -% STK_SF_GAUSSCORR is deprecated, use stk_rbf_gauss instead +% STK_SF_GAUSSCORR [deprecated] % % See also: stk_rbf_gauss @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/covfcs/rbf/stk_sf_matern.m b/inst/covfcs/rbf/stk_sf_matern.m index 0627fef..b7882c1 100644 --- a/inst/covfcs/rbf/stk_sf_matern.m +++ b/inst/covfcs/rbf/stk_sf_matern.m @@ -1,4 +1,4 @@ -% STK_SF_MATERN is deprecated, use stk_rbf_matern instead +% STK_SF_MATERN [deprecated] % % See also: stk_rbf_matern @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/covfcs/rbf/stk_sf_matern32.m b/inst/covfcs/rbf/stk_sf_matern32.m index 43a6e80..d434adc 100644 --- a/inst/covfcs/rbf/stk_sf_matern32.m +++ b/inst/covfcs/rbf/stk_sf_matern32.m @@ -1,4 +1,4 @@ -% STK_SF_MATERN32 is deprecated, use stk_rbf_matern32 instead +% STK_SF_MATERN32 [deprecated] % % See also: stk_rbf_matern32 @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/covfcs/rbf/stk_sf_matern52.m b/inst/covfcs/rbf/stk_sf_matern52.m index d59e639..516cea8 100644 --- a/inst/covfcs/rbf/stk_sf_matern52.m +++ b/inst/covfcs/rbf/stk_sf_matern52.m @@ -1,4 +1,4 @@ -% STK_SF_MATERN52 is deprecated, use stk_rbf_matern52 instead +% STK_SF_MATERN52 [deprecated] % % See also: stk_rbf_matern52 @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/covfcs/stk_discretecov.m b/inst/covfcs/stk_discretecov.m index 0789109..32108a5 100644 --- a/inst/covfcs/stk_discretecov.m +++ b/inst/covfcs/stk_discretecov.m @@ -32,7 +32,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -54,17 +54,17 @@ function K = stk_discretecov (param, x, y, diff, pairwise) x = double (x); y = double (y); -if (nargin >= 4) && (diff ~= -1), +if (nargin >= 4) && (diff ~= -1) stk_error ('diff should be equal to -1', 'InvalidArgument'); end -if nargin < 5, +if nargin < 5 pairwise = false; end %--- compute covariance matrix ------------------------------------------------- -if ~pairwise, +if ~pairwise K = param.K(x, y); else idx = sub2ind (size (param.K), x, y); @@ -78,13 +78,13 @@ end % function %! n0 = 20; n1 = 10; dim = 4; %! x0 = stk_sampling_randunif (n0, dim); %! x1 = stk_sampling_randunif (n1, dim); -%! model = stk_model ('stk_materncov52_aniso', dim); +%! model = stk_model (@stk_materncov52_aniso, dim); %! model.lm = stk_lm_affine (); %! model.param = log ([1.0; 2.1; 2.2; 2.3; 2.4]); %!test % without noise, pairwise = false %! model.lognoisevariance = - inf; -%! model2 = stk_model ('stk_discretecov', model, x0); +%! model2 = stk_model (@stk_discretecov, model, x0); %! idx = [1 4 9]; %! [K1, P1] = stk_make_matcov (model, x0(idx, :)); %! [K2, P2] = stk_make_matcov (model2, idx'); @@ -98,7 +98,7 @@ end % function %!test % with noise, pairwise = false %! model.lognoisevariance = log (0.01); -%! model2 = stk_model ('stk_discretecov', model, x0); +%! model2 = stk_model (@stk_discretecov, model, x0); %! idx = [1 4 9]; %! [K1, P1] = stk_make_matcov (model, x0(idx, :)); %! [K2, P2] = stk_make_matcov (model2, idx'); diff --git a/inst/covfcs/stk_expcov_aniso.m b/inst/covfcs/stk_expcov_aniso.m index 9bae597..0fdb540 100644 --- a/inst/covfcs/stk_expcov_aniso.m +++ b/inst/covfcs/stk_expcov_aniso.m @@ -40,7 +40,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -67,7 +67,7 @@ if nargin < 5, pairwise = false; end % check consistency for the number of factors dim = size (x, 2); -if (size (y, 2) ~= dim), +if (size (y, 2) ~= dim) stk_error ('xi and yi have incompatible sizes.', 'InvalidArgument'); end @@ -84,7 +84,7 @@ Sigma2 = exp (param(1)); invRho = exp (param(2:end)); % check parameter values -if ~ (Sigma2 > 0) || ~ all (invRho >= 0), +if ~ (Sigma2 > 0) || ~ all (invRho >= 0) error ('Incorrect parameter value.'); end @@ -103,20 +103,20 @@ if isempty (x0) || isempty (y0) || isempty (param0) ... compute_Kx_cache = true; end -if diff == -1, +if diff == -1 %%% compute the value (not a derivative) k = Sigma2 * stk_rbf_exponential (D, -1); -elseif diff == 1, +elseif diff == 1 %%% diff wrt param(1) = log(Sigma2) k = Sigma2 * stk_rbf_exponential (D, -1); -elseif (diff >= 2) && (diff <= nb_params), +elseif (diff >= 2) && (diff <= nb_params) %%% diff wrt param(diff) = - log(invRho(diff-1)) ind = diff - 1; if compute_Kx_cache || isempty (Kx_cache) Kx_cache = 1 ./ (D + eps) .* (Sigma2 * stk_rbf_exponential (D, 1)); compute_Kx_cache = false; end - if pairwise, + if pairwise k = (xs(:, ind) - ys(:, ind)).^2 .* Kx_cache; else k = (bsxfun (@minus, xs(:, ind), ys(:, ind)')) .^ 2 .* Kx_cache; diff --git a/inst/covfcs/stk_expcov_iso.m b/inst/covfcs/stk_expcov_iso.m index 9f00faf..190cf73 100644 --- a/inst/covfcs/stk_expcov_iso.m +++ b/inst/covfcs/stk_expcov_iso.m @@ -27,7 +27,7 @@ % Copyright Notice % -% Copyright (C) 2016, 2018 CentraleSupelec +% Copyright (C) 2016, 2018, 2020 CentraleSupelec % Copyright (C) 2011-2014 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -39,7 +39,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -64,12 +64,17 @@ y = double (y); if nargin < 4, diff = -1; end if nargin < 5, pairwise = false; end +% check param +if numel (param) ~= 2 + stk_error ('param should have two elements.', 'InvalidArgument'); +end + % extract parameters from the "param" vector Sigma2 = exp (param(1)); invRho = exp (param(2)); % check parameter values -if ~ (Sigma2 > 0) || ~ (invRho >= 0), +if ~ (Sigma2 > 0) || ~ (invRho >= 0) error ('Incorrect parameter value.'); end @@ -84,13 +89,13 @@ if isempty (x0) || isempty (y0) || isempty (param0) ... x0 = x; y0 = y; param0 = param; pairwise0 = pairwise; end -if diff == -1, +if diff == -1 %%% compute the value (not a derivative) k = Sigma2 * stk_rbf_exponential (D, -1); -elseif diff == 1, +elseif diff == 1 %%% diff wrt param(1) = log(Sigma2) k = Sigma2 * stk_rbf_exponential (D, -1); -elseif diff == 2, +elseif diff == 2 %%% diff wrt param(3) = - log(invRho) k = D .* (Sigma2 * stk_rbf_exponential (D, 1)); else @@ -109,6 +114,8 @@ end % function %! x = stk_sampling_randunif (5, dim); %! y = stk_sampling_randunif (5, dim); +%!error K = stk_expcov_iso ([param; 1.234], x, y); + %!error stk_expcov_iso (); %!error stk_expcov_iso (param); %!error stk_expcov_iso (param, x); diff --git a/inst/covfcs/stk_gausscov_aniso.m b/inst/covfcs/stk_gausscov_aniso.m index f68d602..774b2e3 100644 --- a/inst/covfcs/stk_gausscov_aniso.m +++ b/inst/covfcs/stk_gausscov_aniso.m @@ -40,7 +40,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -67,7 +67,7 @@ if nargin < 5, pairwise = false; end % check consistency for the number of factors dim = size (x, 2); -if size (y, 2) ~= dim, +if size (y, 2) ~= dim stk_error ('xi and yi have incompatible sizes.', 'InvalidArgument'); end @@ -84,7 +84,7 @@ Sigma2 = exp (param(1)); invRho = exp (param(2:end)); % check parameter values -if ~ (Sigma2 > 0) || ~ all (invRho >= 0), +if ~ (Sigma2 > 0) || ~ all (invRho >= 0) error ('Incorrect parameter value.'); end @@ -103,20 +103,20 @@ if isempty (x0) || isempty (y0) || isempty (param0) || ... compute_Kx_cache = true; end -if diff == -1, +if diff == -1 % Compute the value (not a derivative) k = Sigma2 * stk_rbf_gauss (D, -1); -elseif diff == 1, +elseif diff == 1 % Differentiate wrt param(1) = log (Sigma2) k = Sigma2 * stk_rbf_gauss (D, -1); -elseif (diff >= 2) && (diff <= nb_params), +elseif (diff >= 2) && (diff <= nb_params) % Differentiate wrt param(diff) = - log (invRho(diff-1)) ind = diff - 1; if compute_Kx_cache || isempty (Kx_cache) Kx_cache = 1 ./ (D + eps) .* (Sigma2 * stk_rbf_gauss (D, 1)); compute_Kx_cache = false; end - if pairwise, + if pairwise k = ((xs(:, ind) - ys(:, ind)) .^ 2) .* Kx_cache; else k = (bsxfun (@minus, xs(:, ind), ys(:, ind)')) .^ 2 .* Kx_cache; diff --git a/inst/covfcs/stk_gausscov_iso.m b/inst/covfcs/stk_gausscov_iso.m index 90c005b..e17edff 100644 --- a/inst/covfcs/stk_gausscov_iso.m +++ b/inst/covfcs/stk_gausscov_iso.m @@ -27,7 +27,7 @@ % Copyright Notice % -% Copyright (C) 2015, 2016, 2018 CentraleSupelec +% Copyright (C) 2015, 2016, 2018, 2020 CentraleSupelec % Copyright (C) 2013 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -38,7 +38,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -63,12 +63,17 @@ y = double (y); if nargin < 4, diff = -1; end if nargin < 5, pairwise = false; end +% check param +if numel (param) ~= 2 + stk_error ('param should have two elements.', 'InvalidArgument'); +end + % extract parameters from the "param" vector Sigma2 = exp (param(1)); invRho = exp (param(2)); % check parameter values -if ~ (Sigma2 > 0) || ~ (invRho > 0), +if ~ (Sigma2 > 0) || ~ (invRho > 0) error ('Incorrect parameter value.'); end @@ -83,13 +88,13 @@ if isempty (x0) || isempty (y0) || isempty (param0) || ... x0 = x; y0 = y; param0 = param; pairwise0 = pairwise; end -if diff == -1, +if diff == -1 % compute the value (not a derivative) k = Sigma2 * stk_rbf_gauss (D, -1); -elseif diff == 1, +elseif diff == 1 % diff wrt param(1) = log(Sigma2) k = Sigma2 * stk_rbf_gauss (D, -1); -elseif diff == 2, +elseif diff == 2 % diff wrt param(3) = - log(invRho) k = D .* (Sigma2 * stk_rbf_gauss (D, 1)); else @@ -108,6 +113,8 @@ end % function %! x = stk_sampling_randunif (5, dim); %! y = stk_sampling_randunif (5, dim); +%!error K = stk_gausscov_iso ([param; 1.234], x, y); + %!error stk_gausscov_iso (); %!error stk_gausscov_iso (param); %!error stk_gausscov_iso (param, x); diff --git a/inst/covfcs/stk_materncov32_aniso.m b/inst/covfcs/stk_materncov32_aniso.m index bc22cb6..e5677c6 100644 --- a/inst/covfcs/stk_materncov32_aniso.m +++ b/inst/covfcs/stk_materncov32_aniso.m @@ -41,7 +41,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -68,7 +68,7 @@ if nargin < 5, pairwise = false; end % check consistency for the number of factors dim = size (x, 2); -if (size (y, 2) ~= dim), +if (size (y, 2) ~= dim) stk_error ('xi and yi have incompatible sizes.', 'InvalidArgument'); end @@ -85,7 +85,7 @@ Sigma2 = exp (param(1)); invRho = exp (param(2:end)); % check parameter values -if ~ (Sigma2 > 0) || ~ all (invRho >= 0), +if ~ (Sigma2 > 0) || ~ all (invRho >= 0) error ('Incorrect parameter value.'); end @@ -104,20 +104,20 @@ if isempty (x0) || isempty (y0) || isempty (param0) ... compute_Kx_cache = true; end -if diff == -1, +if diff == -1 %%% compute the value (not a derivative) k = Sigma2 * stk_rbf_matern32 (D, -1); -elseif diff == 1, +elseif diff == 1 %%% diff wrt param(1) = log(Sigma2) k = Sigma2 * stk_rbf_matern32 (D, -1); -elseif (diff >= 2) && (diff <= nb_params), +elseif (diff >= 2) && (diff <= nb_params) %%% diff wrt param(diff) = - log(invRho(diff-1)) ind = diff - 1; if compute_Kx_cache || isempty (Kx_cache) Kx_cache = 1 ./ (D + eps) .* (Sigma2 * stk_rbf_matern32 (D, 1)); compute_Kx_cache = false; end - if pairwise, + if pairwise k = (xs(:, ind) - ys(:, ind)).^2 .* Kx_cache; else k = (bsxfun (@minus, xs(:, ind), ys(:, ind)')) .^ 2 .* Kx_cache; diff --git a/inst/covfcs/stk_materncov32_iso.m b/inst/covfcs/stk_materncov32_iso.m index 5e5a389..e5b3f43 100644 --- a/inst/covfcs/stk_materncov32_iso.m +++ b/inst/covfcs/stk_materncov32_iso.m @@ -27,7 +27,7 @@ % Copyright Notice % -% Copyright (C) 2016, 2018 CentraleSupelec +% Copyright (C) 2016, 2018, 2020 CentraleSupelec % Copyright (C) 2011-2014 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -39,7 +39,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -64,12 +64,17 @@ y = double (y); if nargin < 4, diff = -1; end if nargin < 5, pairwise = false; end +% check param +if numel (param) ~= 2 + stk_error ('param should have two elements.', 'InvalidArgument'); +end + % extract parameters from the "param" vector Sigma2 = exp (param(1)); invRho = exp (param(2)); % check parameter values -if ~ (Sigma2 > 0) || ~ (invRho >= 0), +if ~ (Sigma2 > 0) || ~ (invRho >= 0) error ('Incorrect parameter value.'); end @@ -84,13 +89,13 @@ if isempty (x0) || isempty (y0) || isempty (param0) ... x0 = x; y0 = y; param0 = param; pairwise0 = pairwise; end -if diff == -1, +if diff == -1 %%% compute the value (not a derivative) k = Sigma2 * stk_rbf_matern32 (D, -1); -elseif diff == 1, +elseif diff == 1 %%% diff wrt param(1) = log(Sigma2) k = Sigma2 * stk_rbf_matern32 (D, -1); -elseif diff == 2, +elseif diff == 2 %%% diff wrt param(3) = - log(invRho) k = D .* (Sigma2 * stk_rbf_matern32 (D, 1)); else @@ -109,6 +114,8 @@ end % function %! x = stk_sampling_randunif (5, dim); %! y = stk_sampling_randunif (5, dim); +%!error K = stk_materncov32_iso ([param; 1.234], x, y); + %!error stk_materncov32_iso (); %!error stk_materncov32_iso (param); %!error stk_materncov32_iso (param, x); diff --git a/inst/covfcs/stk_materncov52_aniso.m b/inst/covfcs/stk_materncov52_aniso.m index bf1523d..748f7bc 100644 --- a/inst/covfcs/stk_materncov52_aniso.m +++ b/inst/covfcs/stk_materncov52_aniso.m @@ -41,7 +41,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -68,7 +68,7 @@ if nargin < 5, pairwise = false; end % check consistency for the number of factors dim = size (x, 2); -if (size (y, 2) ~= dim), +if (size (y, 2) ~= dim) stk_error ('xi and yi have incompatible sizes.', 'InvalidArgument'); end @@ -85,7 +85,7 @@ Sigma2 = exp (param(1)); invRho = exp (param(2:end)); % check parameter values -if ~ (Sigma2 > 0) || ~ all (invRho >= 0), +if ~ (Sigma2 > 0) || ~ all (invRho >= 0) error ('Incorrect parameter value.'); end @@ -104,20 +104,20 @@ if isempty (x0) || isempty (y0) || isempty (param0) ... compute_Kx_cache = true; end -if diff == -1, +if diff == -1 %%% compute the value (not a derivative) k = Sigma2 * stk_rbf_matern52 (D, -1); -elseif diff == 1, +elseif diff == 1 %%% diff wrt param(1) = log(Sigma2) k = Sigma2 * stk_rbf_matern52 (D, -1); -elseif (diff >= 2) && (diff <= nb_params), +elseif (diff >= 2) && (diff <= nb_params) %%% diff wrt param(diff) = - log(invRho(diff-1)) ind = diff - 1; if compute_Kx_cache || isempty (Kx_cache) Kx_cache = 1 ./ (D + eps) .* (Sigma2 * stk_rbf_matern52 (D, 1)); compute_Kx_cache = false; end - if pairwise, + if pairwise k = (xs(:, ind) - ys(:, ind)).^2 .* Kx_cache; else k = (bsxfun (@minus, xs(:, ind), ys(:, ind)')) .^ 2 .* Kx_cache; diff --git a/inst/covfcs/stk_materncov52_iso.m b/inst/covfcs/stk_materncov52_iso.m index 65a7e0f..793f9ec 100644 --- a/inst/covfcs/stk_materncov52_iso.m +++ b/inst/covfcs/stk_materncov52_iso.m @@ -27,7 +27,7 @@ % Copyright Notice % -% Copyright (C) 2015, 2016, 2018 CentraleSupelec +% Copyright (C) 2015, 2016, 2018, 2020 CentraleSupelec % Copyright (C) 2011-2014 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -39,7 +39,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -64,12 +64,17 @@ y = double (y); if nargin < 4, diff = -1; end if nargin < 5, pairwise = false; end +% check param +if numel (param) ~= 2 + stk_error ('param should have two elements.', 'InvalidArgument'); +end + % extract parameters from the "param" vector Sigma2 = exp (param(1)); invRho = exp (param(2)); % check parameter values -if ~ (Sigma2 > 0) || ~ (invRho >= 0), +if ~ (Sigma2 > 0) || ~ (invRho >= 0) error ('Incorrect parameter value.'); end @@ -84,13 +89,13 @@ if isempty (x0) || isempty (y0) || isempty (param0) ... x0 = x; y0 = y; param0 = param; pairwise0 = pairwise; end -if diff == -1, +if diff == -1 %%% compute the value (not a derivative) k = Sigma2 * stk_rbf_matern52 (D, -1); -elseif diff == 1, +elseif diff == 1 %%% diff wrt param(1) = log(Sigma2) k = Sigma2 * stk_rbf_matern52 (D, -1); -elseif diff == 2, +elseif diff == 2 %%% diff wrt param(3) = - log(invRho) k = D .* (Sigma2 * stk_rbf_matern52 (D, 1)); else @@ -109,6 +114,8 @@ end % function %! x = stk_sampling_randunif (5, dim); %! y = stk_sampling_randunif (5, dim); +%!error K = stk_materncov52_iso ([param; 1.234], x, y); + %!error stk_materncov52_iso (); %!error stk_materncov52_iso (param); %!error stk_materncov52_iso (param, x); diff --git a/inst/covfcs/stk_materncov_aniso.m b/inst/covfcs/stk_materncov_aniso.m index ed1859c..45c9efc 100644 --- a/inst/covfcs/stk_materncov_aniso.m +++ b/inst/covfcs/stk_materncov_aniso.m @@ -42,7 +42,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -69,7 +69,7 @@ if nargin < 5, pairwise = false; end % check size consistency dim = size (x, 2); -if (size (y, 2) ~= dim), +if (size (y, 2) ~= dim) stk_error ('xi and yi have incompatible sizes.', 'InvalidArgument'); end @@ -87,7 +87,7 @@ Nu = exp (param(2)); invRho = exp (param(3:end)); % check parameter values -if ~ (Sigma2 > 0) || ~ (Nu > 0) || ~ all (invRho >= 0), +if ~ (Sigma2 > 0) || ~ (Nu > 0) || ~ all (invRho >= 0) error ('Incorrect parameter value.'); end @@ -106,23 +106,23 @@ if isempty (x0) || isempty (y0) || isempty (param0) ... compute_Kx_cache = true; end -if diff == -1, +if diff == -1 %%% compute the value (not a derivative) k = Sigma2 * stk_rbf_matern (Nu, D, -1); -elseif diff == 1, +elseif diff == 1 %%% diff wrt param(1) = log(Sigma2) k = Sigma2 * stk_rbf_matern (Nu, D, -1); -elseif diff == 2, +elseif diff == 2 %%% diff wrt param(2) = log(Nu) k = Nu * Sigma2 * stk_rbf_matern (Nu, D, 1); -elseif (diff >= 3) && (diff <= nb_params), +elseif (diff >= 3) && (diff <= nb_params) %%% diff wrt param(diff) = - log(invRho(diff-2)) ind = diff - 2; if compute_Kx_cache || isempty (Kx_cache) Kx_cache = 1./(D+eps) .* (Sigma2 * stk_rbf_matern (Nu, D, 2)); compute_Kx_cache = false; end - if pairwise, + if pairwise k = (xs(:, ind) - ys(:, ind)) .^ 2 .* Kx_cache; else k = (bsxfun (@minus, xs(:, ind), ys(:, ind)')) .^ 2 .* Kx_cache; diff --git a/inst/covfcs/stk_materncov_iso.m b/inst/covfcs/stk_materncov_iso.m index ee4bdde..f8a28ad 100644 --- a/inst/covfcs/stk_materncov_iso.m +++ b/inst/covfcs/stk_materncov_iso.m @@ -29,7 +29,7 @@ % Copyright Notice % -% Copyright (C) 2015, 2016, 2018 CentraleSupelec +% Copyright (C) 2015, 2016, 2018, 2020 CentraleSupelec % Copyright (C) 2011-2014 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -41,7 +41,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -66,13 +66,18 @@ y = double (y); if nargin < 4, diff = -1; end if nargin < 5, pairwise = false; end +% check param +if numel (param) ~= 3 + stk_error ('param should have two elements.', 'InvalidArgument'); +end + % extract parameters from the "param" vector Sigma2 = exp (param(1)); Nu = exp (param(2)); invRho = exp (param(3)); % check parameter values -if ~ (Sigma2 > 0) || ~ (Nu > 0) || ~ (invRho >= 0), +if ~ (Sigma2 > 0) || ~ (Nu > 0) || ~ (invRho >= 0) error ('Incorrect parameter value.'); end @@ -87,16 +92,16 @@ if isempty (x0) || isempty (y0) || isempty (param0) ... x0 = x; y0 = y; param0 = param; pairwise0 = pairwise; end -if diff == -1, +if diff == -1 %%% compute the value (not a derivative) k = Sigma2 * stk_rbf_matern (Nu, D, -1); -elseif diff == 1, +elseif diff == 1 %%% diff wrt param(1) = log(Sigma2) k = Sigma2 * stk_rbf_matern (Nu, D, -1); -elseif diff == 2, +elseif diff == 2 %%% diff wrt param(2) = log(Nu) k = Nu * Sigma2 * stk_rbf_matern (Nu, D, 1); -elseif diff == 3, +elseif diff == 3 %%% diff wrt param(3) = - log(invRho) k = D .* (Sigma2 * stk_rbf_matern (Nu, D, 2)); else @@ -115,6 +120,8 @@ end % function %! x = stk_sampling_randunif(5, dim); %! y = stk_sampling_randunif(5, dim); +%!error K = stk_materncov_iso ([param; 1.234], x, y); + %!error stk_materncov_iso(); %!error stk_materncov_iso(param); %!error stk_materncov_iso(param, x); diff --git a/inst/covfcs/stk_noisecov.m b/inst/covfcs/stk_noisecov.m index cb89c5a..3fdaab9 100644 --- a/inst/covfcs/stk_noisecov.m +++ b/inst/covfcs/stk_noisecov.m @@ -1,4 +1,6 @@ % STK_NOISECOV [deprecated] +% +% See also: stk_covmat_noise % Copyright Notice % @@ -13,7 +15,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/covfcs/stk_sphcov_aniso.m b/inst/covfcs/stk_sphcov_aniso.m index 92bb4d9..635b445 100644 --- a/inst/covfcs/stk_sphcov_aniso.m +++ b/inst/covfcs/stk_sphcov_aniso.m @@ -40,7 +40,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -67,7 +67,7 @@ if nargin < 5, pairwise = false; end % check consistency for the number of factors dim = size (x, 2); -if (size (y, 2) ~= dim), +if (size (y, 2) ~= dim) stk_error ('xi and yi have incompatible sizes.', 'InvalidArgument'); end @@ -84,7 +84,7 @@ Sigma2 = exp (param(1)); invRho = exp (param(2:end)); % check parameter values -if ~ (Sigma2 > 0) || ~ all (invRho >= 0), +if ~ (Sigma2 > 0) || ~ all (invRho >= 0) error ('Incorrect parameter value.'); end @@ -103,20 +103,20 @@ if isempty (x0) || isempty (y0) || isempty (param0) ... compute_Kx_cache = true; end -if diff == -1, +if diff == -1 %%% compute the value (not a derivative) k = Sigma2 * stk_rbf_spherical (D, -1); -elseif diff == 1, +elseif diff == 1 %%% diff wrt param(1) = log(Sigma2) k = Sigma2 * stk_rbf_spherical (D, -1); -elseif (diff >= 2) && (diff <= nb_params), +elseif (diff >= 2) && (diff <= nb_params) %%% diff wrt param(diff) = - log(invRho(diff-1)) ind = diff - 1; if compute_Kx_cache || isempty (Kx_cache) Kx_cache = 1 ./ (D + eps) .* (Sigma2 * stk_rbf_spherical (D, 1)); compute_Kx_cache = false; end - if pairwise, + if pairwise k = (xs(:, ind) - ys(:, ind)).^2 .* Kx_cache; else k = (bsxfun (@minus, xs(:, ind), ys(:, ind)')) .^ 2 .* Kx_cache; diff --git a/inst/covfcs/stk_sphcov_iso.m b/inst/covfcs/stk_sphcov_iso.m index ea3c8c5..3ec866e 100644 --- a/inst/covfcs/stk_sphcov_iso.m +++ b/inst/covfcs/stk_sphcov_iso.m @@ -27,7 +27,7 @@ % Copyright Notice % -% Copyright (C) 2016, 2018 CentraleSupelec +% Copyright (C) 2016, 2018, 2020 CentraleSupelec % Copyright (C) 2011-2014 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -39,7 +39,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -64,12 +64,17 @@ y = double (y); if nargin < 4, diff = -1; end if nargin < 5, pairwise = false; end +% check param +if numel (param) ~= 2 + stk_error ('param should have two elements.', 'InvalidArgument'); +end + % extract parameters from the "param" vector Sigma2 = exp (param(1)); invRho = exp (param(2)); % check parameter values -if ~ (Sigma2 > 0) || ~ (invRho >= 0), +if ~ (Sigma2 > 0) || ~ (invRho >= 0) error ('Incorrect parameter value.'); end @@ -84,13 +89,13 @@ if isempty (x0) || isempty (y0) || isempty (param0) ... x0 = x; y0 = y; param0 = param; pairwise0 = pairwise; end -if diff == -1, +if diff == -1 %%% compute the value (not a derivative) k = Sigma2 * stk_rbf_spherical (D, -1); -elseif diff == 1, +elseif diff == 1 %%% diff wrt param(1) = log(Sigma2) k = Sigma2 * stk_rbf_spherical (D, -1); -elseif diff == 2, +elseif diff == 2 %%% diff wrt param(3) = - log(invRho) k = D .* (Sigma2 * stk_rbf_spherical (D, 1)); else @@ -109,6 +114,8 @@ end % function %! x = stk_sampling_randunif (5, dim); %! y = stk_sampling_randunif (5, dim); +%!error K = stk_sphcov_iso ([param; 1.234], x, y); + %!error stk_sphcov_iso (); %!error stk_sphcov_iso (param); %!error stk_sphcov_iso (param, x); diff --git a/inst/examples/01_kriging_basics/stk_example_kb01.m b/inst/examples/01_kriging_basics/stk_example_kb01.m index 5255cbc..cac22e5 100644 --- a/inst/examples/01_kriging_basics/stk_example_kb01.m +++ b/inst/examples/01_kriging_basics/stk_example_kb01.m @@ -28,7 +28,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -73,7 +73,7 @@ stk_labels ('input variable x', 'response z'); % The following line defines a model with a constant but unknown mean (ordinary % kriging) and a Matern covariance function. (Some default parameters are also % set, but we override them below.) -model = stk_model ('stk_materncov_iso'); +model = stk_model (@stk_materncov_iso); % NOTE: the suffix '_iso' indicates an ISOTROPIC covariance function, but the % distinction isotropic / anisotropic is irrelevant here since DIM = 1. diff --git a/inst/examples/01_kriging_basics/stk_example_kb01n.m b/inst/examples/01_kriging_basics/stk_example_kb01n.m index 9ce53d5..03337bf 100644 --- a/inst/examples/01_kriging_basics/stk_example_kb01n.m +++ b/inst/examples/01_kriging_basics/stk_example_kb01n.m @@ -26,7 +26,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -71,7 +71,7 @@ stk_labels ('input variable x', 'response z'); % The following line defines a model with a constant but unknown mean (ordinary % kriging) and a Matern covariance function. (Some default parameters are also % set, but we override them below.) -model = stk_model ('stk_materncov_iso'); +model = stk_model (@stk_materncov_iso); % NOTE: the suffix '_iso' indicates an ISOTROPIC covariance function, but the % distinction isotropic / anisotropic is irrelevant here since DIM = 1. diff --git a/inst/examples/01_kriging_basics/stk_example_kb02.m b/inst/examples/01_kriging_basics/stk_example_kb02.m index b4e723f..c87c8a1 100644 --- a/inst/examples/01_kriging_basics/stk_example_kb02.m +++ b/inst/examples/01_kriging_basics/stk_example_kb02.m @@ -22,7 +22,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -61,7 +61,7 @@ stk_title ('True function and observed data'); % Define a model with a constant but unknown mean (ordinary kriging) % and a Matern covariance function, the parameters of which will be % estimated from the data. -model = stk_model ('stk_materncov_iso'); +model = stk_model (@stk_materncov_iso); %% Parameter estimation diff --git a/inst/examples/01_kriging_basics/stk_example_kb02n.m b/inst/examples/01_kriging_basics/stk_example_kb02n.m index b0d2407..cef906a 100644 --- a/inst/examples/01_kriging_basics/stk_example_kb02n.m +++ b/inst/examples/01_kriging_basics/stk_example_kb02n.m @@ -22,7 +22,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -61,7 +61,7 @@ stk_title ('True function and noisy observed data'); % Define a model with a constant but unknown mean (ordinary kriging) % and a Matern covariance function, the parameters of which will be % estimated from the data. -model = stk_model ('stk_materncov_iso'); +model = stk_model (@stk_materncov_iso); % Indicate that with the noise variance to be estimated model.lognoisevariance = nan; diff --git a/inst/examples/01_kriging_basics/stk_example_kb03.m b/inst/examples/01_kriging_basics/stk_example_kb03.m index 3236f4f..047566a 100644 --- a/inst/examples/01_kriging_basics/stk_example_kb03.m +++ b/inst/examples/01_kriging_basics/stk_example_kb03.m @@ -24,7 +24,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -51,19 +51,19 @@ CASENUM = 1; switch CASENUM - case 1, % the classical BRANIN-HOO test function + case 1 % The classical BRANIN-HOO test function f = @stk_testfun_braninhoo; DIM = 2; BOX = [[-5; 10], [0; 15]]; NI = 20; - case 2, % another test function + case 2 % Another test function f_ = inline (['exp(1.8*(x1+x2)) + 3*x1 + 6*x2.^2' ... '+ 3*sin(4*pi*x1)'], 'x1', 'x2'); f = @(x)(f_(x(:, 1), x(:, 2))); DIM = 2; BOX = [[-1; 1], [-1; 1]]; - NI = 40; % this second function is much harder to approximate + NI = 40; % This second function is much harder to approximate. end @@ -90,7 +90,7 @@ axis (BOX); stk_title ('function to be approximated'); %% CHOOSE A KRIGING (GAUSSIAN PROCESS) MODEL % We start with a generic (anisotropic) Matern covariance function. -model = stk_model ('stk_materncov_aniso', DIM); +model = stk_model (@stk_materncov_aniso, DIM); % As a default choice, a constant (but unknown) mean is used, % i.e., model.lm = stk_lm_constant. @@ -109,9 +109,11 @@ hold on; plot (xi(:, 1), xi(:, 2), DOT_STYLE{:}); %% ESTIMATE THE PARAMETERS OF THE COVARIANCE FUNCTION +% Uncomment to use a little bit of "regularization noise": +% model.lognoisevariance = 2 * log (1e-4); % Noise std = 1e-4 (small) + % Compute an initial guess for the parameters of the Matern covariance (param0) -% and a reasonable log-variance for a small "regularization noise" -[param0, model.lognoisevariance] = stk_param_init (model, xi, zi, BOX); +param0 = stk_param_init (model, xi, zi, BOX); % % Alternative: user-defined initial guess for the parameters of % % the Matern covariance (see "help stk_materncov_aniso" for more information) diff --git a/inst/examples/01_kriging_basics/stk_example_kb04.m b/inst/examples/01_kriging_basics/stk_example_kb04.m index 46708d8..593e1c5 100644 --- a/inst/examples/01_kriging_basics/stk_example_kb04.m +++ b/inst/examples/01_kriging_basics/stk_example_kb04.m @@ -15,7 +15,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/examples/01_kriging_basics/stk_example_kb05.m b/inst/examples/01_kriging_basics/stk_example_kb05.m index a79c368..e26359b 100644 --- a/inst/examples/01_kriging_basics/stk_example_kb05.m +++ b/inst/examples/01_kriging_basics/stk_example_kb05.m @@ -31,7 +31,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -74,7 +74,7 @@ xi_ind = ref.xi_ind; % The following line defines a model with a constant but unknown mean % (ordinary kriging) and a Matern covariance function. (Some default % parameters are also set, but we override them below.) -model = stk_model ('stk_materncov_iso'); +model = stk_model (@stk_materncov_iso); % Parameters for the Matern covariance % ("help stk_materncov_iso" for more information) diff --git a/inst/examples/01_kriging_basics/stk_example_kb06.m b/inst/examples/01_kriging_basics/stk_example_kb06.m index 569fdfa..521ccb5 100644 --- a/inst/examples/01_kriging_basics/stk_example_kb06.m +++ b/inst/examples/01_kriging_basics/stk_example_kb06.m @@ -23,7 +23,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -67,7 +67,7 @@ param0 = log ([SIGMA2; NU; 1/RHO1]); %% Ordinary kriging (constant mean) -model = stk_model ('stk_materncov_iso', DIM); +model = stk_model (@stk_materncov_iso, DIM); model.lognoisevariance = 2 * log (1e-10); % model.lm = stk_lm_constant is the default diff --git a/inst/examples/01_kriging_basics/stk_example_kb07.m b/inst/examples/01_kriging_basics/stk_example_kb07.m index 6ca6f16..4ce9a1c 100644 --- a/inst/examples/01_kriging_basics/stk_example_kb07.m +++ b/inst/examples/01_kriging_basics/stk_example_kb07.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2018 CentraleSupelec +% Copyright (C) 2018, 2021 CentraleSupelec % Copyright (C) 2013, 2014 SUPELEC % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -27,7 +27,7 @@ % You should have received a copy of the GNU General Public License % along with STK. If not, see <http://www.gnu.org/licenses/>. -stk_disp_examplewelcome; stk_figure ('stk_example_kb07'); +stk_disp_examplewelcome; %% Define the factor space & a Matern GP model on it @@ -40,24 +40,28 @@ BOX = [-1.0; 1.0]; N = 400; x = stk_sampling_regulargrid (N, DIM, BOX); +% Covariance parameters +SIGMA2 = 1.0; % Variance parameter +NU = 2.5; % Regularity parameter +RHO = 0.4; % Scale (range) parameter + % Model -model = stk_model ('stk_materncov_iso'); -SIGMA2 = 1.0; % variance parameter -NU = NaN; % regularity parameter -RHO1 = 0.4; % scale (range) parameter -model.param = log ([SIGMA2; NU; 1/RHO1]); +model = stk_model (@stk_materncov_iso); +model.param = log ([SIGMA2; NU; 1/RHO]); -% Several values for nu -nu_list = [0.5 1.5 2.5 10.0]; +NB_PATHS = 10; -%% Generate (unconditional) sample paths +%% Generate sample paths with different values of nu -NB_PATHS = 10; +stk_figure ('stk_example_kb07: changing nu'); + +nu_list = [0.5 1.5 2.5 10.0]; for k = 1:4 model.param(2) = log (nu_list(k)); + model.param(3) = log (1 / RHO); zsim = stk_generate_samplepaths (model, x, NB_PATHS); @@ -69,4 +73,25 @@ for k = 1:4 end +%% Generate sample paths with different values of rho + +stk_figure ('stk_example_kb07: changing rho'); + +rho_list = [0.1 0.2 0.4 0.8]; + +for k = 1:4 + + model.param(2) = log (NU); + model.param(3) = log (1 / rho_list(k)); + + zsim = stk_generate_samplepaths (model, x, NB_PATHS); + + % Display the result + stk_subplot (2, 2, k); plot (x, zsim, 'LineWidth', 2); + stk_title (sprintf ('Matern, rho = %.1f', rho_list(k))); + stk_labels ('input variable x', 'response z', 'FontWeight', 'bold'); + +end + + %!test stk_example_kb07; close all; diff --git a/inst/examples/01_kriging_basics/stk_example_kb08.m b/inst/examples/01_kriging_basics/stk_example_kb08.m index 72f2fb4..247d06f 100644 --- a/inst/examples/01_kriging_basics/stk_example_kb08.m +++ b/inst/examples/01_kriging_basics/stk_example_kb08.m @@ -18,7 +18,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -55,7 +55,7 @@ xi_ind = ref.xi_ind; %% Specification of the model -model = stk_model ('stk_materncov_iso'); +model = stk_model (@stk_materncov_iso); % Parameters for the Matern covariance % ("help stk_materncov_iso" for more information) diff --git a/inst/examples/01_kriging_basics/stk_example_kb09.m b/inst/examples/01_kriging_basics/stk_example_kb09.m index e766eea..ee7a777 100644 --- a/inst/examples/01_kriging_basics/stk_example_kb09.m +++ b/inst/examples/01_kriging_basics/stk_example_kb09.m @@ -22,7 +22,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -57,7 +57,7 @@ zt = ref.zt; % Define a model with a constant but unknown mean (ordinary kriging) % and a Matern 5/2 covariance function, the parameters of which will be % estimated from the data. -model = stk_model ('stk_materncov52_iso'); +model = stk_model (@stk_materncov52_iso); % Variance of the heteroscedastic noise (assumed to be known). % Note that ref.noise_std is a *vector* in this case. diff --git a/inst/examples/01_kriging_basics/stk_example_kb10.m b/inst/examples/01_kriging_basics/stk_example_kb10.m index bd7a4f6..5326258 100644 --- a/inst/examples/01_kriging_basics/stk_example_kb10.m +++ b/inst/examples/01_kriging_basics/stk_example_kb10.m @@ -22,7 +22,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -54,7 +54,7 @@ y = stk_testfun_borehole (x); % Obtain the responses on the DoE x M_prior = stk_model (@stk_materncov52_aniso, d); % prior M_prior.param = stk_param_estim (M_prior, x, y); % ReML parameter estimation -% Compye LOO predictions and residuals +% Compute LOO predictions and residuals [y_LOO, res_LOO] = stk_predict_leaveoneout (M_prior, x, y); % Plot predictions VS observations (left planel) diff --git a/inst/examples/02_design_of_experiments/stk_example_doe01.m b/inst/examples/02_design_of_experiments/stk_example_doe01.m index a08f098..b6357d8 100644 --- a/inst/examples/02_design_of_experiments/stk_example_doe01.m +++ b/inst/examples/02_design_of_experiments/stk_example_doe01.m @@ -20,7 +20,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/examples/02_design_of_experiments/stk_example_doe02.m b/inst/examples/02_design_of_experiments/stk_example_doe02.m index f111c2a..8fbde94 100644 --- a/inst/examples/02_design_of_experiments/stk_example_doe02.m +++ b/inst/examples/02_design_of_experiments/stk_example_doe02.m @@ -32,7 +32,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/examples/02_design_of_experiments/stk_example_doe03.m b/inst/examples/02_design_of_experiments/stk_example_doe03.m index 73f1e0e..e1d5816 100644 --- a/inst/examples/02_design_of_experiments/stk_example_doe03.m +++ b/inst/examples/02_design_of_experiments/stk_example_doe03.m @@ -13,7 +13,7 @@ % Copyright Notice % -% Copyright (C) 2015, 2017 CentraleSupelec +% Copyright (C) 2015, 2017, 2020 CentraleSupelec % Copyright (C) 2013, 2014 SUPELEC % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -23,7 +23,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -57,7 +57,7 @@ BOX = stk_hrect ([0; 12], {'x'}); % Factor space (hyper-rectangle object) NT = 400; % Number of points in the grid xg = stk_sampling_regulargrid (NT, DIM, BOX); -% Give names explicit names to the points of the grid +% Give explicit names to the points of the grid xg.rownames = arrayfun ... (@(i)(sprintf ('xg(%03d)', i)), 1:NT, 'UniformOutput', false)'; @@ -77,7 +77,7 @@ N0 = 3; % Construction of the initial design x0 = stk_sampling_regulargrid (N0, DIM, BOX); -% Give names explicit names to the points in the initial design +% Give explicit names to the points in the initial design x0.rownames = arrayfun ... (@(i)(sprintf ('x0(%03d)', i)), 1:N0, 'UniformOutput', false)'; @@ -92,16 +92,21 @@ z0.colnames = {'z'}; % words, the variance and range parameters of the covariance function are % provided by the user rather than estimated from data). % +% NOTE: in a "real life" application, the hyper-parameters would not be +% fixed but estimated from data. Fixed parameters are used here for the +% sake of illustration: estimating them would require a larger initial +% design, which in turn would spoil the fun from a sequential design point +% of view (because the example is very simple). -model = stk_model ('stk_materncov52_iso'); +model = stk_model (@stk_materncov52_iso); % NOTE: the suffix '_iso' indicates an ISOTROPIC covariance function, but the % distinction isotropic / anisotropic is irrelevant here since DIM = 1. % Parameters for the Matern covariance function % ("help stk_materncov52_iso" for more information) -SIGMA2 = 4.0 ^ 2; % variance parameter -RHO1 = 2.0; % scale (range) parameter -model.param = log ([SIGMA2; 1/RHO1]); +SIGMA2 = 4.0 ^ 2; % Variance parameter +RHO = 2.0; % Length scale (range) parameter +model.param = log ([SIGMA2; 1/RHO]); % Play with the parameter of the model to understand their influence on the % behaviour of the algorithm ! @@ -147,7 +152,7 @@ while (iter < NB_ITER) && (EI_max > EI_max_stop), [EI_max, i_max] = max (EI_val); % Figure: upper panel - stk_subplot (2, 1, 1); hold off; % CG#12 + stk_subplot (2, 1, 1); cla; stk_plot1d (data.x, data.z, xg, zg, z_pred); xlim (BOX); hold on; plot (xg(i_max), zg(i_max), 'ro', 'MarkerFaceColor', 'y'); diff --git a/inst/examples/02_design_of_experiments/stk_example_doe04.m b/inst/examples/02_design_of_experiments/stk_example_doe04.m index 87434ab..f122224 100644 --- a/inst/examples/02_design_of_experiments/stk_example_doe04.m +++ b/inst/examples/02_design_of_experiments/stk_example_doe04.m @@ -23,7 +23,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -53,7 +53,7 @@ n = 400; x = stk_sampling_regulargrid (n, DIM, BOX); x.colnames = {'x'}; z = stk_feval (f, x); -model = stk_model ('stk_materncov52_iso'); +model = stk_model (@stk_materncov52_iso); model.param = log ([0.1 0.8]); diff --git a/inst/examples/02_design_of_experiments/stk_example_doe05.m b/inst/examples/02_design_of_experiments/stk_example_doe05.m index 3ea5500..84be3e2 100644 --- a/inst/examples/02_design_of_experiments/stk_example_doe05.m +++ b/inst/examples/02_design_of_experiments/stk_example_doe05.m @@ -11,7 +11,7 @@ % Copyright Notice % -% Copyright (C) 2015-2017 CentraleSupelec +% Copyright (C) 2015-2017, 2020 CentraleSupelec % Copyright (C) 2016 EDF R&D % Copyright (C) 2013, 2014 SUPELEC % @@ -23,7 +23,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -38,8 +38,7 @@ % You should have received a copy of the GNU General Public License % along with STK. If not, see <http://www.gnu.org/licenses/>. -stk_disp_examplewelcome; -stk_figure ('stk_example_eqi_test'); +stk_disp_examplewelcome; stk_figure ('stk_example_doe05'); %% Problem definition @@ -47,7 +46,8 @@ stk_figure ('stk_example_eqi_test'); % The goal is to find the minimum of f on the domain BOX. % 1D test function -f = @(x)(x .* sin (x)); % Define a 1D test function +f = @(x)(x .* sin (x)); % Define a 1D test function... +% f = @(x)((x - 6) .^ 2) % ...or another one? DIM = 1; % Dimension of the factor space BOX = stk_hrect ([0; 12], {'x'}); % Factor space (hyper-rectangle object) @@ -58,7 +58,7 @@ NOISE_VARIANCE = 2 ^ 2; GRID_SIZE = 200; % Number of points in the grid xg = stk_sampling_regulargrid (GRID_SIZE, DIM, BOX); -% Give names explicit names to the points of the grid +% Give explicit names to the points of the grid xg.rownames = arrayfun ... (@(i)(sprintf ('xg(%03d)', i)), 1:GRID_SIZE, 'UniformOutput', false)'; @@ -74,7 +74,7 @@ BUDGET = 100; % Total evaluation budget REESTIM_PERIOD = 10; % How often should we re-estimate the cov parameters ? SAMPCRIT_NAME = 'AKG'; % Choose a particular sampling criterion -% Note: the two criteria proposed here compute an "expected improvement" of +% Note: the three criteria proposed here compute an "expected improvement" of % some kind. As such, they return positive values, and must be maximized. switch SAMPCRIT_NAME @@ -83,7 +83,14 @@ switch SAMPCRIT_NAME POINT_BATCH_SIZE = @(x, n) BUDGET - n; sampcrit = stk_sampcrit_eqi ([], QUANTILE_ORDER, POINT_BATCH_SIZE); case 'AKG' + % Use the "approximate KG" criterion, with Scott's original method + % for the construction of the reference grid (i.e., taking past + % observations points plus the candidate point as the reference grid). sampcrit = stk_sampcrit_akg (); + case 'KG' + % Use the "exact KG" criterion, with can be obtained by taking the + % reference grid equal to the entire input grid + sampcrit = stk_sampcrit_akg ([], xg); end @@ -92,7 +99,7 @@ end % Construction of the initial design x0 = stk_sampling_regulargrid (N0, DIM, BOX); -% Give names explicit names to the points in the initial design +% Give explicit names to the points in the initial design x0.rownames = arrayfun ... (@(i)(sprintf ('init%03d', i)), 1:N0, 'UniformOutput', false)'; @@ -103,7 +110,7 @@ z0 = z0 + sqrt (NOISE_VARIANCE) * randn (size (z0)); %% Specification of the model (Gaussian process prior) -model0 = stk_model ('stk_materncov52_iso'); +model0 = stk_model (@stk_materncov52_iso); % Assume that the variance of the observation noise is known model0.lognoisevariance = log (NOISE_VARIANCE); @@ -139,22 +146,28 @@ for iter = 1:(BUDGET - N0) % Instanciate sampling criterion object with model sampcrit.model = model; - % Compute the EQI criterion on the grid + % Compute the sampling criterion on the grid [crit_val, z_pred] = sampcrit (xg); if mod (iter, PLOT_PERIOD) == 1 + % Figure: upper panel - stk_subplot (2, 1, 1); hold off; % CG#12 + stk_subplot (2, 1, 1); cla; stk_plot1d ([],[], xg, zg, z_pred); hold on; plot (x, z, 'k.'); + title (sprintf ('n = %d + %d = %d.\n\n', N0, iter - 1, N0 + iter - 1)); + % Figure: lower panel stk_subplot (2, 1, 2); cla; plot (xg, crit_val); xlim (BOX); ylabel (SAMPCRIT_NAME); + end - if all (crit_val == 0), break, end + % Stop if the criterion becomes equal to zero everywhere + if all (crit_val == 0), break; end - % Pick the point where the EQI is maximum as our next evaluation point + % Pick the point where the sampling criterion is maximum + % as our next evaluation point [crit_max, i_max] = max (crit_val); x_new = xg(i_max, :); @@ -177,8 +190,14 @@ end % Display the final DoE data = stk_dataframe ([x z], {'x', 'z'}); disp (data); +% Premature stopping ? +if iter < (BUDGET - N0) + warning ('The algorithm stopped prematurely.'); + iter = iter - 1; +end + % Total number of evaluations ? -fprintf ('\nNumber of evaluations: %d + %d = %d.\n\n', N0, BUDGET - N0, BUDGET); +fprintf ('\nNumber of evaluations: %d + %d = %d.\n\n', N0, iter, N0 + iter); %#ok<*AGROW> diff --git a/inst/examples/02_design_of_experiments/stk_example_doe06.m b/inst/examples/02_design_of_experiments/stk_example_doe06.m new file mode 100644 index 0000000..e6d5e66 --- /dev/null +++ b/inst/examples/02_design_of_experiments/stk_example_doe06.m @@ -0,0 +1,246 @@ +% STK_EXAMPLE_DOE06 Sequential design for the estimation of an excursion set +% +% In this example, we consider the problem of estimating the set +% +% Gamma = { x in X | f(x) > z_crit }, +% +% where z_crit is a given value, and/or its volume. +% +% In a typical "structural reliability analysis" problem, Gamma would +% represent the failure region of a certain system, and its volume would +% correspond to the probability of failure (assuming a uniform distribution +% for the input). +% +% A Matern 5/2 prior with known parameters is used for the function f, and +% the evaluations points are chosen sequentially using any of the sampling +% criterion described in [1] (see also [2], section 4.3). +% +% REFERENCE +% +% [1] B. Echard, N. Gayton and M. Lemaire (2011). AK-MCS: an active +% learning reliability method combining Kriging and Monte Carlo +% simulation. Structural Safety, 33(2), 145-154. +% +% [2] J. Bect, D. Ginsbourger, L. Li, V. Picheny and E. Vazquez (2012). +% Sequential design of computer experiments for the estimation of a +% probability of failure. Statistics and Computing, 22(3), 773-793. + +% Copyright Notice +% +% Copyright (C) 2020 CentraleSupelec +% +% Author: Julien Bect <julien.bect@centralesupelec.fr> + +% Copying Permission Statement +% +% This file is part of +% +% STK: a Small (Matlab/Octave) Toolbox for Kriging +% (https://github.com/stk-kriging/stk/) +% +% STK is free software: you can redistribute it and/or modify it under +% the terms of the GNU General Public License as published by the Free +% Software Foundation, either version 3 of the License, or (at your +% option) any later version. +% +% STK is distributed in the hope that it will be useful, but WITHOUT +% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +% License for more details. +% +% You should have received a copy of the GNU General Public License +% along with STK. If not, see <http://www.gnu.org/licenses/>. + +stk_disp_examplewelcome + + +%% Problem definition + +% Variables names +input_name = 'x'; +output_name = 'z'; + +% 1D test function +f = @(x)(x .* (sin (24 * x .^ 0.7) - 0.3)); +x_domain = stk_hrect ([0; 1], {input_name}); + +% Threshold +z_crit = 0.15; + + +%% Monte Carlo + +% Choose a MC sample size that would produce an estimate of the volume of +% the set with standard deviation <= 0.005 (0.5% of the total volume). +MC_target_std = 0.005; +MC_sample_size = 0.25 / (MC_target_std ^ 2); % = 10 000 + +% Draw a MC sample in the input domain +x_MC = stk_sampling_randunif (MC_sample_size, [], x_domain); +x_MC.rownames = arrayfun (@(i)(sprintf ('MC point #%05d', i)), ... + 1:MC_sample_size, 'UniformOutput', false)'; +x_MC = sort (x_MC, 'ascend'); % Better for plotting + +% Compute the MC estimator, which will be our reference value for the +% volume. Note that here we evaluate f on the entire MC set, but ONLY to +% get the reference value (we do not use these evaluations below !). +z_MC = stk_feval (f, x_MC); +z_MC.colnames = {output_name}; +vol_ref = mean (z_MC > z_crit); + +fprintf ('Volume (reference value): %.2f%%\n', vol_ref * 100); + + +%% Plot problem + +% Spatial discretization (used for plotting only) +grid_size = 1000; +x_grid = stk_sampling_regulargrid (grid_size, [], x_domain); +x_grid.rownames = arrayfun ... + (@(i)(sprintf ('grid point #%03d', i)), 1:grid_size, 'UniformOutput', false)'; + +% Values of the response on the grid +z_grid = stk_feval (f, x_grid); +z_grid.colnames = {output_name}; + +stk_figure ('stk_example_doe06: Ground truth'); +plot (x_grid, z_grid, 'b'); hold on; +b = z_grid > z_crit; tmp = z_grid; tmp(~b) = nan; +plot (x_grid, tmp, 'r', 'LineWidth', 3); clear tmp; +plot (xlim, z_crit * [1 1], 'r--'); +title ('Groung truth'); +legend ('z = f(x), below z_{crit}', 'z = f(x), above z_{crit}', ... + 'z_{crit}', 'Location', 'SouthWest'); + + +%% Initial design of experiments + +% Start with an initial design of N0 points, regularly spaced on the domain. +n_init = 4; +x_init = stk_sampling_regulargrid (n_init, [], x_domain); +x_init.rownames = arrayfun ... + (@(i)(sprintf ('initial design #%d', i)), 1:n_init, 'UniformOutput', false)'; + +% Values of the function on the initial design +z_init = stk_feval (f, x_init); +z_init.colnames = {output_name}; + +data_init = [x_init, z_init]; display (data_init); + + +%% Specification of a Gaussian process prior + +% Same as in stk_example_doe03 (read explanation there). +model = stk_model (@stk_materncov52_iso); +SIGMA2 = 4.0 ^ 2; % Variance parameter +RHO = 0.5; % Length scale (range) parameter +model.param = log ([SIGMA2; 1/RHO]); + + +%% Sequential design of experiments + +% Start with the initial design defined above +data = data_init; + +% Iteration number & maximal number of points to be added adaptively +NB_ITER = 50; + +% Upper bound on the posterior std of the volume & target accuracy +vol_std_ub = +inf; +vol_std_tol = MC_target_std * 0.1; + +% Prepare monitoring plot +h_monit = stk_figure ('stk_example_doe06: Monitor'); + +% Record history of volume estimates & misclassification counts +vol_hist = nan (n_init - 1, 1); +nmisclass_hist = nan (n_init - 1, 1); + +% Choose which volume estimator to use: 'plugin' or 'bayes' +% (this does not impact the sequence of points that we choose) +vol_estim_type = 'plugin'; + +for iter = 0:NB_ITER + fprintf ('Iteration #%d\n', iter + 1); + fprintf ('| Current sample size: n = %d\n', n_init + iter); + + % Trick: add a small "regularization" noise to our model + model.lognoisevariance = log (SIGMA2 * 1e-12); + + % Carry out the kriging prediction + M_post = stk_model_gpposterior (model, data.x, data.z); + z_MC_pred = stk_predict (M_post, x_MC); + + % Count misclassified samples + % (this is for educational purposes: we are not supposed to know z_MC) + nmisclass = sum ((z_MC_pred.mean > z_crit) ~= (z_MC > z_crit)); + nmisclass_hist = [nmisclass_hist; nmisclass]; %#ok<AGROW> + + % Compute "maximal probability of misclassification" criterion + % (equivalent to EGL's criterion, but better-looking on plots) + [p, q] = stk_distrib_normal_cdf ... + (z_crit, z_MC_pred.mean, sqrt (z_MC_pred.var)); + crit_val = min (p, q); + + % Compute volume estimate + if strcmp (vol_estim_type, 'bayes') + vol_estim = mean (q); + else + assert (strcmp (vol_estim_type, 'plugin')); + vol_estim = mean (z_MC_pred.mean > z_crit); + end + vol_hist = [vol_hist; vol_estim]; %#ok<AGROW> + fprintf ('| Volume estimate (%s): %.5f [ref: %.5f]\n', ... + vol_estim_type, vol_estim, vol_ref); + + % Compute an upper-bound on the posterior std of the estimator + if strcmp (vol_estim_type, 'bayes') + vol_std_ub = sqrt (mean (p .* q)); + else + vol_std_ub = sqrt (mean (min (p, q))); + end + fprintf ('| Upper-bound on posterior std: %.4e [target: %.3e]\n', ... + vol_std_ub, vol_std_tol); + + % Pick the point where the criterion is maximal + [crit_max, i_max] = max (crit_val); + + % Figure: upper panel + figure (h_monit); stk_subplot (2, 1, 1); cla; + stk_plot1d (data.x, data.z, x_grid, z_grid, stk_predict (M_post, x_grid)); + xlim (x_domain); hold on; plot (xlim, z_crit * [1 1], 'r--'); + plot (x_MC(i_max), z_MC_pred.mean(i_max), 'ro', 'MarkerFaceColor', 'y'); + + % Figure: lower panel + stk_subplot (2, 1, 2); cla; + plot (x_MC, crit_val, 'Linewidth', 2); xlim (x_domain); hold on; + plot (x_MC(i_max), crit_max, 'ro', 'MarkerFaceColor', 'y'); + stk_ylabel ('criterion'); + + if (iter >= NB_ITER) || (vol_std_ub <= vol_std_tol) + break + end + + % Add the new evaluation to the DoE + data = [data; [x_MC(i_max, :), z_MC(i_max, :)]]; %#ok<AGROW> + + drawnow (); % pause (0.5); +end + +% Display full history: DoE + volume estimates +vol_err = vol_hist - vol_ref; +estim_history = stk_dataframe ([vol_hist vol_err nmisclass_hist], ... + {'vol_estim' 'vol_err', 'nmisclass'}); +history = [data estim_history]; display (history); + +% Display final result +fprintf ('Final result:\n'); +fprintf ('| Number of evaluations: %d + %d = %d.\n', ... + n_init, iter, n_init + iter); +fprintf ('| Volume estimate (%s): %.4f%% [ref: %.4f%%]\n\n', ... + vol_estim_type, vol_estim * 100, vol_ref * 100); + + +%#ok<*SPERR> + +%!test stk_example_doe06; close all; diff --git a/inst/examples/03_miscellaneous/stk_example_misc01.m b/inst/examples/03_miscellaneous/stk_example_misc01.m index 75bf608..e3aaa69 100644 --- a/inst/examples/03_miscellaneous/stk_example_misc01.m +++ b/inst/examples/03_miscellaneous/stk_example_misc01.m @@ -21,7 +21,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/examples/03_miscellaneous/stk_example_misc02.m b/inst/examples/03_miscellaneous/stk_example_misc02.m index 8e12cba..dbb05ad 100644 --- a/inst/examples/03_miscellaneous/stk_example_misc02.m +++ b/inst/examples/03_miscellaneous/stk_example_misc02.m @@ -22,7 +22,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -51,7 +51,7 @@ zi = [1.00; 1.10; 0.20; 0.35]; %% SPECIFICATION OF THE MODEL & REML ESTIMATION -model = stk_model ('stk_materncov_iso'); +model = stk_model (@stk_materncov_iso); % small "regularization noise". model.lognoisevariance = 2 * log (1e-6); diff --git a/inst/examples/03_miscellaneous/stk_example_misc03.m b/inst/examples/03_miscellaneous/stk_example_misc03.m index a1b9bd4..413d4bc 100644 --- a/inst/examples/03_miscellaneous/stk_example_misc03.m +++ b/inst/examples/03_miscellaneous/stk_example_misc03.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -43,7 +43,7 @@ t = (0:0.01:30)'; %% Gaussian process model with constant prior mean -model = stk_model ('stk_materncov52_iso'); +model = stk_model (@stk_materncov52_iso); model.lognoisevariance = nan; % Initial guess for the parameters of the Matern covariance @@ -66,7 +66,7 @@ hold on; plot (t, S_posterior.mean, 'r-'); T0 = 2 * pi; % Construct a prior model with sinusoidal trend -model2 = stk_model ('stk_materncov52_iso'); +model2 = stk_model (@stk_materncov52_iso); model2.lm = @(t)([ones(length(t),1) sin(2*pi*t/T0) cos(2*pi*t/T0)]); model2.lognoisevariance = nan; diff --git a/inst/examples/03_miscellaneous/stk_example_misc04.m b/inst/examples/03_miscellaneous/stk_example_misc04.m index 3a950af..4c58aaa 100644 --- a/inst/examples/03_miscellaneous/stk_example_misc04.m +++ b/inst/examples/03_miscellaneous/stk_example_misc04.m @@ -39,7 +39,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -79,10 +79,10 @@ z_obs(:, 2) = f2 (x_obs.data); % ... but see Octave bug #49267 %% Stationary GP models -model1 = stk_model ('stk_materncov52_aniso', DIM); +model1 = stk_model (@stk_materncov52_aniso, DIM); model1.param = stk_param_estim (model1, x_obs, z_obs(:, 1)); -model2 = stk_model ('stk_materncov52_aniso', DIM); +model2 = stk_model (@stk_materncov52_aniso, DIM); model2.param = stk_param_estim (model2, x_obs, z_obs(:, 2)); stk_figure ('stk_example_misc04 (a)'); diff --git a/inst/examples/03_miscellaneous/stk_example_misc05.m b/inst/examples/03_miscellaneous/stk_example_misc05.m index 46e848c..84f9b1b 100644 --- a/inst/examples/03_miscellaneous/stk_example_misc05.m +++ b/inst/examples/03_miscellaneous/stk_example_misc05.m @@ -36,7 +36,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -59,7 +59,7 @@ stk_disp_examplewelcome; stk_figure ('stk_example_misc05'); %% Gaussian process model -model = stk_model ('stk_materncov52_iso'); +model = stk_model (@stk_materncov52_iso); % Variance of the heteroscedastic noise: tau^2(x) = exp(param) * (x + 1) ^ 2 % (note that the true variance function for this dataset is not exactly of this form...) diff --git a/inst/examples/datasets/stk_dataset_twobumps.m b/inst/examples/datasets/stk_dataset_twobumps.m index 17cf02d..5a47d05 100644 --- a/inst/examples/datasets/stk_dataset_twobumps.m +++ b/inst/examples/datasets/stk_dataset_twobumps.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/examples/test_functions/stk_testcase_truss3.m b/inst/examples/test_functions/stk_testcase_truss3.m index e1bb58c..2f22f31 100644 --- a/inst/examples/test_functions/stk_testcase_truss3.m +++ b/inst/examples/test_functions/stk_testcase_truss3.m @@ -145,7 +145,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/examples/test_functions/stk_testfun_borehole.m b/inst/examples/test_functions/stk_testfun_borehole.m index 47c088a..592d5e9 100644 --- a/inst/examples/test_functions/stk_testfun_borehole.m +++ b/inst/examples/test_functions/stk_testfun_borehole.m @@ -57,7 +57,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/examples/test_functions/stk_testfun_braninhoo.m b/inst/examples/test_functions/stk_testfun_braninhoo.m index 0626b1c..b12fecc 100644 --- a/inst/examples/test_functions/stk_testfun_braninhoo.m +++ b/inst/examples/test_functions/stk_testfun_braninhoo.m @@ -26,7 +26,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/examples/test_functions/stk_testfun_goldsteinprice.m b/inst/examples/test_functions/stk_testfun_goldsteinprice.m index e653389..cc286ed 100644 --- a/inst/examples/test_functions/stk_testfun_goldsteinprice.m +++ b/inst/examples/test_functions/stk_testfun_goldsteinprice.m @@ -32,7 +32,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/examples/test_functions/stk_testfun_truss3_bb.m b/inst/examples/test_functions/stk_testfun_truss3_bb.m index 8d94687..19e87c0 100644 --- a/inst/examples/test_functions/stk_testfun_truss3_bb.m +++ b/inst/examples/test_functions/stk_testfun_truss3_bb.m @@ -24,7 +24,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/examples/test_functions/stk_testfun_truss3_vol.m b/inst/examples/test_functions/stk_testfun_truss3_vol.m index 59ff087..b5cd2d7 100644 --- a/inst/examples/test_functions/stk_testfun_truss3_vol.m +++ b/inst/examples/test_functions/stk_testfun_truss3_vol.m @@ -25,7 +25,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/examples/test_functions/stk_testfun_twobumps.m b/inst/examples/test_functions/stk_testfun_twobumps.m index 1f30841..4401d20 100644 --- a/inst/examples/test_functions/stk_testfun_twobumps.m +++ b/inst/examples/test_functions/stk_testfun_twobumps.m @@ -25,7 +25,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/lm/@stk_lm_affine/feval.m b/inst/lm/@stk_lm_affine/feval.m index a320e8a..244a13b 100644 --- a/inst/lm/@stk_lm_affine/feval.m +++ b/inst/lm/@stk_lm_affine/feval.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/lm/@stk_lm_affine/stk_lm_affine.m b/inst/lm/@stk_lm_affine/stk_lm_affine.m index 82bb3ae..e928b4c 100644 --- a/inst/lm/@stk_lm_affine/stk_lm_affine.m +++ b/inst/lm/@stk_lm_affine/stk_lm_affine.m @@ -16,7 +16,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/lm/@stk_lm_constant/feval.m b/inst/lm/@stk_lm_constant/feval.m index ebfd201..db739fc 100644 --- a/inst/lm/@stk_lm_constant/feval.m +++ b/inst/lm/@stk_lm_constant/feval.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/lm/@stk_lm_constant/stk_lm_constant.m b/inst/lm/@stk_lm_constant/stk_lm_constant.m index 9fe8ae5..17b1d4d 100644 --- a/inst/lm/@stk_lm_constant/stk_lm_constant.m +++ b/inst/lm/@stk_lm_constant/stk_lm_constant.m @@ -16,7 +16,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/lm/@stk_lm_cubic/feval.m b/inst/lm/@stk_lm_cubic/feval.m index e7206e0..0925bae 100644 --- a/inst/lm/@stk_lm_cubic/feval.m +++ b/inst/lm/@stk_lm_cubic/feval.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/lm/@stk_lm_cubic/stk_lm_cubic.m b/inst/lm/@stk_lm_cubic/stk_lm_cubic.m index 19afec5..3a665c1 100644 --- a/inst/lm/@stk_lm_cubic/stk_lm_cubic.m +++ b/inst/lm/@stk_lm_cubic/stk_lm_cubic.m @@ -16,7 +16,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/lm/@stk_lm_matrix/feval.m b/inst/lm/@stk_lm_matrix/feval.m index 1b87f62..a1e712e 100644 --- a/inst/lm/@stk_lm_matrix/feval.m +++ b/inst/lm/@stk_lm_matrix/feval.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/lm/@stk_lm_matrix/stk_lm_matrix.m b/inst/lm/@stk_lm_matrix/stk_lm_matrix.m index 93699c0..a9b1997 100644 --- a/inst/lm/@stk_lm_matrix/stk_lm_matrix.m +++ b/inst/lm/@stk_lm_matrix/stk_lm_matrix.m @@ -18,7 +18,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/lm/@stk_lm_null/feval.m b/inst/lm/@stk_lm_null/feval.m index 604477b..255705f 100644 --- a/inst/lm/@stk_lm_null/feval.m +++ b/inst/lm/@stk_lm_null/feval.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/lm/@stk_lm_null/stk_lm_null.m b/inst/lm/@stk_lm_null/stk_lm_null.m index 41cfeaf..0c999a0 100644 --- a/inst/lm/@stk_lm_null/stk_lm_null.m +++ b/inst/lm/@stk_lm_null/stk_lm_null.m @@ -16,7 +16,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/lm/@stk_lm_quadratic/feval.m b/inst/lm/@stk_lm_quadratic/feval.m index a22751b..9367de7 100644 --- a/inst/lm/@stk_lm_quadratic/feval.m +++ b/inst/lm/@stk_lm_quadratic/feval.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/lm/@stk_lm_quadratic/stk_lm_quadratic.m b/inst/lm/@stk_lm_quadratic/stk_lm_quadratic.m index c102878..3094e5c 100644 --- a/inst/lm/@stk_lm_quadratic/stk_lm_quadratic.m +++ b/inst/lm/@stk_lm_quadratic/stk_lm_quadratic.m @@ -16,7 +16,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/lm/stk_lm_polynomial.m b/inst/lm/stk_lm_polynomial.m index 6f466c2..21dd37e 100644 --- a/inst/lm/stk_lm_polynomial.m +++ b/inst/lm/stk_lm_polynomial.m @@ -16,7 +16,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/benchmarks/stk_benchmark_.m b/inst/misc/benchmarks/stk_benchmark_.m index fe11ee3..0671673 100644 --- a/inst/misc/benchmarks/stk_benchmark_.m +++ b/inst/misc/benchmarks/stk_benchmark_.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/benchmarks/stk_benchmark_bivnorm.m b/inst/misc/benchmarks/stk_benchmark_bivnorm.m index 496fce6..cfe6890 100644 --- a/inst/misc/benchmarks/stk_benchmark_bivnorm.m +++ b/inst/misc/benchmarks/stk_benchmark_bivnorm.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/benchmarks/stk_benchmark_cov1.m b/inst/misc/benchmarks/stk_benchmark_cov1.m index b997769..0c2f1fb 100644 --- a/inst/misc/benchmarks/stk_benchmark_cov1.m +++ b/inst/misc/benchmarks/stk_benchmark_cov1.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/benchmarks/stk_benchmark_cov2.m b/inst/misc/benchmarks/stk_benchmark_cov2.m index 6beb775..58b831b 100644 --- a/inst/misc/benchmarks/stk_benchmark_cov2.m +++ b/inst/misc/benchmarks/stk_benchmark_cov2.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/benchmarks/stk_benchmark_examples.m b/inst/misc/benchmarks/stk_benchmark_examples.m index 43f2b3f..9740e96 100644 --- a/inst/misc/benchmarks/stk_benchmark_examples.m +++ b/inst/misc/benchmarks/stk_benchmark_examples.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/benchmarks/stk_benchmark_init.m b/inst/misc/benchmarks/stk_benchmark_init.m index 6a6370b..fcef2c2 100644 --- a/inst/misc/benchmarks/stk_benchmark_init.m +++ b/inst/misc/benchmarks/stk_benchmark_init.m @@ -15,7 +15,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/benchmarks/stk_benchmark_logdet.m b/inst/misc/benchmarks/stk_benchmark_logdet.m index 93aad4b..8058268 100644 --- a/inst/misc/benchmarks/stk_benchmark_logdet.m +++ b/inst/misc/benchmarks/stk_benchmark_logdet.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -32,7 +32,7 @@ NREP = 100; n = 200; % test on large matrices d = 2; x = stk_sampling_maximinlhs (n, d, [], 10); -model = stk_model ('stk_materncov52_aniso', d); +model = stk_model (@stk_materncov52_aniso, d); model.param = zeros (size (model.param)); propname = { ... diff --git a/inst/misc/benchmarks/stk_benchmark_loocv.m b/inst/misc/benchmarks/stk_benchmark_loocv.m index 974d04f..b8cb482 100644 --- a/inst/misc/benchmarks/stk_benchmark_loocv.m +++ b/inst/misc/benchmarks/stk_benchmark_loocv.m @@ -17,7 +17,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -50,7 +50,7 @@ for i = 1:m d = 1; x_obs = stk_sampling_regulargrid (n(i), d, [0; 2*pi]); z_obs = stk_feval (@sin, x_obs); - model = stk_model ('stk_materncov32_iso', d); + model = stk_model (@stk_materncov32_iso, d); model.param = log ([1; 5]); model.lognoisevariance = (1 + rand (n(i), 1)) * 1e-3; M_post = stk_model_gpposterior (model, x_obs, z_obs); diff --git a/inst/misc/benchmarks/stk_benchmark_paramestim.m b/inst/misc/benchmarks/stk_benchmark_paramestim.m index 879d7f7..0746cd6 100644 --- a/inst/misc/benchmarks/stk_benchmark_paramestim.m +++ b/inst/misc/benchmarks/stk_benchmark_paramestim.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -76,7 +76,7 @@ if NOISY, zi = zi + noise_std * randn (ni, 1); end -model = stk_model ('stk_materncov_iso'); +model = stk_model (@stk_materncov_iso); if ~ NOISY, % Noiseless case: set a small "regularization" noise diff --git a/inst/misc/benchmarks/stk_benchmark_predict.m b/inst/misc/benchmarks/stk_benchmark_predict.m index cb118f8..bdbcb4d 100644 --- a/inst/misc/benchmarks/stk_benchmark_predict.m +++ b/inst/misc/benchmarks/stk_benchmark_predict.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -71,7 +71,7 @@ end % function function M_prior = test_A_init () -% M_prior = stk_model ('stk_materncov32_iso'); +% M_prior = stk_model (@stk_materncov32_iso); % M_prior.param = [0; 0]; % This works even in very releases of STK diff --git a/inst/misc/benchmarks/stk_benchmark_uppertriangular.m b/inst/misc/benchmarks/stk_benchmark_uppertriangular.m index f05555d..a9092a8 100644 --- a/inst/misc/benchmarks/stk_benchmark_uppertriangular.m +++ b/inst/misc/benchmarks/stk_benchmark_uppertriangular.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -71,7 +71,7 @@ W = randn (n); tic (); for i = 1:NREP - M1 = W * inv (K) * (W'); + M1 = W * (inv (K)) * (W'); end t1 = toc (); diff --git a/inst/misc/design/stk_maxabscorr.m b/inst/misc/design/stk_maxabscorr.m index 90de6b2..957b9e1 100644 --- a/inst/misc/design/stk_maxabscorr.m +++ b/inst/misc/design/stk_maxabscorr.m @@ -38,7 +38,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/design/stk_phipcrit.m b/inst/misc/design/stk_phipcrit.m index ed38c4d..5e3a4ea 100644 --- a/inst/misc/design/stk_phipcrit.m +++ b/inst/misc/design/stk_phipcrit.m @@ -55,7 +55,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/dist/stk_dist.m b/inst/misc/dist/stk_dist.m index b9406c4..b6e553f 100644 --- a/inst/misc/dist/stk_dist.m +++ b/inst/misc/dist/stk_dist.m @@ -25,7 +25,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/dist/stk_filldist.m b/inst/misc/dist/stk_filldist.m index 0499281..d066839 100644 --- a/inst/misc/dist/stk_filldist.m +++ b/inst/misc/dist/stk_filldist.m @@ -62,7 +62,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/dist/stk_filldist_discretized.m b/inst/misc/dist/stk_filldist_discretized.m index 952395f..931ee76 100644 --- a/inst/misc/dist/stk_filldist_discretized.m +++ b/inst/misc/dist/stk_filldist_discretized.m @@ -37,7 +37,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/dist/stk_filldist_exact.m b/inst/misc/dist/stk_filldist_exact.m index 158e36f..b250dc1 100644 --- a/inst/misc/dist/stk_filldist_exact.m +++ b/inst/misc/dist/stk_filldist_exact.m @@ -55,7 +55,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/dist/stk_gpquadform.m b/inst/misc/dist/stk_gpquadform.m index 610ac37..4b30b97 100644 --- a/inst/misc/dist/stk_gpquadform.m +++ b/inst/misc/dist/stk_gpquadform.m @@ -28,7 +28,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/dist/stk_mindist.m b/inst/misc/dist/stk_mindist.m index 0594a6e..0b117f7 100644 --- a/inst/misc/dist/stk_mindist.m +++ b/inst/misc/dist/stk_mindist.m @@ -24,7 +24,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/distrib/stk_distrib_bivnorm_cdf.m b/inst/misc/distrib/stk_distrib_bivnorm_cdf.m index 54f5cca..bfe637b 100644 --- a/inst/misc/distrib/stk_distrib_bivnorm_cdf.m +++ b/inst/misc/distrib/stk_distrib_bivnorm_cdf.m @@ -1,4 +1,4 @@ -% STK_DISTRIB_BIVNORM_CDF [STK internal] +% STK_DISTRIB_BIVNORM_CDF [STK internal] % Copyright Notice % @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/distrib/stk_distrib_logpdf.m b/inst/misc/distrib/stk_distrib_logpdf.m index 9e72a52..2448d16 100644 --- a/inst/misc/distrib/stk_distrib_logpdf.m +++ b/inst/misc/distrib/stk_distrib_logpdf.m @@ -21,7 +21,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/distrib/stk_distrib_logpdf_grad.m b/inst/misc/distrib/stk_distrib_logpdf_grad.m index dfe7695..ac8a17a 100644 --- a/inst/misc/distrib/stk_distrib_logpdf_grad.m +++ b/inst/misc/distrib/stk_distrib_logpdf_grad.m @@ -21,7 +21,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/distrib/stk_distrib_normal_cdf.m b/inst/misc/distrib/stk_distrib_normal_cdf.m index 02c06e8..143ac3b 100644 --- a/inst/misc/distrib/stk_distrib_normal_cdf.m +++ b/inst/misc/distrib/stk_distrib_normal_cdf.m @@ -1,4 +1,4 @@ -% STK_DISTRIB_NORMAL_CDF [STK internal] +% STK_DISTRIB_NORMAL_CDF [STK internal] % Copyright Notice % @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/distrib/stk_distrib_normal_crps.m b/inst/misc/distrib/stk_distrib_normal_crps.m index a5c7c77..8adb407 100644 --- a/inst/misc/distrib/stk_distrib_normal_crps.m +++ b/inst/misc/distrib/stk_distrib_normal_crps.m @@ -37,7 +37,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/distrib/stk_distrib_normal_ei.m b/inst/misc/distrib/stk_distrib_normal_ei.m index a7a8b44..e2229c0 100644 --- a/inst/misc/distrib/stk_distrib_normal_ei.m +++ b/inst/misc/distrib/stk_distrib_normal_ei.m @@ -59,7 +59,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/distrib/stk_distrib_normal_pdf.m b/inst/misc/distrib/stk_distrib_normal_pdf.m index 70bcacf..3b0e4bb 100644 --- a/inst/misc/distrib/stk_distrib_normal_pdf.m +++ b/inst/misc/distrib/stk_distrib_normal_pdf.m @@ -1,4 +1,4 @@ -% STK_DISTRIB_NORMAL_PDF [STK internal] +% STK_DISTRIB_NORMAL_PDF [STK internal] % Copyright Notice % @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/distrib/stk_distrib_student_cdf.m b/inst/misc/distrib/stk_distrib_student_cdf.m index 46fb85c..560afa1 100644 --- a/inst/misc/distrib/stk_distrib_student_cdf.m +++ b/inst/misc/distrib/stk_distrib_student_cdf.m @@ -1,4 +1,4 @@ -% STK_DISTRIB_STUDENT_CDF [STK internal] +% STK_DISTRIB_STUDENT_CDF [STK internal] % Copyright Notice % @@ -17,7 +17,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/distrib/stk_distrib_student_ei.m b/inst/misc/distrib/stk_distrib_student_ei.m index 64aa4bb..601cdbe 100644 --- a/inst/misc/distrib/stk_distrib_student_ei.m +++ b/inst/misc/distrib/stk_distrib_student_ei.m @@ -44,7 +44,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/distrib/stk_distrib_student_pdf.m b/inst/misc/distrib/stk_distrib_student_pdf.m index 03b7bd7..7264ba6 100644 --- a/inst/misc/distrib/stk_distrib_student_pdf.m +++ b/inst/misc/distrib/stk_distrib_student_pdf.m @@ -1,4 +1,4 @@ -% STK_DISTRIB_STUDENT_PDF [STK internal] +% STK_DISTRIB_STUDENT_PDF [STK internal] % Copyright Notice % @@ -16,7 +16,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/error/stk_assert_box.m b/inst/misc/error/stk_assert_box.m index b6f9709..0b049a9 100644 --- a/inst/misc/error/stk_assert_box.m +++ b/inst/misc/error/stk_assert_box.m @@ -1,4 +1,4 @@ -% STK_ASSERT_BOX [STK internal] +% STK_ASSERT_BOX [STK internal] % Copyright Notice % @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/error/stk_assert_model_struct.m b/inst/misc/error/stk_assert_model_struct.m index 7f11847..470fdd8 100644 --- a/inst/misc/error/stk_assert_model_struct.m +++ b/inst/misc/error/stk_assert_model_struct.m @@ -17,7 +17,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/error/stk_assert_no_duplicates.m b/inst/misc/error/stk_assert_no_duplicates.m index 6f0c706..2a2d01d 100644 --- a/inst/misc/error/stk_assert_no_duplicates.m +++ b/inst/misc/error/stk_assert_no_duplicates.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/error/stk_error.m b/inst/misc/error/stk_error.m index 6755f0e..f6ee32b 100644 --- a/inst/misc/error/stk_error.m +++ b/inst/misc/error/stk_error.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/mole/graphics_toolkit/graphics_toolkit.m b/inst/misc/mole/graphics_toolkit/graphics_toolkit.m deleted file mode 100644 index 6e43015..0000000 --- a/inst/misc/mole/graphics_toolkit/graphics_toolkit.m +++ /dev/null @@ -1,69 +0,0 @@ -% GRAPHICS_TOOLKIT indicates which toolkit is assigned to new figures. -% -% This is a (partial) replacement for the graphics_toolkit function that is missing both -% from Matlab and from some old version f Octave. -% -% CALL: NAME = graphics_toolkit () -% -% returns: -% -% * the result of get (0, 'defaultfigure__backend__') if you're running an old version -% of Octave that does not have graphics_toolkit, -% -% * 'matlab-nojvm' if running Matlab without the Java Virtual Machine, -% -% * 'matlab-jvm' if running Matlab with the Java Virtual Machine. - -% Copyright Notice -% -% Copyright (C) 2013, 2014 SUPELEC -% -% Author: Julien Bect <julien.bect@centralesupelec.fr> - -% Copying Permission Statement -% -% This file is part of -% -% STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) -% -% STK is free software: you can redistribute it and/or modify it under -% the terms of the GNU General Public License as published by the Free -% Software Foundation, either version 3 of the License, or (at your -% option) any later version. -% -% STK is distributed in the hope that it will be useful, but WITHOUT -% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -% License for more details. -% -% You should have received a copy of the GNU General Public License -% along with STK. If not, see <http://www.gnu.org/licenses/>. - -function name = graphics_toolkit () - -if exist ('OCTAVE_VERSION', 'builtin') == 5 % Octave - - try - % This should work on older versions of Octave, e.g., 3.2.4 - % (there was no notion of a 'toolkit' at the time, but if gnuplot - % is reported as the backend, then it is also the toolkit) - name = get (0, 'defaultfigure__backend__'); - catch - error ('Unable to determine which toolkit is being used.'); - end - -else % Matlab - - try - assert (usejava ('jvm')); - name = 'matlab-jvm'; - catch - name = 'matlab-nojvm'; - end - -end - -end % function - -%#ok<*CTCH> diff --git a/inst/misc/mole/linsolve/linsolve.m b/inst/misc/mole/linsolve/linsolve.m deleted file mode 100644 index 078de06..0000000 --- a/inst/misc/mole/linsolve/linsolve.m +++ /dev/null @@ -1,141 +0,0 @@ -## Copyright (C) 2013 Nir Krakauer -## -## This program is free software; you can redistribute it and/or modify -## it under the terms of the GNU General Public License as published by -## the Free Software Foundation; either version 3 of the License, or -## (at your option) any later version. -## -## This program is distributed in the hope that it will be useful, -## but WITHOUT ANY WARRANTY; without even the implied warranty of -## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the -## GNU General Public License for more details. -## -## You should have received a copy of the GNU General Public License -## along with this program; If not, see <http://www.gnu.org/licenses/>. - -## -*- texinfo -*- -## @deftypefn {Function File} {@var{x} =} linsolve (@var{A}, @var{b}) -## @deftypefnx {Function File} {@var{x} =} linsolve (@var{A}, @var{b}, @var{opts}) -## @deftypefnx {Function File} {[@var{x}, @var{R}] =} linsolve (@dots{}) -## Solve the linear system @code{A*x = b}. -## -## With no options, this function is equivalent to the left division operator -## @w{(@code{x = A \ b})} or the matrix-left-divide function -## @w{(@code{x = mldivide (A, b)})}. -## -## Octave ordinarily examines the properties of the matrix @var{A} and chooses -## a solver that best matches the matrix. By passing a structure @var{opts} -## to @code{linsolve} you can inform Octave directly about the matrix @var{A}. -## In this case Octave will skip the matrix examination and proceed directly -## to solving the linear system. -## -## @strong{Warning:} If the matrix @var{A} does not have the properties -## listed in the @var{opts} structure then the result will not be accurate -## AND no warning will be given. When in doubt, let Octave examine the matrix -## and choose the appropriate solver as this step takes little time and the -## result is cached so that it is only done once per linear system. -## -## Possible @var{opts} fields (set value to true/false): -## -## @table @asis -## @item LT -## @var{A} is lower triangular -## -## @item UT -## @var{A} is upper triangular -## -## @item UHESS -## @var{A} is upper Hessenberg (currently makes no difference) -## -## @item SYM -## @var{A} is symmetric or complex Hermitian (currently makes no difference) -## -## @item POSDEF -## @var{A} is positive definite -## -## @item RECT -## @var{A} is general rectangular (currently makes no difference) -## -## @item TRANSA -## Solve @code{A'*x = b} by @code{transpose (A) \ b} -## @end table -## -## The optional second output @var{R} is the inverse condition number of -## @var{A} (zero if matrix is singular). -## @seealso{mldivide, matrix_type, rcond} -## @end deftypefn - -## Author: Nir Krakauer <nkrakauer@ccny.cuny.edu> - -## STK notes: -## * This version of linsolve.m comes from revision b66f068e4468 of Octave's -## hg repository (changeset by Nir Krakauer on 2013-09-26, 09:38:51) -## * The only change that has been made is the introduction of a tolerance -## in the first assert of the first unit test, that's all ! - -function [x, R] = linsolve (A, b, opts) - - if (nargin < 2 || nargin > 3) - print_usage (); - endif - - if (! (isnumeric (A) && isnumeric (b))) - error ("linsolve: A and B must be numeric"); - endif - - ## Process any opts - if (nargin > 2) - if (! isstruct (opts)) - error ("linsolve: OPTS must be a structure"); - endif - trans_A = false; - if (isfield (opts, "TRANSA") && opts.TRANSA) - trans_A = true; - A = A'; - endif - if (isfield (opts, "POSDEF") && opts.POSDEF) - A = matrix_type (A, "positive definite"); - endif - if (isfield (opts, "LT") && opts.LT) - if (trans_A) - A = matrix_type (A, "upper"); - else - A = matrix_type (A, "lower"); - endif - endif - if (isfield (opts, "UT") && opts.UT) - if (trans_A) - A = matrix_type (A, "lower"); - else - A = matrix_type (A, "upper"); - endif - endif - endif - - x = A \ b; - - if (nargout > 1) - if (issquare (A)) - R = rcond (A); - else - R = 0; - endif - endif -endfunction # linsolve - - -%!test -%! n = 4; -%! A = triu (rand (n)); -%! x = rand (n, 1); -%! b = A' * x; -%! opts.UT = true; -%! opts.TRANSA = true; -%! assert (linsolve (A, b, opts), A' \ b, 1e-12); - -%!error linsolve () -%!error linsolve (1) -%!error linsolve (1,2,3) -%!error <A and B must be numeric> linsolve ({1},2) -%!error <A and B must be numeric> linsolve (1,{2}) -%!error <OPTS must be a structure> linsolve (1,2,3) diff --git a/inst/misc/mole/quantile/quantile.m b/inst/misc/mole/quantile/quantile.m deleted file mode 100644 index 1d21751..0000000 --- a/inst/misc/mole/quantile/quantile.m +++ /dev/null @@ -1,463 +0,0 @@ -% QUANTILE ... - -% Copyright Notice -% -% Copyright (C) 2013 SUPELEC -% -% Author: Julien Bect <julien.bect@centralesupelec.fr> -% -% The function comes from Octave 3.7.6+'s quantile.m, with minor -% modifications. The original copyright notice was: -% -% Copyright (C) 2008-2012 Ben Abbott and Jaroslav Hajek - -% Copying Permission Statement -% -% This file is part of -% -% STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) -% -% STK is free software: you can redistribute it and/or modify it under -% the terms of the GNU General Public License as published by the Free -% Software Foundation, either version 3 of the License, or (at your -% option) any later version. -% -% STK is distributed in the hope that it will be useful, but WITHOUT -% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -% License for more details. -% -% You should have received a copy of the GNU General Public License -% along with STK. If not, see <http://www.gnu.org/licenses/>. - -% ## Copyright (C) 2008-2012 Ben Abbott and Jaroslav Hajek -% ## -% ## This file is part of Octave. -% ## -% ## Octave is free software; you can redistribute it and/or modify it -% ## under the terms of the GNU General Public License as published by -% ## the Free Software Foundation; either version 3 of the License, or (at -% ## your option) any later version. -% ## -% ## Octave is distributed in the hope that it will be useful, but -% ## WITHOUT ANY WARRANTY; without even the implied warranty of -% ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU -% ## General Public License for more details. -% ## -% ## You should have received a copy of the GNU General Public License -% ## along with Octave; see the file COPYING. If not, see -% ## <http://www.gnu.org/licenses/>. -% -% ## -*- texinfo -*- -% ## @deftypefn {Function File} {@var{q} =} quantile (@var{x}) -% ## @deftypefnx {Function File} {@var{q} =} quantile (@var{x}, @var{p}) -% ## @deftypefnx {Function File} {@var{q} =} quantile (@var{x}, @var{p}, @var{dim}) -% ## @deftypefnx {Function File} {@var{q} =} quantile (@var{x}, @var{p}, @var{dim}, @var{method}) -% ## For a sample, @var{x}, calculate the quantiles, @var{q}, corresponding to -% ## the cumulative probability values in @var{p}. All non-numeric values (NaNs) -% ## of @var{x} are ignored. -% ## -% ## If @var{x} is a matrix, compute the quantiles for each column and -% ## return them in a matrix, such that the i-th row of @var{q} contains -% ## the @var{p}(i)th quantiles of each column of @var{x}. -% ## -% ## If @var{p} is unspecified, return the quantiles for -% ## @code{[0.00 0.25 0.50 0.75 1.00]}. -% ## The optional argument @var{dim} determines the dimension along which -% ## the quantiles are calculated. If @var{dim} is omitted, and @var{x} is -% ## a vector or matrix, it defaults to 1 (column-wise quantiles). If -% ## @var{x} is an N-D array, @var{dim} defaults to the first non-singleton -% ## dimension. -% ## -% ## The methods available to calculate sample quantiles are the nine methods -% ## used by R (@url{http://www.r-project.org/}). The default value is -% ## @w{METHOD = 5}. -% ## -% ## Discontinuous sample quantile methods 1, 2, and 3 -% ## -% ## @enumerate 1 -% ## @item Method 1: Inverse of empirical distribution function. -% ## -% ## @item Method 2: Similar to method 1 but with averaging at discontinuities. -% ## -% ## @item Method 3: SAS definition: nearest even order statistic. -% ## @end enumerate -% ## -% ## Continuous sample quantile methods 4 through 9, where p(k) is the linear -% ## interpolation function respecting each methods' representative cdf. -% ## -% ## @enumerate 4 -% ## @item Method 4: p(k) = k / n. That is, linear interpolation of the -% ## empirical cdf. -% ## -% ## @item Method 5: p(k) = (k - 0.5) / n. That is a piecewise linear function -% ## where the knots are the values midway through the steps of the empirical -% ## cdf. -% ## -% ## @item Method 6: p(k) = k / (n + 1). -% ## -% ## @item Method 7: p(k) = (k - 1) / (n - 1). -% ## -% ## @item Method 8: p(k) = (k - 1/3) / (n + 1/3). The resulting quantile -% ## estimates are approximately median-unbiased regardless of the distribution -% ## of @var{x}. -% ## -% ## @item Method 9: p(k) = (k - 3/8) / (n + 1/4). The resulting quantile -% ## estimates are approximately unbiased for the expected order statistics if -% ## @var{x} is normally distributed. -% ## @end enumerate -% ## -% ## Hyndman and Fan (1996) recommend method 8. Maxima, S, and R -% ## (versions prior to 2.0.0) use 7 as their default. Minitab and SPSS -% ## use method 6. @sc{matlab} uses method 5. -% ## -% ## References: -% ## -% ## @itemize @bullet -% ## @item Becker, R. A., Chambers, J. M. and Wilks, A. R. (1988) The New -% ## S Language. Wadsworth & Brooks/Cole. -% ## -% ## @item Hyndman, R. J. and Fan, Y. (1996) Sample quantiles in -% ## statistical packages, American Statistician, 50, 361--365. -% ## -% ## @item R: A Language and Environment for Statistical Computing; -% ## @url{http://cran.r-project.org/doc/manuals/fullrefman.pdf}. -% ## @end itemize -% ## -% ## Examples: -% ## @c Set example in small font to prevent overfull line -% ## -% ## @smallexample -% ## @group -% ## x = randi (1000, [10, 1]); # Create empirical data in range 1-1000 -% ## q = quantile (x, [0, 1]); # Return minimum, maximum of distribution -% ## q = quantile (x, [0.25 0.5 0.75]); # Return quartiles of distribution -% ## @end group -% ## @end smallexample -% ## @seealso{prctile} -% ## @end deftypefn -% -% ## Author: Ben Abbott <bpabbott@mac.com> -% ## Description: Matlab style quantile function of a discrete/continuous distribution - -function q = quantile (x, p, dim, method) - -if nargin < 2, - p = []; -end - -if nargin < 3, - dim = 1; -end - -if nargin < 4, - % Use Matlab compatiblity mode - method = 5; -end - -if (~ (isnumeric (x) || islogical (x))) - error ('quantile: X must be a numeric vector or matrix'); -end - -if (isempty (p)) - p = [0.00 0.25, 0.50, 0.75, 1.00]; -end - -if (~ (isnumeric (p) && isvector (p))) - error ('quantile: P must be a numeric vector'); -end - -if (~ (isscalar (dim) && dim == fix (dim)) ... - || ~(1 <= dim && dim <= ndims (x))) - error ('quantile: DIM must be an integer and a valid dimension'); -end - -% Set the permutation vector. -perm = 1:ndims (x); -perm(1) = dim; -perm(dim) = 1; - -% Permute dim to the 1st index. -x = permute (x, perm); - -% Save the size of the permuted x N-d array. -sx = size (x); - -% Reshape to a 2-d array. -x = reshape (x, [sx(1), prod(sx(2:end))]); - -% Calculate the quantiles. -q = octave__quantile__ (x, p, method); - -% Return the shape to the original N-d array. -q = reshape (q, [numel(p), sx(2:end)]); - -% Permute the 1st index back to dim. -q = ipermute (q, perm); - -end % function - -%!test -%! p = 0.5; -%! x = sort (rand (11)); -%! q = quantile (x, p); -%! assert (isequal (q, x(6,:))); -%! x = x.'; -%! q = quantile (x, p, 2); -%! assert (isequal (q, x(:,6))); - -% Note: method 3 not available yet because Matlab doesn't have roundb() - -%!test -%! p = [0.00, 0.25, 0.50, 0.75, 1.00]; -%! x = [1; 2; 3; 4]; -%! a = [1.0000 1.0000 2.0000 3.0000 4.0000 -%! 1.0000 1.5000 2.5000 3.5000 4.0000 -%! 1.0000 1.0000 2.0000 3.0000 4.0000 -%! 1.0000 1.0000 2.0000 3.0000 4.0000 -%! 1.0000 1.5000 2.5000 3.5000 4.0000 -%! 1.0000 1.2500 2.5000 3.7500 4.0000 -%! 1.0000 1.7500 2.5000 3.2500 4.0000 -%! 1.0000 1.4167 2.5000 3.5833 4.0000 -%! 1.0000 1.4375 2.5000 3.5625 4.0000]; -%! for m = [1:2 4:9] -%! q = quantile (x, p, 1, m).'; -%! assert (stk_isequal_tolabs (q, a(m,:), 0.0001)); -%! end - -%!test -%! p = [0.00, 0.25, 0.50, 0.75, 1.00]; -%! x = [1; 2; 3; 4; 5]; -%! a = [1.0000 2.0000 3.0000 4.0000 5.0000 -%! 1.0000 2.0000 3.0000 4.0000 5.0000 -%! 1.0000 1.0000 2.0000 4.0000 5.0000 -%! 1.0000 1.2500 2.5000 3.7500 5.0000 -%! 1.0000 1.7500 3.0000 4.2500 5.0000 -%! 1.0000 1.5000 3.0000 4.5000 5.0000 -%! 1.0000 2.0000 3.0000 4.0000 5.0000 -%! 1.0000 1.6667 3.0000 4.3333 5.0000 -%! 1.0000 1.6875 3.0000 4.3125 5.0000]; -%! for m = [1:2 4:9] -%! q = quantile (x, p, 1, m).'; -%! assert (stk_isequal_tolabs (q, a(m,:), 0.0001)); -%! end - -%!test -%! p = [0.00, 0.25, 0.50, 0.75, 1.00]; -%! x = [1; 2; 5; 9]; -%! a = [1.0000 1.0000 2.0000 5.0000 9.0000 -%! 1.0000 1.5000 3.5000 7.0000 9.0000 -%! 1.0000 1.0000 2.0000 5.0000 9.0000 -%! 1.0000 1.0000 2.0000 5.0000 9.0000 -%! 1.0000 1.5000 3.5000 7.0000 9.0000 -%! 1.0000 1.2500 3.5000 8.0000 9.0000 -%! 1.0000 1.7500 3.5000 6.0000 9.0000 -%! 1.0000 1.4167 3.5000 7.3333 9.0000 -%! 1.0000 1.4375 3.5000 7.2500 9.0000]; -%! for m = [1:2 4:9] -%! q = quantile (x, p, 1, m).'; -%! assert (stk_isequal_tolabs (q, a(m,:), 0.0001)); -%! end - -%!test -%! p = [0.00, 0.25, 0.50, 0.75, 1.00]; -%! x = [1; 2; 5; 9; 11]; -%! a = [1.0000 2.0000 5.0000 9.0000 11.0000 -%! 1.0000 2.0000 5.0000 9.0000 11.0000 -%! 1.0000 1.0000 2.0000 9.0000 11.0000 -%! 1.0000 1.2500 3.5000 8.0000 11.0000 -%! 1.0000 1.7500 5.0000 9.5000 11.0000 -%! 1.0000 1.5000 5.0000 10.0000 11.0000 -%! 1.0000 2.0000 5.0000 9.0000 11.0000 -%! 1.0000 1.6667 5.0000 9.6667 11.0000 -%! 1.0000 1.6875 5.0000 9.6250 11.0000]; -%! for m = [1:2 4:9] -%! q = quantile (x, p, 1, m).'; -%! assert (stk_isequal_tolabs (q, a(m,:), 0.0001)); -%! end - -%!test -%! p = [0.00, 0.25, 0.50, 0.75, 1.00]; -%! x = [16; 11; 15; 12; 15; 8; 11; 12; 6; 10]; -%! a = [6.0000 10.0000 11.0000 15.0000 16.0000 -%! 6.0000 10.0000 11.5000 15.0000 16.0000 -%! 6.0000 8.0000 11.0000 15.0000 16.0000 -%! 6.0000 9.0000 11.0000 13.5000 16.0000 -%! 6.0000 10.0000 11.5000 15.0000 16.0000 -%! 6.0000 9.5000 11.5000 15.0000 16.0000 -%! 6.0000 10.2500 11.5000 14.2500 16.0000 -%! 6.0000 9.8333 11.5000 15.0000 16.0000 -%! 6.0000 9.8750 11.5000 15.0000 16.0000]; -%! for m = [1:2 4:9] -%! q = quantile (x, p, 1, m).'; -%! assert (stk_isequal_tolabs (q, a(m,:), 0.0001)); -%! end - -%!test -%! p = [0.00, 0.25, 0.50, 0.75, 1.00]; -%! x = [-0.58851; 0.40048; 0.49527; -2.551500; -0.52057; ... -%! -0.17841; 0.057322; -0.62523; 0.042906; 0.12337]; -%! a = [-2.551474 -0.588505 -0.178409 0.123366 0.495271 -%! -2.551474 -0.588505 -0.067751 0.123366 0.495271 -%! -2.551474 -0.625231 -0.178409 0.123366 0.495271 -%! -2.551474 -0.606868 -0.178409 0.090344 0.495271 -%! -2.551474 -0.588505 -0.067751 0.123366 0.495271 -%! -2.551474 -0.597687 -0.067751 0.192645 0.495271 -%! -2.551474 -0.571522 -0.067751 0.106855 0.495271 -%! -2.551474 -0.591566 -0.067751 0.146459 0.495271 -%! -2.551474 -0.590801 -0.067751 0.140686 0.495271]; -%! for m = [1:2 4:9] -%! q = quantile (x, p, 1, m).'; -%! assert (stk_isequal_tolabs (q, a(m,:), 0.0001)); -%! end - -%!test -%! p = 0.5; -%! x = [0.112600, 0.114800, 0.052100, 0.236400, 0.139300 -%! 0.171800, 0.727300, 0.204100, 0.453100, 0.158500 -%! 0.279500, 0.797800, 0.329600, 0.556700, 0.730700 -%! 0.428800, 0.875300, 0.647700, 0.628700, 0.816500 -%! 0.933100, 0.931200, 0.963500, 0.779600, 0.846100]; -%! tol = 0.00001; -%! x(5,5) = NaN; -%! assert (stk_isequal_tolabs ... -%! (quantile (x, p, 1), ... -%! [0.27950, 0.79780, 0.32960, 0.55670, 0.44460], tol)); -%! x(1,1) = NaN; -%! assert (stk_isequal_tolabs ... -%! (quantile (x, p, 1), ... -%! [0.35415, 0.79780, 0.32960, 0.55670, 0.44460], tol)); -%! x(3,3) = NaN; -%! assert (stk_isequal_tolabs ... -%! (quantile (x, p, 1), ... -%! [0.35415, 0.79780, 0.42590, 0.55670, 0.44460], tol)); - -%!test -%! sx = [2, 3, 4]; -%! x = rand (sx); -%! dim = 2; -%! p = 0.5; -%! yobs = quantile (x, p, dim); -%! yexp = median (x, dim); -%! assert (isequal (yobs, yexp)); - -%% Test input validation -%!error quantile () -%!error quantile (1, 2, 3, 4, 5) -%!error quantile (['A'; 'B'], 10) -%!error quantile (1:10, [true, false]) -%!error quantile (1:10, ones (2,2)) -%!error quantile (1, 1, 1.5) -%!error quantile (1, 1, 0) -%!error quantile (1, 1, 3) -%!error quantile ((1:5)', 0.5, 1, 0) -%!error quantile ((1:5)', 0.5, 1, 10) - -% ## For the cumulative probability values in @var{p}, compute the -% ## quantiles, @var{q} (the inverse of the cdf), for the sample, @var{x}. -% ## -% ## The optional input, @var{method}, refers to nine methods available in R -% ## (http://www.r-project.org/). The default is @var{method} = 7. -% ## @seealso{prctile, quantile, statistics} -% -% ## Author: Ben Abbott <bpabbott@mac.com> -% ## Vectorized version: Jaroslav Hajek <highegg@gmail.com> -% ## Description: Quantile function of empirical samples - -function inv = octave__quantile__ (x, p, method) - -if (isinteger (x) || islogical (x)) - x = double (x); -end - -% set shape of quantiles to column vector. -p = p(:); - -% Save length and set shape of samples. -% FIXME: does sort guarantee that NaN's come at the end? -x = sort (x); -m = sum (~ isnan (x)); -[xr, xc] = size (x); - -% Initialize output values. -inv = Inf (class (x)) * (-(p < 0) + (p > 1)); -inv = repmat (inv, 1, xc); - -% Do the work. -k = find ((p >= 0) & (p <= 1)); -if (any (k)) - n = length (k); - p = p(k); - % Special case of 1 row. - if (xr == 1) - inv(k,:) = repmat (x, n, 1); - return; - end - - % The column-distribution indices. - pcd = kron (ones (n, 1), xr*(0:xc-1)); - mm = kron (ones (n, 1), m); - switch (method) - case {1, 2, 3} - switch (method) - case 1 - p = max (ceil (kron (p, m)), 1); - inv(k,:) = x(p + pcd); - - case 2 - p = kron (p, m); - p_lr = max (ceil (p), 1); - p_rl = min (floor (p + 1), mm); - inv(k,:) = (x(p_lr + pcd) + x(p_rl + pcd))/2; - - case 3 - % Used by SAS, method PCTLDEF=2. - % http://support.sas.com/onlinedoc/913/getDoc/en/statug.hlp/stdize_sect14.htm - t = max (kron (p, m), 1); - t = roundb (t); - inv(k,:) = x(t + pcd); - end - - otherwise - switch (method) - case 4 - p = kron (p, m); - - case 5 - % Used by Matlab. - p = kron (p, m) + 0.5; - - case 6 - % Used by Minitab and SPSS. - p = kron (p, m+1); - - case 7 - % Used by S and R. - p = kron (p, m-1) + 1; - - case 8 - % Median unbiased. - p = kron (p, m+1/3) + 1/3; - - case 9 - % Approximately unbiased respecting order statistics. - p = kron (p, m+0.25) + 0.375; - - otherwise - error ('quantile: Unknown METHOD, ''%d''', method); - end - - % Duplicate single values. - imm1 = (mm == 1); - x(2,imm1) = x(1,imm1); - - % Interval indices. - pi = max (min (floor (p), mm-1), 1); - pr = max (min (p - pi, 1), 0); - pi = pi + pcd; - inv(k,:) = (1-pr) .* x(pi) + pr .* x(pi+1); - end -end - -end % function diff --git a/inst/misc/optim/@stk_optim_fmincon/stk_minimize_boxconstrained.m b/inst/misc/optim/@stk_optim_fmincon/stk_minimize_boxconstrained.m index daa8210..b2c3a55 100644 --- a/inst/misc/optim/@stk_optim_fmincon/stk_minimize_boxconstrained.m +++ b/inst/misc/optim/@stk_optim_fmincon/stk_minimize_boxconstrained.m @@ -27,7 +27,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/optim/@stk_optim_fmincon/stk_optim_fmincon.m b/inst/misc/optim/@stk_optim_fmincon/stk_optim_fmincon.m index 5848d61..a8667e6 100644 --- a/inst/misc/optim/@stk_optim_fmincon/stk_optim_fmincon.m +++ b/inst/misc/optim/@stk_optim_fmincon/stk_optim_fmincon.m @@ -23,7 +23,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -41,7 +41,7 @@ function algo = stk_optim_fmincon (varargin) % Some default options -options = optimset ( ... +options0 = optimset ( ... 'Display', 'off', ... 'GradObj', 'on', ... 'MaxFunEvals', 500, ... @@ -54,8 +54,14 @@ ws = warning ('off', 'all'); try % Try to use the interior-point algorithm, which has been % found to provide satisfactory results in many cases - options = optimset (options, 'algorithm', 'interior-point'); + options = optimset (options0, 'algorithm', 'interior-point'); +catch + % FIXME: This is brutal. We should catch selectively the error raised + % by Matlab when (in old releases) 'algorithm' is not a legal parameter + % name or (does this exist?) 'interior-point' is not an algorithm name. + options = options0; end + warning (ws); % TODO: see if the 'UseParallel' option can be useful diff --git a/inst/misc/optim/@stk_optim_fminsearch/stk_minimize_boxconstrained.m b/inst/misc/optim/@stk_optim_fminsearch/stk_minimize_boxconstrained.m index 59f025f..b9d9763 100644 --- a/inst/misc/optim/@stk_optim_fminsearch/stk_minimize_boxconstrained.m +++ b/inst/misc/optim/@stk_optim_fminsearch/stk_minimize_boxconstrained.m @@ -19,7 +19,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/optim/@stk_optim_fminsearch/stk_minimize_unconstrained.m b/inst/misc/optim/@stk_optim_fminsearch/stk_minimize_unconstrained.m index 1d2fb7a..df963e4 100644 --- a/inst/misc/optim/@stk_optim_fminsearch/stk_minimize_unconstrained.m +++ b/inst/misc/optim/@stk_optim_fminsearch/stk_minimize_unconstrained.m @@ -26,7 +26,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/optim/@stk_optim_fminsearch/stk_optim_fminsearch.m b/inst/misc/optim/@stk_optim_fminsearch/stk_optim_fminsearch.m index a4ef3d5..2c1e5c0 100644 --- a/inst/misc/optim/@stk_optim_fminsearch/stk_optim_fminsearch.m +++ b/inst/misc/optim/@stk_optim_fminsearch/stk_optim_fminsearch.m @@ -23,7 +23,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/optim/@stk_optim_octavesqp/private/sqp_quadprog.m b/inst/misc/optim/@stk_optim_octavesqp/private/sqp_quadprog.m index 9f229ee..698e52d 100644 --- a/inst/misc/optim/@stk_optim_octavesqp/private/sqp_quadprog.m +++ b/inst/misc/optim/@stk_optim_octavesqp/private/sqp_quadprog.m @@ -186,7 +186,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -285,7 +285,7 @@ function [x, obj, info, iter, nf, lambda] = sqp_quadprog ... % constraint function given by user without gradient globals.cifcn = @empty_cf; if (iscell (cif)) - if (length (cif) > 0) + if (~ isempty (cif)) globals.cifcn = cif{1}; end % if elseif (~ isempty (cif)) @@ -452,8 +452,8 @@ function [x, obj, info, iter, nf, lambda] = sqp_quadprog ... try % Call quadprog to solve the QP subproblem quadprog_options = optimset ('Display', 'off'); - [p, ignd1, quadprog_exitflag, ignd2, lambda] = quadprog ... - (B, c, -C, -d, F, g, [], [], x, quadprog_options); %#ok<ASGLU> CG#07 + [p, ~, quadprog_exitflag, ~, lambda] = quadprog ... + (B, c, -C, -d, F, g, [], [], x, quadprog_options); catch warning (ws); rethrow (lasterror ()); diff --git a/inst/misc/optim/@stk_optim_octavesqp/stk_minimize_boxconstrained.m b/inst/misc/optim/@stk_optim_octavesqp/stk_minimize_boxconstrained.m index 11ccb3c..3d7d275 100644 --- a/inst/misc/optim/@stk_optim_octavesqp/stk_minimize_boxconstrained.m +++ b/inst/misc/optim/@stk_optim_octavesqp/stk_minimize_boxconstrained.m @@ -16,7 +16,7 @@ % Copyright Notice % -% Copyright (C) 2015, 2018 CentraleSupelec +% Copyright (C) 2015, 2018, 2021 CentraleSupelec % Copyright (C) 2014 SUPELEC & A. Ravisankar % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -27,7 +27,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -57,6 +57,6 @@ function df = nabla_f_ (f, u) % Note: with this implementation, f_val is computed twice % (once when f is called by sqp, and once again when nabla_f is called) -[ignd, df] = f (u); %#ok<ASGLU> CG#07 +[~, df] = f (u); end % function diff --git a/inst/misc/optim/@stk_optim_octavesqp/stk_minimize_unconstrained.m b/inst/misc/optim/@stk_optim_octavesqp/stk_minimize_unconstrained.m index 2021386..edb1e05 100644 --- a/inst/misc/optim/@stk_optim_octavesqp/stk_minimize_unconstrained.m +++ b/inst/misc/optim/@stk_optim_octavesqp/stk_minimize_unconstrained.m @@ -26,7 +26,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/optim/@stk_optim_octavesqp/stk_optim_octavesqp.m b/inst/misc/optim/@stk_optim_octavesqp/stk_optim_octavesqp.m index 24789ad..73049f8 100644 --- a/inst/misc/optim/@stk_optim_octavesqp/stk_optim_octavesqp.m +++ b/inst/misc/optim/@stk_optim_octavesqp/stk_optim_octavesqp.m @@ -23,7 +23,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/optim/@stk_optim_optimizer_/stk_optim_isavailable.m b/inst/misc/optim/@stk_optim_optimizer_/stk_optim_isavailable.m index 89871da..cd4fab7 100644 --- a/inst/misc/optim/@stk_optim_optimizer_/stk_optim_isavailable.m +++ b/inst/misc/optim/@stk_optim_optimizer_/stk_optim_isavailable.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/optim/@stk_optim_optimizer_/stk_optim_optimizer_.m b/inst/misc/optim/@stk_optim_optimizer_/stk_optim_optimizer_.m index e23c18d..68aac49 100644 --- a/inst/misc/optim/@stk_optim_optimizer_/stk_optim_optimizer_.m +++ b/inst/misc/optim/@stk_optim_optimizer_/stk_optim_optimizer_.m @@ -24,7 +24,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/optim/stk_minimize_boxconstrained.m b/inst/misc/optim/stk_minimize_boxconstrained.m index 8f0c8bc..6ca3b80 100644 --- a/inst/misc/optim/stk_minimize_boxconstrained.m +++ b/inst/misc/optim/stk_minimize_boxconstrained.m @@ -24,7 +24,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/optim/stk_minimize_unconstrained.m b/inst/misc/optim/stk_minimize_unconstrained.m index 692ccf7..3f4b1f3 100644 --- a/inst/misc/optim/stk_minimize_unconstrained.m +++ b/inst/misc/optim/stk_minimize_unconstrained.m @@ -24,7 +24,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/optim/stk_optim_isavailable.m b/inst/misc/optim/stk_optim_isavailable.m index 2b5c758..7e8077c 100644 --- a/inst/misc/optim/stk_optim_isavailable.m +++ b/inst/misc/optim/stk_optim_isavailable.m @@ -18,7 +18,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/optim/stk_optim_testmin_box.m b/inst/misc/optim/stk_optim_testmin_box.m index e816996..46a0287 100644 --- a/inst/misc/optim/stk_optim_testmin_box.m +++ b/inst/misc/optim/stk_optim_testmin_box.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/optim/stk_optim_testmin_unc.m b/inst/misc/optim/stk_optim_testmin_unc.m index dc5db1e..0189080 100644 --- a/inst/misc/optim/stk_optim_testmin_unc.m +++ b/inst/misc/optim/stk_optim_testmin_unc.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/optim/stk_select_optimizer.m b/inst/misc/optim/stk_select_optimizer.m deleted file mode 100644 index ad00b43..0000000 --- a/inst/misc/optim/stk_select_optimizer.m +++ /dev/null @@ -1,106 +0,0 @@ -% STK_SELECT_OPTIMIZER is a deprecated function -% -% stk_select_optimizer is deprecated and will be removed -% from future releases of STK. Use -% -% stk_options_get ('stk_param_estim', ...) -% stk_options_set ('stk_param_estim', ...) -% -% instead to get/set optimizer algorithm objects. -% -% See also: stk_options_get, stk_options_set - -% Copyright Notice -% -% Copyright (C) 2015 CentraleSupelec -% Copyright (C) 2011-2014 SUPELEC -% -% Author: Julien Bect <julien.bect@centralesupelec.fr> - -% Copying Permission Statement -% -% This file is part of -% -% STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) -% -% STK is free software: you can redistribute it and/or modify it under -% the terms of the GNU General Public License as published by the Free -% Software Foundation, either version 3 of the License, or (at your -% option) any later version. -% -% STK is distributed in the hope that it will be useful, but WITHOUT -% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -% License for more details. -% -% You should have received a copy of the GNU General Public License -% along with STK. If not, see <http://www.gnu.org/licenses/>. - -function optim_num = stk_select_optimizer (bounds_available, display) - -warning (help ('stk_select_optimizer')); - -% Get current optimization algorithm objects -algo_con = stk_options_get ('stk_param_estim', 'stk_minimize_boxconstrained'); -algo_unc = stk_options_get ('stk_param_estim', 'stk_minimize_unconstrained'); - -% Legacy: corresponding optim_num in stk <= 2.3.2 -optim_num_con = get_optim_num (algo_con); -optim_num_unc = get_optim_num (algo_unc); - -% Return value -if nargin > 0 - if bounds_available, - optim_num = optim_num_con; - else - optim_num = optim_num_unc; - end -else - optim_num = []; -end - -% Display status -if (nargin > 1) && display, - - fprintf ('Constrained optimizer for stk_param_estim: '); - switch optim_num_con - case 1, % octave / sqp - fprintf ('sqp.\n'); - case 2, % Matlab / fminsearch - fprintf ('NONE.\n'); - case 3, % Matlab / fmincon - fprintf ('fmincon.\n'); - otherwise - fprintf ('%s\n', class (algo_con)); - end - - fprintf ('Unconstrained optimizer for stk_param_estim: '); - switch optim_num_unc - case 1, % octave / sqp - fprintf ('sqp.\n'); - case 2, % Matlab / fminsearch - fprintf ('fminsearch.\n'); - otherwise - fprintf ('%s\n', class (algo_unc)); - end - -end - -end % function - - -function optim_num = get_optim_num (algo) - -switch class (algo) - case 'stk_optim_octavesqp' - optim_num = 1; - case 'stk_optim_fminsearch' - optim_num = 2; - case 'stk_optim_fmincon' - optim_num = 3; - otherwise - optim_num = []; -end - -end % function diff --git a/inst/misc/options/stk_options_get.m b/inst/misc/options/stk_options_get.m index 9d24d20..fafaf61 100644 --- a/inst/misc/options/stk_options_get.m +++ b/inst/misc/options/stk_options_get.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/options/stk_options_set.m b/inst/misc/options/stk_options_set.m index 85e594c..f301917 100644 --- a/inst/misc/options/stk_options_set.m +++ b/inst/misc/options/stk_options_set.m @@ -27,7 +27,7 @@ % Copyright Notice % -% Copyright (C) 201 CentraleSupelec +% Copyright (C) 2019 CentraleSupelec % Copyright (C) 2015-2017 CentraleSupelec % Copyright (C) 2014 SUPELEC & A. Ravisankar % Copyright (C) 2013 SUPELEC @@ -40,7 +40,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/parallel/@stk_parallel_engine_none/stk_parallel_engine_none.m b/inst/misc/parallel/@stk_parallel_engine_none/stk_parallel_engine_none.m index 1a370ca..d816056 100644 --- a/inst/misc/parallel/@stk_parallel_engine_none/stk_parallel_engine_none.m +++ b/inst/misc/parallel/@stk_parallel_engine_none/stk_parallel_engine_none.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/parallel/@stk_parallel_engine_none/stk_parallel_feval.m b/inst/misc/parallel/@stk_parallel_engine_none/stk_parallel_feval.m index 9fb910d..b837860 100644 --- a/inst/misc/parallel/@stk_parallel_engine_none/stk_parallel_feval.m +++ b/inst/misc/parallel/@stk_parallel_engine_none/stk_parallel_feval.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/parallel/@stk_parallel_engine_none/stk_parallel_stop.m b/inst/misc/parallel/@stk_parallel_engine_none/stk_parallel_stop.m index 7dc96d9..c962467 100644 --- a/inst/misc/parallel/@stk_parallel_engine_none/stk_parallel_stop.m +++ b/inst/misc/parallel/@stk_parallel_engine_none/stk_parallel_stop.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/parallel/@stk_parallel_engine_parfor/stk_parallel_engine_parfor.m b/inst/misc/parallel/@stk_parallel_engine_parfor/stk_parallel_engine_parfor.m index 029a071..a3c2f7c 100644 --- a/inst/misc/parallel/@stk_parallel_engine_parfor/stk_parallel_engine_parfor.m +++ b/inst/misc/parallel/@stk_parallel_engine_parfor/stk_parallel_engine_parfor.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2017 CentraleSupelec +% Copyright (C) 2017, 2021 CentraleSupelec % Copyright (C) 2013 SUPELEC % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -57,9 +57,3 @@ pareng = class (struct(), 'stk_parallel_engine_parfor'); end % function %#ok<*DPOOL> - - -%!test -%! if exist ('matlabpool') || exist ('parpool') -%! stk_test_class ('stk_parallel_engine_parfor') -%! end diff --git a/inst/misc/parallel/@stk_parallel_engine_parfor/stk_parallel_feval.m b/inst/misc/parallel/@stk_parallel_engine_parfor/stk_parallel_feval.m index 54e8492..3d39898 100644 --- a/inst/misc/parallel/@stk_parallel_engine_parfor/stk_parallel_feval.m +++ b/inst/misc/parallel/@stk_parallel_engine_parfor/stk_parallel_feval.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/parallel/@stk_parallel_engine_parfor/stk_parallel_stop.m b/inst/misc/parallel/@stk_parallel_engine_parfor/stk_parallel_stop.m index fab98e8..f4b3bc6 100644 --- a/inst/misc/parallel/@stk_parallel_engine_parfor/stk_parallel_stop.m +++ b/inst/misc/parallel/@stk_parallel_engine_parfor/stk_parallel_stop.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/parallel/stk_parallel_cutblocks.m b/inst/misc/parallel/stk_parallel_cutblocks.m index ae47957..bac7af2 100644 --- a/inst/misc/parallel/stk_parallel_cutblocks.m +++ b/inst/misc/parallel/stk_parallel_cutblocks.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/parallel/stk_parallel_engine_get.m b/inst/misc/parallel/stk_parallel_engine_get.m index dbf6441..fc971fd 100644 --- a/inst/misc/parallel/stk_parallel_engine_get.m +++ b/inst/misc/parallel/stk_parallel_engine_get.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/parallel/stk_parallel_engine_set.m b/inst/misc/parallel/stk_parallel_engine_set.m index 02cc77a..eaffb2a 100644 --- a/inst/misc/parallel/stk_parallel_engine_set.m +++ b/inst/misc/parallel/stk_parallel_engine_set.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/parallel/stk_parallel_feval.m b/inst/misc/parallel/stk_parallel_feval.m index d5ecaf0..5796051 100644 --- a/inst/misc/parallel/stk_parallel_feval.m +++ b/inst/misc/parallel/stk_parallel_feval.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/parallel/stk_parallel_start.m b/inst/misc/parallel/stk_parallel_start.m index 17768d8..076c741 100644 --- a/inst/misc/parallel/stk_parallel_start.m +++ b/inst/misc/parallel/stk_parallel_start.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/parallel/stk_parallel_stop.m b/inst/misc/parallel/stk_parallel_stop.m index a47b14a..6e7a068 100644 --- a/inst/misc/parallel/stk_parallel_stop.m +++ b/inst/misc/parallel/stk_parallel_stop.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/pareto/stk_dominatedhv.m b/inst/misc/pareto/stk_dominatedhv.m index 9f7005d..e9f05fd 100644 --- a/inst/misc/pareto/stk_dominatedhv.m +++ b/inst/misc/pareto/stk_dominatedhv.m @@ -47,7 +47,7 @@ % Copyright Notice % -% Copyright (C) 2015, 2017, 2018 CentraleSupelec +% Copyright (C) 2015, 2017, 2018, 2022 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -56,7 +56,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -74,10 +74,14 @@ function result = stk_dominatedhv (y, y_ref, do_decomposition) % Missing or empty y_ref: will use [0 0 ... 0] as a reference point -if nargin < 2, +if nargin < 2 y_ref = []; -elseif ~ ((isnumeric (y_ref)) && ((isempty (y_ref)) || (isrow (y_ref)))) - stk_error ('y_ref should be a numeric row vector.', 'IncorrectSize'); +elseif ~ isempty (y_ref) + y_ref = double (y_ref); + d = size (y_ref, 2); + if (d == 0) || (~ isequal (size (y_ref), [1 d])) % isrow CG#08 + stk_error ('y_ref should be a numeric row vector.', 'IncorrectSize'); + end end % Return the decomposition or just the value of the volume ? diff --git a/inst/misc/pareto/stk_isdominated.m b/inst/misc/pareto/stk_isdominated.m index 303ba52..f8d83a9 100644 --- a/inst/misc/pareto/stk_isdominated.m +++ b/inst/misc/pareto/stk_isdominated.m @@ -39,7 +39,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/pareto/stk_paretofind.m b/inst/misc/pareto/stk_paretofind.m index 0494560..5252dab 100644 --- a/inst/misc/pareto/stk_paretofind.m +++ b/inst/misc/pareto/stk_paretofind.m @@ -31,7 +31,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/plot/stk_axes.m b/inst/misc/plot/stk_axes.m index df2b385..2d9bf76 100644 --- a/inst/misc/plot/stk_axes.m +++ b/inst/misc/plot/stk_axes.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/plot/stk_figure.m b/inst/misc/plot/stk_figure.m index 5b406b5..5ceb8ec 100644 --- a/inst/misc/plot/stk_figure.m +++ b/inst/misc/plot/stk_figure.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/plot/stk_labels.m b/inst/misc/plot/stk_labels.m index 8bba4a7..186dcd1 100644 --- a/inst/misc/plot/stk_labels.m +++ b/inst/misc/plot/stk_labels.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/plot/stk_legend.m b/inst/misc/plot/stk_legend.m index b69b8b9..7f6fb65 100644 --- a/inst/misc/plot/stk_legend.m +++ b/inst/misc/plot/stk_legend.m @@ -30,7 +30,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/plot/stk_plot_getaxesarg.m b/inst/misc/plot/stk_plot_getaxesarg.m index c4e6662..9b8e473 100644 --- a/inst/misc/plot/stk_plot_getaxesarg.m +++ b/inst/misc/plot/stk_plot_getaxesarg.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/plot/stk_plot_shadedci.m b/inst/misc/plot/stk_plot_shadedci.m index bf29391..42f73c3 100644 --- a/inst/misc/plot/stk_plot_shadedci.m +++ b/inst/misc/plot/stk_plot_shadedci.m @@ -16,7 +16,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/plot/stk_subplot.m b/inst/misc/plot/stk_subplot.m index 662a390..bde3de3 100644 --- a/inst/misc/plot/stk_subplot.m +++ b/inst/misc/plot/stk_subplot.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/plot/stk_title.m b/inst/misc/plot/stk_title.m index c98a7fa..93fab4d 100644 --- a/inst/misc/plot/stk_title.m +++ b/inst/misc/plot/stk_title.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/plot/stk_xlabel.m b/inst/misc/plot/stk_xlabel.m index 68f02b1..fb9eb48 100644 --- a/inst/misc/plot/stk_xlabel.m +++ b/inst/misc/plot/stk_xlabel.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/plot/stk_ylabel.m b/inst/misc/plot/stk_ylabel.m index f10572c..18d8bcf 100644 --- a/inst/misc/plot/stk_ylabel.m +++ b/inst/misc/plot/stk_ylabel.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/plot/stk_zlabel.m b/inst/misc/plot/stk_zlabel.m index 2b571df..1b9359a 100644 --- a/inst/misc/plot/stk_zlabel.m +++ b/inst/misc/plot/stk_zlabel.m @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/test/stk_is_lhs.m b/inst/misc/test/stk_is_lhs.m index 955da88..75f42ef 100644 --- a/inst/misc/test/stk_is_lhs.m +++ b/inst/misc/test/stk_is_lhs.m @@ -31,7 +31,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/test/stk_isequal_tolabs.m b/inst/misc/test/stk_isequal_tolabs.m index 38bd86e..76ff6c3 100644 --- a/inst/misc/test/stk_isequal_tolabs.m +++ b/inst/misc/test/stk_isequal_tolabs.m @@ -35,7 +35,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/test/stk_isequal_tolrel.m b/inst/misc/test/stk_isequal_tolrel.m index 012823d..37c5296 100644 --- a/inst/misc/test/stk_isequal_tolrel.m +++ b/inst/misc/test/stk_isequal_tolrel.m @@ -39,7 +39,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/test/stk_runtests.m b/inst/misc/test/stk_runtests.m index b45129f..728ff43 100644 --- a/inst/misc/test/stk_runtests.m +++ b/inst/misc/test/stk_runtests.m @@ -18,7 +18,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -72,6 +72,7 @@ here = pwd (); res = struct ( ... 'n_total', 0, ... 'n_pass', 0, ... + 'n_xfail', 0, ... 'n_files', 0, ... 'n_notest', 0, ... 'n_dirs', 0, ... @@ -87,10 +88,12 @@ for i = 1:(numel (dirs)) % Get absolute path cd (dirs{i}); dirname = pwd (); cd (here); - [np, nt, nn, nf, nd, res.err] = run_all_tests (dirname, dirname, res.err); + [np, nt, nx, nn, nf, nd, res.err] = ... + run_all_tests (dirname, dirname, res.err); res.n_total = res.n_total + nt; res.n_pass = res.n_pass + np; + res.n_xfail = res.n_xfail + nx; res.n_files = res.n_files + nf; res.n_notest = res.n_notest + nn; res.n_dirs = res.n_dirs + nd; @@ -101,7 +104,8 @@ res.runtime = toc (t0); if res.n_dirs > 1 fprintf ('*** Summary for all %d directories:\n', res.n_dirs); - fprintf ('*** --> passed %d/%d tests\n', res.n_pass, res.n_total); + fprintf ('*** --> passed %d/%d tests', res.n_pass, res.n_total); + fprintf (' [%d expected failures]\n', res.n_xfail); fprintf ('*** --> %d/%d files had no tests\n', res.n_notest, res.n_files); fprintf ('*** --> RUNTIME: %.2f seconds\n\n', res.runtime); end @@ -121,7 +125,7 @@ end % function % run_all_tests % %%%%%%%%%%%%%%%%% -function [n_pass, n_total, n_notest, n_files, n_dirs, err] ... +function [n_pass, n_total, n_xfail, n_notest, n_files, n_dirs, err] ... = run_all_tests (testdir, basedir, err) % list directory content @@ -136,6 +140,7 @@ fflush (stdout); % init counters n_total = 0; n_pass = 0; +n_xfail = 0; n_files = 0; n_notest = 0; n_dirs = 1; @@ -157,21 +162,26 @@ for i = 1:numel (flist) s = warning_off (); try % Do the actual tests. - [p, n] = stk_test (ff, 'quiet', stdout); + [p, n, nx] = stk_test (ff, 'quiet', stdout); % Note: the presence of the third argument (fid=stdout) forces % stk_test in batch mode, which means that it doesn't stop at % the first failed test. print_pass_fail (n, p); n_total = n_total + n; n_pass = n_pass + p; + n_xfail = n_xfail + nx; % Record function name if at least one test failed if p < n err = [err; {ff, n, p}]; end - % deal with warnings + % Deal with warnings if ~ isempty (lastwarn ()) fprintf (' (warnings)'); end + % Indicate if there were expected failures + if nx > 0 + fprintf (' [%d expected failures]', nx); + end warning (s); catch % Restore warning state after error @@ -193,17 +203,19 @@ end runtime = toc (t0); -fprintf (' --> passed %d/%d tests\n', n_pass, n_total); +fprintf ([' --> passed %d/%d tests ' ... + '[%d expected failures]\n'], n_pass, n_total, n_xfail); fprintf (' --> %d/%d files had no tests\n', n_notest, n_files); fprintf (' --> RUNTIME: %.2f seconds\n\n', runtime); for i = 1:(length (subdirs_class)) - [p, n, nnt, nf, nd, err] = run_all_tests ... + [p, n, nx, nnt, nf, nd, err] = run_all_tests ... (subdirs_class{i}, pwd(), err); n_total = n_total + n; n_pass = n_pass + p; + n_xfail = n_xfail + nx; n_files = n_files + nf; n_notest = n_notest + nnt; n_dirs = n_dirs + nd; @@ -211,11 +223,12 @@ end for i = 1:(length (subdirs_private)) - [p, n, nnt, nf, nd, err] = run_all_tests ... + [p, n, nx, nnt, nf, nd, err] = run_all_tests ... (subdirs_private{i}, subdirs_private{i}, err); n_total = n_total + n; n_pass = n_pass + p; + n_xfail = n_xfail + nx; n_files = n_files + nf; n_notest = n_notest + nnt; n_dirs = n_dirs + nd; @@ -283,8 +296,7 @@ function s = warning_off () s = warning ('off', 'all'); % Check whether warnings can be still be recovered by lastwarn -% (this is not the case in Octave 3.8.2, for example; -% see https://savannah.gnu.org/bugs/?41028) +% (see https://savannah.gnu.org/bugs/?41028) lastwarn (''); warning ('ah:ah', 'toto'); diff --git a/inst/misc/test/stk_test.m b/inst/misc/test/stk_test.m index 1d6c2f5..f6375db 100644 --- a/inst/misc/test/stk_test.m +++ b/inst/misc/test/stk_test.m @@ -67,7 +67,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -281,8 +281,8 @@ for x__i = 1:length(x__blockidx)-1 x__vars = deblank (x__vars); if (~ isempty (x__vars)) x__shared_names = {}; - while ~isempty(x__vars), - [x__shared_names{end+1}, x__vars] = strtok(x__vars, ', '); + while ~isempty(x__vars) + [x__shared_names{end+1}, x__vars] = strtok(x__vars, ', '); %#ok<STTOK> end x__shared_vals = repmat({[]}, 1, length(x__shared_names)); else @@ -423,8 +423,8 @@ for x__i = 1:length(x__blockidx)-1 nb_expected_failures = nb_expected_failures + 1; else x__msg = sprintf ('%stest failed\n%s', SIGNAL_FAIL, lasterr ()); - x__success = 0; end + x__success = 0; if (isempty (lasterr ())) error ('empty error text, probably Ctrl-C --- aborting'); end diff --git a/inst/misc/test/stk_test_class.m b/inst/misc/test/stk_test_class.m index f7cc800..61c600a 100644 --- a/inst/misc/test/stk_test_class.m +++ b/inst/misc/test/stk_test_class.m @@ -1,4 +1,8 @@ -% STK_TEST_CLASS is a unit test that any STK class should pass +% STK_TEST_CLASS [STK internal] +% +% INTERNAL FUNCTION WARNING: +% This function is considered as internal: API-breaking changes are +% likely to happen in future releases. Please don't rely on it. % Copyright Notice % @@ -11,7 +15,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/test/stk_test_critgrad.m b/inst/misc/test/stk_test_critgrad.m new file mode 100644 index 0000000..cbe5408 --- /dev/null +++ b/inst/misc/test/stk_test_critgrad.m @@ -0,0 +1,171 @@ +% STK_TEST_CRITGRAD [STK internal] +% +% INTERNAL FUNCTION WARNING: +% This function is considered as internal: API-breaking changes are +% likely to happen in future releases. Please don't rely on it. + +% Copyright Notice +% +% Copyright (C) 2021 CentraleSupelec +% +% Author: Julien Bect <julien.bect@centralesupelec.fr> + +% Copying Permission Statement +% +% This file is part of +% +% STK: a Small (Matlab/Octave) Toolbox for Kriging +% (https://github.com/stk-kriging/stk/) +% +% STK is free software: you can redistribute it and/or modify it under +% the terms of the GNU General Public License as published by the Free +% Software Foundation, either version 3 of the License, or (at your +% option) any later version. +% +% STK is distributed in the hope that it will be useful, but WITHOUT +% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +% License for more details. +% +% You should have received a copy of the GNU General Public License +% along with STK. If not, see <http://www.gnu.org/licenses/>. + +function ok = stk_test_critgrad (criterion, model, x, z, diff, delta0) + +% Tolerances +TOL_CRIT_VAL = 1e-12; +TOL_CRIT_DERIV = 1e-5; +TOL_RSQUARED = 1e-4; + +% Number evaluation points in the parameter space +q = 4; grid_size = 2 * q + 1; + +% Current vector of model parameters +v = stk_get_optimizable_model_parameters (model); + +% Current value of the parameter of interest +p0 = v(diff); + +% Evaluation grid +p = linspace (p0 - delta0, p0 + delta0, grid_size); + +% Evaluate the criterion on the grid +crit_val = zeros (grid_size, 1); +for k = 1:grid_size + v(diff) = p(k); + m = stk_set_optimizable_model_parameters (model, v); + if k == q + 1 + [crit_val(k), crit_deriv] = criterion (m, x, z); + else + crit_val(k) = criterion (m, x, z); + end +end + +% Regressors for a quadratic model +H1 = ones (2 * q + 1, 1); +H2 = (p - p0)'; +H3 = (p - p0)' .^ 2; +H = [H1 H2 H3]; + +% Ordinary least squares +beta = H \ crit_val; + +% Root-mean-square error +mse = mean ((crit_val - H * beta) .^ 2); +rmse = sqrt (mse); + +% Coefficient of determination +rsquared = 1 - mse / (mean ((crit_val - mean (crit_val)) .^ 2)); + +% Function values +crit_val1 = crit_val(q+1); +crit_val2 = beta(1); +crit_vald = crit_val1 - crit_val2; + +% Relative error on function value +if crit_vald == 0 + crit_val_err = 0.0; +else + crit_val_err = crit_vald / (max (abs (crit_val1), abs (crit_val2))); +end + +% Relative error on the partial derivative +crit_deriv1 = crit_deriv(diff); +crit_deriv2 = beta(2); +crit_derivd = crit_deriv1 - crit_deriv2; + +% Relative error on function value +if crit_derivd == 0 + crit_deriv_err = 0.0; +else + crit_deriv_err = crit_derivd / (max (abs (crit_deriv1), abs (crit_deriv2))); +end + +ok0 = rsquared > (1 - TOL_RSQUARED); +ok1 = (abs (crit_val_err) < TOL_CRIT_VAL); +ok2 = (abs (crit_deriv_err) < TOL_CRIT_DERIV); + +if nargout == 0 % Display outputs + + pp = linspace (min (p), max (p), 50); + ff = beta(1) + beta(2) * (pp - p0) + beta(3) * (pp - p0) .^ 2; + + figure; + plot (p, crit_val, 'dk--'); hold on; + plot (p0, crit_val(q + 1), 'ro', ... + 'MarkerFaceColor', 'y', 'MarkerSize', 10); + plot (pp, ff, 'r--'); + stk_labels (sprintf ('param(%d)', diff), 'ALL'); + set (gcf, 'Name', sprintf ('Check %s gradient wrt #%d', ... + func2str (criterion), diff)); + + fprintf ('~~~ Checking gradient for parameter #%d of %s ~~~\n', ... + diff, func2str (criterion)); + if stk_disp_isloose (), fprintf ('|\n'); end + + % Function values + fprintf ('| * function value:\n'); + fprintf ('| o computed: %+.6e\n', crit_val1); + fprintf ('| o regression: %+.6e\n', crit_val2); + fprintf ('| o difference: %+.6e\n', crit_vald); + fprintf ('| o relative error: %+.6e [TOL = %.1e, %s]\n', ... + crit_val_err, TOL_CRIT_VAL, ok_str (ok1)); + if stk_disp_isloose (), fprintf ('|\n'); end + + % Partial derivative + fprintf ('| * partial derivative:\n'); + fprintf ('| o computed: %+.6e\n', crit_deriv1); + fprintf ('| o regression: %+.6e\n', crit_deriv2); + fprintf ('| o difference: %+.6e\n', crit_derivd); + fprintf ('| o relative error: %+.6e [TOL = %.1e, %s]\n', ... + crit_deriv_err, TOL_CRIT_DERIV, ok_str (ok2)); + if stk_disp_isloose (), fprintf ('|\n'); end + + % Numerical noise + fprintf ('| * error (numerical noise or deviation from quadratic model ?)\n'); + fprintf ('| o RMSE: %.5e\n', rmse); + fprintf ('| o R^2: %.5f [TOL = %.1e, %s]\n', ... + rsquared, TOL_RSQUARED, ok_str (ok0)); + + if stk_disp_isloose () + fprintf ('|\n\n'); + end + +else + + ok = ok1 & ok2; + +end + +end % function + + +function s = ok_str (b) + +if b + s = 'OK'; +else + s = 'NOT OK'; +end + +end diff --git a/inst/misc/test/stk_test_dfbinaryop.m b/inst/misc/test/stk_test_dfbinaryop.m index 8e5880f..bd70fe8 100644 --- a/inst/misc/test/stk_test_dfbinaryop.m +++ b/inst/misc/test/stk_test_dfbinaryop.m @@ -1,4 +1,8 @@ -% STK_TEST_DFBINARYOP ... +% STK_TEST_DFBINARYOP [STK internal] +% +% INTERNAL FUNCTION WARNING: +% This function is considered as internal: API-breaking changes are +% likely to happen in future releases. Please don't rely on it. % Copyright Notice % @@ -11,7 +15,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/text/stk_disp_examplewelcome.m b/inst/misc/text/stk_disp_examplewelcome.m index 79ecba1..fde7ed0 100644 --- a/inst/misc/text/stk_disp_examplewelcome.m +++ b/inst/misc/text/stk_disp_examplewelcome.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/text/stk_disp_getformat.m b/inst/misc/text/stk_disp_getformat.m index 1de8a92..39e515f 100644 --- a/inst/misc/text/stk_disp_getformat.m +++ b/inst/misc/text/stk_disp_getformat.m @@ -13,16 +13,16 @@ % Copyright Notice % -% Copyright (C) 2017 CentraleSupelec +% Copyright (C) 2017, 2021 CentraleSupelec % -% Authors: Julien Bect <julien.bect@centralesupelec.fr> +% Author: Julien Bect <julien.bect@centralesupelec.fr> % Copying Permission Statement % % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -103,7 +103,7 @@ catch try - [fmt, spc] = format (); %#ok<ASGLU> CG#07 + [~, spc] = format (); assert (ismember (spc, {'compact', 'loose'})); method = 3; diff --git a/inst/misc/text/stk_disp_isloose.m b/inst/misc/text/stk_disp_isloose.m index 90a1e8e..8e9a1fd 100644 --- a/inst/misc/text/stk_disp_isloose.m +++ b/inst/misc/text/stk_disp_isloose.m @@ -15,7 +15,7 @@ % Copyright Notice % -% Copyright (C) 2017 CentraleSupelec +% Copyright (C) 2017, 2021 CentraleSupelec % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -24,7 +24,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -41,7 +41,7 @@ function b = stk_disp_isloose () -[fmt, spc] = stk_disp_getformat (); %#ok<ASGLU> CG#07 +[~, spc] = stk_disp_getformat (); b = strcmp (spc, 'loose'); diff --git a/inst/misc/text/stk_disp_progress.m b/inst/misc/text/stk_disp_progress.m index 3996382..bd10ffa 100644 --- a/inst/misc/text/stk_disp_progress.m +++ b/inst/misc/text/stk_disp_progress.m @@ -21,7 +21,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/text/stk_sprintf_colvect.m b/inst/misc/text/stk_sprintf_colvect.m index a2b2c8a..1f3284a 100644 --- a/inst/misc/text/stk_sprintf_colvect.m +++ b/inst/misc/text/stk_sprintf_colvect.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/text/stk_sprintf_colvect_fixedpoint.m b/inst/misc/text/stk_sprintf_colvect_fixedpoint.m index bea7794..2688b9c 100644 --- a/inst/misc/text/stk_sprintf_colvect_fixedpoint.m +++ b/inst/misc/text/stk_sprintf_colvect_fixedpoint.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/text/stk_sprintf_colvect_scientific.m b/inst/misc/text/stk_sprintf_colvect_scientific.m index 579574f..3d6ac7f 100644 --- a/inst/misc/text/stk_sprintf_colvect_scientific.m +++ b/inst/misc/text/stk_sprintf_colvect_scientific.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/text/stk_sprintf_framed.m b/inst/misc/text/stk_sprintf_framed.m index 91b5d68..7896e52 100644 --- a/inst/misc/text/stk_sprintf_framed.m +++ b/inst/misc/text/stk_sprintf_framed.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_/cat.m b/inst/model/@stk_model_/cat.m index 944b359..f6a8d14 100644 --- a/inst/model/@stk_model_/cat.m +++ b/inst/model/@stk_model_/cat.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_/disp.m b/inst/model/@stk_model_/disp.m index 08ce46f..77445ca 100644 --- a/inst/model/@stk_model_/disp.m +++ b/inst/model/@stk_model_/disp.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_/display.m b/inst/model/@stk_model_/display.m index 1f1564c..d887827 100644 --- a/inst/model/@stk_model_/display.m +++ b/inst/model/@stk_model_/display.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_/get.m b/inst/model/@stk_model_/get.m index 964fe66..6856be8 100644 --- a/inst/model/@stk_model_/get.m +++ b/inst/model/@stk_model_/get.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_/horzcat.m b/inst/model/@stk_model_/horzcat.m index 39447d1..53cdad4 100644 --- a/inst/model/@stk_model_/horzcat.m +++ b/inst/model/@stk_model_/horzcat.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_/set.m b/inst/model/@stk_model_/set.m index fcc38cc..85c0c9e 100644 --- a/inst/model/@stk_model_/set.m +++ b/inst/model/@stk_model_/set.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_/stk_covmat_noise.m b/inst/model/@stk_model_/stk_covmat_noise.m index 7606211..8df0eca 100644 --- a/inst/model/@stk_model_/stk_covmat_noise.m +++ b/inst/model/@stk_model_/stk_covmat_noise.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_/stk_get_input_data.m b/inst/model/@stk_model_/stk_get_input_data.m index 5bb5915..f33e699 100644 --- a/inst/model/@stk_model_/stk_get_input_data.m +++ b/inst/model/@stk_model_/stk_get_input_data.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2018 CentraleSupelec +% Copyright (C) 2018, 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -28,9 +28,7 @@ function input_data = stk_get_input_data (model) %#ok<INUSD> -% DESIGN NOTE: all model classes derived from stk_model_ are considered -% as prior models unless they overload stk_get_prior_model, stk_get_input_data -% stk_get_output_data and stk_get_observation_variances. +% DESIGN NOTE: cf. stk_get_prior_model.m % FIXME: size should be 0 x input_dim diff --git a/inst/model/@stk_model_/stk_get_observation_variances.m b/inst/model/@stk_model_/stk_get_observation_variances.m index 7fe6d61..3ba4ad2 100644 --- a/inst/model/@stk_model_/stk_get_observation_variances.m +++ b/inst/model/@stk_model_/stk_get_observation_variances.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2018 CentraleSupelec +% Copyright (C) 2018, 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -28,9 +28,7 @@ function v = stk_get_observation_variances (model) %#ok<INUSD> -% DESIGN NOTE: all model classes derived from stk_model_ are considered -% as prior models unless they overload stk_get_prior_model, stk_get_input_data -% stk_get_output_data and stk_get_observation_variances. +% DESIGN NOTE: cf. stk_get_prior_model.m v = []; diff --git a/inst/model/@stk_model_/stk_get_output_data.m b/inst/model/@stk_model_/stk_get_output_data.m index f4ae2ab..ec7aa8d 100644 --- a/inst/model/@stk_model_/stk_get_output_data.m +++ b/inst/model/@stk_model_/stk_get_output_data.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2018 CentraleSupelec +% Copyright (C) 2018, 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -28,9 +28,7 @@ function output_data = stk_get_output_data (model) %#ok<INUSD> -% DESIGN NOTE: all model classes derived from stk_model_ are considered -% as prior models unless they overload stk_get_prior_model, stk_get_input_data -% stk_get_output_data and stk_get_observation_variances. +% DESIGN NOTE: cf. stk_get_prior_model.m output_data = zeros (0, 1); diff --git a/inst/model/@stk_model_/stk_get_prior_model.m b/inst/model/@stk_model_/stk_get_prior_model.m index b78a547..f83f784 100644 --- a/inst/model/@stk_model_/stk_get_prior_model.m +++ b/inst/model/@stk_model_/stk_get_prior_model.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2018 CentraleSupelec +% Copyright (C) 2018, 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -30,7 +30,7 @@ function prior_model = stk_get_prior_model (model) % DESIGN NOTE: all model classes derived from stk_model_ are considered % as prior models unless they overload stk_get_prior_model, stk_get_input_data -% stk_get_output_data and stk_get_observation_variances. +% stk_get_output_data, stk_get_sample_size and stk_get_observation_variances. prior_model = model; diff --git a/inst/model/@stk_model_gpposterior/get_prior_model.m b/inst/model/@stk_model_/stk_get_sample_size.m index 76c662f..7d5a6b1 100644 --- a/inst/model/@stk_model_gpposterior/get_prior_model.m +++ b/inst/model/@stk_model_/stk_get_sample_size.m @@ -1,8 +1,8 @@ -% GET_PRIOR_MODEL [deprecated] +% STK_GET_SAMPLE_SIZE [overload STK function] % Copyright Notice % -% Copyright (C) 2016 CentraleSupelec +% Copyright (C) 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -26,8 +26,10 @@ % You should have received a copy of the GNU General Public License % along with STK. If not, see <http://www.gnu.org/licenses/>. -function prior_model = get_prior_model (model) +function n = stk_get_sample_size (model) -prior_model = model.prior_model; +% DESIGN NOTE: cf. stk_get_prior_model.m + +n = 0; end % function diff --git a/inst/model/@stk_model_/stk_model_.m b/inst/model/@stk_model_/stk_model_.m index 34cddff..dfd774c 100644 --- a/inst/model/@stk_model_/stk_model_.m +++ b/inst/model/@stk_model_/stk_model_.m @@ -19,7 +19,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/misc/mole/isrow/isrow.m b/inst/model/@stk_model_/stk_predict_.m index 2b1b1b5..5b9e175 100644 --- a/inst/misc/mole/isrow/isrow.m +++ b/inst/model/@stk_model_/stk_predict_.m @@ -1,8 +1,10 @@ -% ISROW returns true for row vectors and false otherwise +% STK_PREDICT_ [STK internal] +% +% See also: stk_predict % Copyright Notice % -% Copyright (C) 2014 SUPELEC +% Copyright (C) 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -26,9 +28,9 @@ % You should have received a copy of the GNU General Public License % along with STK. If not, see <http://www.gnu.org/licenses/>. -function b = isrow (x) +function [zp, lambda, mu, K] = stk_predict_ (model, xt) %#ok<STOUT,INUSD> -n = length (x); -b = isequal (size (x), [1 n]); +stk_error (sprintf (['stk_predict_ is not implemented for models of ' ... + 'class %s.'], class (model)), 'NotImplemented'); end % function diff --git a/inst/model/@stk_model_/subsasgn.m b/inst/model/@stk_model_/subsasgn.m index 33b46e8..20a887f 100644 --- a/inst/model/@stk_model_/subsasgn.m +++ b/inst/model/@stk_model_/subsasgn.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_/subsref.m b/inst/model/@stk_model_/subsref.m index 7f95b39..aa363a6 100644 --- a/inst/model/@stk_model_/subsref.m +++ b/inst/model/@stk_model_/subsref.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_/vertcat.m b/inst/model/@stk_model_/vertcat.m index 8988e8e..141bc17 100644 --- a/inst/model/@stk_model_/vertcat.m +++ b/inst/model/@stk_model_/vertcat.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_gpposterior/disp.m b/inst/model/@stk_model_gpposterior/disp.m index 505256c..7f6b1cd 100644 --- a/inst/model/@stk_model_gpposterior/disp.m +++ b/inst/model/@stk_model_gpposterior/disp.m @@ -2,16 +2,16 @@ % Copyright Notice % -% Copyright (C) 2015-2017 CentraleSupelec +% Copyright (C) 2015-2017, 2020 CentraleSupelec % -% Authors: Julien Bect <julien.bect@centralesupelec.fr> +% Author: Julien Bect <julien.bect@centralesupelec.fr> % Copying Permission Statement % % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -46,19 +46,16 @@ else str_prior_model = ['<' stk_sprintf_sizetype(model.prior_model) '>']; end -if size (model.input_data, 1) == 0 +if stk_get_sample_size (model) == 0 str_input_data = '--'; -else - str_input_data = ['<' stk_sprintf_sizetype(model.input_data) '>']; -end - -if size (model.output_data, 1) == 0 str_output_data = '--'; else + str_input_data = ['<' stk_sprintf_sizetype(model.input_data) '>']; str_output_data = ['<' stk_sprintf_sizetype(model.output_data) '>']; end fprintf ('| prior_model: %s\n', str_prior_model); +fprintf ('| sample_size: %d\n', stk_get_sample_size (model)); fprintf ('| input_data: %s\n', str_input_data); fprintf ('| output_data: %s\n', str_output_data); diff --git a/inst/model/@stk_model_gpposterior/fieldnames.m b/inst/model/@stk_model_gpposterior/fieldnames.m index add9b1c..9fc7dca 100644 --- a/inst/model/@stk_model_gpposterior/fieldnames.m +++ b/inst/model/@stk_model_gpposterior/fieldnames.m @@ -2,6 +2,7 @@ % Copyright Notice % +% Copyright (C) 2020 CentraleSupelec % Copyright (C) 2016 SUPELEC % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -28,7 +29,7 @@ function fn = fieldnames (model) -fn = {'prior_model'; 'input_data'; 'output_data'}; +fn = {'prior_model'; 'sample_size'; 'input_data'; 'output_data'}; % Note: kreq is a 'hidden' field that might change in future versions of STK, % we don't want ordinary users to see it diff --git a/inst/model/@stk_model_gpposterior/get.m b/inst/model/@stk_model_gpposterior/get.m index fd6d3b7..be3e1f4 100644 --- a/inst/model/@stk_model_gpposterior/get.m +++ b/inst/model/@stk_model_gpposterior/get.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2015, 2016 CentraleSupelec +% Copyright (C) 2015, 2016, 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -34,6 +34,9 @@ switch propname % rem: kreq is a hidden property value = model.(propname); + case 'sample_size' + value = size (model.input_data, 1); + otherwise if ~ ischar (propname) errmsg = 'Invalid property name.'; @@ -52,7 +55,7 @@ end % function %!shared M_post %! x_obs = (linspace (0, pi, 15))'; %! z_obs = sin (x_obs); -%! M_prior = stk_model ('stk_materncov32_iso'); +%! M_prior = stk_model (@stk_materncov32_iso); %! M_prior.param = log ([1.0; 2.1]); %! M_post = stk_model_gpposterior (M_prior, x_obs, z_obs); diff --git a/inst/model/@stk_model_gpposterior/set.m b/inst/model/@stk_model_gpposterior/set.m index b93aac2..9e583d8 100644 --- a/inst/model/@stk_model_gpposterior/set.m +++ b/inst/model/@stk_model_gpposterior/set.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -66,7 +66,7 @@ end % function %!shared M_post %! x_obs = (linspace (0, pi, 15))'; %! z_obs = sin (x_obs); -%! M_prior = stk_model ('stk_materncov32_iso'); +%! M_prior = stk_model (@stk_materncov32_iso); %! M_prior.param = log ([1.0; 2.1]); %! M_post = stk_model_gpposterior (M_prior, x_obs, z_obs); diff --git a/inst/model/@stk_model_gpposterior/stk_covmat_noise.m b/inst/model/@stk_model_gpposterior/stk_covmat_noise.m index 71fe4c2..fdeed75 100644 --- a/inst/model/@stk_model_gpposterior/stk_covmat_noise.m +++ b/inst/model/@stk_model_gpposterior/stk_covmat_noise.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_gpposterior/stk_generate_samplepaths.m b/inst/model/@stk_model_gpposterior/stk_generate_samplepaths.m index 3af2da1..1513cdd 100644 --- a/inst/model/@stk_model_gpposterior/stk_generate_samplepaths.m +++ b/inst/model/@stk_model_gpposterior/stk_generate_samplepaths.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_gpposterior/stk_get_input_data.m b/inst/model/@stk_model_gpposterior/stk_get_input_data.m index fea78a7..b195cda 100644 --- a/inst/model/@stk_model_gpposterior/stk_get_input_data.m +++ b/inst/model/@stk_model_gpposterior/stk_get_input_data.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_gpposterior/stk_get_observation_variances.m b/inst/model/@stk_model_gpposterior/stk_get_observation_variances.m index 12efbeb..db98c5f 100644 --- a/inst/model/@stk_model_gpposterior/stk_get_observation_variances.m +++ b/inst/model/@stk_model_gpposterior/stk_get_observation_variances.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_gpposterior/stk_get_optimizable_noise_parameters.m b/inst/model/@stk_model_gpposterior/stk_get_optimizable_noise_parameters.m index c26f57f..16c15ee 100644 --- a/inst/model/@stk_model_gpposterior/stk_get_optimizable_noise_parameters.m +++ b/inst/model/@stk_model_gpposterior/stk_get_optimizable_noise_parameters.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_gpposterior/stk_get_optimizable_parameters.m b/inst/model/@stk_model_gpposterior/stk_get_optimizable_parameters.m index 6b3931f..b47b324 100644 --- a/inst/model/@stk_model_gpposterior/stk_get_optimizable_parameters.m +++ b/inst/model/@stk_model_gpposterior/stk_get_optimizable_parameters.m @@ -10,7 +10,7 @@ % Copyright Notice % -% Copyright (C) 2018 CentraleSupelec +% Copyright (C) 2018, 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -19,7 +19,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -36,6 +36,6 @@ function value = stk_get_optimizable_parameters (model) -value = stk_get_optimizable_parameters (model.prior); +value = stk_get_optimizable_parameters (model.prior_model); end % function diff --git a/inst/model/@stk_model_gpposterior/stk_get_output_data.m b/inst/model/@stk_model_gpposterior/stk_get_output_data.m index 5f4efc8..c7877db 100644 --- a/inst/model/@stk_model_gpposterior/stk_get_output_data.m +++ b/inst/model/@stk_model_gpposterior/stk_get_output_data.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_gpposterior/stk_get_prior_model.m b/inst/model/@stk_model_gpposterior/stk_get_prior_model.m index 788c8e5..25717ab 100644 --- a/inst/model/@stk_model_gpposterior/stk_get_prior_model.m +++ b/inst/model/@stk_model_gpposterior/stk_get_prior_model.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_gpposterior/get_input_data.m b/inst/model/@stk_model_gpposterior/stk_get_sample_size.m index 287960c..a6d5255 100644 --- a/inst/model/@stk_model_gpposterior/get_input_data.m +++ b/inst/model/@stk_model_gpposterior/stk_get_sample_size.m @@ -1,8 +1,8 @@ -% GET_INTPUT_DATA [deprecated] +% STK_GET_SAMPLE_SIZE [overload STK function] % Copyright Notice % -% Copyright (C) 2015, 2016 CentraleSupelec +% Copyright (C) 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -26,8 +26,8 @@ % You should have received a copy of the GNU General Public License % along with STK. If not, see <http://www.gnu.org/licenses/>. -function input_data = get_input_data (model) +function n = stk_get_sample_size (model) -input_data = model.input_data; +n = size (model.input_data, 1); end % function diff --git a/inst/model/@stk_model_gpposterior/stk_isnoisy.m b/inst/model/@stk_model_gpposterior/stk_isnoisy.m index 4d824b1..00f92a4 100644 --- a/inst/model/@stk_model_gpposterior/stk_isnoisy.m +++ b/inst/model/@stk_model_gpposterior/stk_isnoisy.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_gpposterior/stk_make_kreq.m b/inst/model/@stk_model_gpposterior/stk_make_kreq.m index f1a5716..5252f29 100644 --- a/inst/model/@stk_model_gpposterior/stk_make_kreq.m +++ b/inst/model/@stk_model_gpposterior/stk_make_kreq.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/@stk_model_gpposterior/stk_model_gpposterior.m b/inst/model/@stk_model_gpposterior/stk_model_gpposterior.m index cd685de..1d27067 100644 --- a/inst/model/@stk_model_gpposterior/stk_model_gpposterior.m +++ b/inst/model/@stk_model_gpposterior/stk_model_gpposterior.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -125,7 +125,7 @@ end % function %! x_obs = (linspace (0, pi, 15))'; %! z_obs = sin (x_obs); %! -%! M_prior = stk_model ('stk_materncov32_iso'); +%! M_prior = stk_model (@stk_materncov32_iso); %! M_prior.param = log ([1.0; 2.1]); %!test M_post = stk_model_gpposterior (); diff --git a/inst/model/@stk_model_gpposterior/stk_model_update.m b/inst/model/@stk_model_gpposterior/stk_model_update.m index 4d19171..3e9c952 100644 --- a/inst/model/@stk_model_gpposterior/stk_model_update.m +++ b/inst/model/@stk_model_gpposterior/stk_model_update.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2016 CentraleSupelec +% Copyright (C) 2016, 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -28,6 +28,9 @@ function M = stk_model_update (M, x_new, z_new, lnv_new) +% FIXME: We should check in this function if prior_model.lognoisevariance +% is an object, because if it is, things will not work properly (as it is). + lnv_current = M.prior_model.lognoisevariance; if nargin < 4 % lnv not provided (homoscedastic case only) @@ -40,11 +43,11 @@ if nargin < 4 % lnv not provided (homoscedastic case only) 'new observations points X_NEW.']), 'NotEnoughInputArguments'); end - heteroscedastic = false; + oldstyle_heteroscedastic = false; elseif ~ isempty (lnv_new) % lnv provided (heteroscedastic case only) - if (size (M.input_data, 1) ~= 1) && (isscalar (lnv_current)) + if (stk_get_sample_size (M) ~= 1) && (isscalar (lnv_current)) if lnv_current == -inf s1 = 'a noiseless'; s2 = 'noiseless'; @@ -62,17 +65,19 @@ elseif ~ isempty (lnv_new) % lnv provided (heteroscedastic case only) % Make sure that lnv is a column vector lnv_new = lnv_new(:); - heteroscedastic = true; + oldstyle_heteroscedastic = true; end M.input_data = [M.input_data; x_new]; M.output_data = [M.output_data; z_new]; -if heteroscedastic +% In the "old style" heteroscedastic case, we have a value of the noise +% variance provided for each observation, and thus lognoisevariance is a +% vector whose length equals the sample size. +if oldstyle_heteroscedastic M.prior_model.lognoisevariance = [lnv_current; lnv_new]; end -% FIXME: use @stk_kreq/stk_update ? M.kreq = stk_kreq_qr (M.prior_model, M.input_data); end % function @@ -80,7 +85,7 @@ end % function %!shared x_obs, z_obs, ref, M_prior, x_new, z_new, lnv_new %! [x_obs, z_obs, ref] = stk_dataset_twobumps ('noisy2'); -%! M_prior = stk_model ('stk_materncov52_iso'); +%! M_prior = stk_model (@stk_materncov52_iso); %! M_prior.param = [-0.15; 0.38]; %! M_prior.lognoisevariance = 2 * log (ref.noise_std); %! x_new = [-0.79; -0.79]; diff --git a/inst/model/@stk_model_gpposterior/stk_predict.m b/inst/model/@stk_model_gpposterior/stk_predict_.m index 78c8ee2..25c0a33 100644 --- a/inst/model/@stk_model_gpposterior/stk_predict.m +++ b/inst/model/@stk_model_gpposterior/stk_predict_.m @@ -1,8 +1,8 @@ -% STK_PREDICT [overload STK function] +% STK_PREDICT_ [STK internal] % Copyright Notice % -% Copyright (C) 2015-2018 CentraleSupelec +% Copyright (C) 2015-2018, 2020 CentraleSupelec % Copyright (C) 2011-2014 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -28,7 +28,7 @@ % You should have received a copy of the GNU General Public License % along with STK. If not, see <http://www.gnu.org/licenses/>. -function [zp, lambda, mu, K] = stk_predict (M_post, xt) +function [zp, lambda, mu, K] = stk_predict_ (M_post, xt) % TODO: these should become options block_size = []; @@ -70,7 +70,7 @@ end %--- Choose nb_blocks & block_size --------------------------------------------- -n_obs = size (M_post.input_data, 1); +n_obs = stk_get_sample_size (M_post); if isempty (block_size) MAX_RS_SIZE = 5e6; SIZE_OF_DOUBLE = 8; % in bytes @@ -209,7 +209,7 @@ end % function %! z_obs = sin (x_obs); %! x_prd = x0(idx_prd); %! -%! M_prior = stk_model ('stk_materncov32_iso'); +%! M_prior = stk_model (@stk_materncov32_iso); %! M_prior.param = log ([1.0; 2.1]); %! %! M_post = stk_model_gpposterior (M_prior, x_obs, z_obs); @@ -243,13 +243,13 @@ end % function %! assert (all (isnan (y_prd_nan.mean))); %!test % discrete model (prediction indices provided) -%! M_prior1 = stk_model ('stk_discretecov', M_prior, x0); +%! M_prior1 = stk_model (@stk_discretecov, M_prior, x0); %! M_post1 = stk_model_gpposterior (M_prior1, idx_obs, z_obs); %! y_prd1 = stk_predict (M_post1, idx_prd); %! assert (stk_isequal_tolrel (y_prd, y_prd1)); %!test % discrete model (prediction indices *not* provided) -%! M_prior1 = stk_model ('stk_discretecov', M_prior, x0); +%! M_prior1 = stk_model (@stk_discretecov, M_prior, x0); %! M_post1 = stk_model_gpposterior (M_prior1, idx_obs, z_obs); %! y_prd1 = stk_predict (M_post1, []); % predict them all! %! assert (stk_isequal_tolrel (y_prd, y_prd1(idx_prd, :))); diff --git a/inst/model/@stk_model_gpposterior/stk_predict_leaveoneout.m b/inst/model/@stk_model_gpposterior/stk_predict_leaveoneout.m index 479077f..94dbee1 100644 --- a/inst/model/@stk_model_gpposterior/stk_predict_leaveoneout.m +++ b/inst/model/@stk_model_gpposterior/stk_predict_leaveoneout.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -65,7 +65,7 @@ if nargout ~= 1 % Compute normalized residual % norm_res = (zi - zp_mean) ./ (sqrt (noisevariance + zp_var)); - norm_res = (sqrt (dR)) .* raw_res; + norm_res = (sqrt (max (0, dR))) .* raw_res; % Pack results into a dataframe LOO_res = stk_dataframe (horzcat (raw_res, norm_res), ... @@ -97,7 +97,7 @@ end % function %! for j = 0:2 %! for k = 1:(length (lm_list)) %! -%! model = stk_model ('stk_materncov32_iso', d); +%! model = stk_model (@stk_materncov32_iso, d); %! model.lm = lm_list{k}; %! model.param = log ([1; 5]); %! diff --git a/inst/model/@stk_model_gpposterior/stk_predict_leaveoneout_direct.m b/inst/model/@stk_model_gpposterior/stk_predict_leaveoneout_direct.m index 2ad121c..b994b36 100644 --- a/inst/model/@stk_model_gpposterior/stk_predict_leaveoneout_direct.m +++ b/inst/model/@stk_model_gpposterior/stk_predict_leaveoneout_direct.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2016-2018 CentraleSupelec +% Copyright (C) 2016-2018, 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> % Stefano Duhamel <stefano.duhamel@supelec.fr> @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -32,7 +32,7 @@ function [LOO_pred, LOO_res] = stk_predict_leaveoneout_direct (M_post) % Heteroscedatic noise ? heteroscedastic = ~ isscalar (M_post.prior_model.lognoisevariance); -n = size (M_post.input_data, 1); +n = stk_get_sample_size (M_post); zp_mean = zeros (n, 1); zp_var = zeros (n, 1); diff --git a/inst/model/@stk_model_gpposterior/stk_set_optimizable_parameters.m b/inst/model/@stk_model_gpposterior/stk_set_optimizable_parameters.m index fc40b8a..0f003f1 100644 --- a/inst/model/@stk_model_gpposterior/stk_set_optimizable_parameters.m +++ b/inst/model/@stk_model_gpposterior/stk_set_optimizable_parameters.m @@ -10,7 +10,7 @@ % Copyright Notice % -% Copyright (C) 2018 CentraleSupelec +% Copyright (C) 2018, 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -19,7 +19,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -36,6 +36,6 @@ function model = stk_set_optimizable_parameters (model, value) -model.prior = stk_set_optimizable_parameters (model.prior, value); +model.prior_model = stk_set_optimizable_parameters (model.prior_model, value); end % function diff --git a/inst/model/noise/@stk_gaussiannoise_/disp.m b/inst/model/noise/@stk_gaussiannoise_/disp.m index 2167e99..7a91149 100644 --- a/inst/model/noise/@stk_gaussiannoise_/disp.m +++ b/inst/model/noise/@stk_gaussiannoise_/disp.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/noise/@stk_gaussiannoise_/stk_covmat.m b/inst/model/noise/@stk_gaussiannoise_/stk_covmat.m index bad0727..2326433 100644 --- a/inst/model/noise/@stk_gaussiannoise_/stk_covmat.m +++ b/inst/model/noise/@stk_gaussiannoise_/stk_covmat.m @@ -15,7 +15,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/noise/@stk_gaussiannoise_/stk_covmat_noise.m b/inst/model/noise/@stk_gaussiannoise_/stk_covmat_noise.m index 8b981c6..6d341ef 100644 --- a/inst/model/noise/@stk_gaussiannoise_/stk_covmat_noise.m +++ b/inst/model/noise/@stk_gaussiannoise_/stk_covmat_noise.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/noise/@stk_gaussiannoise_/stk_gaussiannoise_.m b/inst/model/noise/@stk_gaussiannoise_/stk_gaussiannoise_.m index b21bc0f..e0ef768 100644 --- a/inst/model/noise/@stk_gaussiannoise_/stk_gaussiannoise_.m +++ b/inst/model/noise/@stk_gaussiannoise_/stk_gaussiannoise_.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/noise/@stk_gaussiannoise_/stk_isnoisy.m b/inst/model/noise/@stk_gaussiannoise_/stk_isnoisy.m index 91576b5..410afdc 100644 --- a/inst/model/noise/@stk_gaussiannoise_/stk_isnoisy.m +++ b/inst/model/noise/@stk_gaussiannoise_/stk_isnoisy.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/noise/@stk_gaussiannoise_/stk_predict_.m b/inst/model/noise/@stk_gaussiannoise_/stk_predict_.m new file mode 100644 index 0000000..0d1f646 --- /dev/null +++ b/inst/model/noise/@stk_gaussiannoise_/stk_predict_.m @@ -0,0 +1,51 @@ +% STK_PREDICT_ [STK internal] +% +% See also: stk_predict + +% Copyright Notice +% +% Copyright (C) 2020 CentraleSupelec +% +% Author: Julien Bect <julien.bect@centralesupelec.fr> + +% Copying Permission Statement +% +% This file is part of +% +% STK: a Small (Matlab/Octave) Toolbox for Kriging +% (https://github.com/stk-kriging/stk/) +% +% STK is free software: you can redistribute it and/or modify it under +% the terms of the GNU General Public License as published by the Free +% Software Foundation, either version 3 of the License, or (at your +% option) any later version. +% +% STK is distributed in the hope that it will be useful, but WITHOUT +% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +% License for more details. +% +% You should have received a copy of the GNU General Public License +% along with STK. If not, see <http://www.gnu.org/licenses/>. + +function [zp, lambda, mu, K] = stk_predict_ (gn, xt) + +nt = stk_get_sample_size (xt); + +zp_mean = zeros (nt, 1); +zp_var = stk_variance_eval (gn, xt); +zp = stk_dataframe ([zp_mean zp_var], {'mean' 'var'}); + +if nargout > 1 + lambda = zeros (0, nt); + + if nargout > 2 + mu = zeros (0, nt); + + if nargout > 3 + K = diag (zp_var); + end + end +end + +end % function diff --git a/inst/model/noise/@stk_gaussiannoise_het0/disp.m b/inst/model/noise/@stk_gaussiannoise_het0/disp.m index 5b132a2..d1eacc2 100644 --- a/inst/model/noise/@stk_gaussiannoise_het0/disp.m +++ b/inst/model/noise/@stk_gaussiannoise_het0/disp.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/noise/@stk_gaussiannoise_het0/fieldnames.m b/inst/model/noise/@stk_gaussiannoise_het0/fieldnames.m index 691de35..b753172 100644 --- a/inst/model/noise/@stk_gaussiannoise_het0/fieldnames.m +++ b/inst/model/noise/@stk_gaussiannoise_het0/fieldnames.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/noise/@stk_gaussiannoise_het0/get.m b/inst/model/noise/@stk_gaussiannoise_het0/get.m index df019b2..905dbf9 100644 --- a/inst/model/noise/@stk_gaussiannoise_het0/get.m +++ b/inst/model/noise/@stk_gaussiannoise_het0/get.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/noise/@stk_gaussiannoise_het0/set.m b/inst/model/noise/@stk_gaussiannoise_het0/set.m index bf7821c..ee76002 100644 --- a/inst/model/noise/@stk_gaussiannoise_het0/set.m +++ b/inst/model/noise/@stk_gaussiannoise_het0/set.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -56,7 +56,7 @@ end % function %!shared M_post %! x_obs = (linspace (0, pi, 15))'; %! z_obs = sin (x_obs); -%! M_prior = stk_model ('stk_materncov32_iso'); +%! M_prior = stk_model (@stk_materncov32_iso); %! M_prior.param = log ([1.0; 2.1]); %! M_post = stk_model_gpposterior (M_prior, x_obs, z_obs); diff --git a/inst/model/noise/@stk_gaussiannoise_het0/stk_gaussiannoise_het0.m b/inst/model/noise/@stk_gaussiannoise_het0/stk_gaussiannoise_het0.m index 6d4cb47..555ba51 100644 --- a/inst/model/noise/@stk_gaussiannoise_het0/stk_gaussiannoise_het0.m +++ b/inst/model/noise/@stk_gaussiannoise_het0/stk_gaussiannoise_het0.m @@ -29,7 +29,7 @@ % Copyright Notice % -% Copyright (C) 2018, 2019 CentraleSupelec +% Copyright (C) 2018-2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -38,7 +38,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -57,6 +57,10 @@ function gn = stk_gaussiannoise_het0 (variance_function, dispersion) if (nargin < 2) || (isempty (dispersion)) log_dispersion = nan; % must be estimated + + if nargin == 0 + variance_function = @(x) 1.0; + end else log_dispersion = log (dispersion); end diff --git a/inst/model/noise/@stk_gaussiannoise_het0/stk_get_optimizable_parameters.m b/inst/model/noise/@stk_gaussiannoise_het0/stk_get_optimizable_parameters.m index 3eb1c2e..ac84730 100644 --- a/inst/model/noise/@stk_gaussiannoise_het0/stk_get_optimizable_parameters.m +++ b/inst/model/noise/@stk_gaussiannoise_het0/stk_get_optimizable_parameters.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/noise/@stk_gaussiannoise_het0/stk_param_getdefaultbounds.m b/inst/model/noise/@stk_gaussiannoise_het0/stk_param_getdefaultbounds.m index ac945f8..b2ebf18 100644 --- a/inst/model/noise/@stk_gaussiannoise_het0/stk_param_getdefaultbounds.m +++ b/inst/model/noise/@stk_gaussiannoise_het0/stk_param_getdefaultbounds.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/noise/@stk_gaussiannoise_het0/stk_set_optimizable_parameters.m b/inst/model/noise/@stk_gaussiannoise_het0/stk_set_optimizable_parameters.m index f104234..6c2b61b 100644 --- a/inst/model/noise/@stk_gaussiannoise_het0/stk_set_optimizable_parameters.m +++ b/inst/model/noise/@stk_gaussiannoise_het0/stk_set_optimizable_parameters.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/noise/@stk_gaussiannoise_het0/stk_variance_eval.m b/inst/model/noise/@stk_gaussiannoise_het0/stk_variance_eval.m index 73ff871..ced356f 100644 --- a/inst/model/noise/@stk_gaussiannoise_het0/stk_variance_eval.m +++ b/inst/model/noise/@stk_gaussiannoise_het0/stk_variance_eval.m @@ -27,7 +27,7 @@ % Copyright Notice % -% Copyright (C) 2018 CentraleSupelec +% Copyright (C) 2018, 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -36,7 +36,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -60,7 +60,12 @@ switch diff case {-1, 1} % -1 means "no derivative" % +1 means "derivative wrt log_dispersion" - v = exp (gn.log_dispersion) * feval (gn.variance_function, double (x)); + if isempty (x) + v = zeros (0, 1); + else + v = exp (gn.log_dispersion) ... + * feval (gn.variance_function, double (x)); + end otherwise stk_error ('diff should be either -1 or +1', 'IncorrectArgument'); end diff --git a/inst/model/prior_struct/@struct/get_input_data.m b/inst/model/prior_struct/@struct/get_input_data.m deleted file mode 100644 index 83cccd7..0000000 --- a/inst/model/prior_struct/@struct/get_input_data.m +++ /dev/null @@ -1,33 +0,0 @@ -% GET_INTPUT_DATA [deprecated] - -% Copyright Notice -% -% Copyright (C) 2018 CentraleSupelec -% -% Author: Julien Bect <julien.bect@centralesupelec.fr> - -% Copying Permission Statement -% -% This file is part of -% -% STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) -% -% STK is free software: you can redistribute it and/or modify it under -% the terms of the GNU General Public License as published by the Free -% Software Foundation, either version 3 of the License, or (at your -% option) any later version. -% -% STK is distributed in the hope that it will be useful, but WITHOUT -% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -% License for more details. -% -% You should have received a copy of the GNU General Public License -% along with STK. If not, see <http://www.gnu.org/licenses/>. - -function input_data = get_input_data (model) - -input_data = stk_get_input_data (model); - -end % function diff --git a/inst/model/prior_struct/@struct/get_output_data.m b/inst/model/prior_struct/@struct/get_output_data.m deleted file mode 100644 index b2e4243..0000000 --- a/inst/model/prior_struct/@struct/get_output_data.m +++ /dev/null @@ -1,33 +0,0 @@ -% GET_OUTPUT_DATA [deprecated] - -% Copyright Notice -% -% Copyright (C) 2018 CentraleSupelec -% -% Author: Julien Bect <julien.bect@centralesupelec.fr> - -% Copying Permission Statement -% -% This file is part of -% -% STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) -% -% STK is free software: you can redistribute it and/or modify it under -% the terms of the GNU General Public License as published by the Free -% Software Foundation, either version 3 of the License, or (at your -% option) any later version. -% -% STK is distributed in the hope that it will be useful, but WITHOUT -% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -% License for more details. -% -% You should have received a copy of the GNU General Public License -% along with STK. If not, see <http://www.gnu.org/licenses/>. - -function output_data = get_output_data (model) - -output_data = stk_get_output_data (model); - -end % function diff --git a/inst/model/prior_struct/@struct/get_prior_model.m b/inst/model/prior_struct/@struct/get_prior_model.m deleted file mode 100644 index c3629e7..0000000 --- a/inst/model/prior_struct/@struct/get_prior_model.m +++ /dev/null @@ -1,33 +0,0 @@ -% GET_PRIOR_MODEL [deprecated] - -% Copyright Notice -% -% Copyright (C) 2018 CentraleSupelec -% -% Author: Julien Bect <julien.bect@centralesupelec.fr> - -% Copying Permission Statement -% -% This file is part of -% -% STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) -% -% STK is free software: you can redistribute it and/or modify it under -% the terms of the GNU General Public License as published by the Free -% Software Foundation, either version 3 of the License, or (at your -% option) any later version. -% -% STK is distributed in the hope that it will be useful, but WITHOUT -% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -% License for more details. -% -% You should have received a copy of the GNU General Public License -% along with STK. If not, see <http://www.gnu.org/licenses/>. - -function prior_model = get_prior_model (model) - -prior_model = stk_get_prior_model (model); - -end % function diff --git a/inst/model/prior_struct/stk_covmat_noise.m b/inst/model/prior_struct/stk_covmat_noise.m index f2f5753..dacb7ce 100644 --- a/inst/model/prior_struct/stk_covmat_noise.m +++ b/inst/model/prior_struct/stk_covmat_noise.m @@ -19,7 +19,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -150,7 +150,7 @@ end % function %!shared model, model2, x1, x2, n1, n2, d, Ka, Kb, Kc, Pa, Pb, Pc, P1, P2, P3, K1, K2, K3 %! n1 = 20; n2 = 10; d = 4; -%! model = stk_model ('stk_materncov52_aniso', d); +%! model = stk_model (@stk_materncov52_aniso, d); %! model.lm = stk_lm_affine; %! model.param = log ([1.0; 2.1; 2.2; 2.3; 2.4]); %! model2 = model; model2.lognoisevariance = log(0.01); diff --git a/inst/model/prior_struct/stk_get_input_data.m b/inst/model/prior_struct/stk_get_input_data.m index b18c917..f0477eb 100644 --- a/inst/model/prior_struct/stk_get_input_data.m +++ b/inst/model/prior_struct/stk_get_input_data.m @@ -18,7 +18,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/prior_struct/stk_get_observation_variances.m b/inst/model/prior_struct/stk_get_observation_variances.m index 518c113..339fc1c 100644 --- a/inst/model/prior_struct/stk_get_observation_variances.m +++ b/inst/model/prior_struct/stk_get_observation_variances.m @@ -16,7 +16,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/prior_struct/stk_get_optimizable_model_parameters.m b/inst/model/prior_struct/stk_get_optimizable_model_parameters.m index 7742f46..ce77533 100644 --- a/inst/model/prior_struct/stk_get_optimizable_model_parameters.m +++ b/inst/model/prior_struct/stk_get_optimizable_model_parameters.m @@ -21,7 +21,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/prior_struct/stk_get_optimizable_noise_parameters.m b/inst/model/prior_struct/stk_get_optimizable_noise_parameters.m index f319242..6074a5d 100644 --- a/inst/model/prior_struct/stk_get_optimizable_noise_parameters.m +++ b/inst/model/prior_struct/stk_get_optimizable_noise_parameters.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/prior_struct/stk_get_output_data.m b/inst/model/prior_struct/stk_get_output_data.m index 34a5fc8..39e3b28 100644 --- a/inst/model/prior_struct/stk_get_output_data.m +++ b/inst/model/prior_struct/stk_get_output_data.m @@ -18,7 +18,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/prior_struct/stk_get_prior_model.m b/inst/model/prior_struct/stk_get_prior_model.m index bb9a1d6..7819a0e 100644 --- a/inst/model/prior_struct/stk_get_prior_model.m +++ b/inst/model/prior_struct/stk_get_prior_model.m @@ -18,7 +18,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/prior_struct/stk_isnoisy.m b/inst/model/prior_struct/stk_isnoisy.m index cdd3ac7..6c15ae5 100644 --- a/inst/model/prior_struct/stk_isnoisy.m +++ b/inst/model/prior_struct/stk_isnoisy.m @@ -1,4 +1,4 @@ -% STK_ISNOISY returns false for noiseless models +% STK_ISNOISY returns false for noiseless models, true otherwise % % CALL: ISNOISY = stk_isnoisy (MODEL) % @@ -11,8 +11,8 @@ % optional), % % * MODEL.lognoisevariance is equal to -inf (this is the default for a -% model created by stk_model and the currently recommended way for -% declaring a noiseless model), +% model created by stk_model and the currently recommended way to declare +% a noiseless model), % % * MODEL.lognoisevariance is a vector of -inf (heteroscedastic case with % all variances set to zero). @@ -28,7 +28,7 @@ % Copyright Notice % -% Copyright (C) 2016-2018 CentraleSupelec +% Copyright (C) 2016-2018, 2020 CentraleSupelec % Copyright (C) 2017-2018 LNE % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -39,7 +39,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/prior_struct/stk_model.m b/inst/model/prior_struct/stk_model.m index 6422bd8..1437115 100644 --- a/inst/model/prior_struct/stk_model.m +++ b/inst/model/prior_struct/stk_model.m @@ -38,7 +38,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -144,52 +144,52 @@ model.lognoisevariance = - inf; end % function -%!test model = stk_model(); +%!test model = stk_model (); -%!test model = stk_model('stk_expcov_iso'); -%!test model = stk_model('stk_expcov_iso', 1); -%!test model = stk_model('stk_expcov_iso', 3); +%!test model = stk_model (@stk_expcov_iso); +%!test model = stk_model (@stk_expcov_iso, 1); +%!test model = stk_model (@stk_expcov_iso, 3); -%!test model = stk_model('stk_expcov_aniso'); -%!test model = stk_model('stk_expcov_aniso', 1); -%!test model = stk_model('stk_expcov_aniso', 3); +%!test model = stk_model (@stk_expcov_aniso); +%!test model = stk_model (@stk_expcov_aniso, 1); +%!test model = stk_model (@stk_expcov_aniso, 3); -%!test model = stk_model('stk_materncov_iso'); -%!test model = stk_model('stk_materncov_iso', 1); -%!test model = stk_model('stk_materncov_iso', 3); +%!test model = stk_model (@stk_materncov_iso); +%!test model = stk_model (@stk_materncov_iso, 1); +%!test model = stk_model (@stk_materncov_iso, 3); -%!test model = stk_model('stk_materncov_aniso'); -%!test model = stk_model('stk_materncov_aniso', 1); -%!test model = stk_model('stk_materncov_aniso', 3); +%!test model = stk_model (@stk_materncov_aniso); +%!test model = stk_model (@stk_materncov_aniso, 1); +%!test model = stk_model (@stk_materncov_aniso, 3); -%!test model = stk_model('stk_materncov32_iso'); -%!test model = stk_model('stk_materncov32_iso', 1); -%!test model = stk_model('stk_materncov32_iso', 3); +%!test model = stk_model (@stk_materncov32_iso); +%!test model = stk_model (@stk_materncov32_iso, 1); +%!test model = stk_model (@stk_materncov32_iso, 3); -%!test model = stk_model('stk_materncov32_aniso'); -%!test model = stk_model('stk_materncov32_aniso', 1); -%!test model = stk_model('stk_materncov32_aniso', 3); +%!test model = stk_model (@stk_materncov32_aniso); +%!test model = stk_model (@stk_materncov32_aniso, 1); +%!test model = stk_model (@stk_materncov32_aniso, 3); -%!test model = stk_model('stk_materncov52_iso'); -%!test model = stk_model('stk_materncov52_iso', 1); -%!test model = stk_model('stk_materncov52_iso', 3); +%!test model = stk_model (@stk_materncov52_iso); +%!test model = stk_model (@stk_materncov52_iso, 1); +%!test model = stk_model (@stk_materncov52_iso, 3); -%!test model = stk_model('stk_materncov52_aniso'); -%!test model = stk_model('stk_materncov52_aniso', 1); -%!test model = stk_model('stk_materncov52_aniso', 3); +%!test model = stk_model (@stk_materncov52_aniso); +%!test model = stk_model (@stk_materncov52_aniso, 1); +%!test model = stk_model (@stk_materncov52_aniso, 3); -%!test model = stk_model('stk_gausscov_iso'); -%!test model = stk_model('stk_gausscov_iso', 1); -%!test model = stk_model('stk_gausscov_iso', 3); +%!test model = stk_model (@stk_gausscov_iso); +%!test model = stk_model (@stk_gausscov_iso, 1); +%!test model = stk_model (@stk_gausscov_iso, 3); -%!test model = stk_model('stk_gausscov_aniso'); -%!test model = stk_model('stk_gausscov_aniso', 1); -%!test model = stk_model('stk_gausscov_aniso', 3); +%!test model = stk_model (@stk_gausscov_aniso); +%!test model = stk_model (@stk_gausscov_aniso, 1); +%!test model = stk_model (@stk_gausscov_aniso, 3); -%!test model = stk_model('stk_sphcov_iso'); -%!test model = stk_model('stk_sphcov_iso', 1); -%!test model = stk_model('stk_sphcov_iso', 3); +%!test model = stk_model (@stk_sphcov_iso); +%!test model = stk_model (@stk_sphcov_iso, 1); +%!test model = stk_model (@stk_sphcov_iso, 3); -%!test model = stk_model('stk_sphcov_aniso'); -%!test model = stk_model('stk_sphcov_aniso', 1); -%!test model = stk_model('stk_sphcov_aniso', 3); +%!test model = stk_model (@stk_sphcov_aniso); +%!test model = stk_model (@stk_sphcov_aniso, 1); +%!test model = stk_model (@stk_sphcov_aniso, 3); diff --git a/inst/model/prior_struct/stk_model_fixlm.m b/inst/model/prior_struct/stk_model_fixlm.m index 1a3f46d..f198389 100644 --- a/inst/model/prior_struct/stk_model_fixlm.m +++ b/inst/model/prior_struct/stk_model_fixlm.m @@ -1,4 +1,4 @@ -% STK_MODEL_FIXLM [STK internal] +% STK_MODEL_FIXLM [STK internal] % % This internal STK function ensures backward compatiblity for model structures % with a .order field. @@ -14,7 +14,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/model/prior_struct/stk_ortho_func.m b/inst/model/prior_struct/stk_ortho_func.m index c35f89e..c8febeb 100644 --- a/inst/model/prior_struct/stk_ortho_func.m +++ b/inst/model/prior_struct/stk_ortho_func.m @@ -1,4 +1,4 @@ -% STK_ORTHO_FUNC [deprecated] +% STK_ORTHO_FUNC [deprecated] % % CALL: P = stk_ortho_func (MODEL, X) % @@ -35,7 +35,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -72,7 +72,7 @@ end % function %!shared model, x, n, d %! n = 15; d = 4; -%! model = stk_model ('stk_materncov_aniso', d); +%! model = stk_model (@stk_materncov_aniso, d); %! x = stk_sampling_randunif (n, d); %! model = rmfield (model, 'lm'); % Test the old .order approach diff --git a/inst/model/prior_struct/stk_predict_.m b/inst/model/prior_struct/stk_predict_.m new file mode 100644 index 0000000..8f05133 --- /dev/null +++ b/inst/model/prior_struct/stk_predict_.m @@ -0,0 +1,76 @@ +% STK_PREDICT_ [STK internal] +% +% See also: stk_predict + +% Copyright Notice +% +% Copyright (C) 2020 CentraleSupelec +% +% Author: Julien Bect <julien.bect@centralesupelec.fr> + +% Copying Permission Statement +% +% This file is part of +% +% STK: a Small (Matlab/Octave) Toolbox for Kriging +% (https://github.com/stk-kriging/stk/) +% +% STK is free software: you can redistribute it and/or modify it under +% the terms of the GNU General Public License as published by the Free +% Software Foundation, either version 3 of the License, or (at your +% option) any later version. +% +% STK is distributed in the hope that it will be useful, but WITHOUT +% ANY WARRANTY; without even the implied warranty of MERCHANTABILITY +% or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public +% License for more details. +% +% You should have received a copy of the GNU General Public License +% along with STK. If not, see <http://www.gnu.org/licenses/>. + +function [zp, lambda, mu, K] = stk_predict_ (model, xt) + +% If we end up here, model must be a prior model struct (as opposed to a +% model object). Better safe than sorry: +stk_assert_model_struct (model); + +nt = stk_get_sample_size (xt); + +% Is it a proper or an improper prior? +model = stk_model_fixlm (model); +if isa (model.lm, 'stk_lm_null') + % Proper prior (currently, zero-mean only) + zp_mean = zeros (nt, 1); +else + % Improper prior + zp_mean = nan (nt, 1); +end + +if nargout > 3 + K = stk_make_matcov (model, xt, xt, false); + zp_var = diag (K); +else + zp_var = stk_make_matcov (model, xt, xt, true); +end + +zp = stk_dataframe ([zp_mean zp_var], {'mean' 'var'}); + +if nargout > 1 % We want lambda + + % lambda must be n x nt, with n the sample size (here n = 0) + lambda = zeros (0, nt); + + if nargout > 2 % We want mu as well + + % UGLY: we have no cleaner way to find the dimension... + x_ = xt(1, :); + [K_ignore, P] = stk_make_matcov (model, x_, x_); %#ok<ASGLU> + r = size (P, 2); + + % mu must be r x nt, and setting it to zero in this case makes + % sense because the posterior variance formula remains valid + mu = zeros (r, nt); + end +end + +end % function diff --git a/inst/model/prior_struct/stk_set_optimizable_model_parameters.m b/inst/model/prior_struct/stk_set_optimizable_model_parameters.m index 4b04db1..488b9e8 100644 --- a/inst/model/prior_struct/stk_set_optimizable_model_parameters.m +++ b/inst/model/prior_struct/stk_set_optimizable_model_parameters.m @@ -21,7 +21,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/param/classes/stk_get_optimizable_parameters.m b/inst/param/classes/stk_get_optimizable_parameters.m index 9aadd28..12ced2f 100644 --- a/inst/param/classes/stk_get_optimizable_parameters.m +++ b/inst/param/classes/stk_get_optimizable_parameters.m @@ -28,7 +28,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/param/classes/stk_set_optimizable_parameters.m b/inst/param/classes/stk_set_optimizable_parameters.m index ccf7828..bd3a79b 100644 --- a/inst/param/classes/stk_set_optimizable_parameters.m +++ b/inst/param/classes/stk_set_optimizable_parameters.m @@ -29,7 +29,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/param/estim/stk_param_estim.m b/inst/param/estim/stk_param_estim.m index 3308cc1..5ba29d6 100644 --- a/inst/param/estim/stk_param_estim.m +++ b/inst/param/estim/stk_param_estim.m @@ -36,7 +36,7 @@ % Copyright Notice % -% Copyright (C) 2015-2018 CentraleSupelec +% Copyright (C) 2015-2018, 2020 CentraleSupelec % Copyright (C) 2017 LNE % Copyright (C) 2014 A. Ravisankar % Copyright (C) 2011-2014 SUPELEC @@ -51,7 +51,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -85,7 +85,7 @@ end % Size checking: xi, zi zi_data = double (zi); -if ~ isequal (size (zi_data), [stk_length(xi) 1]) +if ~ isequal (size (zi_data), [stk_get_sample_size(xi) 1]) errmsg = 'zi should be a column, with the same number of rows as xi.'; stk_error (errmsg, 'IncorrectSize'); end @@ -252,7 +252,7 @@ end % function %! RHO1 = 0.4; % scale (range) parameter %! param0 = log ([SIGMA2; NU; 1/RHO1]); %! -%! model = stk_model ('stk_materncov_iso'); +%! model = stk_model (@stk_materncov_iso); %!test % noiseless %! zi = stk_feval (f, xi); @@ -298,7 +298,7 @@ end % function %!error param = stk_param_estim (model, xi); %!test % Constant response -%! model = stk_model ('stk_materncov52_iso'); +%! model = stk_model (@stk_materncov52_iso); %! n = 10; x = stk_sampling_regulargrid (n, 1, [0; 1]); z = ones (size (x)); %! param = stk_param_estim (model, x, z); %! assert ((all (isfinite (param))) && (length (param) == 2)); diff --git a/inst/param/estim/stk_param_estim_optim.m b/inst/param/estim/stk_param_estim_optim.m index 3f64ef5..b3a4e8f 100644 --- a/inst/param/estim/stk_param_estim_optim.m +++ b/inst/param/estim/stk_param_estim_optim.m @@ -7,7 +7,7 @@ % Copyright Notice % -% Copyright (C) 2015-2019 CentraleSupelec +% Copyright (C) 2015-2020 CentraleSupelec % Copyright (C) 2014 Ashwin Ravisankar % Copyright (C) 2011-2014 SUPELEC % @@ -20,7 +20,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -58,7 +58,7 @@ f = @(v)(crit_wrapper (model0, v, xi, zi, criterion, covparam_select, noiseparam bounds_available = (~ isempty (lb)) && (~ isempty (ub)); -% Sanity check (part 1) +% Sanity check crit0 = f (w0); if ~ (isscalar (crit0) && isfinite (crit0)) errmsg = '*** PANIC: crit0 is not a finite scalar value. ***'; @@ -73,18 +73,18 @@ else [w_opt, crit_opt] = stk_minimize_unconstrained (A, f, w0); end -% Sanity check (part 2) -if crit0 < crit_opt - s1 = '*** PANIC: Something went SERIOUSLY WRONG during the optimization ***'; +% Create 'model_opt' output +if crit_opt < crit0 + v_opt = v0; + v_opt(select) = w_opt; + model_opt = stk_set_optimizable_parameters (model0, v_opt); +else + s1 = 'Something went wrong during the optimization'; s2 = sprintf ('crit0 = %f, crit_opt = %f: crit0 < crit_opt', crit0, crit_opt); - stk_error (sprintf ('%s\n%s\n', s1, s2), 'OptimizationFailure'); + warning (sprintf ('%s\n%s\n', s1, s2)); % FIXME: warning id + model_opt = model0; end -% Create outputs -v_opt = v0; -v_opt(select) = w_opt; -model_opt = stk_set_optimizable_parameters (model0, v_opt); - % Create 'info' structure, if requested if nargout > 1 info.criterion = criterion; diff --git a/inst/param/estim/stk_param_getdefaultbounds.m b/inst/param/estim/stk_param_getdefaultbounds.m index fe464c1..ba66b39 100644 --- a/inst/param/estim/stk_param_getdefaultbounds.m +++ b/inst/param/estim/stk_param_getdefaultbounds.m @@ -33,7 +33,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/param/estim/stk_param_getdefaultbounds_lnv.m b/inst/param/estim/stk_param_getdefaultbounds_lnv.m index 8329aa4..15885d4 100644 --- a/inst/param/estim/stk_param_getdefaultbounds_lnv.m +++ b/inst/param/estim/stk_param_getdefaultbounds_lnv.m @@ -15,7 +15,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/param/estim/stk_param_gls.m b/inst/param/estim/stk_param_gls.m index 773b284..a7eb950 100644 --- a/inst/param/estim/stk_param_gls.m +++ b/inst/param/estim/stk_param_gls.m @@ -2,7 +2,7 @@ % % CALL: BETA = stk_param_gls (MODEL, XI, ZI) % -% computes the generalised least squares estimate BETA of the vector of +% computes a generalised least squares estimate BETA of the vector of % coefficients for the linear part of MODEL, where XI and ZI stand for % the evaluation points and observed responses, respectively. % @@ -26,7 +26,7 @@ % Copyright Notice % -% Copyright (C) 2015, 2016 CentraleSupelec +% Copyright (C) 2015, 2016, 2021 CentraleSupelec % Copyright (C) 2014 SUPELEC & A. Ravisankar % Copyright (C) 2011-2013 SUPELEC % @@ -39,7 +39,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -66,9 +66,9 @@ zi = double (zi); % Compute the Generalized Least Squares (GLS) estimate L = stk_cholcov (K, 'lower'); -W = L \ P; -u = L \ zi; -beta = (W' * W) \ (W' * u); +W = linsolve (L, P, struct ('LT', true)); +u = linsolve (L, zi, struct ('LT', true)); +beta = W \ u; if nargin > 1 % Assuming that the actual covariance matrice is sigma^2 K, compute the @@ -78,12 +78,12 @@ if nargin > 1 sigma2 = 1 / (n - r) * sum ((u - W * beta) .^ 2); end -end % end function stk_param_gls +end % function %!shared xi, zi, model, beta, sigma2 %! xi = (1:10)'; zi = sin (xi); -%! model = stk_model ('stk_materncov52_iso'); +%! model = stk_model (@stk_materncov52_iso); %! model.param = [0.0 0.0]; %!test diff --git a/inst/param/estim/stk_param_init.m b/inst/param/estim/stk_param_init.m index 33dd531..0ba8fbc 100644 --- a/inst/param/estim/stk_param_init.m +++ b/inst/param/estim/stk_param_init.m @@ -32,7 +32,7 @@ % Copyright Notice % -% Copyright (C) 2015, 2016, 2018 CentraleSupelec +% Copyright (C) 2015, 2016, 2018, 2020 CentraleSupelec % Copyright (C) 2012-2014 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -43,7 +43,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -163,7 +163,7 @@ if isfield (model, 'dim') && ~ isequal (dim, model.dim) stk_error (errmsg, 'IncorrectSize'); end -if ~ isequal (size (zi), [size(xi, 1) 1]) +if ~ isequal (size (zi), [stk_get_sample_size(xi) 1]) errmsg = 'zi should be a column, with the same number of rows as xi.'; stk_error (errmsg, 'IncorrectSize'); end @@ -379,7 +379,7 @@ end % function %!test %! xi = (1:10)'; zi = sin (xi); -%! model = stk_model ('stk_materncov52_iso'); +%! model = stk_model (@stk_materncov52_iso); %! model.param = stk_param_init (model, xi, zi, [1; 10], false); %! xt = (1:9)' + 0.5; zt = sin (xt); %! zp = stk_predict (model, xi, zi, xt); @@ -389,7 +389,7 @@ end % function %! f = @(x) sin (x); %! xi = stk_sampling_regulargrid (10, 1); zi = stk_feval (f, xi); %! shift = 1000; scale = 0.01; -%! model = stk_model ('stk_materncov32_iso'); +%! model = stk_model (@stk_materncov32_iso); %! p1 = stk_param_init (model, xi, zi); %! p2 = stk_param_init (model, xi, shift + scale .* zi); %! assert (stk_isequal_tolabs (p2(1), p1(1) + log (scale^2), 1e-10)) @@ -409,63 +409,63 @@ end % function %! zt = stk_feval (f, xt); % Values of f on the grid %!test -%! model = stk_model ('stk_materncov_iso'); +%! model = stk_model (@stk_materncov_iso); %! [param0, model.lognoisevariance] = stk_param_init (model, xi, zi, BOX); %! model.param = stk_param_estim (model, xi, zi, param0); %! zp = stk_predict (model, xi, zi, xt); %! assert (max ((zp.mean - zt) .^ 2) < 1e-3) %!test -%! model = stk_model ('stk_materncov_aniso'); +%! model = stk_model (@stk_materncov_aniso); %! [param0, model.lognoisevariance] = stk_param_init (model, xi, zi, BOX); %! model.param = stk_param_estim (model, xi, zi, param0); %! zp = stk_predict (model, xi, zi, xt); %! assert (max ((zp.mean - zt) .^ 2) < 1e-3) %!test -%! model = stk_model ('stk_materncov32_iso'); +%! model = stk_model (@stk_materncov32_iso); %! [param0, model.lognoisevariance] = stk_param_init (model, xi, zi, BOX); %! model.param = stk_param_estim (model, xi, zi, param0); %! zp = stk_predict (model, xi, zi, xt); %! assert (max ((zp.mean - zt) .^ 2) < 1e-3) %!test -%! model = stk_model ('stk_materncov32_aniso'); +%! model = stk_model (@stk_materncov32_aniso); %! [param0, model.lognoisevariance] = stk_param_init (model, xi, zi, BOX); %! model.param = stk_param_estim (model, xi, zi, param0); %! zp = stk_predict (model, xi, zi, xt); %! assert (max ((zp.mean - zt) .^ 2) < 1e-3) %!test -%! model = stk_model ('stk_materncov52_iso'); +%! model = stk_model (@stk_materncov52_iso); %! [param0, model.lognoisevariance] = stk_param_init (model, xi, zi, BOX); %! model.param = stk_param_estim (model, xi, zi, param0); %! zp = stk_predict (model, xi, zi, xt); %! assert (max ((zp.mean - zt) .^ 2) < 1e-3) %!test -%! model = stk_model ('stk_materncov52_aniso'); +%! model = stk_model (@stk_materncov52_aniso); %! [param0, model.lognoisevariance] = stk_param_init (model, xi, zi, BOX); %! model.param = stk_param_estim (model, xi, zi, param0); %! zp = stk_predict (model, xi, zi, xt); %! assert (max ((zp.mean - zt) .^ 2) < 1e-3) %!test -%! model = stk_model ('stk_gausscov_iso'); +%! model = stk_model (@stk_gausscov_iso); %! [param0, model.lognoisevariance] = stk_param_init (model, xi, zi, BOX); %! model.param = stk_param_estim (model, xi, zi, param0); %! zp = stk_predict (model, xi, zi, xt); %! assert (max ((zp.mean - zt) .^ 2) < 1e-3) %!test -%! model = stk_model ('stk_gausscov_aniso'); +%! model = stk_model (@stk_gausscov_aniso); %! [param0, model.lognoisevariance] = stk_param_init (model, xi, zi, BOX); %! model.param = stk_param_estim (model, xi, zi, param0); %! zp = stk_predict (model, xi, zi, xt); %! assert (max ((zp.mean - zt) .^ 2) < 1e-3) %!test % Homoscedastic case / do_estim_lnv = true -%! model = stk_model ('stk_materncov32_iso'); +%! model = stk_model (@stk_materncov32_iso); %! [model.param, model.lognoisevariance] = ... %! stk_param_init (model, xi, zi, BOX, true); %! [model.param, model.lognoisevariance] = ... @@ -475,13 +475,13 @@ end % function %! assert (max ((zp.mean - zt) .^ 2) < 1e-3) %!error % Homoscedastic case / do_estim_lnv = false / model.lnv = nan -%! model = stk_model ('stk_materncov32_iso'); +%! model = stk_model (@stk_materncov32_iso); %! model.lognoisevariance = nan; % not compatible with do_estim_lnv == false %! [model.param, model.lognoisevariance] = ... %! stk_param_init (model, xi, zi, BOX, false); %!test % Heteroscedastic case / known noise variance -%! model = stk_model ('stk_materncov32_iso'); +%! model = stk_model (@stk_materncov32_iso); %! lnv = log ((100 + rand (size (zi))) / 1e6); %! model.lognoisevariance = lnv; % here we say that lnv is known %! [param0, model.lognoisevariance] = stk_param_init (model, xi, zi, BOX); @@ -491,7 +491,7 @@ end % function %! assert (max ((zp.mean - zt) .^ 2) < 1e-3) %!shared model, x, z -%! model = stk_model ('stk_materncov52_iso'); +%! model = stk_model (@stk_materncov52_iso); %! n = 10; x = stk_sampling_regulargrid (n, 1, [0; 1]); z = ones (size (x)); %!test % Constant response, noiseless model diff --git a/inst/param/estim/stk_param_init_lnv.m b/inst/param/estim/stk_param_init_lnv.m index 945716e..fd51a64 100644 --- a/inst/param/estim/stk_param_init_lnv.m +++ b/inst/param/estim/stk_param_init_lnv.m @@ -17,7 +17,7 @@ % Copyright Notice % -% Copyright (C) 2018 CentraleSupelec +% Copyright (C) 2018, 2020 CentraleSupelec % Copyright (C) 2014 SUPELEC % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -27,7 +27,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -45,7 +45,7 @@ function lnv = stk_param_init_lnv (model, xi, zi) % size checking: xi, zi -if ~ isequal (size (zi), [size(xi, 1) 1]) +if ~ isequal (size (zi), [stk_get_sample_size(xi) 1]) errmsg = 'zi should be a column, with the same number of rows as xi.'; stk_error (errmsg, 'IncorrectSize'); end @@ -109,7 +109,7 @@ end % function %! xi = (linspace (-1, 1, ni))' + 0.2 * (randn (ni, 1)); %! zi = stk_feval (f, xi); %! -%! model = stk_model ('stk_materncov_iso'); +%! model = stk_model (@stk_materncov_iso); %! model.param = log ([1; 5/2; 1/0.4]); %! model.lognoisevariance = nan; %! lnv = stk_param_init_lnv (model, xi, zi); diff --git a/inst/param/estim/stk_param_init_remlgls.m b/inst/param/estim/stk_param_init_remlgls.m index 484c023..977ebb9 100644 --- a/inst/param/estim/stk_param_init_remlgls.m +++ b/inst/param/estim/stk_param_init_remlgls.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2015, 2016, 2018, 2019 CentraleSupelec +% Copyright (C) 2015, 2016, 2018, 2019, 2021 CentraleSupelec % Copyright (C) 2012-2014 SUPELEC % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -67,14 +67,14 @@ for eta = eta_list if noiseless - [ignd, sigma2] = stk_param_gls (model, xi, zi); %#ok<ASGLU> CG#07 + [~, sigma2] = stk_param_gls (model, xi, zi); if ~ (sigma2 > 0), continue; end log_sigma2 = log (sigma2); elseif homoscedastic && (isnan (lnv)) % Unknown noise variance model.lognoisevariance = log (eta); - [ignd, sigma2] = stk_param_gls (model, xi, zi); %#ok<ASGLU> CG#07 + [~, sigma2] = stk_param_gls (model, xi, zi); if ~ (sigma2 > 0), continue; end log_sigma2 = log (sigma2); model.lognoisevariance = log (eta * sigma2); diff --git a/inst/param/estim/stk_param_relik.m b/inst/param/estim/stk_param_relik.m index a6646aa..ee9f323 100644 --- a/inst/param/estim/stk_param_relik.m +++ b/inst/param/estim/stk_param_relik.m @@ -26,7 +26,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -82,7 +82,7 @@ end if ~ simple_kriging % Construct a "filtering matrix" A = W' - [Q, R_ignored] = qr (P); %#ok<NASGU> %the second argument *must* be here + [Q, R_ignored] = qr (P); %#ok<ASGLU> %the second argument *must* be here W = Q(:, (q+1):n); % Compute G = W' * K * W, the covariance matrix of filtered observations @@ -198,8 +198,8 @@ end % function %! NU = 4.0; % regularity parameter %! RHO1 = 0.4; % scale (range) parameter %! -%! model = stk_model('stk_materncov_aniso'); -%! model.param = log([SIGMA2; NU; 1/RHO1 * ones(DIM, 1)]); +%! model = stk_model (@stk_materncov_aniso); +%! model.param = log ([SIGMA2; NU; 1/RHO1 * ones(DIM, 1)]); %!error [C, dC1, dC2] = stk_param_relik (); %!error [C, dC1, dC2] = stk_param_relik (model); @@ -215,7 +215,7 @@ end % function %!shared xi, zi, model, TOL_REL %! xi = [-1 -.6 -.2 .2 .6 1]'; %! zi = [-0.11 1.30 0.23 -1.14 0.36 -0.37]'; -%! model = stk_model ('stk_materncov_iso'); +%! model = stk_model (@stk_materncov_iso); %! model.param = log ([1.0 4.0 2.5]); %! model.lognoisevariance = log (0.01); %! TOL_REL = 0.01; @@ -242,14 +242,16 @@ end % function %! TOL_REL = 1e-2; %! DELTA = 1e-6; %! -%! model = stk_model ('stk_materncov52_iso', DIM); -%! xi = stk_sampling_halton_rr2 (NI, DIM, BOX); -%! zi = stk_feval (f, xi); -%! +%! model = stk_model (@stk_materncov52_iso, DIM); %! model.param = [1 1]; -%! [C1 dC] = stk_param_relik (model, xi, zi); %! -%! model.param = model.param + DELTA * [0 1]; -%! C2 = stk_param_relik (model, xi, zi); +%! xi = stk_sampling_halton_rr2 (NI, DIM, BOX); +%! zi = stk_feval (f, xi); %! -%! assert (stk_isequal_tolrel (dC(2), (C2 - C1) / DELTA, TOL_REL)); +%! for range = [0.3 2 10] +%! model.param(2) = - log (range); +%! for diff = 1:2 +%! assert (stk_test_critgrad ... +%! (@stk_param_relik, model, xi, zi, diff, 1e-6)); +%! end +%! end diff --git a/inst/sampling/@stk_function/disp.m b/inst/sampling/@stk_function/disp.m index 09ed974..47aaf6e 100644 --- a/inst/sampling/@stk_function/disp.m +++ b/inst/sampling/@stk_function/disp.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_function/display.m b/inst/sampling/@stk_function/display.m index 8873369..94c5b49 100644 --- a/inst/sampling/@stk_function/display.m +++ b/inst/sampling/@stk_function/display.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_function/feval.m b/inst/sampling/@stk_function/feval.m index 94318e5..488f1a0 100644 --- a/inst/sampling/@stk_function/feval.m +++ b/inst/sampling/@stk_function/feval.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_function/get.m b/inst/sampling/@stk_function/get.m index d4e9a5a..b76be1a 100644 --- a/inst/sampling/@stk_function/get.m +++ b/inst/sampling/@stk_function/get.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_function/horzcat.m b/inst/sampling/@stk_function/horzcat.m index 2f361f1..7c8a5d1 100644 --- a/inst/sampling/@stk_function/horzcat.m +++ b/inst/sampling/@stk_function/horzcat.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_function/stk_function.m b/inst/sampling/@stk_function/stk_function.m index c1f53ef..a92fb4f 100644 --- a/inst/sampling/@stk_function/stk_function.m +++ b/inst/sampling/@stk_function/stk_function.m @@ -25,7 +25,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_function/subsasgn.m b/inst/sampling/@stk_function/subsasgn.m index 68abfa9..f0e201f 100644 --- a/inst/sampling/@stk_function/subsasgn.m +++ b/inst/sampling/@stk_function/subsasgn.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_function/subsref.m b/inst/sampling/@stk_function/subsref.m index c0bc0ec..9199d67 100644 --- a/inst/sampling/@stk_function/subsref.m +++ b/inst/sampling/@stk_function/subsref.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_function/vertcat.m b/inst/sampling/@stk_function/vertcat.m index a4fc8ad..011a432 100644 --- a/inst/sampling/@stk_function/vertcat.m +++ b/inst/sampling/@stk_function/vertcat.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_sampcrit_akg/disp.m b/inst/sampling/@stk_sampcrit_akg/disp.m index 93b5d08..f97856d 100644 --- a/inst/sampling/@stk_sampcrit_akg/disp.m +++ b/inst/sampling/@stk_sampcrit_akg/disp.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_sampcrit_akg/feval.m b/inst/sampling/@stk_sampcrit_akg/feval.m index 1aaa0d4..597670b 100644 --- a/inst/sampling/@stk_sampcrit_akg/feval.m +++ b/inst/sampling/@stk_sampcrit_akg/feval.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_sampcrit_akg/get.m b/inst/sampling/@stk_sampcrit_akg/get.m index cf4652e..378b0a6 100644 --- a/inst/sampling/@stk_sampcrit_akg/get.m +++ b/inst/sampling/@stk_sampcrit_akg/get.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_sampcrit_akg/set.m b/inst/sampling/@stk_sampcrit_akg/set.m index 08ace98..8cae7a8 100644 --- a/inst/sampling/@stk_sampcrit_akg/set.m +++ b/inst/sampling/@stk_sampcrit_akg/set.m @@ -2,7 +2,7 @@ % Copyright Notice % -% Copyright (C) 2017 CentraleSupelec +% Copyright (C) 2017, 2020 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -62,7 +62,7 @@ if isempty (crit.model) else if isempty (crit.reference_grid) - crit.xr = stk_get_input_data (crit.model); + crit.xr = unique (stk_get_input_data (crit.model), 'rows'); else crit.xr = crit.reference_grid; end diff --git a/inst/sampling/@stk_sampcrit_akg/stk_sampcrit_akg.m b/inst/sampling/@stk_sampcrit_akg/stk_sampcrit_akg.m index ffb70bf..1f4813f 100644 --- a/inst/sampling/@stk_sampcrit_akg/stk_sampcrit_akg.m +++ b/inst/sampling/@stk_sampcrit_akg/stk_sampcrit_akg.m @@ -41,7 +41,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_sampcrit_ei/disp.m b/inst/sampling/@stk_sampcrit_ei/disp.m index 938a9ee..b6ad1b7 100644 --- a/inst/sampling/@stk_sampcrit_ei/disp.m +++ b/inst/sampling/@stk_sampcrit_ei/disp.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_sampcrit_ei/feval.m b/inst/sampling/@stk_sampcrit_ei/feval.m index 867ab4c..112f851 100644 --- a/inst/sampling/@stk_sampcrit_ei/feval.m +++ b/inst/sampling/@stk_sampcrit_ei/feval.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_sampcrit_ei/get.m b/inst/sampling/@stk_sampcrit_ei/get.m index d4e9a5a..b76be1a 100644 --- a/inst/sampling/@stk_sampcrit_ei/get.m +++ b/inst/sampling/@stk_sampcrit_ei/get.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_sampcrit_ei/set.m b/inst/sampling/@stk_sampcrit_ei/set.m index 22e447a..eaf0908 100644 --- a/inst/sampling/@stk_sampcrit_ei/set.m +++ b/inst/sampling/@stk_sampcrit_ei/set.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_sampcrit_ei/stk_sampcrit_ei.m b/inst/sampling/@stk_sampcrit_ei/stk_sampcrit_ei.m index a684be5..d55d33f 100644 --- a/inst/sampling/@stk_sampcrit_ei/stk_sampcrit_ei.m +++ b/inst/sampling/@stk_sampcrit_ei/stk_sampcrit_ei.m @@ -26,7 +26,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_sampcrit_eqi/disp.m b/inst/sampling/@stk_sampcrit_eqi/disp.m index 89fa594..4b35a7c 100644 --- a/inst/sampling/@stk_sampcrit_eqi/disp.m +++ b/inst/sampling/@stk_sampcrit_eqi/disp.m @@ -13,7 +13,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_sampcrit_eqi/feval.m b/inst/sampling/@stk_sampcrit_eqi/feval.m index 5646ed4..57513f1 100644 --- a/inst/sampling/@stk_sampcrit_eqi/feval.m +++ b/inst/sampling/@stk_sampcrit_eqi/feval.m @@ -4,7 +4,7 @@ % Copyright Notice % -% Copyright (C) 2016, 2017 CentraleSupelec +% Copyright (C) 2016, 2017, 2020 CentraleSupelec % Copyright (C) 2016 EDF R&D % % Authors: Tom Assouline, Florent Autret & Stefano Duhamel (for EDF R&D) @@ -15,7 +15,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -45,7 +45,7 @@ if nargin < 3 if stk_isnoisy (crit.model) if isa (crit.point_batch_size, 'function_handle') - n = stk_length (get (crit.model, 'input_data')); + n = stk_get_sample_size (crit.model); pbs = feval (crit.point_batch_size, x, n); else pbs = crit.point_batch_size; diff --git a/inst/sampling/@stk_sampcrit_eqi/get.m b/inst/sampling/@stk_sampcrit_eqi/get.m index d4e9a5a..b76be1a 100644 --- a/inst/sampling/@stk_sampcrit_eqi/get.m +++ b/inst/sampling/@stk_sampcrit_eqi/get.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_sampcrit_eqi/set.m b/inst/sampling/@stk_sampcrit_eqi/set.m index 4df80be..9c81c75 100644 --- a/inst/sampling/@stk_sampcrit_eqi/set.m +++ b/inst/sampling/@stk_sampcrit_eqi/set.m @@ -11,7 +11,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/@stk_sampcrit_eqi/stk_sampcrit_eqi.m b/inst/sampling/@stk_sampcrit_eqi/stk_sampcrit_eqi.m index 74a3784..6de2fda 100644 --- a/inst/sampling/@stk_sampcrit_eqi/stk_sampcrit_eqi.m +++ b/inst/sampling/@stk_sampcrit_eqi/stk_sampcrit_eqi.m @@ -31,7 +31,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/stk_halfpintl.m b/inst/sampling/stk_halfpintl.m index af47570..cc4a941 100644 --- a/inst/sampling/stk_halfpintl.m +++ b/inst/sampling/stk_halfpintl.m @@ -34,7 +34,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/stk_sampcrit_akg_eval.m b/inst/sampling/stk_sampcrit_akg_eval.m index c63b802..6d47408 100644 --- a/inst/sampling/stk_sampcrit_akg_eval.m +++ b/inst/sampling/stk_sampcrit_akg_eval.m @@ -96,7 +96,7 @@ % Copyright Notice % -% Copyright (C) 2017, 2018 CentraleSupelec +% Copyright (C) 2017, 2018, 2021 CentraleSupelec % % Author: Julien Bect <julien.bect@centralesupelec.fr> @@ -105,7 +105,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -201,13 +201,13 @@ end % function %! zi = [1; 0.9; 0.6; 0.1] - 10; %! ni = 4; %! -%! M_prior = stk_model('stk_materncov32_iso'); +%! M_prior = stk_model (@stk_materncov32_iso); %! M_prior.param = log ([1.0; 2.1]); %! M_prior.lognoisevariance = 0.678; %! %! nc = 20; %! xc = stk_sampling_regulargrid (nc, 1, [0; 1]); -%! [zp, ignd1, ignd2, K] = stk_predict (M_prior, xi, zi, [xi; xc]); % See CG#07 +%! [zp, ~, ~, K] = stk_predict (M_prior, xi, zi, [xi; xc]); %! %! ir = 1:ni; ic = ni + (1:nc); %! diff --git a/inst/sampling/stk_sampcrit_ehvi_eval.m b/inst/sampling/stk_sampcrit_ehvi_eval.m index 9844769..f0140fc 100644 --- a/inst/sampling/stk_sampcrit_ehvi_eval.m +++ b/inst/sampling/stk_sampcrit_ehvi_eval.m @@ -45,7 +45,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/stk_sampcrit_ei_eval.m b/inst/sampling/stk_sampcrit_ei_eval.m index e711619..621dce1 100644 --- a/inst/sampling/stk_sampcrit_ei_eval.m +++ b/inst/sampling/stk_sampcrit_ei_eval.m @@ -51,7 +51,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -83,7 +83,7 @@ end % function %!shared xi, zi, M_prior, xt, zp, EIref, EI1, EI2, EI3 %! xi = [0; 0.2; 0.7; 0.9]; %! zi = [1; 0.9; 0.6; 0.1]; -%! M_prior = stk_model('stk_materncov32_iso'); +%! M_prior = stk_model (@stk_materncov32_iso); %! M_prior.param = log ([1.0; 2.1]); %! xt = stk_sampling_regulargrid (20, 1, [0; 1]); %! zp = stk_predict (M_prior, xi, zi, xt); diff --git a/inst/sampling/stk_sampcrit_emmi_eval.m b/inst/sampling/stk_sampcrit_emmi_eval.m index 395e25e..8d32f9c 100644 --- a/inst/sampling/stk_sampcrit_emmi_eval.m +++ b/inst/sampling/stk_sampcrit_emmi_eval.m @@ -34,16 +34,16 @@ % % REFERENCES % -% [1] Svenson J.D. and Santner T.J. Multiobjective optimization of -% expensive black-box functions via expected maximin improvement. -% Technical report, Tech. rep., 43210, Ohio University, Columbus, -% Ohio, 2010 +% [1] Svenson, J., & Santner, T. (2016). Multiobjective optimization of +% expensive-to-evaluate deterministic computer simulator models. +% Computational Statistics & Data Analysis, 94, 250-264, +% DOI: 10.1016/j.csda.2015.08.011. % % See also: stk_sampcrit_ehvi_eval % Copyright Notice % -% Copyright (C) 2017, 2018 CentraleSupelec +% Copyright (C) 2017, 2018, 2020 CentraleSupelec % Copyright (C) 2016 IRT SystemX % % Author: Paul Feliot <paul.feliot@irt-systemx.fr> @@ -53,7 +53,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/stk_sampling_halton_rr2.m b/inst/sampling/stk_sampling_halton_rr2.m index 6534b28..0149551 100644 --- a/inst/sampling/stk_sampling_halton_rr2.m +++ b/inst/sampling/stk_sampling_halton_rr2.m @@ -28,7 +28,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/stk_sampling_maximinlhs.m b/inst/sampling/stk_sampling_maximinlhs.m index 116a633..d9b5f41 100644 --- a/inst/sampling/stk_sampling_maximinlhs.m +++ b/inst/sampling/stk_sampling_maximinlhs.m @@ -21,7 +21,7 @@ % Copyright Notice % -% Copyright (C) 2017, 2018 CentraleSupelec +% Copyright (C) 2017, 2018, 2021 CentraleSupelec % Copyright (C) 2011-2014 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -32,7 +32,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -111,7 +111,7 @@ function x = generatedesign_ (n, d) x = zeros (n, d); for i = 1:d % for each dimension, draw a random permutation - [ignd, x(:,i)] = sort (rand (n,1)); %#ok<ASGLU> CG#07 + [~, x(:,i)] = sort (rand (n,1)); end x = (x - rand (size (x))) / n; diff --git a/inst/sampling/stk_sampling_nesteddesign.m b/inst/sampling/stk_sampling_nesteddesign.m index 25d72bd..2dae720 100644 --- a/inst/sampling/stk_sampling_nesteddesign.m +++ b/inst/sampling/stk_sampling_nesteddesign.m @@ -46,17 +46,17 @@ % Copyright Notice % +% Copyright (C) 2017, 2018, 2021 CentraleSupelec % Copyright (C) 2017 LNE -% Copyright (C) 2017, 2018 CentraleSupelec % -% Authors: Remi Stroh <remi.stroh@lne.fr> +% Author: Remi Stroh <remi.stroh@lne.fr> % Copying Permission Statement % % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -159,7 +159,7 @@ for k_lev = (nLev - 1):-1:1 dist_new_prev = min( stk_dist(X_new_k, X_prev), [], 2); % 3: Keep the farthest - [ignd, ind_dist] = sort(dist_new_prev, 'descend'); %#ok<ASGLU> CG#07 + [~, ind_dist] = sort (dist_new_prev, 'descend'); ind_select = ind_dist( 1:((n(k_lev) - n(k_lev + 1)) ), 1); best_design(row_currentLevel(1, k_lev, n), :) = double( X_new_k(ind_select, :) ); diff --git a/inst/sampling/stk_sampling_nestedlhs.m b/inst/sampling/stk_sampling_nestedlhs.m index 4795361..307aced 100644 --- a/inst/sampling/stk_sampling_nestedlhs.m +++ b/inst/sampling/stk_sampling_nestedlhs.m @@ -49,17 +49,18 @@ % Copyright Notice % +% Copyright (C) 2017, 2018, 2021 CentraleSupelec % Copyright (C) 2017 LNE -% Copyright (C) 2017, 2018 CentraleSupelec % -% Authors: Remi Stroh <remi.stroh@lne.fr> +% Author: Remi Stroh <remi.stroh@lne.fr> +% % Copying Permission Statement % % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -181,7 +182,7 @@ for k_lev = nLev:-1:1; %begin by the end X_new_kl = NaN(n_new_k, dim); %the matrix to add - [ignd, random_index] = sort(rand(n_new_k, dim), 1); %#ok<ASGLU> CG#07 + [~, random_index] = sort(rand(n_new_k, dim), 1); for i = 1:dim X_new_kl(:, i) = list_nb_new_k(random_index(:, i), i); end diff --git a/inst/sampling/stk_sampling_olhs.m b/inst/sampling/stk_sampling_olhs.m index d26a857..2480006 100644 --- a/inst/sampling/stk_sampling_olhs.m +++ b/inst/sampling/stk_sampling_olhs.m @@ -52,7 +52,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/stk_sampling_randomlhs.m b/inst/sampling/stk_sampling_randomlhs.m index fc0a629..7cb9e56 100644 --- a/inst/sampling/stk_sampling_randomlhs.m +++ b/inst/sampling/stk_sampling_randomlhs.m @@ -27,7 +27,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/stk_sampling_randunif.m b/inst/sampling/stk_sampling_randunif.m index cfd7ba9..b1ca9e6 100644 --- a/inst/sampling/stk_sampling_randunif.m +++ b/inst/sampling/stk_sampling_randunif.m @@ -24,7 +24,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/stk_sampling_regulargrid.m b/inst/sampling/stk_sampling_regulargrid.m index f7f6062..b4e3e58 100644 --- a/inst/sampling/stk_sampling_regulargrid.m +++ b/inst/sampling/stk_sampling_regulargrid.m @@ -28,7 +28,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/stk_sampling_sobol.m b/inst/sampling/stk_sampling_sobol.m index 1579dfc..6d7ecfd 100644 --- a/inst/sampling/stk_sampling_sobol.m +++ b/inst/sampling/stk_sampling_sobol.m @@ -56,7 +56,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/sampling/stk_sampling_vdc_rr2.m b/inst/sampling/stk_sampling_vdc_rr2.m index c60be7b..832502d 100644 --- a/inst/sampling/stk_sampling_vdc_rr2.m +++ b/inst/sampling/stk_sampling_vdc_rr2.m @@ -27,7 +27,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/stk_init.m b/inst/stk_init.m index 2fe55c1..befabf8 100644 --- a/inst/stk_init.m +++ b/inst/stk_init.m @@ -6,7 +6,7 @@ % Copyright Notice % -% Copyright (C) 2015-2018 CentraleSupelec +% Copyright (C) 2015-2018, 2019, 2022 CentraleSupelec % Copyright (C) 2011-2014 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -17,7 +17,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -42,7 +42,7 @@ if nargin == 0 command = 'pkg_load'; end -% Deduce the root of STK from the path to this script +% Deduce the root of STK from the path to this function root = fileparts (mfilename ('fullpath')); switch command @@ -53,9 +53,6 @@ switch command case 'pkg_unload' stk_init__pkg_unload (root); - case 'prune_mole' - stk_init__config_mole (root, false, true); % prune, but do not add to path - case 'clear_persistents' % Note: this implies munlock stk_init__clear_persistents (); @@ -95,7 +92,7 @@ stk_init__clear_persistents (); stk_init__addpath (root); % Set default options -stk_options_set (); +stk_options_set ('default'); % Select default "parallelization engine" stk_parallel_engine_set (); @@ -147,6 +144,9 @@ stk_init__munlock (); filenames = { ... 'stk_disp_progress', ... + 'stk_disp_getformat', ... + 'stk_expcov_iso', ... + 'stk_expcov_aniso', ... 'stk_gausscov_iso', ... 'stk_gausscov_aniso', ... 'stk_materncov_aniso', ... @@ -155,9 +155,12 @@ filenames = { ... 'stk_materncov32_iso', ... 'stk_materncov52_aniso', ... 'stk_materncov52_iso', ... + 'stk_sphcov_iso', ... + 'stk_sphcov_aniso', ... 'stk_optim_fmincon', ... 'stk_options_set', ... - 'stk_parallel_engine_set' }; + 'stk_parallel_engine_set' ... + 'stk_plot_shadedci' }; for i = 1:(length (filenames)) clear (filenames{i}); @@ -181,9 +184,6 @@ end % Add STK folders to the path addpath (path{:}); -% Selectively add MOLE subdirectories to compensate for missing functions -stk_init__config_mole (root, true, false); % (add to path, but do not prune) - end % function @@ -272,89 +272,3 @@ s = strrep (s, '+', '\+'); s = strrep (s, '.', '\.'); end % function - - -function stk_init__config_mole (root, do_addpath, prune_unused) - -mole_dir = fullfile (root, 'misc', 'mole'); -isoctave = (exist ('OCTAVE_VERSION', 'builtin') == 5); - -if isoctave - recursive_rmdir_state = confirm_recursive_rmdir (0); -end - -opts = {root, mole_dir, do_addpath, prune_unused}; - -% Provide missing octave functions for Matlab users -% TODO: extract functions that are REALLY needed in separate directories -% and get rid of the others ! -if (exist ('OCTAVE_VERSION', 'builtin') ~= 5) % if Matlab - if do_addpath - addpath (fullfile (mole_dir, 'matlab')); - end -elseif prune_unused - rmdir (fullfile (mole_dir, 'matlab'), 's'); -end - -% graphics_toolkit -% * For Octave users: graphics_toolkit is missing in some old version of Octave -% * For Matlab users: there is no function named graphics_toolkit in Matlab. -% Our implementation returns either 'matlab-jvm' or 'matlab-nojvm'. -install_mole_function ('graphics_toolkit', opts{:}); - -% isrow -% * For Octave users: ? -% * For Matlab users: missing in R2007a -install_mole_function ('isrow', opts{:}); - -% linsolve -% * For Octave users: linsolve has been missing in Octave for a long time -% (up to 3.6.4) -% * For Matlab users: ? -install_mole_function ('linsolve', opts{:}); - -% quantile -% * For Octave users: ? -% * For Matlab users: quantile is missing from Matlab itself, but it provided -% by the Statistics toolbox if you're rich enough to afford it. -install_mole_function ('quantile', opts{:}); - -% cleanup -if isoctave - confirm_recursive_rmdir (recursive_rmdir_state); -end - -end % function - - -function install_mole_function (funct_name, ... - root, mole_dir, do_addpath, prune_unused) - -function_dir = fullfile (mole_dir, funct_name); - -w = which (funct_name); - -if (isempty (w)) || (~ isempty (strfind (w, root))) % if the function is absent - - function_mfile = fullfile (function_dir, [funct_name '.m']); - - if exist (function_dir, 'dir') && exist (function_mfile, 'file') - - % fprintf ('[MOLE] Providing function %s\n', function_name); - if do_addpath - addpath (function_dir); - end - - else - - warning (sprintf ('[MOLE] Missing function: %s\n', funct_name)); - - end - -elseif prune_unused && (exist (function_dir, 'dir')) - - rmdir (function_dir, 's'); - -end - -end % function diff --git a/inst/stk_version.m b/inst/stk_version.m index 760b942..f30a90a 100644 --- a/inst/stk_version.m +++ b/inst/stk_version.m @@ -12,7 +12,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -29,6 +29,6 @@ function v = stk_version () -v = '2.6.1'; +v = '2.7.0'; end % function diff --git a/inst/utils/stk_conditioning.m b/inst/utils/stk_conditioning.m index 12a7e66..544cb59 100644 --- a/inst/utils/stk_conditioning.m +++ b/inst/utils/stk_conditioning.m @@ -58,7 +58,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -153,7 +153,7 @@ end % function %! zi = (1:NI)'; % linear response ;-) %! %! % Carry out the kriging prediction at points xt -%! model = stk_model ('stk_materncov52_iso'); +%! model = stk_model (@stk_materncov52_iso); %! model.param = log ([1.0; 2.9]); %! [ignore_zp, lambda] = stk_predict (model, xi, [], xt); %! diff --git a/inst/utils/stk_generate_samplepaths.m b/inst/utils/stk_generate_samplepaths.m index 165f3fd..d2bae08 100644 --- a/inst/utils/stk_generate_samplepaths.m +++ b/inst/utils/stk_generate_samplepaths.m @@ -50,7 +50,7 @@ % Copyright Notice % -% Copyright (C) 2015-2018 CentraleSupelec +% Copyright (C) 2015-2018, 2021 CentraleSupelec % Copyright (C) 2011-2014 SUPELEC % % Authors: Julien Bect <julien.bect@centralesupelec.fr> @@ -61,7 +61,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -78,9 +78,6 @@ function zsim = stk_generate_samplepaths (model, varargin) -% Note: we know that none of the input argument is an stk_dataframe object -% (otherwise we would have ended up in @stk_dataframe/stk_generate_samplepaths) - switch nargin case {0, 1} @@ -119,7 +116,6 @@ end %--- Process input arguments --------------------------------------------------- -% Extract row names from xt xt = double (xt); % Check nb_paths argument @@ -149,7 +145,7 @@ end %--- Generate unconditional sample paths -------------------------------------- % Pick unique simulation points -[xt_unique, ignd, j] = unique (xt, 'rows'); %#ok<ASGLU> CG#07 +[xt_unique, ~, j] = unique (xt, 'rows'); % Did we actually find duplicates in xt ? duplicates_detected = (size (xt_unique, 1) < size (xt, 1)); @@ -178,7 +174,7 @@ if duplicates_detected, zsim = zsim(j, :); end if conditional % Carry out the kriging prediction at points xt - [ignd, lambda] = stk_predict (model, xi, zi, xt); %#ok<ASGLU> CG#07 + [~, lambda] = stk_predict (model, xi, zi, xt); if ~ stk_isnoisy (model) @@ -207,7 +203,7 @@ end % function %!shared model, xi, zi, xt, n, nb_paths %! dim = 1; n = 50; nb_paths = 5; -%! model = stk_model ('stk_materncov32_iso', dim); +%! model = stk_model (@stk_materncov32_iso, dim); %! model.param = log ([1.0; 2.9]); %! xt = stk_sampling_regulargrid (n, dim, [-1.0; 1.0]); %! xi = [xt(1, :); xt(end, :)]; zi = [0; 0]; diff --git a/inst/utils/stk_plot1d.m b/inst/utils/stk_plot1d.m index f2826ed..7a213a6 100644 --- a/inst/utils/stk_plot1d.m +++ b/inst/utils/stk_plot1d.m @@ -36,7 +36,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/utils/stk_plot_histnormres.m b/inst/utils/stk_plot_histnormres.m index 8eafcaa..30b57f5 100644 --- a/inst/utils/stk_plot_histnormres.m +++ b/inst/utils/stk_plot_histnormres.m @@ -17,7 +17,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -53,9 +53,20 @@ end % Choose the number of bins using the Freedman-Diaconis rule n = length (norm_res); q = quantile (norm_res, [0 0.25 0.75 1]); -binsize = 2 * (q(3) -q(2)) * (n ^ (- 1/3)); +norm_res_range = q(4) - q(1); +norm_res_iqr = q(3) - q(2); +if norm_res_iqr >= 0.1 * norm_res_range + % For reasonably large norm_res_iqr, we use teh FD rule + binsize = 2 * norm_res_iqr * (n ^ (- 1/3)); +else + % Safety net for small (possibly zero) norm_res_iqr + binsize = 0.2 * norm_res_range * (n ^ (- 1/3)); +end nbins = ceil ((q(4) - q(1)) / binsize); +% Use the number of bins provided by Sturges' rule as a minimum +nbins = max (nbins, 1 + log2 (n)); + % Compute and plot histogram pdf [count, rr] = hist (norm_res, nbins); pdf = count / (n * (rr(2) - rr(1))); @@ -67,7 +78,7 @@ M = max (3, max (abs (xlim ()))); xlim ([-M, M]); % Plot reference N(0, 1) pdf rr = linspace (-M, M, 100); pdf_ref = 1 / (sqrt (2 * pi)) * (exp (- 0.5 * (rr .^ 2))); -h.ref_pdf = plot (rr, pdf_ref, 'r--'); +h.ref_pdf = plot (rr, pdf_ref, 'r--'); hold off; % Apply options if ~ isempty (opts) diff --git a/inst/utils/stk_plot_predvsobs.m b/inst/utils/stk_plot_predvsobs.m index 25a0659..d06b287 100644 --- a/inst/utils/stk_plot_predvsobs.m +++ b/inst/utils/stk_plot_predvsobs.m @@ -17,7 +17,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free @@ -55,7 +55,7 @@ end h.data = plot (h_axes, y, y_pred, 'kd'); hold on; % Plot "reference" line y_LOO = y -h.refline = plot (h_axes, xlim, xlim, 'r--'); +h.refline = plot (h_axes, xlim, xlim, 'r--'); hold off; % Apply options if ~ isempty (opts) diff --git a/inst/utils/stk_plot_probdom2d.m b/inst/utils/stk_plot_probdom2d.m index 76cf3c8..0370384 100644 --- a/inst/utils/stk_plot_probdom2d.m +++ b/inst/utils/stk_plot_probdom2d.m @@ -41,7 +41,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/utils/stk_pmisclass.m b/inst/utils/stk_pmisclass.m index 777543f..24fcc73 100644 --- a/inst/utils/stk_pmisclass.m +++ b/inst/utils/stk_pmisclass.m @@ -33,7 +33,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/inst/utils/stk_simulate_noise.m b/inst/utils/stk_simulate_noise.m index 7cd5879..b0babb6 100644 --- a/inst/utils/stk_simulate_noise.m +++ b/inst/utils/stk_simulate_noise.m @@ -32,7 +32,7 @@ % This file is part of % % STK: a Small (Matlab/Octave) Toolbox for Kriging -% (http://sourceforge.net/projects/kriging) +% (https://github.com/stk-kriging/stk/) % % STK is free software: you can redistribute it and/or modify it under % the terms of the GNU General Public License as published by the Free diff --git a/post_install.m b/post_install.m deleted file mode 100644 index 8e6ee99..0000000 --- a/post_install.m +++ /dev/null @@ -1,42 +0,0 @@ -# POST_INSTALL is run after the installation of the package - -# Copyright Notice -# -# Copyright (C) 2014 SUPELEC -# Copyright (C) 2015 CentraleSupelec -# -# Author: Julien Bect <julien.bect@centralesupelec.fr> - -# Copying Permission Statement -# -# This file is part of -# -# STK: a Small (Matlab/Octave) Toolbox for Kriging -# (http://sourceforge.net/projects/kriging) -# -# STK is free software: you can redistribute it and/or modify it under -# the terms of the GNU General Public License as published by the Free -# Software Foundation, either version 3 of the License, or (at your -# option) any later version. -# -# STK is distributed in the hope that it will be useful, but WITHOUT -# ANY WARRANTY; without even the implied warranty of MERCHANTABILITY -# or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public -# License for more details. -# -# You should have received a copy of the GNU General Public License -# along with STK. If not, see <http://www.gnu.org/licenses/>. - -function post_install (desc) - - here = pwd (); - - # Prune unused functions from the MOLE - unwind_protect - cd (desc.dir); - stk_init prune_mole - unwind_protect_cleanup - cd (here); - end_unwind_protect - -endfunction diff --git a/src/get_column_number.c b/src/get_column_number.c index 975c898..83dc40d 100644 --- a/src/get_column_number.c +++ b/src/get_column_number.c @@ -4,6 +4,7 @@ * * * Copyright Notice * * * + * Copyright (C) 2020 CentraleSupelec * * Copyright (C) 2013 SUPELEC * * * * Author: Julien Bect <julien.bect@centralesupelec.fr> * @@ -13,7 +14,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * @@ -33,9 +34,10 @@ #include "string.h" #include "stk_mex.h" -#define ICOL_INFO -5 /* will be a -4 in the end */ -#define ICOL_ROWNAMES -4 /* will be a -3 in the end */ -#define ICOL_COLNAMES -3 /* will be a -2 in the end */ +#define ICOL_SAMPLESIZE -6 /* will be a -5 in the end */ +#define ICOL_INFO -5 /* will be a -4 in the end */ +#define ICOL_ROWNAMES -4 /* will be a -3 in the end */ +#define ICOL_COLNAMES -3 /* will be a -2 in the end */ #define ICOL_ENTIRE_DATAFRAME -2 /* will be a -1 in the end */ int get_column_number(const mxArray* mxColNames, char* s) @@ -54,6 +56,9 @@ int get_column_number(const mxArray* mxColNames, char* s) if (strcmp (s, "colnames") == 0) return ICOL_COLNAMES; + if (strcmp (s, "sample_size") == 0) + return ICOL_SAMPLESIZE; + ncol = mxGetNumberOfElements (mxColNames); if (ncol == 0) { if (strcmp(s, "data") == 0) diff --git a/src/pareto.h b/src/pareto.h index 02423df..a57ced5 100644 --- a/src/pareto.h +++ b/src/pareto.h @@ -13,7 +13,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_dist_matrixx.c b/src/stk_dist_matrixx.c index ee5a86d..4db70da 100644 --- a/src/stk_dist_matrixx.c +++ b/src/stk_dist_matrixx.c @@ -15,7 +15,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_dist_matrixy.c b/src/stk_dist_matrixy.c index 1e5960f..ec23115 100644 --- a/src/stk_dist_matrixy.c +++ b/src/stk_dist_matrixy.c @@ -15,7 +15,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_dist_pairwise.c b/src/stk_dist_pairwise.c index d7d5d41..24a1f2f 100644 --- a/src/stk_dist_pairwise.c +++ b/src/stk_dist_pairwise.c @@ -14,7 +14,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_distrib_bivnorm0_cdf.c b/src/stk_distrib_bivnorm0_cdf.c index d708f0b..5f17a15 100644 --- a/src/stk_distrib_bivnorm0_cdf.c +++ b/src/stk_distrib_bivnorm0_cdf.c @@ -17,7 +17,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_dominatedhv_mex.c b/src/stk_dominatedhv_mex.c index f57060a..55f5bf0 100644 --- a/src/stk_dominatedhv_mex.c +++ b/src/stk_dominatedhv_mex.c @@ -13,7 +13,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_filldist_discr_mex.c b/src/stk_filldist_discr_mex.c index 734a733..f06dc31 100644 --- a/src/stk_filldist_discr_mex.c +++ b/src/stk_filldist_discr_mex.c @@ -14,7 +14,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_gpquadform_matrixx.c b/src/stk_gpquadform_matrixx.c index b1cdf2d..523ee1d 100644 --- a/src/stk_gpquadform_matrixx.c +++ b/src/stk_gpquadform_matrixx.c @@ -14,7 +14,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_gpquadform_matrixy.c b/src/stk_gpquadform_matrixy.c index b08a872..d481f28 100644 --- a/src/stk_gpquadform_matrixy.c +++ b/src/stk_gpquadform_matrixy.c @@ -14,7 +14,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_gpquadform_pairwise.c b/src/stk_gpquadform_pairwise.c index 7204f75..f38f721 100644 --- a/src/stk_gpquadform_pairwise.c +++ b/src/stk_gpquadform_pairwise.c @@ -14,7 +14,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_isdominated_mex.c b/src/stk_isdominated_mex.c index 6f3ac86..cbcc6e7 100644 --- a/src/stk_isdominated_mex.c +++ b/src/stk_isdominated_mex.c @@ -13,7 +13,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_mex.h b/src/stk_mex.h index 7951c49..101e04d 100644 --- a/src/stk_mex.h +++ b/src/stk_mex.h @@ -14,7 +14,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_mindist_mex.c b/src/stk_mindist_mex.c index d71f432..b161179 100644 --- a/src/stk_mindist_mex.c +++ b/src/stk_mindist_mex.c @@ -14,7 +14,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_paretofind_mex.c b/src/stk_paretofind_mex.c index 14852df..9cc8917 100644 --- a/src/stk_paretofind_mex.c +++ b/src/stk_paretofind_mex.c @@ -13,7 +13,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_sampling_sobol_mex.c b/src/stk_sampling_sobol_mex.c index bd85713..903e650 100644 --- a/src/stk_sampling_sobol_mex.c +++ b/src/stk_sampling_sobol_mex.c @@ -22,7 +22,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * diff --git a/src/stk_sampling_vdc_rr2.c b/src/stk_sampling_vdc_rr2.c index 422d5d7..99a393d 100644 --- a/src/stk_sampling_vdc_rr2.c +++ b/src/stk_sampling_vdc_rr2.c @@ -15,7 +15,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * @@ -19,7 +19,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * @@ -19,7 +19,7 @@ * This file is part of * * * * STK: a Small (Matlab/Octave) Toolbox for Kriging * - * (http://sourceforge.net/projects/kriging) * + * (https://github.com/stk-kriging/stk/) * * * * STK is free software: you can redistribute it and/or modify it under * * the terms of the GNU General Public License as published by the Free * |