### Added new mex file for computing Quasi Monte-Carlo sequences (Sobol), texinfo...

Added new mex file for computing Quasi Monte-Carlo sequences (Sobol), texinfo headers and unitary tests are available in <DYNARE_PATH>/matlab/qmc_sequence.m.
parent dec622c4
 ... ... @@ -246,5 +246,15 @@ else end if verbose disp([ message 'k-order solution simulation.' ]) end % Test if qmc_sequence DLL is present if exist('qmc_sequence', 'file') == 3 message = '[mex] '; else message = '[no] '; end if verbose disp([ message 'Quasi Monte-Carlo sequence (Sobol).' ]) disp(' ') end
 %@info: %! @deftypefn {Mex File} {[@var{a}, @var{s}] =} qmc_sequence (@var{d}, @var{s}, @var{t}, @var{n}, @var{lu}) %! @anchor{qmc_sequence} %! @sp 1 %! Computes quasi Monte-Carlo sequence (Sobol numbers). %! @sp 2 %! @strong{Inputs} %! @sp 1 %! @table @ @var %! @item d %! Integer scalar, dimension. %! @item s %! Integer scalar (int32 or int64), seed. %! @item t %! Integer scalar, sequence type: %! @sp 1 %! @table @ @samp %! @item @var{t}=0 %! Uniform numbers in a n-dimensional (unit by default) hypercube %! @item @var{t}=1 %! Gaussian numbers %! @item @var{t}=2 %! Uniform numbers on a n-dimensional (unit by default) hypersphere %! @end table %! @item n %! Integer scalar, number of elements in the sequence. %! @item lu %! Optional argument, the interpretation depends on its size: %! @sp 1 %! @table @ @samp %! @item @var{d}x2 array of doubles %! Lower and upper bounds of the hypercube (default is 0-1 in all dimensions). @var{t} must be equal to zero. %! @item @var{d}x@var{d} array of doubles %! Covariance matrix of the Gaussian variates (default is the identity matrix). @var{t} must be equal to one. %! @item scalar double %! Radius of the hypershere (default is one). @var{t} must be equal to two. %! @end table %! @end table %! @sp 2 %! @strong{Outputs} %! @sp 1 %! @table @ @var %! @item a %! @var{n}x@var{d} matrix of doubles, the Sobol sequence. %! @item s %! Integer scalar, current value of the seed. %! @end table %! @sp 2 %! @strong{This function is called by:} %! @sp 2 %! @strong{This function calls:} %! @sp 2 %! @end deftypefn %@eod: %@test:1 %\$ t = ones(3,1); %\$ %\$ d = 2; %\$ n = 100; %\$ s = int64(0); %\$ %\$ try %\$ [draws, S] = qmc_sequence(d,s,0,n); %\$ catch %\$ t(1) = 0; %\$ end %\$ %\$ try %\$ [draws, S] = qmc_sequence(d,s,1,n); %\$ catch %\$ t(2) = 0; %\$ end %\$ %\$ try %\$ [draws, S] = qmc_sequence(d,s,2,n); %\$ catch %\$ t(3) = 0; %\$ end %\$ %\$ T = all(1); %@eof:1 \ No newline at end of file
 ... ... @@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I ../../../m4 # libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_ if DO_SOMETHING SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv k_order_perturbation dynare_simul_ estimation block_kalman_filter SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv k_order_perturbation dynare_simul_ estimation block_kalman_filter sobol if HAVE_GSL SUBDIRS += ms_sbvar ... ...
 ... ... @@ -143,6 +143,7 @@ AC_CONFIG_FILES([Makefile libslicot/Makefile kalman_steady_state/Makefile ms_sbvar/Makefile block_kalman_filter/Makefile]) block_kalman_filter/Makefile sobol/Makefile]) AC_OUTPUT
 include ../mex.am include ../../qmc_sequence.am
 ... ... @@ -2,7 +2,7 @@ ACLOCAL_AMFLAGS = -I ../../../m4 # libdynare++ must come before gensylv, k_order_perturbation, dynare_simul_ if DO_SOMETHING SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv k_order_perturbation dynare_simul_ qzcomplex ordschur block_kalman_filter SUBDIRS = mjdgges kronecker bytecode libdynare++ gensylv k_order_perturbation dynare_simul_ qzcomplex ordschur block_kalman_filter sobol if HAVE_GSL SUBDIRS += ms_sbvar ... ...
 ... ... @@ -130,6 +130,7 @@ AC_CONFIG_FILES([Makefile libslicot/Makefile kalman_steady_state/Makefile ms_sbvar/Makefile block_kalman_filter/Makefile]) block_kalman_filter/Makefile sobol/Makefile]) AC_OUTPUT
 include ../mex.am include ../../qmc_sequence.am
 vpath %.cc \$(top_srcdir)/../../sources/sobol noinst_PROGRAMS = qmc_sequence nodist_qmc_sequence_SOURCES = qmc_sequence.cc
 ... ... @@ -13,7 +13,8 @@ EXTRA_DIST = \ libslicot \ kalman_steady_state \ ms-sbvar \ block_kalman_filter block_kalman_filter \ sobol clean-local: rm -rf `find mex/sources -name *.o` ... ...