********  HRCR_PSEARCH.TXT -- 23 Dec 2003 - 4 Jan 2004  ********
**
**        PARAMETER SEARCH FOR A HIERARCHY OF ANCHOR MODELS
**        CATEGORY RATING, see HRAI_PSEARCH.TXT for absolute identification
**

P  -->  PS  -->  PSC  -->  PSCR  -->   PSACR=ANCHOR
            \->  PSA  -->  PSAC  /

Model P:     Perception mechanism only; nearest-anchor responses.
Model PS:    Perception + anchor Selection mechanisms only.
Model PSC:   Perception + Selection + Correction mechanisms only.
Model PSA:   Perception + Selection + Activation, no corrections.
Model PSAC:  All except location learning.
Model PSCR:  All except activation learning.
Model PSACR: Full ANCHOR model.


The supportive data are the following:
a) 24=12+12 empirical absolute-identification S-R sequences.
c) 40=20+20 empirical category-rating S-R sequences.

The general methodology is always the same:
1. Fit the same model to the 40 individual data sets from the
   Category Rating Expmt 2. This produces 40 parameter sets.
   Which parameters are "active", which are shunted off, and
   which are fixed for all subjects depends on the particular model.
3. Run the model with each CR parametrization on each of the
   new CR stimulus sequences, for a total of 9600=40*240 runs.
4. Calculate a battery of model statistics via CR_STATS and
   compare them with the empirical ones.

This file carries out step 1. above.
The results from each parameter search are stored in HIER_OPT_PARAMS.MAT.
See HRCR_MSTATS.TXT for model statistics (steps 2. and 3.).
The summary statistics for each model are stored in HIER_SUMSTATS.MAT.
See also HRAI_PSEARCH.TXT and HRAI_MSTATS.TXT for identification analogs.


*************************************************************
***                ******************************************
***   Model P      ******************************************
***   Cat. Rat     ******************************************
***                ******************************************
*************************************************************

Active parameters:  perc_k, L1
Shunted parameters: mem_k=0, temper=0, hist=0, cutoff=Inf, alpha=0
Fixed parameters:   perc_k=0.04, decay=0.5, L9=0.675, avail=[1:9]'

% ANCHOR2MT, with its numerous discretizations and approximations,
% is not appropriate for optimizing the perceptual noise alone.
% The tailor made MODELP_MT is used instead.

 clear all ; cd 'C:\work\anchor\finalsim\' ;
 Sparams=anchor_search_params([1 0 0 0 0 0 1]) ;
 Sparams.model_name = 'modelP_mt' ;    % special-purpose optimizer
Sparams =
    model_name: 'modelP_mt'
    gener_name: 'anchor2'
        params: [1x1 struct]
     p2v_templ: {'VAL = PARAMS.perc_k * 10 ;'  'VAL = PARAMS.anchors(1,1) ;'}
     v2p_templ: {'PARAMS.perc_k = VAL / 10 ;'  [1x50 char]}
        bounds: [2x2 double]
     clip_prob: 0.0183
         optns: [1x1 struct]

 Sparams.params.avail = [1:9]' ;   % all anchors available at all times
 Sparams.params.anchors(:,6)=1 ;   % all anchors available at all times
 Sparams.params.mem_k=0 ;          % deterministic anchor magnitudes
 Sparams.params.temper=0 ;         % deterministic anchor selection
 Sparams.params.cutoffs = [-Inf -Inf +Inf +Inf] ;   % no corrections
 Sparams.params.history = 0 ;      % shunting off the activation mechanism
 Sparams.params.alpha = 0 ;        % immutable anchor locations

% To speed up the search, initialize anchor-1 at 0.200 instead of 0.275
 Sparams.params.anchors(1,1)=0.200

% Widen up the search bounds for PERC_K
 Sparams.bounds(:,1)=[0.01 0.20]'*10 ; Sparams.bounds
ans = 0.1000    0.0500
      2.0000    0.4000

 Sparams.params
       scale: 'LINEAR'
       N_cat: 9
     SM_conv: 0.0010
      cat_sz: 0.0500
      perc_k: 0.0400
       mem_k: 0
       avail: [9x1 double]
     anchors: [9x6 double]
     cutoffs: [-Inf -Inf Inf Inf]
      temper: 0
     history: 0
       alpha: 0
       decay: 0.5000
         ITI: 4
    M_raster: 7
    A_raster: [5 5 3 3]
    mnfieldp: 1

 Sparams_P_CR = Sparams ; clear Sparams


%%%%%%%%%%%%%%%%%%   Run the optimizer on the 40 CR data sets
28 Dec 2003

 diary('session_P_CR.txt');disp('Model P, category rating');
 load CR40mdata ; Sparams_P_CR.fname='resCR40_P' ;
 tic;resCR40_P=big_psearch(CR40mdata,Sparams_P_CR);toc

% Elapsed_time = 832.1200 sec (14 min) on a Dell Inspiron 7500.

 resCR40_P
       model_name: 'modelP_mt'
       descriptor: '28-Dec-2003 16:29:32'
    search_params: [1x1 struct]
            opt_X: [40x2 double]
                L: [40x1 double]
         exitflag: [40x1 double]
          N_evals: [40x1 double]
          N_iters: [40x1 double]
             time: [40x1 double]

 resCR40_P.search_params.v2p_templ'
ans = 'PARAMS.perc_k = VAL / 10 ;'
      'PARAMS.anchors(:,1) = [VAL:(0.675-VAL)/8:0.675]' ;'

 xtab1(resCR40_P.N_iters)
   Value   Count  Percent  Cum_cnt  Cum_pct
-------------------------------------------
       4       1     2.50        1     2.50
       5       5    12.50        6    15.00
       6       6    15.00       12    30.00
       7      11    27.50       23    57.50
       8       5    12.50       28    70.00
       9       4    10.00       32    80.00
      10       4    10.00       36    90.00
      11       3     7.50       39    97.50
      13       1     2.50       40   100.00
-------------------------------------------

 describe(resCR40_P.L)         % log-likelihood
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
 608.971   79.000    449.67  548.81  605.97  669.24  756.12

 describe(resCR40_P.opt_X)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
   1.210    0.252      0.83    0.97    1.18    1.43    1.67  % perc_k * 10
   0.150    0.063      0.05    0.10    0.15    0.20    0.25  % L1

 resCR40_P.opt_X'
  Columns 1 through 7
    1.1714    1.0950    0.8979    1.2514    0.9712    1.6223    0.8259
    0.1691    0.0873    0.2486    0.2452    0.0796    0.1943    0.2282
  Columns 8 through 14
    1.3241    1.4916    0.9145    1.1751    1.0736    0.9656    1.1848
    0.1927    0.1609    0.1378    0.0500    0.2064    0.1645    0.0500
  Columns 15 through 21
    1.0224    0.8663    1.3877    1.5604    1.3504    1.4206    1.6457
    0.1798    0.2317    0.1673    0.1357    0.1302    0.2195    0.2077
  Columns 22 through 28
    1.4305    1.1942    1.1347    0.8588    1.1078    1.5063    1.3417
    0.1548    0.1488    0.2467    0.1534    0.1977    0.0500    0.0500
  Columns 29 through 35
    0.9615    1.4932    1.5005    0.8691    1.0274    1.3343    1.1721
    0.1896    0.2081    0.0500    0.2079    0.0631    0.1270    0.1309
  Columns 36 through 40
    1.3466    0.9170    1.4525    1.6655    0.8671
    0.0863    0.1511    0.1465    0.0500    0.1066


*************************************************************
***                ******************************************
***   Model PS     ******************************************
***   Cat. Rat     ******************************************
***                ******************************************
*************************************************************

Active parameters:  mem_k, temper, L1
Shunted parameters: hist=0, cutoff=Inf, alpha=0
Fixed parameters:   perc_k=0.04, decay=0.5, L9=0.675, avail=[1:9]'

 clear all ; cd 'C:\work\anchor\finalsim\' ;
 Sparams=anchor_search_params([0 1 1 0 0 0 1])
Sparams =
    model_name: 'anchor2mt'
    gener_name: 'anchor2'
        params: [1x1 struct]
     p2v_templ: {1x3 cell}
     v2p_templ: {1x3 cell}
        bounds: [2x3 double]
     clip_prob: 0.0183
         optns: [1x1 struct]

 Sparams.params.avail = [1:9]' ;   % all anchors available at all times
 Sparams.params.anchors(:,6)=1 ;   % all anchors available at all times
 Sparams.params.cutoffs = [-Inf -Inf +Inf +Inf] ;   % no corrections
 Sparams.params.history = 0 ;      % shunting off the activation mechanism
 Sparams.params.alpha = 0 ;        % immutable anchor locations

% Widen up the search bounds for MEM_K and TEMPER:
 Sparams.bounds(:,1)=[0.02 0.20]'*10;Sparams.bounds(:,2)=[0.01 0.10]'*10;

% To speed up the search, initialize anchor-1 at 0.200 instead of 0.275
 Sparams.params.anchors(1,1)=0.200

 Sparams.params
       scale: 'LINEAR'
       N_cat: 9
     SM_conv: 0.0010
      cat_sz: 0.0500
      perc_k: 0.0400
       mem_k: 0.0700
       avail: [9x1 double]
     anchors: [9x6 double]
     cutoffs: [-Inf -Inf Inf Inf]
      temper: 0.0500
     history: 0
       alpha: 0
       decay: 0.5000
         ITI: 4
    M_raster: 7
    A_raster: [5 5 3 3]
    mnfieldp: 1

 Sparams_PS_CR = Sparams ; clear Sparams


%%%%%%%%%%%%%%%%%%   Run the optimizer on the 40 CR data sets
28 Dec 2003

 load CR40mdata;Sparams_PS_CR.fname='resCR40_PS';
 diary('Session_PS_CR.txt');disp('Model PS, category rating');
 tic;resCR40_PS=big_psearch(CR40mdata,Sparams_PS_CR);toc

% Elapsed_time = 27585 sec (7 h 40 min) on a Dell Optiplex GX400.
% No "Divide by zero" warnings on any of the searches.

 resCR40_PS
       model_name: 'anchor2mt'
       descriptor: '28-Dec-2003 23:15:32'
    search_params: [1x1 struct]
            opt_X: [40x3 double]
                L: [40x1 double]
         exitflag: [40x1 double]
          N_evals: [40x1 double]
          N_iters: [40x1 double]
             time: [40x1 double]

 resCR40_PS.search_params.v2p_templ'
ans = 'PARAMS.mem_k = VAL / 10 ;'
      'PARAMS.temper = VAL / 10 ;'
      'PARAMS.anchors(:,1) = [VAL:(0.675-VAL)/8:0.675]' ;'
 resCR40_PS.search_params.bounds
ans = 0.2000    0.1000    0.0500
      2.0000    1.0000    0.4000

 xtab1(resCR40_PS.N_iters)
   Value   Count  Percent  Cum_cnt  Cum_pct
-------------------------------------------
       5       3     7.50        3     7.50
       6       6    15.00        9    22.50
       7       9    22.50       18    45.00
       8       6    15.00       24    60.00
       9       7    17.50       31    77.50
      10       2     5.00       33    82.50
      11       1     2.50       34    85.00
      12       3     7.50       37    92.50
      13       2     5.00       39    97.50
      14       1     2.50       40   100.00
-------------------------------------------

 describe(resCR40_PS.L)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
 586.091   76.658    445.77  528.63  585.06  631.86  746.99

 L=[resCR40_P.L resCR40_PS.L];find(L(:,1)<=L(:,2))'
ans = []         % Model PS fits better than model P for all 40 Ss.

% This is substantial improvement over earlier searches with L1
% fixed=0.275. The new parameter allows responses to slip upwards.
%    Mean  Std.dev       Min     Q25  Median     Q75     Max
%------------------------------------------------------------
% 751.708   89.099    541.16  703.70  752.67  807.60  922.93

 describe(resCR40_PS.opt_X)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
   1.433    0.502      0.20    1.07    1.48    1.96    2.00   % mem_k * 10
   0.271    0.116      0.10    0.18    0.27    0.36    0.50   % temper* 10
   0.155    0.065      0.05    0.10    0.17    0.21    0.26   % L1

% With L1 fixed at 0.275
%    Mean  Std.dev       Min     Q25  Median     Q75     Max
%------------------------------------------------------------
%   1.137    0.693      0.20    0.39    1.26    1.78    2.00  % mem_k * 10
%   0.586    0.261      0.10    0.40    0.57    0.79    1.00  % temper* 10

 resCR40_PS.opt_X'
  Columns 1 through 7
    1.7878    1.4890    1.2543    1.7967    1.2524    2.0000    1.1457
    0.1116    0.2151    0.1000    0.2659    0.1921    0.4290    0.1000
    0.1736    0.0965    0.2499    0.2470    0.0820    0.2237    0.2304
  Columns 8 through 14
    1.9255    1.7601    0.2000    1.3517    1.6773    1.0408    1.0804
    0.1780    0.3763    0.3972    0.3089    0.1000    0.2563    0.3551
    0.1970    0.1722    0.1262    0.0500    0.2121    0.1734    0.0500
  Columns 15 through 21
    1.4663    0.4767    2.0000    2.0000    1.5488    2.0000    2.0000
    0.1000    0.2668    0.2570    0.2375    0.3368    0.2725    0.4995
    0.1881    0.2297    0.1732    0.1526    0.1450    0.2316    0.2313
  Columns 22 through 28
    2.0000    1.2781    1.8318    0.7659    1.6397    2.0000    0.7863
    0.2238    0.3295    0.1000    0.2514    0.1702    0.2755    0.4238
    0.1710    0.1625    0.2568    0.1443    0.2056    0.0500    0.0500
  Columns 29 through 35
    0.6648    1.7173    2.0000    1.0031    0.6390    2.0000    1.0526
    0.2937    0.4457    0.3055    0.1833    0.3866    0.1745    0.3595
    0.1898    0.2133    0.0500    0.2084    0.0777    0.1250    0.1303
  Columns 36 through 40
    1.1889    1.3566    2.0000    1.1927    0.9671
    0.3922    0.1107    0.3496    0.5005    0.1924
    0.0940    0.1441    0.1262    0.0500    0.1097


*************************************************************
***                ******************************************
***   Model PSC    ******************************************
***   Cat. Rat     ******************************************
***                ******************************************
*************************************************************

Active parameters:  mem_k, temper, cutoff, L1
Shunted parameters: hist=0, alpha=0
Fixed parameters:   perc_k=0.04, decay=0.5,
                    L9=0.675, avail=[1:9]'
                    cutoff multipliers=[-3 -1 +0.9 +2.7]

 clear all ; cd 'C:\work\anchor\finalsim\' ;
 Sparams=anchor_search_params([0 1 1 0 1 0 1])
Sparams =
    model_name: 'anchor2mt'
    gener_name: 'anchor2'
        params: [1x1 struct]
     p2v_templ: {1x4 cell}
     v2p_templ: {1x4 cell}
        bounds: [2x4 double]
     clip_prob: 0.0183
         optns: [1x1 struct]

 Sparams.bounds
    0.2000    0.2000    0.5000    0.0500
    1.0000    0.8000    1.5000    0.4000

 Sparams.params.avail = [1:9]' ;   % all anchors available at all times
 Sparams.params.anchors(:,6)=1 ;   % all anchors available at all times
 Sparams.params.history = 0 ;      % shunting off the activation mechanism
 Sparams.params.alpha = 0 ;        % immutable anchor locations

 Sparams.params
       scale: 'LINEAR'
       N_cat: 9
     SM_conv: 0.0010
      cat_sz: 0.0500
      perc_k: 0.0400
       mem_k: 0.0700
       avail: [9x1 double]
     anchors: [9x6 double]
     cutoffs: [-2.4000 -0.8000 0.7200 2.1600]
      temper: 0.0500
     history: 0
       alpha: 0
       decay: 0.5000
         ITI: 4
    M_raster: 7
    A_raster: [5 5 3 3]
    mnfieldp: 1

 Sparams.params.anchors(:,1)'
0.2750 0.3250 0.3750 0.4250 0.4750 0.5250 0.5750 0.6250 0.6750

 Sparams_PSC_CR = Sparams ; clear Sparams


%%%%%%%%%%%%%%%%%%   Run the optimizer on the 40 CR data sets
30 Dec 2003

% Use the PS optimal parameters as a starting point
 x0_PS2PSC_CR = resCR40_PS.opt_X ;
 x0_PS2PSC_CR(:,4) = x0_PS2PSC_CR(:,3);    % L1 is now in column 4
 x0_PS2PSC_CR(:,3) = 0.8 ;                 % init = default cutoff
 describe(x0_PS2PSC_CR)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
   1.433    0.502      0.20    1.07    1.48    1.96    2.00  % mem_k * 10
   0.271    0.116      0.10    0.18    0.27    0.36    0.50  % temper* 10
   0.800    0.000      0.80    0.80    0.80    0.80    0.80  % cutoff
   0.155    0.065      0.05    0.10    0.17    0.21    0.26  % L1

 Sparams_PSC_CR.fname='resCR40_PSC';
 disp('Model PSC, category rating');
 tic;resCR40_PSC=big_psearch(CR40mdata,Sparams_PSC_CR,[],x0_PS2PSC_CR);toc

% Elapsed_time = 1.2511e+004 sec (4 hours) on a Dell Optiplex GX400.
% A barrage of "Divide by zero" warnings on search 10 and occasional
% warning on searches 16, 28, 29, and 33.

 resCR40_PSC =
       model_name: 'anchor2mt'
       descriptor: '30-Dec-2003 23:15:07'
    search_params: [1x1 struct]
            opt_X: [40x4 double]
                L: [40x1 double]
         exitflag: [40x1 double]
          N_evals: [40x1 double]
          N_iters: [40x1 double]
             time: [40x1 double]
               x0: [40x4 double]

 resCR40_PSC.search_params.v2p_templ'
ans = 'PARAMS.mem_k = VAL / 10 ;'
      'PARAMS.temper = VAL / 10 ;'
      'PARAMS.cutoffs = VAL*[-3 -1 +0.9 +2.7] ;'
      'PARAMS.anchors(:,1) = [VAL:(0.675-VAL)/8:0.675]' ;'

 xtab1(resCR40_PSC.N_iters)
   Value   Count  Percent  Cum_cnt  Cum_pct
-------------------------------------------
       2       2     5.00        2     5.00
       3      11    27.50       13    32.50
       4       6    15.00       19    47.50
       5       6    15.00       25    62.50
       6       4    10.00       29    72.50
       7       1     2.50       30    75.00
       8       2     5.00       32    80.00
       9       4    10.00       36    90.00
      10       2     5.00       38    95.00
      12       1     2.50       39    97.50
      18       1     2.50       40   100.00
-------------------------------------------

 describe(resCR40_PSC.L)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
 601.573   86.946    445.16  523.89  599.91  670.36  761.60

 L=[resCR40_PS.L resCR40_PSC.L];find(L(:,1)>L(:,2))'
ans = [4 10 16 28 29 30 32 33 35 40]
% Model PSC improves the fit over model PS for only 10 of the 40 Ss.
% This parameter search proved particularly difficult for the optimizer.
% The above results are a third attempt. Earlier searches (without initial
% vectors informed by PS) typically pushed all parameters against their
% upper bounds and stopped with dismal log-likelihood (e.g. L=850).
% Apparently this particular combination of parameters (cutoff + L1?) is
% especially difficult to do gradient search on. Perhaps it isn't smooth
% enough. Anyway, the mean L=601.573 is good enough for our purposes.

 describe(resCR40_PSC.opt_X)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
   0.920    0.207      0.22    1.00    1.00    1.00    1.00  % mem_k * 10
   0.619    0.250      0.20    0.39    0.80    0.80    0.80  % temper* 10
   0.767    0.398      0.50    0.50    0.50    1.07    1.50  % cutoff
   0.164    0.068      0.05    0.11    0.17    0.22    0.26  % L1

 resCR40_PSC.opt_X'
  Columns 1 through 7
    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000
    0.8000    0.2000    0.6301    0.8000    0.2000    0.8000    0.3844
    0.5000    0.5533    0.9251    1.3888    0.6816    1.5000    1.0507
    0.1829    0.0984    0.2601    0.2611    0.0878    0.2429    0.2336
  Columns 8 through 14
    1.0000    1.0000    0.2798    1.0000    1.0000    1.0000    0.9111
    0.8000    0.8000    0.6885    0.8000    0.8000    0.2000    0.7403
    0.5000    0.5000    1.3959    0.5763    0.5000    0.5341    0.5248
    0.2111    0.1798    0.1421    0.0558    0.2183    0.1743    0.0500
  Columns 15 through 21
    1.0000    0.2214    1.0000    1.0000    1.0000    1.0000    1.0000
    0.8000    0.3897    0.8000    0.8000    0.8000    0.8000    0.8000
    0.5687    1.5000    0.5000    0.5000    0.5000    0.5000    1.5000
    0.1906    0.2342    0.2085    0.1605    0.1396    0.2480    0.2437
  Columns 22 through 28
    1.0000    1.0000    1.0000    0.7915    1.0000    1.0000    1.0000
    0.8000    0.7834    0.8000    0.2000    0.8000    0.2059    0.2000
    0.5000    0.5000    0.5000    0.5000    0.5000    0.5000    0.5000
    0.2031    0.1565    0.2634    0.1620    0.2080    0.0500    0.0500
  Columns 29 through 35
    0.5210    1.0000    0.9899    0.7442    0.3230    1.0000    1.0000
    0.4665    0.8000    0.8000    0.6606    0.8000    0.2000    0.2363
    1.5000    1.5000    0.5000    1.0841    1.5000    0.5000    0.5000
    0.1928    0.2295    0.0500    0.2167    0.0845    0.1377    0.1390
  Columns 36 through 40
    1.0000    1.0000    1.0000    1.0000    1.0000
    0.8000    0.5841    0.8000    0.8000    0.2000
    0.5000    1.2265    0.5000    0.5000    0.6591
    0.1060    0.1593    0.1679    0.0500    0.1169


*************************************************************
***                ******************************************
***   Model PSA    ******************************************
***   Cat. Rat     ******************************************
***                ******************************************
*************************************************************

Active parameters:  mem_k, temper, hist, L1
Shunted parameters: cutoff=Inf, alpha=0
Fixed parameters:   perc_k=0.04, decay=0.5,
                    L9=0.675, avail=[1:9]'
                    cutoff multipliers=[-3 -1 +0.9 +2.7]

 clear all ; cd 'C:\work\anchor\finalsim\' ;
 Sparams=anchor_search_params([0 1 1 1 0 0 1])
Sparams =
    model_name: 'anchor2mt'
    gener_name: 'anchor2'
        params: [1x1 struct]
     p2v_templ: {1x4 cell}
     v2p_templ: {1x4 cell}
        bounds: [2x4 double]
     clip_prob: 0.0183
         optns: [1x1 struct]

 Sparams.params.avail = [1:9]' ;   % all anchors available at all times
 Sparams.params.anchors(:,6)=1 ;   % all anchors available at all times
 Sparams.params.cutoffs = [-Inf -Inf +Inf +Inf] ;   % no corrections
 Sparams.params.alpha = 0 ;        % immutable anchor locations

% To speed up the search, initialize anchor-1 at 0.200 instead of 0.275
 Sparams.params.anchors(1,1)=0.200

 Sparams.params
       scale: 'LINEAR'
       N_cat: 9
     SM_conv: 0.0010
      cat_sz: 0.0500
      perc_k: 0.0400
       mem_k: 0.0700
       avail: [9x1 double]
     anchors: [9x6 double]
     cutoffs: [-Inf -Inf Inf Inf]
      temper: 0.0500
     history: 0.1000
       alpha: 0
       decay: 0.5000
         ITI: 4
    M_raster: 7
    A_raster: [5 5 3 3]
    mnfieldp: 1

 Sparams.params.anchors(:,1)'
0.2000 0.3250 0.3750 0.4250 0.4750 0.5250 0.5750 0.6250 0.6750

% Reduce the lower bound for HISTORY all the way down to zero:
 Sparams.bounds(1,3)=0 ; Sparams.bounds
ans = 0.2000    0.2000         0    0.0500
      1.0000    0.8000    1.5000    0.4000

 Sparams_PSA_CR = Sparams ; clear Sparams


%%%%%%%%%%%%%%%%%%   Run the optimizer on the 40 CR data sets
30 Dec 2003

 Sparams_PSA_CR.fname='resCR40_PSA';
 disp('Model PSA, category rating');
 tic;resCR40_PSA=big_psearch(CR40mdata,Sparams_PSA_CR);toc

% Elapsed_time = 4.8383e+004 sec (13 h 30 min) on a Dell Optiplex GX400.
% No "Divide by zero" warnings on any of the searches.

 resCR40_PSA
       model_name: 'anchor2mt'
       descriptor: '30-Dec-2003 12:19:57'
    search_params: [1x1 struct]
            opt_X: [40x4 double]
                L: [40x1 double]
         exitflag: [40x1 double]
          N_evals: [40x1 double]
          N_iters: [40x1 double]
             time: [40x1 double]

 resCR40_PSA.search_params.v2p_templ'
ans = 'PARAMS.mem_k = VAL / 10 ;'
      'PARAMS.temper = VAL / 10 ;'
      'PARAMS.history = VAL / 5 ;'
      'PARAMS.anchors(:,1) = [VAL:(0.675-VAL)/8:0.675]' ;'

 xtab1(resCR40_PSA.N_iters)
   Value   Count  Percent  Cum_cnt  Cum_pct
-------------------------------------------
       7       7    17.50        7    17.50
       8      13    32.50       20    50.00
       9      12    30.00       32    80.00
      10       4    10.00       36    90.00
      11       2     5.00       38    95.00
      12       1     2.50       39    97.50
      22       1     2.50       40   100.00
-------------------------------------------

 describe(resCR40_PSA.L)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
 536.709   62.044    440.45  490.53  516.61  582.66  667.10

 L=[resCR40_PS.L resCR40_PSA.L];find(L(:,1)<=L(:,2))'
ans = 16     % Model PSA fits better than model PS for 39 of the 40 Ss.

 describe(resCR40_PSA.opt_X)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
   0.910    0.189      0.20    0.92    1.00    1.00    1.00  % mem_k * 10
   0.320    0.089      0.20    0.24    0.31    0.38    0.49  % temper* 10
   0.227    0.097      0.00    0.17    0.24    0.30    0.40  % history* 5
   0.179    0.067      0.05    0.13    0.19    0.23    0.29  % L1

 resCR40_PSA.opt_X'
  Columns 1 through 7
    1.0000    1.0000    0.9626    1.0000    1.0000    1.0000    0.8743
    0.2989    0.2960    0.2000    0.3678    0.2334    0.2134    0.2000
    0.1943    0.2535    0.1331    0.2757    0.1715    0.3037    0.1305
    0.2021    0.1037    0.2584    0.2608    0.1031    0.2918    0.2316
  Columns 8 through 14
    1.0000    1.0000    0.2000    1.0000    1.0000    0.9133    1.0000
    0.4027    0.4745    0.3668    0.3887    0.2491    0.2774    0.3541
    0.1464    0.1934    0.1761    0.2171    0.2204    0.1312    0.2386
    0.2158    0.1955    0.1450    0.0825    0.2335    0.1866    0.0574
  Columns 15 through 21
    1.0000    0.4454    1.0000    1.0000    1.0000    1.0000    1.0000
    0.2000    0.2728    0.3691    0.4931    0.4422    0.3568    0.4332
    0.2498         0    0.2761    0.3132    0.2444    0.3519    0.3992
    0.1998    0.2304    0.2099    0.1712    0.1542    0.2595    0.2795
  Columns 22 through 28
    1.0000    1.0000    1.0000    0.5980    1.0000    1.0000    0.8622
    0.2293    0.3185    0.2380    0.2831    0.2275    0.2815    0.3790
    0.3465    0.2242    0.2399         0    0.2645    0.3194    0.2841
    0.2218    0.1821    0.2779    0.1575    0.2165    0.1531    0.0500
  Columns 29 through 35
    0.6191    1.0000    1.0000    0.7634    0.4254    1.0000    1.0000
    0.3030    0.4784    0.3658    0.2111    0.3918    0.2378    0.3432
    0.0439    0.2874    0.3450    0.1728    0.2020    0.3222    0.1486
    0.1924    0.2586    0.1009    0.2245    0.0914    0.1913    0.1409
  Columns 36 through 40
    0.8163    1.0000    1.0000    1.0000    0.9261
    0.3507    0.2000    0.4294    0.4313    0.2001
    0.3444    0.1629    0.2724    0.3703    0.0998
    0.0941    0.1698    0.1978    0.0500    0.1158


*************************************************************
***                ******************************************
***   Model PSAC   ******************************************
***   Cat. Rat     ******************************************
***                ******************************************
*************************************************************

Active parameters:  mem_k, temper, hist, cutoff, L1
Shunted parameters: alpha=0
Fixed parameters:   perc_k=0.04, decay=0.5,
                    L9=0.675, avail=[1:9]'
                    cutoff multipliers=[-3 -1 +0.9 +2.7]

 clear all ; cd 'C:\work\anchor\finalsim\' ;
 Sparams=anchor_search_params([0 1 1 1 1 0 1])
Sparams =
    model_name: 'anchor2mt'
    gener_name: 'anchor2'
        params: [1x1 struct]
     p2v_templ: {1x5 cell}
     v2p_templ: {1x5 cell}
        bounds: [2x5 double]
     clip_prob: 0.0183
         optns: [1x1 struct]

 Sparams.params.avail = [1:9]' ;   % all anchors available at all times
 Sparams.params.anchors(:,6)=1 ;   % all anchors available at all times
 Sparams.params.alpha = 0 ;        % immutable anchor locations

 Sparams.params
       scale: 'LINEAR'
       N_cat: 9
     SM_conv: 0.0010
      cat_sz: 0.0500
      perc_k: 0.0400
       mem_k: 0.0700
       avail: [9x1 double]
     anchors: [9x6 double]
     cutoffs: [-2.4000 -0.8000 0.7200 2.1600]
      temper: 0.0500
     history: 0.1000
       alpha: 0
       decay: 0.5000
         ITI: 4
    M_raster: 7
    A_raster: [5 5 3 3]
    mnfieldp: 1

 Sparams.params.anchors(:,1)'
0.2750 0.3250 0.3750 0.4250 0.4750 0.5250 0.5750 0.6250 0.6750

% Reduce the lower bound for HISTORY all the way down to zero:
 Sparams.bounds(1,3)=0 ; Sparams.bounds
ans = 0.2000    0.2000         0    0.5000    0.0500
      1.0000    0.8000    1.5000    1.5000    0.4000

% Tighten the search bounds to match the bounds of earlier searches
% for the full ANCHOR model. (The bounds were relaxed for the partial
% models to allow them to compensate for their various deficiencies.)
 Sparams.bounds(:,1)=[0.03 0.10]' * 10 ;    % for mem_k
 Sparams.bounds(:,2)=[0.04 0.06]' * 10 ;    % for temper
 Sparams.bounds(:,3)=[0.05 0.20]' *  5 ;    % history* 5
 Sparams.bounds(:,4)=[0.5 1.1]' ;           % for cutoff
 Sparams.bounds
ans = 0.3000    0.4000    0.2500    0.5000    0.0500
      1.0000    0.6000    1.0000    1.1000    0.4000

 Sparams_PSAC_CR = Sparams ; clear Sparams


%%%%%%%%%%%%%%%%%%   Run the optimizer on the 40 CR data sets
4 Jan 2004

% Use the PSA optimal parameters as a starting point
 x0_PSA2PSAC_CR = resCR40_PSA.opt_X ;
 x0_PSA2PSAC_CR(:,5) = x0_PSA2PSAC_CR(:,4) ;    % L1 is now in column 5
 x0_PSA2PSAC_CR(:,4) = 0.8 ;                    % init = default cutoff
 describe(x0_PSA2PSAC_CR)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
   0.910    0.189      0.20    0.92    1.00    1.00    1.00  % mem_k * 10
   0.320    0.089      0.20    0.24    0.31    0.38    0.49  % temper* 10
   0.227    0.097      0.00    0.17    0.24    0.30    0.40  % history* 5
   0.800    0.000      0.80    0.80    0.80    0.80    0.80  % cutoff
   0.179    0.067      0.05    0.13    0.19    0.23    0.29  % L1

 Sparams_PSAC_CR.fname='resCR40_PSAC';
 disp(['Model PSAC, category rating' datestr(now)]);
 tic;resCR40_PSAC=big_psearch(CR40mdata,Sparams_PSAC_CR,[],x0_PSA2PSAC_CR);toc

% Elapsed_time = 5.6982e+004 sec (16 hours) on a Dell Optiplex GX400.
% Seven "Divide by zero" warnings on search number 10.

 resCR40_PSAC
       model_name: 'anchor2mt'
       descriptor: '04-Jan-2004 17:07:57'
    search_params: [1x1 struct]
            opt_X: [40x5 double]
                L: [40x1 double]
         exitflag: [40x1 double]
          N_evals: [40x1 double]
          N_iters: [40x1 double]
             time: [40x1 double]
               x0: [40x5 double]

 resCR40_PSAC.search_params.v2p_templ'
ans = 'PARAMS.mem_k = VAL / 10 ;'
      'PARAMS.temper = VAL / 10 ;'
      'PARAMS.history = VAL / 5 ;'
      'PARAMS.cutoffs = VAL*[-3 -1 +0.9 +2.7] ;'
      'PARAMS.anchors(:,1) = [VAL:(0.675-VAL)/8:0.675]' ;'

 xtab1(resCR40_PSAC.N_iters)
   Value   Count  Percent  Cum_cnt  Cum_pct
-------------------------------------------
       4       1     2.50        1     2.50
       8       4    10.00        5    12.50
       9       8    20.00       13    32.50
      10       7    17.50       20    50.00
      11       4    10.00       24    60.00
      12       3     7.50       27    67.50
      13       6    15.00       33    82.50
      14       2     5.00       35    87.50
      15       1     2.50       36    90.00
      16       2     5.00       38    95.00
      17       1     2.50       39    97.50
      20       1     2.50       40   100.00
-------------------------------------------

 describe(resCR40_PSAC.L)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
 522.186   69.338    415.36  467.20  508.18  568.98  691.37

 L=[resCR40_PSA.L resCR40_PSAC.L];find(L(:,1)<=L(:,2))'
ans = [8 9 16 19 27 30 31 35 39]      % PSAC fits worse than PSA for 9 of the 24 Ss

 describe(resCR40_PSAC.opt_X)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
   0.935    0.150      0.30    0.96    1.00    1.00    1.00  % mem_k * 10
   0.542    0.082      0.40    0.47    0.60    0.60    0.60  % temper* 10
   0.813    0.230      0.25    0.70    0.92    1.00    1.00  % history* 5
   1.050    0.109      0.53    1.07    1.10    1.10    1.10  % cutoff
   0.200    0.068      0.05    0.15    0.21    0.25    0.32  % L1

%% Earlier search with much relaxed search bounds yielded:
%    Mean  Std.dev       Min     Q25  Median     Q75     Max
%------------------------------------------------------------
% 510.290   66.693    415.54  453.41  496.86  561.44  662.18
%------------------------------------------------------------
%   0.848    0.217      0.25    0.76    0.99    1.00    1.00  % mem_k * 10
%   0.637    0.184      0.20    0.49    0.73    0.80    0.80  % temper* 10
%   0.811    0.349      0.00    0.61    0.87    1.02    1.50  % history* 5
%   1.252    0.250      0.52    1.05    1.32    1.49    1.50  % cutoff
%   0.197    0.067      0.05    0.15    0.20    0.24    0.33  % L1

 resCR40_PSAC.opt_X'
  Columns 1 through 7 
    1.0000    1.0000    1.0000    1.0000    1.0000    1.0000    0.7881
    0.6000    0.6000    0.4002    0.6000    0.5301    0.4197    0.4000
    0.7555    0.9992    0.5100    0.9018    0.8379    0.9726    0.7523
    1.0936    1.1000    0.8661    1.0862    1.1000    1.1000    0.8498
    0.2364    0.1287    0.2653    0.2690    0.1192    0.3217    0.2407
  Columns 8 through 14 
    1.0000    1.0000    0.6211    1.0000    1.0000    1.0000    1.0000
    0.6000    0.6000    0.6000    0.6000    0.4266    0.4709    0.6000
    0.4838    0.4748    0.6373    1.0000    0.7556    0.6910    1.0000
    1.1000    1.1000    1.1000    1.1000    0.9511    1.1000    1.1000
    0.2463    0.2158    0.1598    0.1239    0.2710    0.1966    0.1028
  Columns 15 through 21 
    0.9202    0.3000    1.0000    1.0000    1.0000    1.0000    1.0000
    0.5327    0.5927    0.6000    0.6000    0.6000    0.6000    0.6000
    0.9984    0.2500    0.9922    1.0000    0.7148    1.0000    1.0000
    1.0686    1.1000    1.1000    1.1000    1.1000    1.1000    1.1000
    0.2053    0.2457    0.2343    0.2013    0.1888    0.2664    0.2979
  Columns 22 through 28 
    1.0000    1.0000    0.8924    0.6787    0.9935    1.0000    1.0000
    0.6000    0.6000    0.5503    0.5981    0.4001    0.6000    0.6000
    1.0000    0.8522    0.9884    0.2500    1.0000    1.0000    1.0000
    1.1000    1.1000    0.9305    1.1000    0.9457    1.1000    1.1000
    0.2287    0.2104    0.2959    0.1669    0.2502    0.1753    0.0500
  Columns 29 through 35 
    0.8573    1.0000    1.0000    0.5373    1.0000    0.9906    1.0000
    0.4771    0.4000    0.4000    0.5210    0.6000    0.5780    0.6000
    0.3050    0.9343    1.0000    0.9189    0.7099    0.9252    0.5475
    1.0766    1.0647    1.1000    0.9464    1.1000    1.1000    0.5330
    0.2104    0.2990    0.1541    0.2508    0.0883    0.2242    0.1486
  Columns 36 through 40 
    1.0000    0.9178    1.0000    1.0000    0.9193
    0.6000    0.4002    0.6000    0.6000    0.4000
    1.0000    0.7263    0.9985    1.0000    0.6183
    1.1000    1.0419    1.1000    1.1000    0.9528
    0.1140    0.2002    0.2226    0.0500    0.1323

%%% Apply the same POST-OPTIMIZATION CORRECTION as in model PSACR.
%%  This correction is intended to compensate for the systematic
%%  bias in the optimization machinery (see below).
%%
%%  mem_k  = fmincon_mem_k - 0.008               % bias = 0.008
%%  temper = fmincon_temper                      % no correction
%%  hist   = max(0.050, fmincon_hist - 0.013)    % bias = 0.013
%%  cutoff = max(0.500, fmincon_cutoff - 0.030)  % bias = 0.030

 x=resCR40_PSAC.opt_X; x(:,1)=x(:,1)-(0.008*10);
 x(:,3)=max(0.050*5,x(:,3)-(0.013*5));
 x(:,4)=max(0.500,x(:,4)-0.030);

 resCR40_PSAC.corr_X=x;describe(resCR40_PSAC.corr_X)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
   0.855    0.150      0.22    0.88    0.92    0.92    0.92  % mem_k * 10
   0.542    0.082      0.40    0.47    0.60    0.60    0.60  % temper* 10
   0.751    0.221      0.25    0.64    0.86    0.94    0.94  % history* 5
   1.020    0.109      0.50    1.04    1.07    1.07    1.07  % cutoff
   0.200    0.068      0.05    0.15    0.21    0.25    0.32  % L1


*************************************************************
***                ******************************************
***   Model PSCR   ******************************************
***   Cat. Rat     ******************************************
***                ******************************************
*************************************************************

Active parameters:  mem_k, temper, cutoff
Shunted parameters: hist=0
Fixed parameters:   perc_k=0.04, alpha=0.3, decay=0.5,
                    L1=0.275, L9=0.675, avail=[1 ; 9] only
                    cutoff multipliers=[-3 -1 +0.9 +2.7]

 clear all ; cd 'C:\work\anchor\finalsim\' ;
 Sparams=anchor_search_params([0 1 1 0 1 0 0])
Sparams =
    model_name: 'anchor2mt'
    gener_name: 'anchor2'
        params: [1x1 struct]
     p2v_templ: {1x3 cell}
     v2p_templ: {1x3 cell}
        bounds: [2x3 double]
     clip_prob: 0.0183
         optns: [1x1 struct]

 Sparams.params.history = 0 ;      % shunting off the activation mechanism

% Tighten the search bounds to match the bounds of earlier searches
% for the full ANCHOR model. (The bounds were relaxed for the partial
% models to allow them to compensate for their various deficiencies.)
 Sparams.bounds(:,1)=[0.03 0.10]' * 10 ;    % for mem_k
 Sparams.bounds(:,2)=[0.04 0.06]' * 10 ;    % for temper
 Sparams.bounds(:,3)=[0.5 1.1]' ;           % for cutoff
 Sparams.bounds
ans = 0.3000    0.4000    0.5000
      1.0000    0.6000    1.1000

 Sparams.params
       scale: 'LINEAR'
       N_cat: 9
     SM_conv: 0.0010
      cat_sz: 0.0500
      perc_k: 0.0400
       mem_k: 0.0700
       avail: [2x1 double]
     anchors: [9x6 double]
     cutoffs: [-2.4000 -0.8000 0.7200 2.1600]
      temper: 0.0500
     history: 0
       alpha: 0.3000
       decay: 0.5000
         ITI: 4
    M_raster: 7
    A_raster: [5 5 3 3]
    mnfieldp: 1

 Sparams.params.anchors
    0.2750    1.0000  -10.0000  -10.0000    1.0000    1.0000
    0.3250    2.0000  -10.0000  -10.0000    1.0000         0
    0.3750    3.0000  -10.0000  -10.0000    1.0000         0
    0.4250    4.0000  -10.0000  -10.0000    1.0000         0
    0.4750    5.0000  -10.0000  -10.0000    1.0000         0
    0.5250    6.0000  -10.0000  -10.0000    1.0000         0
    0.5750    7.0000  -10.0000  -10.0000    1.0000         0
    0.6250    8.0000  -10.0000  -10.0000    1.0000         0
    0.6750    9.0000  -10.0000  -10.0000    1.0000    1.0000

 Sparams_PSCR_CR = Sparams ; clear Sparams


%%%%%%%%%%%%%%%%%%   Run the optimizer on the 40 CR data sets
1 Jan 2004

% Use the PSC optimal parameters as a starting point
% Paradoxically, PSCR has one free parameter less because
% L1 is eliminated and the new ALPHA is fixed a priori to 0.3.
 x0_PSC2PSCR_CR = resCR40_PSC.opt_X(:,1:3) ;
 describe(x0_PSC2PSCR_CR)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
   0.920    0.207      0.22    1.00    1.00    1.00    1.00  % mem_k * 10
   0.619    0.250      0.20    0.39    0.80    0.80    0.80  % temper* 10
   0.767    0.398      0.50    0.50    0.50    1.07    1.50  % cutoff

 Sparams_PSCR_CR.fname='resCR40_PSCR';
 disp(['Model PSCR, category rating' datestr(now)]);
 tic;resCR40_PSCR=big_psearch(CR40mdata,Sparams_PSCR_CR,[],x0_PSC2PSCR_CR);toc

% Elapsed_time = 5.6119e+003 sec (1 h 40 min) on a Dell Optiplex GX400.
% No "Divide by zero" warnings on any of the searches.

 resCR40_PSCR
       model_name: 'anchor2mt'
       descriptor: '01-Jan-2004 20:10:12'
    search_params: [1x1 struct]
            opt_X: [40x3 double]
                L: [40x1 double]
         exitflag: [40x1 double]
          N_evals: [40x1 double]
          N_iters: [40x1 double]
             time: [40x1 double]
               x0: [40x3 double]

 resCR40_PSCR.search_params.v2p_templ'
ans = 'PARAMS.mem_k = VAL / 10 ;'
      'PARAMS.temper = VAL / 10 ;'
      'PARAMS.cutoffs = VAL*[-3 -1 +0.9 +2.7] ;'

 xtab1(resCR40_PSCR.N_iters)
   Value   Count  Percent  Cum_cnt  Cum_pct
-------------------------------------------
       1       4    10.00        4    10.00
       2       5    12.50        9    22.50
       3       3     7.50       12    30.00
       4       7    17.50       19    47.50
       5       4    10.00       23    57.50
       6       4    10.00       27    67.50
       7       7    17.50       34    85.00
       8       3     7.50       37    92.50
       9       2     5.00       39    97.50
      10       1     2.50       40   100.00
-------------------------------------------

 describe(resCR40_PSCR.L)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
 543.025   86.564    396.63  479.10  514.90  601.85  738.48

% This is worse than earlier models due to the more restrictive
% parameter bounds. Still, running averaging now allows much
% more advantageous anchor placement, hence good fit.
% Note also that PSCR has 3 free parameters whereas PSC has 4.
 L=[resCR40_PSC.L resCR40_PSCR.L];find(L(:,1)<=L(:,2))'
ans = [5 9 19 25 30 40]    % Improvement for 34 of the 40 Ss.

 describe(resCR40_PSCR.opt_X)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
   0.830    0.172      0.42    0.69    0.88    1.00    1.00  % mem_k * 10
   0.517    0.086      0.40    0.40    0.53    0.60    0.60  % temper* 10
   0.899    0.196      0.50    0.79    0.92    1.10    1.10  % cutoff

 resCR40_PSCR.opt_X'
  Columns 1 through 7
    1.0000    0.8699    0.5430    1.0000    0.8059    1.0000    0.5802
    0.6000    0.6000    0.5335    0.6000    0.4000    0.5968    0.5900
    1.0898    1.0931    0.7684    0.5000    1.1000    1.1000    0.7595
  Columns 8 through 14
    1.0000    1.0000    0.4220    1.0000    0.7587    1.0000    0.7188
    0.6000    0.6000    0.4000    0.4927    0.5887    0.4746    0.4000
    0.5068    0.5000    0.9072    0.9353    0.8717    0.8059    1.0293
  Columns 15 through 21
    0.6582    0.6924    1.0000    1.0000    1.0000    1.0000    1.0000
    0.4000    0.4000    0.6000    0.6000    0.6000    0.6000    0.6000
    0.8732    0.5000    0.7815    1.1000    1.1000    0.5000    1.0002
  Columns 22 through 28
    0.6221    0.6046    0.6975    0.8865    0.8913    1.0000    0.6966
    0.5250    0.4000    0.6000    0.4000    0.5236    0.6000    0.4000
    1.1000    0.9656    0.8901    0.8321    0.8004    1.1000    1.1000
  Columns 29 through 35
    0.7578    1.0000    1.0000    0.6822    0.7058    0.9945    0.8060
    0.5316    0.6000    0.4279    0.6000    0.4814    0.4835    0.4944
    0.7422    1.1000    1.1000    0.7019    1.0582    0.9546    0.9657
  Columns 36 through 40
    0.6656    0.5863    1.0000    0.6872    0.8804
    0.4000    0.4000    0.6000    0.4000    0.5524
    1.0642    0.8735    0.8737    1.1000    0.8317

%%% Apply the same POST-OPTIMIZATION CORRECTION as in model PSACR.
%%  This correction is intended to compensate for the systematic
%%  bias in the optimization machinery (see below).
%%
%%  mem_k  = fmincon_mem_k - 0.008               % bias = 0.008
%%  temper = fmincon_temper                      % no correction
%%  cutoff = max(0.500, fmincon_cutoff - 0.030)  % bias = 0.030

 x=resCR40_PSCR.opt_X; x(:,1)=x(:,1)-(0.008*10);
 x(:,3)=max(0.500,x(:,3)-0.030);

 resCR40_PSCR.corr_X=x;describe(resCR40_PSCR.corr_X)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
   0.750    0.172      0.34    0.61    0.80    0.92    0.92  % mem_k * 10
   0.517    0.086      0.40    0.40    0.53    0.60    0.60  % temper* 10
   0.873    0.189      0.50    0.76    0.89    1.07    1.07  % cutoff


*************************************************************
***                ******************************************
***   Model PSACR  = full ANCHOR Model **********************
***                ******************************************
*************************************************************
***

Active parameters:  mem_k, temper, cutoff, hist
Fixed parameters:   perc_k=0.04, decay=0.5, alpha=0.3
                    cutoff multipliers=[-3 -1 +0.9 +2.7]
                    only two anchors initially: L1=.275, L9=.675

% This search has already been performed many times.
% The "official" results are available in \ANCHOR\SIMUL\MAIN_OPTIM.MAT.
% See also OPT_PARAMS.TXT, CRRESULTS.TXT, and DEFAULT_RESULTS.TXT.

21 Oct, 2002, see SIMUL\OPT_PARAMS.TXT
INITIAL PARAMS, SEARCH PARAMS, and FMINCON OPTIONS:
 M_raster: 7           A_raster: [5 5 3 3]     mnfield: 'posterior'
   perc_k: 0.0400         mem_k: 0.0700        optns.TofFun: 1e-1
  cutoffs: [-2.40 -0.80 0.72 2.16]             optns.TolCon: 1e-4
   temper: 0.050        history: 0.100           optns.TolX: 1e-2
    alpha: 0.300          decay: 0.500          MaxFunEvals: 400
    avail: [1 , 9]'     anchors: [0.275:0.050:0.675]'

 Sparams_PSACR_CR
    model_name: 'anchor2mt'
        params: [1x1 struct]
     p2v_templ: {1x4 cell}
     v2p_templ: {1x4 cell}
        bounds: [2x4 double]
     clip_prob: 0.0183
         optns: [1x1 struct]
         fname: 'CR40_poster'

 Sparams_PSACR_CR.v2p_templ'
    'PARAMS.mem_k = VAL / 10 ;'
    'PARAMS.temper = VAL / 10 ;'
    'PARAMS.history = VAL / 5 ;'
    'PARAMS.cutoffs = VAL*[-3 -1 +0.9 +2.7] ;'

 Sparams_PSACR_CR.bounds
ans = 0.3000    0.4000    0.2500    0.5000
      1.0000    0.6000    1.0000    1.1000

 Sparams_PSACR_CR.params
       scale: 'LINEAR'
       N_cat: 9
     SM_conv: 0.0010
      cat_sz: 0.0500
      perc_k: 0.0400
       mem_k: 0.0700
       avail: [2x1 double]
     anchors: [9x6 double]
     cutoffs: [-2.4000 -0.8000 0.7200 2.1600]
      temper: 0.0500
     history: 0.1000
       alpha: 0.3000
       decay: 0.5000
         ITI: 4
    M_raster: 7
    A_raster: [5 5 3 3]
    mnfieldp: 1

%%%%%%%%%%%%%%%%%%   Run the optimizer on the 40 CR data sets
21 Oct, 2002

 tic;resCR40_PSACR=big_psearch(CR40mdata,Sparams_PSACR);toc

 resCR40_PSACR =
       model_name: 'anchor2mt'
       descriptor: '21-Oct-2002 03:26:42'
    search_params: [1x1 struct]
            opt_X: [40x4 double]
                L: [40x1 double]
         exitflag: [40x1 double]
          N_evals: [40x1 double]
          N_iters: [40x1 double]
             time: [40x1 double]

 xtab1(resCR40_PSACR.N_iters)
   Value   Count  Percent  Cum_cnt  Cum_pct
-------------------------------------------
       3       4    10.00        4    10.00
       4       1     2.50        5    12.50
       5       3     7.50        8    20.00
       6       2     5.00       10    25.00
       7       9    22.50       19    47.50
       8       5    12.50       24    60.00
       9       3     7.50       27    67.50
      10       1     2.50       28    70.00
      11       2     5.00       30    75.00
      14       2     5.00       32    80.00
      15       1     2.50       33    82.50
      16       1     2.50       34    85.00
      17       3     7.50       37    92.50
      18       1     2.50       38    95.00
      20       1     2.50       39    97.50
      21       1     2.50       40   100.00
-------------------------------------------

 describe(resCR40_PSACR.L)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
 460.059   82.941    316.99  404.75  446.01  510.16  666.10

 L=[resCR40_PSAC.L resCR40_PSACR.L];find(L(:,1)<=L(:,2))'
ans = [30 40]   % No improvement for 2 of the 40 Ss.

 describe(resCR40_PSACR.opt_X)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
   0.842    0.159      0.43    0.73    0.84    1.00    1.00  % mem_k * 10
   0.495    0.081      0.40    0.42    0.49    0.60    0.60  % temper* 10
   0.599    0.187      0.25    0.48    0.56    0.73    1.00  % history* 5
   0.894    0.154      0.53    0.78    0.86    1.06    1.10  % cutoffs


%%%%%%   POST-OPTIMIZATION CORRECTION    %%%%%%%%%%%%%%%%%%%%%%%%%
%%
%%  Monte Carlo experiments with the optimizer revealed that there
%%  is a systematic bias in the parameter search process. It may be
%%  due in part to discretizations and approximations in the model
%%  tracer ANCHOR2MT, in part to the model-tracing nature of the
%%  log-likelihood calculation scheme, and in part to inherent
%%  statistical instability in the gradient search method under
%%  rather volatile tolerances and termination criteria.
%%  This corrections below are intended to compensate for
%%  the systematic biases in the optimization machinery.
%%
%%  mem_k  = fmincon_mem_k - 0.008               % bias = 0.008
%%  temper = fmincon_temper                      % no correction
%%  hist   = max(0.050, fmincon_hist - 0.013)    % bias = 0.013
%%  cutoff = max(0.500, fmincon_cutoff - 0.030)  % bias = 0.030

 x=resCR40_PSACR.opt_X; x(:,1)=x(:,1)-(0.008*10);
 x(:,3)=max(0.050*5,x(:,3)-(0.013*5));
 x(:,4)=max(0.500,x(:,4)-0.030);

 resCR40_PSACR.corr_X=x;describe(resCR40_PSACR.corr_X)
    Mean  Std.dev       Min     Q25  Median     Q75     Max
------------------------------------------------------------
   0.762    0.159      0.35    0.65    0.76    0.92    0.92  % mem_k * 10
   0.495    0.081      0.40    0.42    0.49    0.60    0.60  % temper* 10
   0.537    0.181      0.25    0.41    0.49    0.67    0.94  % history* 5
   0.864    0.153      0.50    0.75    0.83    1.03    1.07  % cutoff


===========  Final optimal parameters, full model  ======================

ANCHOR2MT, CATEGORY-RATING DATA, 40 Ss     21 Oct, 2002
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
POSTERIOR-BASED model tracing.
Fixed parameters: PERC_K=0.040, ALPHA=0.30, DECAY=0.50.
Initial anchors:  L1=0.275, L9=0.675.

          logL     mem_k    temper      hist    cutoff
------------------------------------------------------
fmincon lo_bound  0.0300    0.0400    0.0500    0.5000
fmincon init_app  0.0700    0.0500    0.1000    0.8000
fmincon hi_bound  0.1000    0.0600    0.2000    1.1000
------------------------------------------------------
mean   460.059    0.0762    0.0495    0.1075    0.8638
std     82.941    0.0159    0.0081    0.0362    0.1535

min    316.991    0.0349    0.0400    0.0500    0.5000
P10    369.268    0.0557    0.0400    0.0630    0.6957
P25    404.747    0.0646    0.0416    0.0828    0.7475
med    446.014    0.0761    0.0485    0.0989    0.8323
P75    510.163    0.0920    0.0600    0.1333    1.0312
P90    578.119    0.0920    0.0600    0.1597    1.0700
max    666.105    0.0920    0.0600    0.1870    1.0700
------------------------------------------------------
 1     506.857    0.0920    0.0400    0.1155    0.7060
 2     409.155    0.0859    0.0600    0.1359    0.9721
 3     412.008    0.0549    0.0420    0.0500    0.7237
 4     583.159    0.0920    0.0600    0.1175    0.8333
 5     400.340    0.0757    0.0491    0.0930    1.0579
 6     434.105    0.0906    0.0400    0.0778    1.0700
 7     416.273    0.0565    0.0404    0.0863    0.6884
 8     609.595    0.0920    0.0473    0.0916    0.6013
 9     654.042    0.0920    0.0600    0.0940    0.8060
10     371.782    0.0349    0.0400    0.0581    0.8344

11     462.580    0.0899    0.0480    0.1319    0.8370
12     446.071    0.0639    0.0449    0.1179    0.7799
13     497.721    0.0907    0.0416    0.0679    0.8265
14     387.578    0.0652    0.0521    0.1338    0.9534
15     375.957    0.0602    0.0444    0.0750    0.8872
16     469.090    0.0615    0.0400    0.0500    0.5000
17     528.037    0.0920    0.0600    0.1422    0.7101
18     573.078    0.0920    0.0600    0.1870    1.0322
19     564.404    0.0920    0.0600    0.1144    1.0700
20     546.459    0.0920    0.0600    0.1532    0.8056

21     513.470    0.0920    0.0544    0.1737    0.8312
22     398.597    0.0667    0.0600    0.0920    1.0692
23     366.755    0.0469    0.0400    0.0802    0.8654
24     471.365    0.0711    0.0567    0.0976    0.7025
25     457.769    0.0715    0.0455    0.1077    0.7042
26     422.944    0.0766    0.0400    0.1328    0.8169
27     453.190    0.0920    0.0400    0.1870    1.0700
28     363.932    0.0679    0.0497    0.0824    1.0303
29     519.801    0.0709    0.0491    0.0500    0.6890
30     666.105    0.0920    0.0593    0.0836    1.0700

31     421.058    0.0920    0.0600    0.1356    1.0700
32     445.957    0.0571    0.0507    0.1002    0.7049
33     426.835    0.0671    0.0536    0.0836    0.9355
34     458.224    0.0920    0.0600    0.1151    1.0700
35     429.946    0.0735    0.0437    0.0832    0.7817
36     322.866    0.0657    0.0416    0.1479    0.9717
37     381.008    0.0547    0.0433    0.0763    0.7713
38     479.751    0.0896    0.0600    0.1663    0.8245
39     316.991    0.0603    0.0400    0.1168    1.0700
40     437.517    0.0828    0.0423    0.0945    0.8099
------------------------------------------------------
sbj       logL     mem_k    temper      hist    cutoff


INITIAL PARAMS, SEARCH PARAMS, and FMINCON OPTIONS:
 M_raster: 7           A_raster: [5 5 3 3]     mnfield: 'posterior'
   perc_k: 0.0400         mem_k: 0.0700        optns.TofFun: 1e-1
  cutoffs: [-2.40 -0.80 0.72 2.16]             optns.TolCon: 1e-4
   temper: 0.050        history: 0.100           optns.TolX: 1e-2
    alpha: 0.300          decay: 0.500          MaxFunEvals: 400
    avail: [1 , 9]'     anchors: [0.275:0.050:0.675]'

POST-OPTIMIZATION CORRECTION (based on Monte-Carlo estimation
                  of the biases of the optimization machinery):
  mem_k  = fmincon_mem_k - 0.008               % bias = 0.008
  temper = fmincon_temper                      % no correction
  hist   = max(0.050, fmincon_hist - 0.013)    % bias = 0.013
  cutoff = max(0.500, fmincon_cutoff - 0.030)  % bias = 0.030

%%%
%%%%%%%%%%  End of file HRCR_PSEARCH.TXT
