Log In | Get Help   
Home My Page Projects Code Snippets Project Openings Mareframe
Summary Activity Forums Tracker Lists Tasks Docs Surveys News SCM Files
[mareframe] Annotation of /trunk/gadget/recstatistics.h
[mareframe] / trunk / gadget / recstatistics.h Repository:
ViewVC logotype

Annotation of /trunk/gadget/recstatistics.h

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1 - (view) (download)

1 : agomez 1 #ifndef recstatistics_h
2 :     #define recstatistics_h
3 :    
4 :     #include "likelihood.h"
5 :     #include "commentstream.h"
6 :     #include "recaggregator.h"
7 :     #include "doublematrixptrvector.h"
8 :     #include "tagptrvector.h"
9 :     #include "popstatistics.h"
10 :    
11 :     /**
12 :     * \class RecStatistics
13 :     * \brief This is the class used to calculate a likelihood score based on statistical data sampled from the tagging experiments
14 :     *
15 :     * This class calculates a likelihood score based on the difference between statistical data sampled from tagging experiments within the model and that caught by fleets, according to the landings data. This is typically used to compare biological data, such as mean length at age This class is an extension of the CatchStatistics class for tagged populations. The model will calculate the mean length of the tagged stock that is caught according to the model parameters, and aggregate this into specified age groups. This statistical data is then compared to the corresponding data calculated from the tagging experiment data.
16 :     */
17 :     class RecStatistics : public Likelihood {
18 :     public:
19 :     /**
20 :     * \brief This is the RecStatistics constructor
21 :     * \param infile is the CommentStream to read the RecStatistics data from
22 :     * \param Area is the AreaClass for the current model
23 :     * \param TimeInfo is the TimeClass for the current model
24 :     * \param weight is the weight for the likelihood component
25 :     * \param Tag is the TagPtrVector of tagging experiments for the current model
26 :     * \param name is the name for the likelihood component
27 :     */
28 :     RecStatistics(CommentStream& infile, const AreaClass* const Area,
29 :     const TimeClass* const TimeInfo, double weight, TagPtrVector Tag, const char* name);
30 :     /**
31 :     * \brief This is the default RecStatistics destructor
32 :     */
33 :     virtual ~RecStatistics();
34 :     /**
35 :     * \brief This function will calculate the likelihood score for the RecStatistics component
36 :     * \param TimeInfo is the TimeClass for the current model
37 :     */
38 :     virtual void addLikelihood(const TimeClass* const TimeInfo);
39 :     /**
40 :     * \brief This function will reset the RecStatistics likelihood information
41 :     * \param keeper is the Keeper for the current model
42 :     */
43 :     virtual void Reset(const Keeper* const keeper);
44 :     /**
45 :     * \brief This function will print the summary RecStatistics likelihood information
46 :     * \param outfile is the ofstream that all the model information gets sent to
47 :     */
48 :     virtual void Print(ofstream& outfile) const;
49 :     /**
50 :     * \brief This will select the fleets and stocks required to calculate the RecStatistics likelihood score
51 :     * \param Fleets is the FleetPtrVector of all the available fleets
52 :     * \param Stocks is the StockPtrVector of all the available stocks
53 :     */
54 :     void setFleetsAndStocks(FleetPtrVector& Fleets, StockPtrVector& Stocks);
55 :     /**
56 :     * \brief This function will print summary information from the RecStatistics likelihood calculation
57 :     * \param outfile is the ofstream that all the model likelihood information gets sent to
58 :     */
59 :     virtual void printSummary(ofstream& outfile);
60 :     /**
61 :     * \brief This function will print information from each Recaptures calculation
62 :     * \param outfile is the ofstream that all the model likelihood information gets sent to
63 :     * \param TimeInfo is the TimeClass for the current model
64 :     */
65 :     virtual void printLikelihood(ofstream& outfile, const TimeClass* const TimeInfo);
66 :     private:
67 :     /**
68 :     * \brief This function will read the RecStatistics data from the input file
69 :     * \param infile is the CommentStream to read the RecStatistics data from
70 :     * \param TimeInfo is the TimeClass for the current model
71 :     * \param numarea is the number of areas that the likelihood data covers
72 :     * \param Tag is the TagPtrVector of the available tagging experiments for the current model
73 :     */
74 :     void readStatisticsData(CommentStream& infile, const TimeClass* TimeInfo,
75 :     int numarea, TagPtrVector Tag);
76 :     /**
77 :     * \brief This function will calculate the likelihood score for the current timestep based on a sum of squares function
78 :     * \return likelihood score
79 :     */
80 :     double calcLikSumSquares();
81 :     /**
82 :     * \brief This is the DoubleMatrixPtrVector used to store number information specified in the input file
83 :     * \note The indices for this object are [tag][time][area]
84 :     */
85 :     DoubleMatrixPtrVector numbers;
86 :     /**
87 :     * \brief This is the DoubleMatrixPtrVector used to store mean length information specified in the input file
88 :     * \note The indices for this object are [tag][time][area]
89 :     */
90 :     DoubleMatrixPtrVector obsMean;
91 :     /**
92 :     * \brief This is the DoubleMatrixPtrVector used to store mean length information calculated in the model
93 :     * \note The indices for this object are [tag][time][area]
94 :     */
95 :     DoubleMatrixPtrVector modelMean;
96 :     /**
97 :     * \brief This is the DoubleMatrixPtrVector used to store the standard deviation of the length information specified in the input file
98 :     * \note The indices for this object are [tag][time][area]
99 :     */
100 :     DoubleMatrixPtrVector obsStdDev;
101 :     /**
102 :     * \brief This is the DoubleMatrixPtrVector used to store the standard deviation of the length information calculated in the model
103 :     * \note The indices for this object are [tag][time][area]
104 :     */
105 :     DoubleMatrixPtrVector modelStdDev;
106 :     /**
107 :     * \brief This is the RecAggregator used to collect information about the racptured tagged fish
108 :     */
109 :     RecAggregator** aggregator;
110 :     /**
111 :     * \brief This is the LengthGroupDivision used to store length information
112 :     */
113 :     LengthGroupDivision* LgrpDiv;
114 :     /**
115 :     * \brief This is the CharPtrVector of the names of the fleets that will be used to calculate the likelihood score
116 :     */
117 :     CharPtrVector fleetnames;
118 :     /**
119 :     * \brief This is the CharPtrVector of the names of the tagging experiments that will be used to calculate the likelihood score
120 :     */
121 :     CharPtrVector tagnames;
122 :     /**
123 :     * \brief This is the IntMatrix used to store area information
124 :     */
125 :     IntMatrix areas;
126 :     /**
127 :     * \brief This is the CharPtrVector of the names of the areas
128 :     */
129 :     CharPtrVector areaindex;
130 :     /**
131 :     * \brief This is the identifier of the function to be used to calculate the likelihood component
132 :     */
133 :     int functionnumber;
134 :     /**
135 :     * \brief This is the IntVector of indices of the timesteps for the likelihood component data
136 :     */
137 :     IntVector timeindex;
138 :     /**
139 :     * \brief This is the IntMatrix used to store information about the years when the likelihood score should be calculated
140 :     */
141 :     IntMatrix Years;
142 :     /**
143 :     * \brief This is the IntMatrix used to store information about the steps when the likelihood score should be calculated
144 :     */
145 :     IntMatrix Steps;
146 :     /**
147 :     * \brief This is the name of the function to be used to calculate the likelihood component
148 :     */
149 :     char* functionname;
150 :     /**
151 :     * \brief This is the TagPtrVector of the relevant tagging experiments
152 :     */
153 :     TagPtrVector tagvec;
154 :     /**
155 :     * \brief This is the PopStatistics used to calculate the statistics of the population
156 :     */
157 :     PopStatistics ps;
158 :     /**
159 :     * \brief This is the AgeBandMatrixPtrVector used to temporarily store the information returned from the aggregatation function
160 :     */
161 :     const AgeBandMatrixPtrVector* alptr;
162 :     };
163 :    
164 :     #endif

root@forge.cesga.es
ViewVC Help
Powered by ViewVC 1.0.0  

Powered By FusionForge