# An Overview of Fog Data Analytics for IoT Applications
## 5 Research Challenges
### Prediction and Optimization  
One of the major applications of fog architecture is vehicular networks because of their low latency requirements and continuous and uninterrupted availability. Much is at stake regarding handling vehicular networks through the fog environment. The main intricacy here is that the vehicles are constantly moving at different speeds [101]. On the contrary, the fog nodes that they connect to do not move and are stationary or anchored at specific points on the streets. Thus, during motion, the vehicles need to constantly connect and disconnect to different fog nodes that come their way very quickly so that they can perform the actual communication that they intend to. This is where the role of prediction becomes important. Latest and state-of-the-art machine learning and deep learning algorithms are used for a better prediction accuracy. Some authors have also emphasized using caching policies [102; 103] for content popularity and user preference prediction using the online gradient descent (OGD) method [104], prediction in terms of choosing the nearest fog node, and also cost prediction. The challenge here also lies in the state transfer during the constant connection and disconnection with the fog nodes. As the vehicles move, they detach from present fog nodes and reconnect to the next. Therefore, the vehicle's state needs to be transferred to the next fog node to perform further computations and reduce the overhead of calculating everything repeatedly. Optimization is the biggest challenge in fog computing at present. Optimization, both in terms of availability and cost, is necessary to ensure on-demand serviceability, efficient resource allocation, energy consumption, security, reliability, resource usage, and bandwidth optimization, as well as thwarting unnecessary overheads. Optimization can also be talked of in terms of data-driven, code-driven, task-driven, or a combination of these. Many parameters can be considered for optimization in the fog-driven environment, as the performance depends on many parameters. An optimization problem can be defined according to the application by setting constraints on some parameters to achieve desired results [105]. For example, the power consumption constraint applies to end devices because they run on batteries, whereas this is not the case with fog nodes as they do not operate on batteries. The challenge here is that, although individual optimization problems have been defined, they are yet to be integrated into one coherent and cohesive unit for overall optimization. Thus, we need to find different optimization techniques for different sub-optimizations within the system. As we already know, the fog environment is a distributed environment, so any algorithm applied for any purpose in the fog should be distributed. This is also a challenge in optimization, as designing a distributed algorithm requires special skills and knowledge of the distributed architecture domain. In big and convoluted networks, there is generally a multi-tier fog architecture with more than one layer of fog nodes. The computation power of a fog node is directly proportional to its distance from the edge, which means that the farther a fog node is from the edge, the more computation power it has. Still, because of being far away, it is associated with a latency overhead. This imbalance is termed the power-latency tradeoff. Therefore,