---
title: "Statistical framework of the ARTFISH methodology"
output:
  rmarkdown::html_vignette:
    toc: true
    number_sections: true
    toc_depth: 2
vignette: >
  %\VignetteIndexEntry{Statistical framework of the ARTFISH methodology}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r setup, include=FALSE}
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>",
  warning = FALSE,
  message = FALSE
)
library(artfishr)
```

## 1. Introduction
This vignette presents the statistical and conceptual framework that underpins the ARTFISH methodology implemented in the `artfishr` package.

The aim of ARTFISH methodology is to produce catch and effort estimates at the country level. It is a __sampled based approach__ using __stratified random sampling__.

ARTFISH stands for Approaches, Rules and Techniques for Fisheries statistical monitoring. It has been developed as a standardized tool adaptable to most fisheries in the developing countries. Its design was driven by the need to provide users with robust, user-friendly and error-free approaches and achieve the implementation of cost-effective fishery statistical systems with minimal external assistance. It was implemented and describe by Constantine Stamatopoulos (Stamatopoulos, 2002) and it is the methodology promoted by FAO.

## 2. Artfish Methodology concept
### 2.1	Presentation of a generic formula

ARTFISH is based on the concept of catch per unit of effort CPUE, using the following formula:
    CPUE = Catch/effort <=> Catch = CPUE x Effort
    
Where:

- Catch: refers to all species taken together and is usually computed within the logical context of:
- - A limited geographical area or stratum
- - A given reference period (i.e. a calendar month)
- - A specific boat/gear category
- CPUE (estimated from sample, overall catch per fishing unit): is an overall average deriving from sampling and expressing how much fish (all species) is caught by a unit effort. Sampling context is the same as that for the estimated catch.
- Effort (estimated from sample): is expressed uniformly in total number of boats.days within the same logical context used for total catch and overall CPUE.

CPUE and effort are estimated from the sample. The sources of data can vary depending on what is available in the country and which type of survey have been implemented.

The following schema shows the calculation for a sampling in time and in space, in others words few days are sampled and few landing sites.

(find how to add the schema)
Figure 1: ARTFISH principles schema

### 2.2 Stratification

In ARTFISH, as in other statistics method, the estimates are produced for each stratum. Then the results are summed to calculate the total amount at the higher level (country total catch…).

The first level of stratification corresponds to a reference period. In ARTFISH, the data collection is generally organised on a monthly basis. But rather than using months, fishing seasons may be preferable. The reference period will be the first stratification level, meaning that the estimation can be done by month when the reference period is the month.

Types of stratification that can be defined in the data collection program if necessary are:

-	__Major strata__: with is often subdivisions based on administrative, geographical or temporal criteria,
-	__Minor strata__: subdivisions of a major stratum.
-	__Fishing units is the last (and minimum) level of stratification__ in the method: fishing units are built to describe the fisheries sector of the country.
  
Major strata and minor strata are not necessary and can only be implemented if the context requires it. There may also be clear logistical criteria supporting the choice of strata.

__Estimates of population parameters are always calculated at lowest stratum level__. Totals at major stratum level are simply aggregations of estimates and counts from the minor strata involved.

The sample size for each stratum can be calculated different method using preliminary data. If no data are available, it is recommended to sample:

-	Between 8 to 12 days a month,
-	At least, 30 landings for landing survey,
-	At least, 70 effort surveys.

## 3. CPUE

CPUE are calculating with the data collected by the landing survey in weight (kg or lbs) per day.
(schéma de la formule)

To estimated CPUE, the following variables must be collected:
-	the fishing unit type (as defined in the sampling plan)
-	the total weight of catch, all species together (and detailed by species for estimation per species)
-	the fishing trip duration (time spent fishing, fishing trip length…)

CPUE are calculated per stratum (combination of a reference month/a major and/or minor strata/a fishing unit) with the following formula:

(insert formula?)
$$ \mathrm{CPUE}=\frac{\sum_{i=1}^{n} {Catch}_{i}}{\sum_{i=1}^{n} {Unit of Effort}_{i}}$$
Where:

- Catch~i~ = the total catch of the i^th^ sampled fishing trip
- Unit of effort~i~ = the effort spent fishing of the i^th^ sampled fishing trip
- n = the number of fishing trips sampled for this specific determining context.

In ARTFISH, the unit of effort is expressed in day: duration of the fishing trip or time spent fishing (depending on the level of detail of the data collected). The formula used in ARTFISH is then:

$$ \mathrm{CPUE}=\frac{\sum_{i=1}^{n} {Catch}_{i}}{\sum_{i=1}^{n} {TripDuration}_{i}}$$
Example:
Table 1: Example of landings survey record for CPUE calculation

(insert table)

CPUE = (165 + 0 + 90)/(2+1+1) = 63,75 kg/day

__WARNING:__
Data collectors must record trip with zero catch as well and those must be considered in calculation
In our example, if zero catch are not considered (or nor record by data collectors), the CPUE calculation becomes: (165+90)/(2+1) = 255/3 = 85 kg/day. As a result, the overall catches will be overestimated.


## 4. Effort
## 4.1 Presentation

In sampling in time and in space, effort calculation requires 3 components:

(insert formula schema)

Where:

- D: is a raising time factor expressing total number of days with fishing activities during the month. D is estimated from an active days survey.
- F: is a raising factor expressing total number of fishing units that are potentially operating at all fishing sites (the overall geographical area or stratum). F is estimated from a frame survey or registry.
- AC: is the activity coefficient. The activity of the fishing units can be either estimated through the boat activity coefficient (BAC, with vertical sampling using boat counting) or through the fishing activity coefficient (FAC, with horizontal sampling using fisher interviews). The estimation for both is expressed as:

<span style="color:yellow">
<p style="text-align:center;">__Effort =F x D x BAC__</p>
<p style="text-align:center;">__Effort = F x D x FAC__</p>
</span>

BAC and FAC are both expressing the probability that any boat (= fishing unit) will be active (=fishing) on any day during the month. BAC is estimated from a boat activity survey, FAC with fisher interview.


### 4.2	Number of active vessels: Estimation of raising factor expressing total number of active fishing units (F)

F represents the number of boats that are active/involved in the fishing fleet hence potentially capable of going fishing any day during the sampling period. To estimate F there are two common methods depending on how the fleet is administratively managed:

-	either frame survey when boats are not registered,
-	or vessel registry when boat must register to the fisheries or maritime administration.

Other sources may be considered and are currently explored such as household surveys in case of only small-scale fisheries.

For the stratum i and the fishing unit j, F is the sum of the number of boats of this fishing unit of all sites included in the stratum:

$$ \mathrm{F}_{i,j}=\sum_{k=1}^{q} {x}_{i,j,k}$$
Where:

- x~(i,j,k)~ is the number of potentially active vessels of the fishing unit j at the site k in the stratum i
- q	is the number of sites in the stratum i
- F~i,j~ will be the raising factor for stratum i and fishing unit j.

### 4.3	Number of active days: Estimation of the time raising factor (D)

D is a time-extrapolation factor and specifies the total number of days that are assumed to be normal fishing days during the survey period. It is usually formulated by first considering the total number of calendar days and then reducing it according to empirically known factors, such as holidays, weekends, bad weather, etc.
This number accounts uniformly for days of normal activity. D is estimated for a specific determining context (a reference period/a geographical strata/fishing unit combination).
To estimate D, the target population is the total number of days within the month.

The coefficient D can be calculated by subtracting the number of non-potentially fishing days from the total number of days in the month (for stratum I and fishing unit j):
D_(i,j)=Number day in the month-Number of nonfishing days

Example:
Table 2: Template example for active days survey
(insert table)

In Table 2: for strata 1 and fishing unit 2: A = 31-9=22

When there are several sites in the stratum, D is the weighted mean of the values, weighted by the number of boats of the fishing unit at the different sites.

$$ \mathrm{D}_{i,j}=\frac{\sum_{m=1}^{t} {(D_{i,j,m}*x_{i,j,m})}_{i}}{\sum_{m=1}^{t} x_{i,j,m}}$$
Where:

- m is the number of the mth sampled site. m goes from 1 to t
- t is the total number of sampled sites
- x~i,j,m~ is the number of active boats at the site m in the stratum I for the fishing unit j
- D~i,j,m~ is the number of active days at the site m in the stratum I for the fishing unit j


### 4.4 Activity coefficient: Estimation of boat activity coefficient (BAC) or fishing activity coefficient (FAC)
#### 4.4.1	Difference between BAC and FAC

Activity coefficient accounts for the individual variability of boat activities and is determined by examining an appropriate number of boats and findings out how many have been active on a given day.

The activity of the fishing units can be either estimated through the boat activity coefficient (BAC, vertical sampling) or through the fishing activity coefficient (FAC, horizontal sampling). The estimation for both is expressed as:

<p style="text-align:center;">__Total fishing effort = F x D x BAC__</p>
<p style="text-align:center;">or</p>
<p style="text-align:center;">__Total fishing effort = F x D x FAC__</p>

The effort is expressed in number of boat-day when the CPUE is in kg/day.

Horizontal sampling is used to estimate FAC. Vertical sampling is used to estimate BAC:
-	__Horizontal sampling__. The easiest way to collect information on the average number of fishing days is to include a question on this in the landing survey. The fishers know how many days they went out in the previous week, so simply asking them how many days they went fishing in the previous week will suffice. This is called horizontal sampling for fishing effort.
-	__Vertical sampling__. In vertical sampling, a separate fishing effort data collection system is designed. At the landing sites, throughout the month, on a daily basis, the total number of vessels and the vessels that go fishing is registered. This system is slightly more complicated and a little costlier, but it may be needed in cases of high migration of vessels and where fishing activities are influenced by the lunar cycle, e.g. light fishing for sardinellas.

#### 4.4.2	Boat activity coefficient

For the stratum i and the fishing unit j, BAC is calculating by dividing the total number of boats out for fishing by the total number of boats of the sampled sites (given by the registry or the frame survey):

(insert formula)

Where:
m		is the number of the mth sampled sites. m goes from 1 to t
t		is the total number of sampled sites
e		is the eth sampled day at the site m. d goes from 1 to E
E		is the number of sampled days
Boatsi,j,m,d	can be either the number of boats in the frame survey or the number of boats sampled at site m (which is int the stratum i) for the fishing unit j
Boats outi,j,m,d	is the total number of boats that went fishing the day d at site m (which is int the stratum i) for the fishing unit j 

In case we use the frame survey, the formula becomes:
(insert formula)
Where:
xi,j,m	is the number of boats at site m (in the strata i) for the fishing unit j

### 4.4.3	Fishing activity coefficient

A simple question can be added in the landing form during the interview of the fisher that can help to determine the activity per fishing unit (Table 3).

Table 3: Example of vertical survey template
(insert table)

When fishers do one-day trip, 5 or 7 days before is sufficient. When fishing trip are longer (ie. 2 or 3 weeks), it is more relevant to interview about the last 30 days. A simpler way to question is then “How many days have you been on land during the last 30 days?”. A fix reference period is defined for each specific fishing unit.

For the stratum i and the fishing unit j, FAC is calculating by dividing the total number of days where fishers were active by the total number of days of the reference periods:

(insert formula)

Where:
b			is the number of bth interview
z			is the total number of interviews
DaysActivei,j		is the number of days where the fisher went out for fishing during the reference period of the interview
DaysSelectedi,j	is the number of days of the reference period of the interview
RefTime		is the reference period of the interview (i.e., 5 days, 30 days…)

# 5. Total catch estimation and catch per species
## 5.1	Catch per species per stratum

Once the total catch has been estimated, species composition is computed by means of the following simple formula:
(insert formula schema)

Where:
Species (catch): is the estimated catch for each species within the estimating context described earlier
SP: is a fraction of the total catch corresponding to a species and is formulated from the proportion of a species found in the samples.
Catch: is the estimated total catch discussed earlier

From catch by species and using the estimated effort, it is also possible to compute species-specific CPUEs.

## 5.2	Total catch estimation

Total catch per month is calculating by summing all strata estimates (all fishing units, from all strata major and minor strata if existed).
(insert fomula)

## 6. Estimation quality control

Quality control is given by the different accuracies that are calculated by the system. 

The two parallel accuracy approaches are used for the spatial accuracy only (sufficiency of samples), the reason being that for the temporal accuracy the population is always small (number of calendar days). The system is compiling algebraic and probabilistic approaches for CPUE and AC estimates. In the end the procedure will furnish the following results:
-	Spatial accuracy for AC.
-	Temporal accuracy for the AC (always be 1 and need not be computed).
-	Spatial accuracy for the CPUE.
-	Temporal accuracy for the CPUE.

The overall sampling accuracy will be the minimum of (a), (b), (c) and (d). It should be review first and if low (<80%), the detailed accuracy can be used to find where the hight variability come from.

