An Improved Weighted Median Algorithm for Spatial Outliers Detection

- A spatial outlier is an object that significantly deviates from its surrounding neighbors. The median algorithm is one of the spatial outlier methods, which is robust. However, it assumes that all spatial objects have the same characteristics. Meanwhile, the Average Difference Algorithm (AvgDiff) has accommodated the differences in spatial characteristics, but it does not use statistical tests to determine the status of an object, whether it is an outlier or not. The research developed an improved version of the median algorithm and AvgDiff, called the Weighted Median Algorithm (WMA). WMA combined the advantages of the two methods. From the median algorithm, WMA adopted median and statistical test concepts. Meanwhile, from AvgDiff, WMA adopted the concept of using differences in objects’ spatial characteristics as weights. A combination of the two advantages was innovated by calculating WMA’s neighborhood score using a weighted median. Then, a simulation was conducted to analyze the accuracy of the method. The result confirms that when objects have heterogeneous spatial characteristics, WMA performs better than the median algorithm. The accuracy of WMA is not much higher than AvgDiff, but the use of WMA can prevent a serious false detection problem. The methods can be applied to an incidence rate of Covid-19 data in East Java.

In addition, the detection of spatial outliers can also be applied to the cases of Covid-19, which is recently a problem in all countries of the world (Baba, Midi, & Abd Rahman, 2021;Xia, An, Li, & Zhang, 2022). The outlier, in this case, is an area that behaves unusually based on the incidence rate of Covid-19. An area is considered normal (behaves naturally) if the area has almost the same high incidence rate as the surrounding areas. Areas that become outliers indicate factors that influence the number of cases, apart from the factor of transmission or spread from surrounding areas. For the rest of the research, the term 'outliers' is referred to as 'spatial outliers'.

I N P R E S S
In spatial data, an object which is the center of attention is called a central object. The other objects surrounding a central object are defined as the nearest neighbors. The condition of the neighboring objects is summarized into a neighborhood score. Then, spatial outlier detection is performed by comparing the nonspatial attribute values of the central object with its neighborhood scores. A comparison score measures the comparison. If a central object extremely differs from its neighbors, the comparison score will be extremely large. In that case, the central object is considered an outlier (Lu, Chen, & Kou, 2003;Shekhar et al., 2001). Therefore, the neighborhood score must be carefully formed because it can describe the neighborhood's condition accurately.
The problem that often arises in the formation of spatial outlier detection algorithms is how to define the neighborhood score that well represents the condition of the neighbors. Previous studies such as spatial statistics by Shekhar et al. (2001), iterative z and iterative r by Lu et al. (2003), and improved z score by Aggarwal, Gupta, Singh, Sharma, and Sharma (2019) to calculate the neighborhood score. Others utilize the median, such as the median algorithm by Chen, Lu, Kou, and Chen (2008). Each method has its advantages and disadvantages. The use of mean is the simplest method, but it can mistakenly detect a central-normal object as a spatial outlier due to the true outlier in its neighborhood. This condition is known as the swamping effect (Baba et al., 2021;Kolbaşi & Ünsal, 2019;Wang & Serfling, 2018). The neighbor scores are pulled towards outlier values which cause the comparison score to be higher than it should be. The swamping effect is less likely to happen when the median is used. It is due to the robust nature of the median (Sajana & Sajesh, 2018). However, both mean and median-based methods still assume that all spatial objects have the same spatial characteristics (homogeneous). In many fields of application, the area of the objects, the distance between objects, or the length of the shared border between the objects tend to be different (Taha, Onsi, El Din, & Hegazy, 2019).
The spatial characteristics affect the relationship of an object with its neighbors. Figure 1 shows the importance of accommodating spatial characteristics in calculating neighboring scores. If A is the central object, B, C, and D become the nearest neighbors of object A. The D is known as an outlier whose nonspatial attribute value is extremely different from A, B, and C. The mean and median methods will interpret these conditions as illustrated in Figure 2. All objects have the same characteristics. Based on the concept of mean and median, B or C will be chosen as a representation of the neighboring conditions of A. It causes A to be detected as a normal object because it is not significantly different from its neighbors (B and C). Meanwhile, the real condition shows that D has a larger area surrounding A and shares a longer common borderline with A than B and C with A. It indicates that D dominates the area around A and makes a greater contribution to A. Therefore, D must have a stronger relationship with A and should be chosen to represent the neighbor's condition of A. It is based on the first law of geography that everything is related to everything else, but nearby things are more related than distant things (Tobler, 1970). In this way, A is detected as an outlier because it is significantly different from its neighbors (D). From this illustration, it is necessary to give different weights to the objects with different spatial characteristics in the calculation of the neighborhood score, as in line with Colak, Memisoglu, Erbas, and Bediroglu (2018), Taha et al. (2019), and Ulak, Ozguven, Vanli, and Horner (2019).
According to Kou, Lu, and Chen (2006), outlier detection methods accommodate different characteristics. These methods are the weighted Z value approach (weighted Z) and the Average Difference Algorithm (AvgDiff). Both methods assign different weights for different neighbors in computing the Degree of Oulierness (DO) of the central object. The closer/stronger the spatial relationship between objects is, the greater the weight is given to the objects. For example, Fitriani, Pusdiktasari, and Diartho (2021) applied AvgDiff to identify the spatial outlying East Java regency/municipality in terms of economic growth. In their study, the use of AvgDiff was in accordance with the conditions of East Java regencies/municipalities with different characteristics. However, the methods still have several drawbacks. Weighted Z and AvgDiff have the potential for false detection when neighbors with extreme values have small weights. The non-robustness of the mean (average) used in those two methods is the cause. Furthermore, AvgDiff does not rely on a statistical test to determine the outliers. It is based on the rank of the DO, namely a concept of the top m outliers. Statistical tests cannot be used because the results of the difference between the value of the central object and its neighbors are in absolute values, so it does not follow the normal distribution. In the concept of top m outliers, a researcher is asked to determine the number of outliers (m). It is a hard-to-answer question because I N P R E S S the researchers never know how many outliers exist in the data set (Su, 2011). Therefore, it is necessary to develop the outlier detection method further to improve the drawbacks of the median algorithm and AvgDiff. With the improvement, it expects a more accurate outlier detection method that can accommodate the real conditions in applied cases. It is important to do, given that outlier detection can be applied in wide cases. It is not only applied in cases related to geospatial on the earth's surface but can also be in objects that can be defined spatially. For example, outlier detection methods can be applied in the medical field to detect the position of cells that behave unusually, such as tumor/cancer cells, from other cells in the vicinity (Goovaerts, 2005;Ijaz, Attique, & Son, 2020;Prastawa, Bullitt, Ho, & Gerig, 2004). If the method results in false detection, it will certainly be a serious problem. Based on the explanation, the research develops an improved version of the median algorithm and AvgDiff, called Weighted Median Algorithm (WMA). WMA combines the advantages of the two methods. From Median Algorithm, WMA adopts the median and statistical test concepts. From AvgDiff, WMA adopts the concept of using differences in objects' spatial characteristics as weights. The advantages of the two methods are combined by utilizing the weighted median in the calculation of neighborhood score and using a robust statistical test to determine the status of objects. Combining both advantages will improve the drawbacks of the median algorithm, which does not accommodate spatial characteristics differences. It will also improve the drawbacks of AvgDiff, which is not robust, and the determination of outliers that are only based on ranks. Two scenarios are used in the research. Scenario 1 is used to analyze the performance of WMA in detecting outliers in data with different spatial characteristics of objects. Then, scenario 2 analyzes the performance of WMA in detecting outliers without asking the researchers to determine the right m. The simulation is conducted 10.000 times to measure the accuracy of the methods.

II. METHODS
The research outlines the proposed algorithm, WMA. The algorithm is a systematic practical method to do a computation, in this case, detecting an outlier. The algorithm consists of inputs, effective step-bystep methods, and output. WMA is an improved version of the median algorithm by Chen et al. (2008) and AvgDiff by Kou et al. (2006). The improvement is made by adding different objects' spatial characteristics as weights to the median algorithm. It is done by changing the median into the weighted median in calculating the neighborhood score ( ). It also uses statistical tests in determining outliers as a substitute for top m outliers in AvgDiff. The inputs are as follows. It shows S as a set of spatial objects {s 1 , s 2 , ... , s n }, k as the number of the nearest neighbors of a central object. The neighbors are determined based on a spatial configuration, notated by NN k (i), and X as a set of attribute values {x 1 , x 2 , ... , x n }, in which x 1 is the attribute value of spatial object i.
Meanwhile, is the value that measures the spatial relationship of the neighbors to the central object based on spatial characteristics information. Several characteristics can be used to define this relationship, such as the inverse distance, the length of the shared border, and the area. The concept gives larger weights to objects whose spatial relationship is stronger (Taha et al., 2019). The weights must satisfy the following condition (1) Those notations are used to define the following steps for WMA. First, k nearest neighbors for each object i are defined using spatial relationships, such as Queen Contiguity, Rook Contiguity, and others. Then, spatial weights are calculated based on spatial information (length of the shared border (border j )) between the central object i and each of its neighbors using Equation (2). (2) The weights are used to calculate the weighted median of the nearest neighbors. A weighted median is the 50% weighted percentile. The k-ordered nearest neighbors attribute values of x 1 , x 2 , ... , x k with weights , x i will be the weighted median if it satisfies the following condition (Edgeworth, 1887). If an ordered nearest neighbor (x i ) has a total weight of its previous neighbors of less than or equal to ½, and the total weights thereafter is less than equal to ½, the x i is the weighted median. (3) The weighted median is called the neighborhood score . This neighborhood score represents the condition of neighbors of a central object. It can be defined as follows. The neighborhood score is selected from the attribute values of weight ordered neighbors which satisfy the condition in Equation (3).
(4) Then, the comparison score is calculated. The score measures the differences between a central object and its neighborhood score . The comparison score indicates how big the difference of I N P R E S S a central object and its neighbors. If the comparison score is extremely high, it shows that the central object has a very different characteristic from its surrounding and vice versa. The calculation uses Equation (5). (5) Finally, the status of objects (normal/outlier) is defined using the statistical test in Equation (6). The μ* and σ* denote the robust mean and standard deviation, respectively. According to Chen et al. (2008) and Kolbaşi and Ünsal (2019), the median is used as μ*, and Median Absolute Deviation (MAD) as σ* of H set {h 1 , h 2 , ... , h n }.

(6)
In the research, simulations are conducted. Generated data with predetermined outliers are used so their existence can be traced. The situation is hardly met when real data are used. The reason for using generated data is for the ease of evaluating the performance of the outlier detection methods (Ernst & Haesbroeck, 2017). Figure 3 shows the spatial configuration of the objects. Numbers in Figure 3 show the ordered code for the objects. The values (attributes) for these spatial objects are generated based on the spatial lag model with a high positive autocorrelation value. It ensures that all spatial objects are normal objects. Normal object in spatial data has attribute values that tend to be similar or do not extremely differ from the attribute values of their neighboring objects. The spatial lag model is used because it is assumed that there is a relationship between the attribute value of an object and the attribute value of its surrounding objects. High positive spatial autocorrelation is used because it is in line with normal object definitions. A parameter (ρ) is used to measure the degree of spatial autocorrelation. The high value of ρ (close to 1) indicates strong positive spatial autocorrelation, so clusters of nearby spatial objects with similar attribute values will be formed.
The model used to generate the attribute values of the 36 spatial objects is shown in Equation (7). It has ρ = 0,9, indicating strong positive spatial autocorrelation. Strong autocorrelation shows that all the objects have strong relationships and affect one another. That is why they tend to have the same characteristics. In this condition, it can be easily controlled that there is no outlier besides the defined or generated ones (7) Then, the spatial outlier can be created by selecting a particular normal object and replacing its attribute value with a more extreme value. The spatial outlier attribute value is generated as follows. For extremely high spatial outlier, it is shown in Equation (8). Meanwhile, the extremely low spatial outlier is in Equation (9).
Extremely high spatial outliers are the type of spatial objects with very high attribute values compared to their nearest neighbors. Meanwhile, the spatial outlier of the extremely low type is a spatial object with a very low attribute value compared to its nearest neighbors. The simulation is done with two scenarios. The first scenario (scenario 1) is applied to the median algorithm and WMA. The scenario is set so there are outliers in a data set with different spatial characteristics among the objects. Figure 4 illustrates a situation where the objects have various areas and lengths of shared borders.
In the research, the length of the shared border is used as the weight. The unit of length is explained through some illustrations in Figure 4. It shows the subsets of the spatial configuration depicted in Figure  3. Figure 4(a) shows objects 1 and 2 sharing 1 unit border length. Then, Figure 4(b) shows objects 10 and 11 sharing 2 units of border length. Meanwhile, Figure  4(c) shows objects 9 and 16 sharing 2 units of border length. The method used to define a neighboring object in the research is Rook Contiguity.
In this scenario, objects 18 and 7 in Figure 3 are defined as outliers. In outlier detection methods that do not accommodate spatial characteristics, object 18 has the same contribution as objects 17 and 24 to the central object (object 20). However, object 18 has a really long shared border with object 20 compared to objects 17 and 24 to object 20. It indicates that object 18 dominates the neighborhood of object 20, which makes it a good choice to represent the neighbors. Hence, it is good to choose it to represent the neighbors. These characteristics make object 20 an outlier because it has an extremely different value from its neighbors. The simulation gives a 'TRUE' result if the method can correctly detect objects 18, 7, and 20 as outliers. The simulation is conducted 10.000 times to calculate the accuracy of the methods. Each simulation generates normal object values first using Equation (7) and outlier values for objects 18 and 7 using Equations (8) and (9).
Scenario 2 is applied to AvgDiff and WMA. The scenario is formed with the same spatial configuration ( Figure 3) and weights as scenario 1 but is focused on analyzing the performance of WMA in detecting outliers without determining the exact m. Each simulation generates normal object values first using Equation (7), defines two objects randomly as outliers, and generates outlier values for the two selected objects using Equations (8) and (9). The simulation will give a 'TRUE' result if the method correctly detects the two objects defined before as outliers. The simulation is conducted 10.000 times to calculate the accuracy of the method. According to its algorithm, the determination of outliers in AvgDiff uses top m outliers. Based on this concept, with 36 objects, AvgDiff detects 2 ( ) objects with the highest DO as outliers. Meanwhile, in WMA, the determination of outliers is based on statistical tests using Equation (6).
The accuracy is calculated using Equation (10). The higher the accuracy of the method is, the more precise the method is in detecting spatial outliers that the researchers have predetermined. The improvement of spatial outlier detection methods is shown in Figure 5. The base of the spatial outlier detection (a) (b) (c) Figure 4 The Illustration of How to Measure the Length of Shared Border Figure 5 The Improved Spatial Outlier Detection Methods Flowchart I N P R E S S methods improvement in this research is Spatial Statistics. The method then improved to be a robust outlier detection method in Median Algorithm, but it does not assign different spatial characteristics. Spatial Statistics is also improved by assigning different spatial characteristics in Average Difference Algorithm, but it is not robust. Therefore, in the research the advantages of those two methods are combined by improving a Weighted Median Algorithm. The method is robust and assign different spatial characteristics. (10)

III. RESULTS AND DISCUSSIONS
The data are generated for 36 normal objects before being adjusted to the settings in scenarios 1 and 2. The data generation is done according to Equation (7). Each generation produces 36 attribute values for 36 objects. Moran's I test is conducted to ensure that the 36 objects are normal objects. Table 1 shows the results of Moran's I test for a one-time generation. Based on the results of Moran's I test in Table 1, the p-value is not greater than α = 5%, leading to the rejection of the null hypothesis. This rejection indicates that the generated attribute values have a strong spatial autocorrelation. Objects with strong spatial autocorrelation show that they have attribute values that tend to be the same as the attribute values of their nearest neighbors. This statement is also the definition of a normal object. Thus, it can be guaranteed that all objects with generated attribute values are normal objects.
From 36 normal objects, objects 18 and 7 are selected as spatial outliers. This selection is based on the characteristics of objects 18 and 7, which emphasize the importance of weights. Object 18 has 13 nearest neighbors, and object 20 is one of them. Object 20 shares 5 units of length common border with object 18. Meanwhile, it only shares 1 unit with object 17 and 2 units with object 24. Object 20 has values that are similar to objects 17 and 24. However, the area around object 20 is dominated by object 18 with extreme values. So, object 18 represents the neighbors of object 20 well. This condition makes object 20 an outlier because object 20 differs from its neighbors (object 18). Although the generated outliers are objects 18 and 7, object 20 is also an outlier.
Object 7 is selected as an outlier to show that the neighbors with the greatest weights do not always dominate. Object 3 is one of the neighbors of object 7. Both share a common border of 2 units. Other objects that are neighbors of object 3 only share 1 unit, namely objects 2, 4, 8, and 12. However, object 7, with extreme value, is not considered dominating. The reason is that objects 2, 4, 8, and 12 with similar values have 4 of 6 units border of object 3. So, those objects are a better representation of the neighbors of object 3. Because object 3 has similar values to the values of its neighbors, it will not be considered an outlier.
This scenario ensures that the true outliers are objects 18, 7, and 20. Therefore, a good outlier detection method can detect these three objects as outliers. The results of running the median algorithm and WMA for one-time simulation are presented in Table 2. The simulation is conducted one time so that the DO object can be analyzed. Although there are 36 objects, only 10 objects with the highest DO are presented in Table 2 for simplification.

P R E S S
The results of outlier detection in Table 2 show that objects with DO values more than 3 in the median algorithm are objects 18 and 7. These two objects are indeed the two predetermined outliers. However, it is unable to detect object 20 as an outlier. The object is not even included in the top 10 objects with the highest potential as outliers. On the contrary, WMA detects those objects 18, 20, and 7 as having more than 3 DO values, which indicates those objects as outliers. This result indicates that WMA performs better than the median algorithm in detecting outliers in data with heterogeneous characteristics of objects. Simulations are conducted 10.000 times to measure the accuracy of the methods.
The determination of object status (normal/ outlier) is only based on its rank (top m outlier) and does not use statistical tests. It is due to the use of absolute differences in its algorithm, resulting in values that do not follow a normal distribution. This concept is computationally advantageous because the calculations become faster. However, this method requires the researchers' knowledge regarding the number of outliers (m) in the data. This information is rarely unknown.
WMA is developed to overcome this weakness of AvgDiff. The improvement is made while keeping the advantages of AvgDiff in accommodating the spatial characteristics to the calculation of DO. Table 3 presents the results of running the two methods based on scenario 2 for a one-time simulation. In this one-time simulation, objects 18 and 32 are the randomly selected outliers. However, in line with the explanation in scenario 1, object 20 is also an outlier because it is the neighbor of object 18.
Based on Table 3, AvgDiff successfully detects the 3 predetermined outliers as the objects with the highest DO. However, based on the concept of top m outliers in AvgDiff, m is calculated by the formula m = 5% × n. With n = 36, it is m = 5% × 36 = 1,8 ≈ 2. If the researchers do not have a priori information about the number of outliers in the data, AvgDiff will only identify 2 objects with the highest DO as outliers, while, in fact, there are 3 outliers. The method fails to detect object 20 as an outlier.
WMA can identify the number of outliers and which objects are the outliers. WMA detects objects 18, 32, and 20 as the 3 objects with the highest DO without prior determination about the number of outliers in the data. From the results in Table 3, the DO values of objects 18, 32, and 20, which exceed 3, indicate that WMA successfully detects those predetermined objects as outliers. It confirms that WMA performs better than AvgDiff. Both produce the same detection results, but WMA can automatically determine outliers. Meanwhile, AvgDiff requires a predetermined correct number of outliers (m). Based on Table 4, which shows the simulation results, the WMA overperforms the median algorithm with an accuracy of 80,45%. Meanwhile, the accuracy of the median algorithm is 0,81%.  Simulations are conducted 10.000 times to measure the accuracy of both methods. Based on the results in Table 4, AvgDiff's accuracy is 87,25% while WMA is 84,36%. Although the accuracy of WMA is not higher than AvgDiff, WMA can avoid a more serious problem when researchers cannot determine the exact m.
The WMA is the improved version of the median algorithm, which is weighted based on the spatial characteristics of the objects. When WMA is applied to objects with homogeneous characteristics, the same weight for all objects will produce DO, which is exactly the same as the DO of the median algorithm. The median algorithm and WMA are applied to data with homogeneous spatial characteristics objects to show these conditions. The detection results can be seen in Table 5.
The robustness of the method is also confirmed by Chen et al. (2008) by developing median algorithm to overcome the drawback of spatial statistics with masking and swamping effects. The research results confirm that median algorithm is a robust method which can overcome the effects of masking and swamping. The result is in line with the results of research by Su (2011), and the validity of the method is also confirmed by Wang, Wang, Hong, and Wan (2004). These three previous studies show the good performance of the median algorithm for homogeneous spatial characteristics objects. Thus, when the object has homogeneous characteristics, WMA is as good and robust as a median algorithm. However, when the objects have heterogeneous spatial characteristics, WMA performs better than a median algorithm.
On March 11 th , 2020, the World Health Organization (WHO) declared Covid-19 as a global pandemic. In Indonesia, as of December 20th, 2021, this virus has caused more than 4,6 million confirmed infection cases and around 144.000 confirmed deaths (Mathieu et al., 2020) . East Java is one of the provinces with the highest number of cases of Covid-19. Although some cases are still found in several areas, the case rate is low enough, and the recovery rate has increased to 4,1 million (Satuan Tugas Penanganan COVID-19, 2021). However, the government should not be off guard. The wave of the spread of Covid-19 can happen again at any time. In addition, new variants of Covid-19 which are the result of mutations continuously appear, such as the Alpha, Beta, Delta, and Gamma I variants (Duong, 2021) to the newest one, Omicron (WHO, 2021) Therefore, studies related to this pandemic need to be continued. They can be used as a consideration in determining prevention and efforts to overcome the spread of Covid-19 in the future. If the detected outliers are extremely high (areas with high values surrounded by areas with a tendency to low values), the government is suggested to make a particular strategy to reduce the transmission rate or the number of Covid-19 cases in that area. If the detected outliers are extremely low (areas with low values surrounded by areas with high values), the outliers can be considered a pilot area in suppressing the number of Covid-19 cases to be applied in other areas.
The model is applied to determine the unusual behavior based on the number of confirmed Covid-19 cases. Areas with significantly different behavior are considered outliers. The data are the incidence rate (transmission) which is the ratio of the accumulated number of positive confirmed cases of Covid-19 to the population in the city/regency in East Java from March 2020 until December 2021. The data are taken from the covid19.go.id. Then, the neighboring method used is Queen Contiguity, considering the irregular shape of the object (areas). Spatial information as weight is Euclidean distance, based on the CDC statement (2020) that Covid-19 can spread through air contaminated with droplets and small airborne particles containing the virus. Table 6 shows the top ten objects (areas) that have the most risk of becoming spatial outliers.

P R E S S
The difference in the detection results between the median algorithm and WMA is because the median algorithm assumes that all objects (areas) have the same characteristics as outlined in the concept of contiguity (neighborhood). Based on the East Java map in Figure  6, it can be seen that Mojokerto Regency and Pasuruan Regency (with the tendency of low values) dominate the neighboring Sidoarjo Regency. It causes the median algorithm to choose areas with low Covid-19 cases to represent neighboring Sidoarjo Regency, resulting in Sidoarjo Regency with high Covid-19 cases being detected as outliers. However, city/district areas in East Java have different spatial characteristics, and in Covid-19 cases, distance is important, not only contiguity. So, the median algorithm is unable to accommodate this case properly.
WMA only detects Surabaya City as an outlier. The WMA result states that Sidoarjo Regency is not an outlier considering differences in characteristics, especially the distance between regions as spatial information. The distance of Sidoarjo Regency, which is very close to Surabaya City, is indicated by a fairly large weighting value. This condition makes Surabaya City dominate the neighbor of Sidoarjo Regency. Hence, Sidoarjo Regency is not detected as an outlier because it has the same high value as its neighbors (Surabaya City). In other words, Sidoarjo Regency with a high Covid-19 incidence rate is normal because it is influenced by its neighbors, which also have a high Covid-19 incidence rate. With regard to the goodness of the method, WMA is more suitable to be used to detect outliers in the case of the incidence rate of Covid-19.
Apart from the differences in the three methods described, there is one thing in common. All three methods detect Surabaya City as an outlier. Some factors support this condition. Its geographical position, which is a coastal settlement, makes Surabaya have a high potential as a stopover and settlement for immigrants. In addition, its highly dense population and large port make Surabaya have a very big role in receiving and distributing industrial goods. Then, as a trade center, Surabaya City is the second largest metropolitan city after Jakarta. Malls and cafes in this city are the largest compared to other cities in East Java. These places are the main entertainment for the citizens of Surabaya City. Psychologically, it is not easy for its citizen to refrain from gathering and spending time outside their homes. So, their mobility is still high as it is not easy for them to stay home. It causes a high incidence rate as well. However, those complex characteristics of Surabaya City cannot be found in other cities around it. Although currently in Indonesia, the incidence rate of Covid-19 has decreased, this finding can be used as a consideration for the government in the future if a similar case occurs. The government is advised to pay attention and focus on prevention and action for Surabaya, as it is a center of mobility and the entrance and exit of East Java. Note: 1 = Rank; 2 = Object Index; 3 = DO of Median Algorithm; 4 = DO of AvgDiff; 5 = DO of WMA Figure 6 The Map of Cities/Regencies in East Java I N P R E S S

IV. CONCLUSIONS
In the research, a method for detecting spatial outliers is developed, namely WMA. It is an improved version of the median algorithm and AvgDiff. WMA is confirmed to be as good and robust as the median algorithm when applied to objects with homogeneous spatial characteristics. When the objects have heterogeneous spatial characteristics, WMA performs better than a median algorithm. Even though the accuracy of WMA is not much higher than AvgDiff, the use of WMA can prevent a serious false detection problem when there is no prior information about the true number of outliers. With this concept, if it is applied to data on Covid-19 cases in cities/districts in East Java, it is possible to provide detection results. The Surabaya City and Sidoarjo Regency are a group of outliers with extreme values compared to other areas around them.
Currently, WMA focuses only on univariate nonspatial attributes with one information for the weights. In the future, researchers can improve it. So, it is suitable for data with multivariate nonspatial attributes and a combination of spatial information for the weights. WMA can also be improved to detect outliers in groups.