## 3 Proposed Approach  
In this section, we propose a hybrid algorithm for NTN handover optimization. First, we dynamically estimate the distance between the UE and the satellite using a particle filter-based method. Subsequently, we employ RL to adaptively optimize the handover parameters based on the estimated distance and location data, specifically including hysteresis, \(TTT\), and handover decisions. The architecture of the proposed approach is shown in Figure 2.  
To improve the performance of NTN handovers, we propose a novel approach that utilizes a particle filter to accurately estimate the distance between UE and NTN satellites. This estimation is followed by reinforcement learning to dynamically optimize key handover parameters, including hysteresis, \(TTT\), and handover decision-making within the location-based handover mechanism of NTN networks. The pseudocode of the proposed approach is presented below in the LBH-PRL Algorithm 1. A mathematical model was developed to simulate the NTN handover process, complemented by a reinforcement learning framework designed to maximize throughput while minimizing handover failures and ping-pong effects. NTNs leverage LEO satellites to provide global communication coverage. However, the high-speed motion of satellites and the dynamic nature of network topologies make handover management a critical challenge in NTN systems. Figure 2: The architecture of the proposed approach. ```
Input: Satellite and UE positions, velocities, network configuration Output: Optimized hysteresis (\(H\)) and \(TTT\), handover decisions Step1. Initialize:  A. Particle filter parameters: Number of particles \(K\), initial distance range \([d_{min},d_{max}]\)  B. Reinforcement learning parameters: Initial hysteresis \((H)\), \(TTT\), policy \(\pi_{\theta}\)  C. Learning rate \(\alpha\), discount factor \(\gamma\)  D. State space \(S(t)\) = [Estimated distance, \(RSSI\), UE position, velocity] Step2. For each time step \(t\): 1. Particle Filter for Distance Estimation: 1. Initialize particles: For \(k\) = 1 to \(K\): \(d_{k}^{(0)}\sim\mathcal{U}(d_{min},d_{max})\) 2. Predict particle states: \(d_{k}^{(t+1)}=d_{k}^{(t)}+v_{j}\cdot\Delta t+\xi_{k}\) 3. Update weights: For \(k\) = 1 to \(K\): \[w_{k}^{(t+1)}=\frac{\exp\left(-\frac{\left(RSSI_{\text{measured}}-RSSI_{k}^{(t+ 1)}\right)^{2}}{2\sigma^{2}}\right)}{\sum_{j=1}^{K}\exp\left(-\frac{\left(RSSI_ {\text{measured}}-RSSI_{j}^{(t+1)}\right)^{2}}{2\sigma^{2}}\right)}.\] 4. Resample particles based on weights. 5. Estimate distance: \(\widehat{d}_{i,j}(t)=\sum_{k=1}^{K}w_{k}^{(t)}d_{k}^{(t)}\) for \(k\) = 1 to \(K\) B. Evaluate Handover Conditions: If UE is at the edge of the current satellite's coverage area:  Calculate \(RSSI_{target}\) and \(RSSI_{current}\). If (\(RSSI_{target}-RSSI_{current}>H\)):  Start \(TTT\) timer. If (Condition holds for \(TTT\) seconds):  Perform handover and update state. Else:  Stay in the current cell. C. Reinforcement Learning Policy Update: 1. **Observe state:** \(S(t)\) = {\(\hat{d}\), \(RSSI\), UE position, velocity}. 2. Select action \(A(t)\) = [hysteresis, \(TTT\)] using policy \(\pi_{\theta}\) (\(\text{A}\,|\,S\)). 3. Compute cumulative reward: \(G(t)=\sum\limits_{k=0}^{\infty}\gamma^{k}R(t+k)\) 4. Update policy parameters: \(\theta\) \(\leftarrow\)\(\theta+\alpha\
abla_{\theta}E[G]\) Return optimized hysteresis (\(H\)), \(TTT\), and final handover decisions. ```  
**Algorithm 1** LBH-PRL Algorithm  
```
Input: Satellite and UE positions, velocities, network configuration Output: Optimized hysteresis (\(H\)) and \(TTT\), handover decisions Step1. Initialize:  A. Particle filter parameters: Number of particles \(K\), initial distance range \([d_{min},d_{max}]\)  B. Reinforcement learning parameters: Initial hysteresis \((H)\), \(TTT\), policy \(\pi_{\theta}\)  C. Learning rate \(\alpha\), discount factor \(\gamma\)  D. State space \(S(t)\) = [Estimated distance, \(RSSI\), UE position, velocity] Step2. For each time step \(t\): 1. Particle Filter for Distance Estimation: 1.