# Maritime Traffic Evaluation Using Spatial-Temporal Density Analysis Based on Big AIS Data
## 2 Materials and Methods
### Density Model  
#### 2.4.1 Definition of Ship Density  
Although there is no standard definition of density and no standardized methodology for analyzing maritime traffic fields, density is generally defined as the number of ships per unit area [45]. However, since all maritime traffic-density analyses are based on historical AIS data, various analysis can be performed depending on the data types (e.g., points or lines) and analysis methods, all with potentially different results. One method calculates the density from raw AIS point data; another method calculates the line density based on line data that connect points belonging to the same MMSI over time; the other method counts the number of lines as the number of ships [37; 38; 44]. Point density calculates the density of point features in the neighborhood of each output cell. The neighborhood, which is the search radius, is defined around each cell center, and the number of points within the neighborhood are summed and divided by the area of the neighborhood. The line density defines the density of linear features in the neighborhood of each output cell. The line density is expressed as length per unit area and is calculated by Equation (1). A circle representing the search radius is centered on each output cell and the length of each line in the circle is multiplied by its weight value. The density of each cell is obtained by adding these individual products and dividing the result by the circle's area:  
\[Line\;Density=\frac{(L_{n}\times V_{n})+(L_{n+1}\times V_{n+1})}{Area\;of\; Unit}. \tag{1}\]  
Figure 2: Analysis area covering the coastal waters of Korea and the grid composed of 1 km \(\times\) 1 km cells. where \(L_{n}\) represents the length of the portion of each line within the circle and \(V_{n}\) represents the corresponding weight, which may be a ship attribute value. Another analysis method can yield the probability density function of ship density to visualize the maritime traffic [35]. The KDE method estimates the data distribution non-parametrically rather than assuming the parametric form of a data sample in advance. To determine the probability density function of ship density, KDE determines the appropriate kernel function and bandwidth by generating a kernel function based on the data value of each observation, adding all the generated kernel functions, and dividing by the total number of samples. The formula is then determined by. \[\hat{f}(x)=\frac{1}{n\hbar}\sum_{i=1}^{n}K\bigg{(}\frac{x-x_{i}}{h}\bigg{)}. \tag{2}\]  
where \(\hat{f}(x)\) is the estimate of \(f(x)\), \(x\) is a random variable representing ship density, \(x_{i}\) is an observation, \(K\) is the kernel function, \(h\) is the bandwidth, and \(n\) is the number of samples. The message reporting interval in AIS data varies from 2 to 10 s depending on ship speed and on whether a ship is changing course (Table 1) [40,46,47]. This variability limits the accuracy of density calculation methods based on the number of AIS data points. Because a ship's trajectory is recorded at irregular intervals, slower ships record additional data points per unit track than fast ships, thus distorting the volume of passage [48]. This problem can be overcome by developing trajectory lines based on the AIS positional data and performing a density analysis of the number of transiting ships (i.e., the number of trajectory lines in a cell). Although this method is simple and intuitive, the analysis result of the same dataset widely varies with cell size, and a ship that only barely crosses a given cell is counted equal to a ship crossing the full length of the cell. These weaknesses reduce the accuracy of this method. A third alternative calculates the length of each trajectory line in the cell. This method overcomes the limitations of the previous method and is more quantitative, but the resulting values are non-intuitive and the given result cannot be interpreted as the concentration of transiting ships.