1 /* optdesign.h
2 
3    Originally written by Frederic Bois
4 
5    Copyright (c) 1997-2017 Free Software Foundation, Inc.
6 
7    This file is part of GNU MCSim.
8 
9    GNU MCSim is free software; you can redistribute it and/or
10    modify it under the terms of the GNU General Public License
11    as published by the Free Software Foundation; either version 3
12    of the License, or (at your option) any later version.
13 
14    GNU MCSim is distributed in the hope that it will be useful,
15    but WITHOUT ANY WARRANTY; without even the implied warranty of
16    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
17    GNU General Public License for more details.
18 
19    You should have received a copy of the GNU General Public License
20    along with GNU MCSim; if not, see <http://www.gnu.org/licenses/>
21 
22    Header file for optdesign.c
23 */
24 
25 #ifndef OPTDESIGN_H_DEFINED
26 
27 /* ----------------------------------------------------------------------------
28    Inclusions
29 */
30 
31 #include <float.h>  /* Floating point limits */
32 
33 #include "sim.h"
34 
35 
36 /* ----------------------------------------------------------------------------
37    Prototypes
38 */
39 
40 void CloseOptFiles (PANALYSIS panal);
41 
42 void Compute_cost (long nData, int *piData_mask, double *dCost);
43 
44 void Do_Importance_Ratios (double **pdY, PMCVAR *pLikes, long nSims,
45                            long nPreds, long nDesignPts, int *piDesign_mask,
46                            int nDesignPt_tried, double *pdIR);
47 
48 void DoOptimalDesign (PANALYSIS panal);
49 
50 double DoVariance (long nDim, double *pdImpR, double **pdX,
51                    long istart, long ifinish);
52 
53 int Estimate_y (PANALYSIS panal, double *pdTheta, double *pdPred);
54 
55 void Importance_Resample (long nMod, long *pIndex0, long *pIndex1,
56                           long *plDrawn, double *pdLL, double dSumL);
57 
58 void InitOptArrays (PANALYSIS panal, int **piDesign_mask,
59                     long *pnDesignPts, double ***pdY, long *pnPreds,
60                     long *pnStartDecisionPts, double **pdVariance,
61                     double **pdIR, long nSims);
62 
63 void OpenOptFiles (PANALYSIS panal);
64 
65 void ReadAndSimulate (PANALYSIS panal, long nParms,
66                       double **pdY, long nPred, PMCVAR *pLikes, long nSims);
67 
68 void SetupLikes (PANALYSIS panal, long nDesignPts, PMCVAR **pdLikes);
69 
70 void WriteOptimOut (PANALYSIS panal, long iter, long nDesignPts, int criterion,
71                     double *pdVariance, int *piData_mask, long iCrit,
72                     double dCrit, double dCost);
73 
74 void WriteOutHeader (PANALYSIS panal, int criterion);
75 
76 #define OPTDESIGN_H_DEFINED
77 #endif  /* OPTDESIGN_H_DEFINED */
78 
79 /* End */
80 
81