1 ## Copyright (C) 2009 Michael Cree <michael.creel@uab.es>
2 ## under the terms of the GNU General Public License.
4 ## This program is free software; you can redistribute it and/or modify
5 ## it under the terms of the GNU General Public License as published by
6 ## the Free Software Foundation; either version 2 of the License, or
7 ## (at your option) any later version.
9 ## This program is distributed in the hope that it will be useful,
10 ## but WITHOUT ANY WARRANTY; without even the implied warranty of
11 ## MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 ## GNU General Public License for more details.
14 ## You should have received a copy of the GNU General Public License
15 ## along with this program; If not, see <http://www.gnu.org/licenses/>.
18 # mc_example: shows how Monte Carlo can be done using mpi, Does Monte
19 # Carlo on the OLS estimator. Uses montecarlo.m
21 # USAGE: from the command prompt, not the octave prompt, execute
22 # orterun -np 3 octave --eval mc_example
24 function betahat = olswrapper(args)
27 x = [ones(n,1) randn(n,1)];
28 y = x*theta + randn(n,1);
40 outfile = "mc_output";
44 montecarlo(f, args, reps, outfile, n_pooled, false, verbose);
49 # montecarlo(f, args, reps, outfile, n_pooled, verbose);
52 # info = MPI_Finalize()