Example script illustrating how to fit the CSS model

Contents

Add code to the MATLAB path

addpath(genpath(fullfile(pwd,'code')));

Load data

% load data from the first dataset
load('dataset01.mat','betamn','betase');

Load stimuli

load('stimuli.mat','conimages');

Perform stimulus pre-processing

% extract the stimuli we need and then concatenate along the third dimension
stimulus = conimages(1:69);
stimulus = cat(3,stimulus{:});

% resize the stimuli to 100 x 100 (to reduce computational time)
temp = zeros(100,100,size(stimulus,3));
for p=1:size(stimulus,3)
  temp(:,:,p) = imresize(stimulus(:,:,p),[100 100],'cubic');
end
stimulus = temp;

% ensure that all values are between 0 and 1
stimulus(stimulus < 0) = 0;
stimulus(stimulus > 1) = 1;

% inspect one of the stimuli
figure;
imagesc(stimulus(:,:,10));
axis image tight;
colormap(gray);
colorbar;
title('Stimulus');
% reshape stimuli into a "flattened" format: 69 stimuli x 100*100 positions
stimulus = reshape(stimulus,100*100,69)';

Prepare for model fitting

% to perform model fitting, we will be using fitnonlinearmodel.m.  this function
% is essentially a wrapper around MATLAB's lsqcurvefit.m function.  the benefit
% of fitnonlinearmodel.m is that it simplifies input and output issues, deals with
% resampling (cross-validation and bootstrapping), makes it easy to evaluate multiple
% initial seeds, and makes it easy to perform stepwise fitting of models.
%
% to prepare for the call to fitnonlinearmodel.m, we have to define various
% input parameters.  this is what we will now do.

% define constants
res = 100;  % resolution of the pre-processed stimuli

% the parameters of the CSS model are [R C S G N] where
%   R is the row index of the center of the 2D Gaussian
%   C is the column index of the center of the 2D Gaussian
%   S is the standard deviation of the 2D Gaussian
%   G is a gain parameter
%   N is the exponent of the power-law nonlinearity

% define the initial seed for the model parameters
seed = [(1+res)/2 (1+res)/2 res 1 0.5];

% define bounds for the model parameters
bounds = [1-res+1 1-res+1 0   -Inf 0;
          2*res-1 2*res-1 Inf  Inf Inf];

% fitnonlinearmodel.m provides the capacity to perform stepwise fitting.
% here, we define a version of bounds where we insert a NaN in the first
% row in the spot that corresponds to the exponent parameter.  this
% indicates to fix the exponent parameter and not optimize it.
boundsFIX = bounds;
boundsFIX(1,5) = NaN;

% issue a dummy call to makegaussian2d.m to pre-compute xx and yy.
% these variables are re-used to achieve faster computation.
[d,xx,yy] = makegaussian2d(res,2,2,2,2);

% we will now define a function that implements the CSS model.  this function
% accepts a set of parameters (pp, a vector of size 1 x 5) and a set of stimuli
% (dd, a matrix of size A x 100*100) and outputs the predicted response to those
% stimuli (as a vector of size A x 1).  for compactness, we implement this
% function as an anonymous function where the parameters are given by pp
% and the stimuli are given by dd.
modelfun = @(pp,dd) pp(4)*((dd*vflatten(makegaussian2d(res,pp(1),pp(2),pp(3),pp(3),xx,yy,0,0)/(2*pi*pp(3)^2))).^pp(5));

% notice that the overall structure of the model is
%   RESP = GAIN*(STIM*GAU).^N
% where STIM*GAU represents the dot product between the stimulus and the 2D Gaussian.
% also, note that the division by (2*pi*pp(3)^2) makes it such that the integral
% of the Gaussian is equal to 1 (this aids the interpretation of model parameters).

% now that we have defined modelfun, we are ready to define the final model
% specification.  in the following, we specify a stepwise fitting scheme.
% in the first fit (the first row), we start at the seed and optimize all
% parameters except the exponent parameter.  in the second fit (the second row),
% we start at the parameters estimated in the first fit and optimize all parameters.
% the purpose of the stepwise fitting is to help converge to a good solution
% (i.e. avoid local minima).  (the anonymous functions in the second row accept
% a single input, ss, which refers to the parameters estimated in the first fit.)
model = {{seed       boundsFIX   modelfun} ...
         {@(ss) ss   bounds      @(ss) modelfun}};

% define the resampling scheme to use.  here, we use 0, which
% means to just fit the data (no cross-validation nor bootstrapping).
resampling = 0;

% define the metric that we will use to quantify goodness-of-fit.
% here, we use a version of the coefficient of determination (R^2)
% in which variance in the data is computed relative to 0.
% this is sensible since the data being fitted are beta weights that
% represent evoked BOLD responses relative to the baseline signal level
% (which corresponds to 0).
metric = @(a,b) calccod(a,b,[],[],0);

% specify the index of the voxel to fit
ix = 774;

% finally, construct the options struct that will be passed to fitnonlinearmodel.m
opt = struct( ...
  'stimulus',    stimulus, ...
  'data',        betamn(ix,:)', ...
  'model',       {model}, ...
  'resampling',  resampling, ...
  'metric',      metric);

% do a quick inspection of opt
opt
opt = 

      stimulus: [69x10000 double]
          data: [69x1 double]
         model: {{1x3 cell}  {1x3 cell}}
    resampling: 0
        metric: @(a,b)calccod(a,b,[],[],0)

Fit the model

results = fitnonlinearmodel(opt);
*** fitnonlinearmodel: started at 28-Aug-2013 15:06:48. ***
*** fitnonlinearmodel: outputdir = , chunksize = 1, chunknum = 1
*** fitnonlinearmodel: processing voxel 1 (1 of 1). ***
  starting resampling case 1 of 1.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].

                                         Norm of      First-order 
 Iteration  Func-count     f(x)          step          optimality   CG-iterations
     0          5         104.233                          3.81
     1         10            54.6             10           8.05            0
     2         15            54.6        15.3087           8.05            0
     3         20         50.0035        3.82717            7.5            0
     4         25         49.1133        7.65434           28.2            0
     5         30         41.7395        1.91359           8.44            0
     6         35         34.8988        3.82717           8.28            0
     7         40         29.4667        7.65434           88.5            0
     8         45         22.6331        7.65434           5.77            0
     9         50         22.6331        15.3087           5.77            0
    10         55         22.1674        3.82717           55.1            0
    11         60         20.7333        3.82717           3.78            0
    12         65         19.5537        7.65434           19.6            0
    13         70         19.2184        7.65434           38.5            0
    14         75         19.1652        7.65434           59.1            0
    15         80         18.4681        1.91359           9.57            0
    16         85         18.1067        3.82717           27.6            0
    17         90         18.1067        7.65434           27.6            0
    18         95         17.5485        1.91359           13.9            0
    19        100         17.2896        3.82717           45.5            0
    20        105         14.2057       0.956793           8.88            0
    21        110         8.50901        1.98899           5.09            0
    22        115         6.72255        1.07993           4.48            0
    23        120         6.66995       0.685839           4.37            0
    24        125         6.65224       0.233778           3.85            0
    25        130         6.64027      0.0584446          0.357            0
    26        135         6.63494       0.116889          0.562            0
    27        140         6.63475     0.00636041          0.185            0
    28        145         6.63474      0.0143304         0.0977            0
    29        150         6.63472     0.00358261         0.0489            0
    30        155         6.63471    0.000333935        0.00531            0

Local minimum possible.

lsqcurvefit stopped because the final change in the sum of squares relative to 
its initial value is less than the selected value of the function tolerance.



      the estimated parameters are [61.913 70.397 3.044 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.397 3.044 6.443 0.500 ].

                                         Norm of      First-order 
 Iteration  Func-count     f(x)          step          optimality   CG-iterations
     0          6         6.63471                         0.111
     1         12         6.62125       0.231237           1.76            0
     2         18         6.62086       0.155173          0.886            0
     3         24         6.61918      0.0387932          0.463            0
     4         30          6.6188      0.0430187          0.102            0
     5         36         6.61879     0.00487545         0.0349            0

Local minimum possible.

lsqcurvefit stopped because the final change in the sum of squares relative to 
its initial value is less than the selected value of the function tolerance.



      the estimated parameters are [62.003 70.392 2.739 6.416 0.429 ].
*** fitnonlinearmodel: voxel 1 (1 of 1) took 1.1 seconds. ***
*** fitnonlinearmodel: ended at 28-Aug-2013 15:06:49 (0.0 minutes). ***

Inspect the results

% these are the final parameter estimates
results.params
ans =

  Columns 1 through 3

          62.0031314121038          70.3915456636858          2.73865321049464

  Columns 4 through 5

          6.41562465044818         0.428524030231163

% this is the R^2 between the model fit and the data
results.trainperformance
ans =

          94.0972119990802

% visualize the parameter estimates
figure; hold on;
pp = results.params;
  % draw a circle indicating the PRF location +/- 2 PRF sizes.
  % PRF size is defined as S/sqrt(N).
drawellipse(pp(2),pp(1),0,2*pp(3)/sqrt(pp(5)),2*pp(3)/sqrt(pp(5)));
drawrectangle((1+res)/2,(1+res)/2,res,res,'k-');
axis([.5 res+.5 .5 res+.5]);
set(gca,'YDir','reverse');
axis square;
title('Estimated PRF location and size');
% visualize the data and the model fit
figure; setfigurepos([100 100 450 250]); hold on;
bar(betamn(ix,:),1);
errorbar2(1:69,betamn(ix,:),betase(ix,:),'v','g-','LineWidth',2);
modelfit = modelfun(results.params,stimulus);
plot(1:69,modelfit,'r-','LineWidth',3);
ax = axis;
axis([0 70 ax(3:4)]);
xlabel('Stimulus number');
ylabel('BOLD signal (% change)');
title('Data and model fit');

Try a different resampling scheme: cross-validation

% define an options struct that specifies leave-one-out cross-validation
optXVAL = opt;
optXVAL.resampling = -2*(eye(69) - 0.5);
optXVAL.optimoptions = {'Display' 'off'};  % turn off reporting

% fit the model
resultsXVAL = fitnonlinearmodel(optXVAL);
*** fitnonlinearmodel: started at 28-Aug-2013 15:06:50. ***
*** fitnonlinearmodel: outputdir = , chunksize = 1, chunknum = 1
*** fitnonlinearmodel: processing voxel 1 (1 of 1). ***
  starting resampling case 1 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.396 3.045 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.396 3.045 6.443 0.500 ].
      the estimated parameters are [62.003 70.392 2.738 6.416 0.428 ].
  starting resampling case 2 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.397 3.044 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.397 3.044 6.443 0.500 ].
      the estimated parameters are [62.003 70.392 2.739 6.416 0.429 ].
  starting resampling case 3 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.396 3.045 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.396 3.045 6.443 0.500 ].
      the estimated parameters are [62.003 70.392 2.738 6.416 0.428 ].
  starting resampling case 4 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.396 3.045 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.396 3.045 6.443 0.500 ].
      the estimated parameters are [62.003 70.392 2.738 6.416 0.428 ].
  starting resampling case 5 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.912 70.396 3.043 6.443 0.500 ].
      for model 2 of 2, the seed is [61.912 70.396 3.043 6.443 0.500 ].
      the estimated parameters are [62.003 70.394 2.735 6.415 0.428 ].
  starting resampling case 6 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.397 3.044 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.397 3.044 6.443 0.500 ].
      the estimated parameters are [62.003 70.392 2.739 6.416 0.429 ].
  starting resampling case 7 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.397 3.044 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.397 3.044 6.443 0.500 ].
      the estimated parameters are [62.003 70.392 2.739 6.416 0.429 ].
  starting resampling case 8 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.396 3.043 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.396 3.043 6.443 0.500 ].
      the estimated parameters are [62.003 70.394 2.735 6.415 0.428 ].
  starting resampling case 9 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.914 70.396 3.045 6.443 0.500 ].
      for model 2 of 2, the seed is [61.914 70.396 3.045 6.443 0.500 ].
      the estimated parameters are [62.003 70.391 2.739 6.416 0.429 ].
  starting resampling case 10 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.914 70.396 3.045 6.443 0.500 ].
      for model 2 of 2, the seed is [61.914 70.396 3.045 6.443 0.500 ].
      the estimated parameters are [62.003 70.393 2.736 6.416 0.428 ].
  starting resampling case 11 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.919 70.390 3.055 6.443 0.500 ].
      for model 2 of 2, the seed is [61.919 70.390 3.055 6.443 0.500 ].
      the estimated parameters are [62.006 70.388 2.748 6.416 0.429 ].
  starting resampling case 12 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.980 70.279 3.152 6.444 0.500 ].
      for model 2 of 2, the seed is [61.980 70.279 3.152 6.444 0.500 ].
      the estimated parameters are [62.056 70.281 2.857 6.417 0.434 ].
  starting resampling case 13 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.868 70.554 2.992 6.442 0.500 ].
      for model 2 of 2, the seed is [61.868 70.554 2.992 6.442 0.500 ].
      the estimated parameters are [61.956 70.527 2.730 6.418 0.436 ].
  starting resampling case 14 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.915 70.368 3.035 6.446 0.500 ].
      for model 2 of 2, the seed is [61.915 70.368 3.035 6.446 0.500 ].
      the estimated parameters are [62.021 70.342 2.677 6.419 0.418 ].
  starting resampling case 15 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.911 70.394 3.043 6.433 0.500 ].
      for model 2 of 2, the seed is [61.911 70.394 3.043 6.433 0.500 ].
      the estimated parameters are [62.006 70.390 2.720 6.403 0.425 ].
  starting resampling case 16 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.915 70.400 3.044 6.453 0.500 ].
      for model 2 of 2, the seed is [61.915 70.400 3.044 6.453 0.500 ].
      the estimated parameters are [62.001 70.395 2.751 6.426 0.431 ].
  starting resampling case 17 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.916 70.400 3.045 6.457 0.500 ].
      for model 2 of 2, the seed is [61.916 70.400 3.045 6.457 0.500 ].
      the estimated parameters are [62.000 70.396 2.756 6.430 0.433 ].
  starting resampling case 18 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.917 70.403 3.045 6.467 0.500 ].
      for model 2 of 2, the seed is [61.917 70.403 3.045 6.467 0.500 ].
      the estimated parameters are [61.997 70.400 2.770 6.441 0.436 ].
  starting resampling case 19 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.921 70.413 3.045 6.501 0.500 ].
      for model 2 of 2, the seed is [61.921 70.413 3.045 6.501 0.500 ].
      the estimated parameters are [61.988 70.411 2.817 6.479 0.447 ].
  starting resampling case 20 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.914 70.398 3.045 6.448 0.500 ].
      for model 2 of 2, the seed is [61.914 70.398 3.045 6.448 0.500 ].
      the estimated parameters are [62.002 70.393 2.744 6.420 0.430 ].
  starting resampling case 21 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.915 70.399 3.044 6.453 0.500 ].
      for model 2 of 2, the seed is [61.915 70.399 3.044 6.453 0.500 ].
      the estimated parameters are [62.001 70.395 2.751 6.426 0.431 ].
  starting resampling case 22 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.398 3.042 6.449 0.500 ].
      for model 2 of 2, the seed is [61.913 70.398 3.042 6.449 0.500 ].
      the estimated parameters are [62.002 70.395 2.743 6.421 0.430 ].
  starting resampling case 23 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.911 70.392 3.044 6.429 0.500 ].
      for model 2 of 2, the seed is [61.911 70.392 3.044 6.429 0.500 ].
      the estimated parameters are [62.007 70.389 2.714 6.399 0.423 ].
  starting resampling case 24 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.912 70.394 3.044 6.435 0.500 ].
      for model 2 of 2, the seed is [61.912 70.394 3.044 6.435 0.500 ].
      the estimated parameters are [62.005 70.391 2.722 6.405 0.425 ].
  starting resampling case 25 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.915 70.400 3.044 6.456 0.500 ].
      for model 2 of 2, the seed is [61.915 70.400 3.044 6.456 0.500 ].
      the estimated parameters are [62.000 70.396 2.754 6.429 0.432 ].
  starting resampling case 26 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.924 70.417 3.047 6.514 0.500 ].
      for model 2 of 2, the seed is [61.924 70.417 3.047 6.514 0.500 ].
      the estimated parameters are [61.985 70.416 2.834 6.494 0.451 ].
  starting resampling case 27 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.911 70.393 3.043 6.429 0.500 ].
      for model 2 of 2, the seed is [61.911 70.393 3.043 6.429 0.500 ].
      the estimated parameters are [62.007 70.389 2.715 6.399 0.424 ].
  starting resampling case 28 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.908 70.386 3.042 6.412 0.500 ].
      for model 2 of 2, the seed is [61.908 70.386 3.042 6.412 0.500 ].
      the estimated parameters are [62.011 70.383 2.691 6.380 0.418 ].
  starting resampling case 29 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.956 70.194 3.095 6.391 0.500 ].
      for model 2 of 2, the seed is [61.956 70.194 3.095 6.391 0.500 ].
      the estimated parameters are [61.991 70.233 2.927 6.378 0.463 ].
  starting resampling case 30 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.915 70.332 3.025 6.441 0.500 ].
      for model 2 of 2, the seed is [61.915 70.332 3.025 6.441 0.500 ].
      the estimated parameters are [62.011 70.511 2.729 6.416 0.420 ].
  starting resampling case 31 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.397 3.043 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.397 3.043 6.443 0.500 ].
      the estimated parameters are [62.003 70.394 2.735 6.416 0.428 ].
  starting resampling case 32 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.396 3.044 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.396 3.044 6.443 0.500 ].
      the estimated parameters are [62.003 70.392 2.739 6.416 0.429 ].
  starting resampling case 33 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.917 70.397 3.046 6.443 0.500 ].
      for model 2 of 2, the seed is [61.917 70.397 3.046 6.443 0.500 ].
      the estimated parameters are [62.006 70.392 2.741 6.416 0.429 ].
  starting resampling case 34 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.308 70.410 2.832 6.429 0.500 ].
      for model 2 of 2, the seed is [61.308 70.410 2.832 6.429 0.500 ].
      the estimated parameters are [61.356 70.411 2.766 6.422 0.480 ].
  starting resampling case 35 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.172 70.357 3.023 6.465 0.500 ].
      for model 2 of 2, the seed is [62.172 70.357 3.023 6.465 0.500 ].
      the estimated parameters are [62.367 70.326 2.358 6.423 0.355 ].
  starting resampling case 36 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.893 70.399 3.051 6.433 0.500 ].
      for model 2 of 2, the seed is [61.893 70.399 3.051 6.433 0.500 ].
      the estimated parameters are [61.990 70.394 2.745 6.406 0.429 ].
  starting resampling case 37 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.923 70.403 3.041 6.471 0.500 ].
      for model 2 of 2, the seed is [61.923 70.403 3.041 6.471 0.500 ].
      the estimated parameters are [62.000 70.401 2.768 6.446 0.436 ].
  starting resampling case 38 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.908 70.391 3.043 6.417 0.500 ].
      for model 2 of 2, the seed is [61.908 70.391 3.043 6.417 0.500 ].
      the estimated parameters are [62.010 70.384 2.698 6.386 0.420 ].
  starting resampling case 39 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.911 70.393 3.043 6.428 0.500 ].
      for model 2 of 2, the seed is [61.911 70.393 3.043 6.428 0.500 ].
      the estimated parameters are [62.007 70.389 2.713 6.398 0.423 ].
  starting resampling case 40 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.910 70.390 3.044 6.425 0.500 ].
      for model 2 of 2, the seed is [61.910 70.390 3.044 6.425 0.500 ].
      the estimated parameters are [62.008 70.387 2.708 6.394 0.422 ].
  starting resampling case 41 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.912 70.393 3.044 6.434 0.500 ].
      for model 2 of 2, the seed is [61.912 70.393 3.044 6.434 0.500 ].
      the estimated parameters are [62.006 70.391 2.720 6.404 0.425 ].
  starting resampling case 42 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.909 70.390 3.043 6.420 0.500 ].
      for model 2 of 2, the seed is [61.909 70.390 3.043 6.420 0.500 ].
      the estimated parameters are [62.010 70.386 2.700 6.388 0.420 ].
  starting resampling case 43 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.917 70.404 3.045 6.469 0.500 ].
      for model 2 of 2, the seed is [61.917 70.404 3.045 6.469 0.500 ].
      the estimated parameters are [61.997 70.400 2.772 6.443 0.436 ].
  starting resampling case 44 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.911 70.393 3.042 6.433 0.500 ].
      for model 2 of 2, the seed is [61.911 70.393 3.042 6.433 0.500 ].
      the estimated parameters are [62.006 70.390 2.720 6.403 0.425 ].
  starting resampling case 45 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.910 70.392 3.043 6.426 0.500 ].
      for model 2 of 2, the seed is [61.910 70.392 3.043 6.426 0.500 ].
      the estimated parameters are [62.008 70.388 2.710 6.395 0.422 ].
  starting resampling case 46 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.916 70.402 3.044 6.459 0.500 ].
      for model 2 of 2, the seed is [61.916 70.402 3.044 6.459 0.500 ].
      the estimated parameters are [61.999 70.397 2.759 6.433 0.433 ].
  starting resampling case 47 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.910 70.390 3.044 6.422 0.500 ].
      for model 2 of 2, the seed is [61.910 70.390 3.044 6.422 0.500 ].
      the estimated parameters are [62.009 70.387 2.704 6.391 0.421 ].
  starting resampling case 48 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.910 70.392 3.043 6.426 0.500 ].
      for model 2 of 2, the seed is [61.910 70.392 3.043 6.426 0.500 ].
      the estimated parameters are [62.008 70.388 2.710 6.395 0.422 ].
  starting resampling case 49 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.917 70.402 3.045 6.466 0.500 ].
      for model 2 of 2, the seed is [61.917 70.402 3.045 6.466 0.500 ].
      the estimated parameters are [61.998 70.399 2.767 6.440 0.435 ].
  starting resampling case 50 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.852 70.400 3.023 6.451 0.500 ].
      for model 2 of 2, the seed is [61.852 70.400 3.023 6.451 0.500 ].
      the estimated parameters are [61.957 70.396 2.675 6.423 0.419 ].
  starting resampling case 51 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.590 70.450 3.054 6.451 0.500 ].
      for model 2 of 2, the seed is [61.590 70.450 3.054 6.451 0.500 ].
      the estimated parameters are [61.522 70.465 2.554 6.411 0.385 ].
  starting resampling case 52 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.229 70.295 2.904 6.439 0.500 ].
      for model 2 of 2, the seed is [62.229 70.295 2.904 6.439 0.500 ].
      the estimated parameters are [62.358 70.285 2.539 6.409 0.415 ].
  starting resampling case 53 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.873 70.414 3.070 6.444 0.500 ].
      for model 2 of 2, the seed is [61.873 70.414 3.070 6.444 0.500 ].
      the estimated parameters are [61.961 70.409 2.772 6.417 0.431 ].
  starting resampling case 54 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.897 70.405 3.058 6.443 0.500 ].
      for model 2 of 2, the seed is [61.897 70.405 3.058 6.443 0.500 ].
      the estimated parameters are [61.986 70.400 2.757 6.416 0.430 ].
  starting resampling case 55 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.897 70.406 3.059 6.443 0.500 ].
      for model 2 of 2, the seed is [61.897 70.406 3.059 6.443 0.500 ].
      the estimated parameters are [61.986 70.401 2.761 6.416 0.431 ].
  starting resampling case 56 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.896 70.408 3.066 6.443 0.500 ].
      for model 2 of 2, the seed is [61.896 70.408 3.066 6.443 0.500 ].
      the estimated parameters are [61.983 70.403 2.767 6.417 0.431 ].
  starting resampling case 57 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.906 70.402 3.055 6.443 0.500 ].
      for model 2 of 2, the seed is [61.906 70.402 3.055 6.443 0.500 ].
      the estimated parameters are [61.995 70.397 2.753 6.416 0.430 ].
  starting resampling case 58 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.396 3.046 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.396 3.046 6.443 0.500 ].
      the estimated parameters are [62.002 70.392 2.740 6.416 0.429 ].
  starting resampling case 59 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.396 3.044 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.396 3.044 6.443 0.500 ].
      the estimated parameters are [62.003 70.392 2.739 6.416 0.429 ].
  starting resampling case 60 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.396 3.045 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.396 3.045 6.443 0.500 ].
      the estimated parameters are [62.003 70.392 2.738 6.416 0.428 ].
  starting resampling case 61 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.397 3.044 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.397 3.044 6.443 0.500 ].
      the estimated parameters are [62.003 70.392 2.739 6.416 0.429 ].
  starting resampling case 62 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.397 3.044 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.397 3.044 6.443 0.500 ].
      the estimated parameters are [62.003 70.392 2.739 6.416 0.429 ].
  starting resampling case 63 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.397 3.044 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.397 3.044 6.443 0.500 ].
      the estimated parameters are [62.003 70.392 2.739 6.416 0.429 ].
  starting resampling case 64 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.396 3.045 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.396 3.045 6.443 0.500 ].
      the estimated parameters are [62.003 70.392 2.738 6.416 0.428 ].
  starting resampling case 65 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.913 70.397 3.044 6.443 0.500 ].
      for model 2 of 2, the seed is [61.913 70.397 3.044 6.443 0.500 ].
      the estimated parameters are [62.003 70.393 2.736 6.416 0.428 ].
  starting resampling case 66 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.912 70.388 3.062 6.443 0.500 ].
      for model 2 of 2, the seed is [61.912 70.388 3.062 6.443 0.500 ].
      the estimated parameters are [61.999 70.386 2.758 6.416 0.430 ].
  starting resampling case 67 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.920 70.418 3.026 6.443 0.500 ].
      for model 2 of 2, the seed is [61.920 70.418 3.026 6.443 0.500 ].
      the estimated parameters are [62.013 70.414 2.718 6.415 0.428 ].
  starting resampling case 68 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.078 70.716 3.091 6.432 0.500 ].
      for model 2 of 2, the seed is [62.078 70.716 3.091 6.432 0.500 ].
      the estimated parameters are [62.085 70.674 2.984 6.424 0.476 ].
  starting resampling case 69 of 69.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.910 70.392 3.043 6.424 0.500 ].
      for model 2 of 2, the seed is [61.910 70.392 3.043 6.424 0.500 ].
      the estimated parameters are [62.008 70.387 2.706 6.393 0.422 ].
*** fitnonlinearmodel: voxel 1 (1 of 1) took 56.6 seconds. ***
*** fitnonlinearmodel: ended at 28-Aug-2013 15:07:47 (0.9 minutes). ***
% this is the R^2 between the model predictions and the data.
% notice that this cross-validated R^2 is lower than the
% R^2 of the full fit obtained previously.
resultsXVAL.aggregatedtestperformance
ans =

          93.7556576931057

Try a different resampling scheme: bootstrapping

% define an options struct that specifies 100 bootstraps (i.e. draw
% with replacement from the 69 data points)
optBOOT = opt;
optBOOT.resampling = {100 0};  % the 0 sets the random-number seed to 0
optBOOT.optimoptions = {'Display' 'off'};  % turn off reporting

% fit the model
resultsBOOT = fitnonlinearmodel(optBOOT);
*** fitnonlinearmodel: started at 28-Aug-2013 15:07:47. ***
*** fitnonlinearmodel: outputdir = , chunksize = 1, chunknum = 1
*** fitnonlinearmodel: processing voxel 1 (1 of 1). ***
  starting resampling case 1 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.752 70.859 3.116 6.530 0.500 ].
      for model 2 of 2, the seed is [61.752 70.859 3.116 6.530 0.500 ].
      the estimated parameters are [61.748 70.851 3.187 6.543 0.519 ].
  starting resampling case 2 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.629 70.700 2.698 6.409 0.500 ].
      for model 2 of 2, the seed is [61.629 70.700 2.698 6.409 0.500 ].
      the estimated parameters are [61.722 70.654 2.639 6.402 0.477 ].
  starting resampling case 3 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.717 71.260 2.739 6.359 0.500 ].
      for model 2 of 2, the seed is [62.717 71.260 2.739 6.359 0.500 ].
      the estimated parameters are [62.785 71.895 2.218 6.337 0.370 ].
  starting resampling case 4 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.256 70.855 2.622 6.537 0.500 ].
      for model 2 of 2, the seed is [62.256 70.855 2.622 6.537 0.500 ].
      the estimated parameters are [62.624 70.622 1.852 6.474 0.316 ].
  starting resampling case 5 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.107 70.089 3.383 6.362 0.500 ].
      for model 2 of 2, the seed is [62.107 70.089 3.383 6.362 0.500 ].
      the estimated parameters are [62.084 70.065 3.048 6.335 0.439 ].
  starting resampling case 6 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [68.302 122.464 4.095 261615.578 0.500 ].
      for model 2 of 2, the seed is [68.302 122.464 4.095 261615.578 0.500 ].
      the estimated parameters are [68.297 122.544 4.093 261615.563 0.497 ].
  starting resampling case 7 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [63.502 68.531 1.593 6.102 0.500 ].
      for model 2 of 2, the seed is [63.502 68.531 1.593 6.102 0.500 ].
      the estimated parameters are [62.290 68.272 2.133 6.103 0.758 ].
  starting resampling case 8 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [60.675 69.618 2.424 6.436 0.500 ].
      for model 2 of 2, the seed is [60.675 69.618 2.424 6.436 0.500 ].
      the estimated parameters are [61.808 67.842 2.881 6.448 0.887 ].
  starting resampling case 9 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.256 70.171 3.045 6.339 0.500 ].
      for model 2 of 2, the seed is [62.256 70.171 3.045 6.339 0.500 ].
      the estimated parameters are [62.388 70.176 2.654 6.295 0.409 ].
  starting resampling case 10 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.202 70.441 2.760 6.624 0.500 ].
      for model 2 of 2, the seed is [62.202 70.441 2.760 6.624 0.500 ].
      the estimated parameters are [62.428 70.422 2.381 6.581 0.402 ].
  starting resampling case 11 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.372 69.711 3.048 6.514 0.500 ].
      for model 2 of 2, the seed is [62.372 69.711 3.048 6.514 0.500 ].
      the estimated parameters are [62.485 68.882 3.608 6.566 0.641 ].
  starting resampling case 12 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.235 70.757 2.942 6.486 0.500 ].
      for model 2 of 2, the seed is [62.235 70.757 2.942 6.486 0.500 ].
      the estimated parameters are [61.035 75.247 0.314 6.443 0.010 ].
  starting resampling case 13 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.442 70.027 2.571 6.375 0.500 ].
      for model 2 of 2, the seed is [61.442 70.027 2.571 6.375 0.500 ].
      the estimated parameters are [60.211 68.841 3.184 6.387 0.860 ].
  starting resampling case 14 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.712 69.426 2.817 6.309 0.500 ].
      for model 2 of 2, the seed is [62.712 69.426 2.817 6.309 0.500 ].
      the estimated parameters are [62.681 69.512 2.772 6.304 0.482 ].
  starting resampling case 15 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.113 70.923 3.217 6.528 0.500 ].
      for model 2 of 2, the seed is [62.113 70.923 3.217 6.528 0.500 ].
      the estimated parameters are [62.112 70.925 3.211 6.527 0.499 ].
  starting resampling case 16 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [63.122 69.617 2.400 6.206 0.500 ].
      for model 2 of 2, the seed is [63.122 69.617 2.400 6.206 0.500 ].
      the estimated parameters are [62.310 70.805 1.831 6.185 0.264 ].
  starting resampling case 17 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.281 70.306 3.240 6.358 0.500 ].
      for model 2 of 2, the seed is [62.281 70.306 3.240 6.358 0.500 ].
      the estimated parameters are [62.303 70.253 2.387 6.307 0.338 ].
  starting resampling case 18 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.192 69.714 2.577 6.335 0.500 ].
      for model 2 of 2, the seed is [62.192 69.714 2.577 6.335 0.500 ].
      the estimated parameters are [62.616 69.936 1.968 6.280 0.324 ].
  starting resampling case 19 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.879 70.137 2.808 6.370 0.500 ].
      for model 2 of 2, the seed is [61.879 70.137 2.808 6.370 0.500 ].
      the estimated parameters are [62.087 70.119 2.712 6.359 0.459 ].
  starting resampling case 20 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.908 71.064 3.056 6.620 0.500 ].
      for model 2 of 2, the seed is [61.908 71.064 3.056 6.620 0.500 ].
      the estimated parameters are [61.649 71.770 2.412 6.576 0.340 ].
  starting resampling case 21 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.178 70.290 2.738 6.576 0.500 ].
      for model 2 of 2, the seed is [62.178 70.290 2.738 6.576 0.500 ].
      the estimated parameters are [62.282 70.314 2.465 6.562 0.435 ].
  starting resampling case 22 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.081 70.080 3.008 6.632 0.500 ].
      for model 2 of 2, the seed is [62.081 70.080 3.008 6.632 0.500 ].
      the estimated parameters are [62.369 70.250 2.454 6.596 0.374 ].
  starting resampling case 23 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [60.238 70.351 2.714 6.444 0.500 ].
      for model 2 of 2, the seed is [60.238 70.351 2.714 6.444 0.500 ].
      the estimated parameters are [60.128 70.414 2.205 6.414 0.380 ].
  starting resampling case 24 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.677 72.171 2.903 6.622 0.500 ].
      for model 2 of 2, the seed is [62.677 72.171 2.903 6.622 0.500 ].
      the estimated parameters are [62.646 72.179 2.805 6.614 0.476 ].
  starting resampling case 25 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.774 70.700 2.693 6.560 0.500 ].
      for model 2 of 2, the seed is [61.774 70.700 2.693 6.560 0.500 ].
      the estimated parameters are [61.619 70.866 3.039 6.595 0.605 ].
  starting resampling case 26 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [60.741 70.388 2.880 6.381 0.500 ].
      for model 2 of 2, the seed is [60.741 70.388 2.880 6.381 0.500 ].
      the estimated parameters are [60.546 70.504 2.581 6.360 0.442 ].
  starting resampling case 27 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.554 70.565 2.975 6.460 0.500 ].
      for model 2 of 2, the seed is [62.554 70.565 2.975 6.460 0.500 ].
      the estimated parameters are [62.267 70.287 2.455 6.449 0.385 ].
  starting resampling case 28 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.084 70.421 3.014 6.636 0.500 ].
      for model 2 of 2, the seed is [62.084 70.421 3.014 6.636 0.500 ].
      the estimated parameters are [62.046 70.443 3.115 6.652 0.524 ].
  starting resampling case 29 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.294 70.337 2.475 6.364 0.500 ].
      for model 2 of 2, the seed is [61.294 70.337 2.475 6.364 0.500 ].
      the estimated parameters are [61.225 70.271 2.578 6.389 0.546 ].
  starting resampling case 30 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [63.757 68.684 2.034 6.467 0.500 ].
      for model 2 of 2, the seed is [63.757 68.684 2.034 6.467 0.500 ].
      the estimated parameters are [63.468 69.105 2.069 6.436 0.429 ].
  starting resampling case 31 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.348 69.940 3.075 6.473 0.500 ].
      for model 2 of 2, the seed is [62.348 69.940 3.075 6.473 0.500 ].
      the estimated parameters are [62.343 69.871 3.289 6.495 0.547 ].
  starting resampling case 32 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [60.894 70.674 2.835 6.510 0.500 ].
      for model 2 of 2, the seed is [60.894 70.674 2.835 6.510 0.500 ].
      the estimated parameters are [60.866 70.639 2.955 6.528 0.533 ].
  starting resampling case 33 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.386 70.086 2.994 6.430 0.500 ].
      for model 2 of 2, the seed is [62.386 70.086 2.994 6.430 0.500 ].
      the estimated parameters are [63.092 70.058 1.980 6.388 0.282 ].
  starting resampling case 34 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.265 70.060 3.102 6.257 0.500 ].
      for model 2 of 2, the seed is [62.265 70.060 3.102 6.257 0.500 ].
      the estimated parameters are [62.262 70.090 3.023 6.245 0.481 ].
  starting resampling case 35 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.814 69.516 3.119 6.474 0.500 ].
      for model 2 of 2, the seed is [61.814 69.516 3.119 6.474 0.500 ].
      the estimated parameters are [62.118 68.759 3.373 6.495 0.607 ].
  starting resampling case 36 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.647 70.579 2.898 6.299 0.500 ].
      for model 2 of 2, the seed is [61.647 70.579 2.898 6.299 0.500 ].
      the estimated parameters are [62.283 70.292 2.440 6.285 0.366 ].
  starting resampling case 37 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.808 69.976 2.673 6.614 0.500 ].
      for model 2 of 2, the seed is [61.808 69.976 2.673 6.614 0.500 ].
      the estimated parameters are [61.787 69.963 2.689 6.616 0.506 ].
  starting resampling case 38 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.214 70.584 3.173 6.484 0.500 ].
      for model 2 of 2, the seed is [62.214 70.584 3.173 6.484 0.500 ].
      the estimated parameters are [62.173 70.435 2.791 6.468 0.428 ].
  starting resampling case 39 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.968 70.518 2.701 6.482 0.500 ].
      for model 2 of 2, the seed is [61.968 70.518 2.701 6.482 0.500 ].
      the estimated parameters are [61.811 70.548 2.870 6.502 0.551 ].
  starting resampling case 40 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.299 69.573 2.994 6.391 0.500 ].
      for model 2 of 2, the seed is [62.299 69.573 2.994 6.391 0.500 ].
      the estimated parameters are [62.146 69.295 3.263 6.427 0.578 ].
  starting resampling case 41 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.604 70.358 3.082 6.533 0.500 ].
      for model 2 of 2, the seed is [61.604 70.358 3.082 6.533 0.500 ].
      the estimated parameters are [61.797 70.501 3.590 6.568 0.604 ].
  starting resampling case 42 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.465 70.089 3.012 6.426 0.500 ].
      for model 2 of 2, the seed is [62.465 70.089 3.012 6.426 0.500 ].
      the estimated parameters are [62.706 70.349 1.851 6.383 0.294 ].
  starting resampling case 43 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.352 70.283 2.905 6.443 0.500 ].
      for model 2 of 2, the seed is [62.352 70.283 2.905 6.443 0.500 ].
      the estimated parameters are [66.751 69.801 0.422 6.408 0.029 ].
  starting resampling case 44 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.514 70.308 3.259 6.322 0.500 ].
      for model 2 of 2, the seed is [62.514 70.308 3.259 6.322 0.500 ].
      the estimated parameters are [61.871 69.894 1.682 6.293 0.208 ].
  starting resampling case 45 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.381 70.648 3.090 6.438 0.500 ].
      for model 2 of 2, the seed is [62.381 70.648 3.090 6.438 0.500 ].
      the estimated parameters are [62.555 70.748 2.490 6.386 0.371 ].
  starting resampling case 46 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.864 69.906 2.840 6.552 0.500 ].
      for model 2 of 2, the seed is [61.864 69.906 2.840 6.552 0.500 ].
      the estimated parameters are [62.439 70.152 2.386 6.531 0.372 ].
  starting resampling case 47 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.931 70.297 3.012 6.510 0.500 ].
      for model 2 of 2, the seed is [61.931 70.297 3.012 6.510 0.500 ].
      the estimated parameters are [61.903 70.329 2.699 6.477 0.429 ].
  starting resampling case 48 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [60.983 70.544 2.609 6.522 0.500 ].
      for model 2 of 2, the seed is [60.983 70.544 2.609 6.522 0.500 ].
      the estimated parameters are [65.540 69.885 0.638 6.477 0.061 ].
  starting resampling case 49 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [57.883 71.947 1.392 6.299 0.500 ].
      for model 2 of 2, the seed is [57.883 71.947 1.392 6.299 0.500 ].
      the estimated parameters are [57.456 72.499 0.625 6.289 0.309 ].
  starting resampling case 50 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.146 70.682 3.076 6.429 0.500 ].
      for model 2 of 2, the seed is [61.146 70.682 3.076 6.429 0.500 ].
      the estimated parameters are [61.390 70.410 2.430 6.355 0.350 ].
  starting resampling case 51 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [60.080 70.780 2.466 6.415 0.500 ].
      for model 2 of 2, the seed is [60.080 70.780 2.466 6.415 0.500 ].
      the estimated parameters are [59.877 71.104 2.019 6.380 0.395 ].
  starting resampling case 52 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.548 70.942 2.852 6.663 0.500 ].
      for model 2 of 2, the seed is [62.548 70.942 2.852 6.663 0.500 ].
      the estimated parameters are [62.539 71.037 2.951 6.668 0.522 ].
  starting resampling case 53 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [60.583 70.557 2.605 6.494 0.500 ].
      for model 2 of 2, the seed is [60.583 70.557 2.605 6.494 0.500 ].
      the estimated parameters are [61.038 70.484 2.132 6.473 0.353 ].
  starting resampling case 54 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.979 70.670 2.518 6.438 0.500 ].
      for model 2 of 2, the seed is [61.979 70.670 2.518 6.438 0.500 ].
      the estimated parameters are [62.395 70.620 2.213 6.415 0.399 ].
  starting resampling case 55 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.211 70.295 2.649 6.351 0.500 ].
      for model 2 of 2, the seed is [61.211 70.295 2.649 6.351 0.500 ].
      the estimated parameters are [61.937 70.423 2.243 6.317 0.353 ].
  starting resampling case 56 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [60.008 70.959 2.661 6.544 0.500 ].
      for model 2 of 2, the seed is [60.008 70.959 2.661 6.544 0.500 ].
      the estimated parameters are [59.888 70.985 2.327 6.515 0.422 ].
  starting resampling case 57 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.387 70.547 2.717 6.622 0.500 ].
      for model 2 of 2, the seed is [62.387 70.547 2.717 6.622 0.500 ].
      the estimated parameters are [62.685 70.593 1.711 6.592 0.292 ].
  starting resampling case 58 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.977 70.468 2.700 6.446 0.500 ].
      for model 2 of 2, the seed is [61.977 70.468 2.700 6.446 0.500 ].
      the estimated parameters are [62.233 70.447 2.154 6.403 0.347 ].
  starting resampling case 59 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.162 70.212 3.074 6.556 0.500 ].
      for model 2 of 2, the seed is [62.162 70.212 3.074 6.556 0.500 ].
      the estimated parameters are [62.322 70.560 2.681 6.536 0.406 ].
  starting resampling case 60 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.039 70.890 2.647 6.519 0.500 ].
      for model 2 of 2, the seed is [62.039 70.890 2.647 6.519 0.500 ].
      the estimated parameters are [61.632 71.492 3.148 6.580 0.700 ].
  starting resampling case 61 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.399 70.865 2.751 6.493 0.500 ].
      for model 2 of 2, the seed is [61.399 70.865 2.751 6.493 0.500 ].
      the estimated parameters are [61.397 70.866 2.751 6.493 0.500 ].
  starting resampling case 62 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.404 69.986 2.961 6.436 0.500 ].
      for model 2 of 2, the seed is [61.404 69.986 2.961 6.436 0.500 ].
      the estimated parameters are [61.440 69.828 3.060 6.449 0.533 ].
  starting resampling case 63 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [60.482 70.416 2.884 6.495 0.500 ].
      for model 2 of 2, the seed is [60.482 70.416 2.884 6.495 0.500 ].
      the estimated parameters are [60.233 70.327 2.185 6.435 0.357 ].
  starting resampling case 64 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.790 69.978 3.574 6.380 0.500 ].
      for model 2 of 2, the seed is [61.790 69.978 3.574 6.380 0.500 ].
      the estimated parameters are [61.803 70.045 3.287 6.350 0.445 ].
  starting resampling case 65 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.367 70.465 2.943 6.217 0.500 ].
      for model 2 of 2, the seed is [61.367 70.465 2.943 6.217 0.500 ].
      the estimated parameters are [61.345 70.461 3.016 6.222 0.519 ].
  starting resampling case 66 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.963 70.781 2.768 6.342 0.500 ].
      for model 2 of 2, the seed is [61.963 70.781 2.768 6.342 0.500 ].
      the estimated parameters are [61.810 70.939 2.920 6.369 0.558 ].
  starting resampling case 67 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [60.852 70.731 2.929 6.660 0.500 ].
      for model 2 of 2, the seed is [60.852 70.731 2.929 6.660 0.500 ].
      the estimated parameters are [60.995 70.850 2.618 6.616 0.412 ].
  starting resampling case 68 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.228 70.258 3.253 6.328 0.500 ].
      for model 2 of 2, the seed is [61.228 70.258 3.253 6.328 0.500 ].
      the estimated parameters are [61.507 70.275 2.692 6.289 0.378 ].
  starting resampling case 69 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.956 70.403 3.121 6.543 0.500 ].
      for model 2 of 2, the seed is [61.956 70.403 3.121 6.543 0.500 ].
      the estimated parameters are [61.948 70.422 2.792 6.483 0.425 ].
  starting resampling case 70 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.238 70.215 2.661 6.525 0.500 ].
      for model 2 of 2, the seed is [62.238 70.215 2.661 6.525 0.500 ].
      the estimated parameters are [63.311 70.181 1.994 6.483 0.298 ].
  starting resampling case 71 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.228 69.957 2.935 6.444 0.500 ].
      for model 2 of 2, the seed is [62.228 69.957 2.935 6.444 0.500 ].
      the estimated parameters are [62.431 70.371 2.319 6.392 0.352 ].
  starting resampling case 72 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.076 70.358 3.199 6.640 0.500 ].
      for model 2 of 2, the seed is [62.076 70.358 3.199 6.640 0.500 ].
      the estimated parameters are [62.181 70.348 2.811 6.610 0.415 ].
  starting resampling case 73 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.053 70.377 2.593 6.543 0.500 ].
      for model 2 of 2, the seed is [62.053 70.377 2.593 6.543 0.500 ].
      the estimated parameters are [63.235 70.214 1.951 6.501 0.280 ].
  starting resampling case 74 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.230 70.009 3.053 6.494 0.500 ].
      for model 2 of 2, the seed is [62.230 70.009 3.053 6.494 0.500 ].
      the estimated parameters are [62.232 70.022 3.039 6.492 0.496 ].
  starting resampling case 75 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [59.872 71.102 2.291 6.469 0.500 ].
      for model 2 of 2, the seed is [59.872 71.102 2.291 6.469 0.500 ].
      the estimated parameters are [59.722 71.300 1.897 6.429 0.389 ].
  starting resampling case 76 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.114 70.357 3.004 6.421 0.500 ].
      for model 2 of 2, the seed is [61.114 70.357 3.004 6.421 0.500 ].
      the estimated parameters are [61.531 70.311 2.585 6.375 0.398 ].
  starting resampling case 77 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.326 70.788 3.170 6.613 0.500 ].
      for model 2 of 2, the seed is [62.326 70.788 3.170 6.613 0.500 ].
      the estimated parameters are [62.207 70.537 2.501 6.563 0.368 ].
  starting resampling case 78 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.001 70.828 3.211 6.382 0.500 ].
      for model 2 of 2, the seed is [62.001 70.828 3.211 6.382 0.500 ].
      the estimated parameters are [61.950 71.132 3.613 6.427 0.604 ].
  starting resampling case 79 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.436 70.285 3.251 6.520 0.500 ].
      for model 2 of 2, the seed is [61.436 70.285 3.251 6.520 0.500 ].
      the estimated parameters are [61.576 70.415 2.441 6.452 0.330 ].
  starting resampling case 80 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.475 70.932 3.243 6.405 0.500 ].
      for model 2 of 2, the seed is [62.475 70.932 3.243 6.405 0.500 ].
      the estimated parameters are [61.342 71.008 0.767 6.349 0.055 ].
  starting resampling case 81 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.324 69.903 3.079 6.528 0.500 ].
      for model 2 of 2, the seed is [62.324 69.903 3.079 6.528 0.500 ].
      the estimated parameters are [62.353 70.399 2.424 6.492 0.351 ].
  starting resampling case 82 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.507 70.569 3.136 6.421 0.500 ].
      for model 2 of 2, the seed is [62.507 70.569 3.136 6.421 0.500 ].
      the estimated parameters are [62.528 70.575 3.086 6.416 0.487 ].
  starting resampling case 83 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.087 70.487 3.355 6.691 0.500 ].
      for model 2 of 2, the seed is [62.087 70.487 3.355 6.691 0.500 ].
      the estimated parameters are [61.981 70.435 2.993 6.675 0.435 ].
  starting resampling case 84 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.500 69.971 3.192 6.288 0.500 ].
      for model 2 of 2, the seed is [62.500 69.971 3.192 6.288 0.500 ].
      the estimated parameters are [62.347 70.063 2.584 6.267 0.388 ].
  starting resampling case 85 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.685 69.536 2.420 6.322 0.500 ].
      for model 2 of 2, the seed is [61.685 69.536 2.420 6.322 0.500 ].
      the estimated parameters are [61.634 69.504 2.434 6.324 0.514 ].
  starting resampling case 86 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [60.190 70.500 2.705 6.583 0.500 ].
      for model 2 of 2, the seed is [60.190 70.500 2.705 6.583 0.500 ].
      the estimated parameters are [60.139 70.485 2.296 6.554 0.401 ].
  starting resampling case 87 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.749 70.001 2.894 6.307 0.500 ].
      for model 2 of 2, the seed is [61.749 70.001 2.894 6.307 0.500 ].
      the estimated parameters are [61.932 70.084 2.647 6.258 0.425 ].
  starting resampling case 88 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.142 72.261 3.378 6.430 0.500 ].
      for model 2 of 2, the seed is [62.142 72.261 3.378 6.430 0.500 ].
      the estimated parameters are [62.147 72.287 3.402 6.431 0.504 ].
  starting resampling case 89 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.466 70.014 2.857 6.367 0.500 ].
      for model 2 of 2, the seed is [62.466 70.014 2.857 6.367 0.500 ].
      the estimated parameters are [62.446 70.170 1.834 6.218 0.266 ].
  starting resampling case 90 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [63.893 68.290 1.919 6.367 0.500 ].
      for model 2 of 2, the seed is [63.893 68.290 1.919 6.367 0.500 ].
      the estimated parameters are [65.741 65.934 1.296 6.368 1.354 ].
  starting resampling case 91 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.052 70.558 3.284 6.318 0.500 ].
      for model 2 of 2, the seed is [62.052 70.558 3.284 6.318 0.500 ].
      the estimated parameters are [62.040 70.571 3.313 6.319 0.506 ].
  starting resampling case 92 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [60.884 70.255 3.004 6.385 0.500 ].
      for model 2 of 2, the seed is [60.884 70.255 3.004 6.385 0.500 ].
      the estimated parameters are [61.185 71.746 1.744 6.284 0.206 ].
  starting resampling case 93 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.086 70.906 3.421 6.476 0.500 ].
      for model 2 of 2, the seed is [62.086 70.906 3.421 6.476 0.500 ].
      the estimated parameters are [62.086 70.895 3.454 6.479 0.507 ].
  starting resampling case 94 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.462 70.256 2.976 6.429 0.500 ].
      for model 2 of 2, the seed is [61.462 70.256 2.976 6.429 0.500 ].
      the estimated parameters are [61.668 70.677 2.552 6.374 0.376 ].
  starting resampling case 95 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.918 70.154 3.296 6.192 0.500 ].
      for model 2 of 2, the seed is [61.918 70.154 3.296 6.192 0.500 ].
      the estimated parameters are [62.022 70.145 2.909 6.164 0.425 ].
  starting resampling case 96 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.473 70.375 2.891 6.456 0.500 ].
      for model 2 of 2, the seed is [61.473 70.375 2.891 6.456 0.500 ].
      the estimated parameters are [61.400 70.375 3.171 6.505 0.582 ].
  starting resampling case 97 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.765 70.208 2.894 6.506 0.500 ].
      for model 2 of 2, the seed is [62.765 70.208 2.894 6.506 0.500 ].
      the estimated parameters are [62.590 70.242 2.003 6.472 0.315 ].
  starting resampling case 98 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.573 70.196 2.971 6.417 0.500 ].
      for model 2 of 2, the seed is [62.573 70.196 2.971 6.417 0.500 ].
      the estimated parameters are [62.701 70.215 1.870 6.383 0.291 ].
  starting resampling case 99 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [61.592 70.171 2.756 6.555 0.500 ].
      for model 2 of 2, the seed is [61.592 70.171 2.756 6.555 0.500 ].
      the estimated parameters are [62.176 70.252 2.205 6.544 0.355 ].
  starting resampling case 100 of 100.
      for model 1 of 2, the seed is [50.500 50.500 100.000 1.000 0.500 ].
      the estimated parameters are [62.600 70.385 3.145 6.530 0.500 ].
      for model 2 of 2, the seed is [62.600 70.385 3.145 6.530 0.500 ].
      the estimated parameters are [62.214 70.029 2.257 6.495 0.324 ].
*** fitnonlinearmodel: voxel 1 (1 of 1) took 96.0 seconds. ***
*** fitnonlinearmodel: ended at 28-Aug-2013 15:09:23 (1.6 minutes). ***
% visualize the parameter estimates
figure; hold on;
for p=1:size(resultsBOOT.params,1)
  pp = resultsBOOT.params(p,:);
  h = drawellipse(pp(2),pp(1),0,2*pp(3)/sqrt(pp(5)),2*pp(3)/sqrt(pp(5)));
  set(h,'Color',rand(1,3));
end
drawrectangle((1+res)/2,(1+res)/2,res,res,'k-');
axis([.5 res+.5 .5 res+.5]);
set(gca,'YDir','reverse');
axis square;
title('Bootstrap results');

Example of how to simulate model responses

% let's take the model fitted to the full dataset and compute
% the predicted response of the model to some new stimuli.

% let's compute the response of the model to a point stimulus
% that is positioned at different locations in the visual field.
resp = zeros(res,res);
for r=1:res
  for c=1:res
    stim0 = zeros(res,res);
    stim0(r,c) = 1;
    resp(r,c) = modelfun(results.params,flatten(stim0));
  end
end

% visualize the results
figure;
mx = max(resp(:));
imagesc(resp,[0 mx]);
axis image tight;
colormap(gray);
title('Predicted response to point stimuli');
% notice that the results are consistent with the definition
% of PRF size as S/sqrt(N).