2.1. Experimental Data and Feature Selection
The smartphone used in this study was a Samsung Galaxy Z Fold5 (SM-F946N; Samsung Electronics Co., Ltd., Suwon, Republic of Korea). Smartphone GNSS measurements were collected using the GNSS/IMU Logger application. The logged data included Android raw GNSS measurements, smartphone NMEA position outputs, and NMEA/GSV satellite information. The reference positions were obtained using a u-blox ZED-F9P receiver (u-blox AG, Thalwil, Switzerland) operated in RTK-fixed mode. In this study, the term RTK-fixed refers only to the F9P reference solution used for supervised label generation and performance evaluation. It does not mean that RTK corrections, ambiguity resolution, or carrier-phase differential processing were applied to the smartphone measurements.
The smartphone log files were transferred to a computer and processed offline in MATLAB R2025b. The processing workflow consisted of Android raw measurement parsing, NMEA/GSV decoding, satellite elevation and azimuth extraction, epoch-level time matching with the F9P reference, feature construction, LOS projection target generation, random-forest-based LOS error estimation, and WLS-based horizontal correction. In the present study, the smartphone was used only for data collection; model training, validation, and WLS/Temporal WLS evaluation were performed offline on a computer. RINEX-based PPP processing, RTKLIB-based smartphone positioning, precise orbit/clock products, smartphone carrier-phase ambiguity resolution, and PPP/RTK corrections were not used in the proposed smartphone correction pipeline.
The data were collected in outdoor field-observation conditions using synchronized smartphone and F9P measurements. The sessions mainly represent open- to semi-open-sky smartphone GNSS observation conditions, with possible local obstructions and multipath from surrounding objects. Dedicated tests under unfavorable weather conditions, dense forest canopy, or deep urban-canyon environments were not performed in the present study. Therefore, the reported performance should be interpreted as validation under the collected same-session field conditions rather than as a complete demonstration across all possible smartphone GNSS environments.
Figure 1 presents representative field photographs of the data-collection campaign. To provide experimental context, the figure shows both the surrounding observation environment and the practical smartphone–reference co-observation setup used for synchronized data acquisition.
For validation, each session was split chronologically into a front 70% segment and a back 30% segment. The front 70% segments from all sessions were then pooled to train a single random forest LOS projection error estimator. The trained RF model was applied to the back 30% segments of all sessions to predict satellite-wise LOS projection errors. These predicted LOS errors were subsequently used in the epoch-wise WLS and Temporal WLS correction steps. Therefore, this validation setting evaluates pooled same-session temporal generalization: the model is trained using earlier portions of the same set of sessions and tested on later portions of those sessions. It should not be interpreted as leave-one-session-out, cross-date, cross-site, or cross-device generalization.
For feature construction, the initial smartphone raw-measurement parser considered approximately 36 candidate variables from Android GNSS raw measurements, NMEA positions, and GSV satellite information. These candidates included satellite geometry, signal-strength indicators, code-derived temporal variation, uncertainty indicators, hardware-related indicators, measurement state flags, and carrier-phase/ADR-related fields. The candidate feature groups and their use in the final model are summarized after the carrier/ADR exclusion analysis.
Accumulated-delta-range (ADR)-related fields were present in the raw smartphone logs, but their state flags did not satisfy the valid carrier-phase condition required for reliable continuous ADR use. In the collected data, the ADR state was mainly reported as 16, which corresponds to a half-cycle-related state and does not include the
ADR_STATE_VALID bit. Therefore, ADR values were not treated as valid continuous carrier-phase observations and were excluded from the final model. The final 26-feature model was intentionally restricted to code-domain, geometry, uncertainty, receiver-quality, and epoch-context features. This design avoids dependence on carrier-phase ambiguity resolution and makes the proposed correction framework applicable to smartphone logs in which continuous carrier-phase tracking is not valid or not reliable.
Table 1 summarizes how carrier-phase- and ADR-related candidate variables were excluded.
To verify whether carrier-phase-related measurements could be used, a parser-level availability and ADR-state validity scan was performed. The carrier-phase, carrier-cycle, and carrier-phase-uncertainty fields had non-missing ratios of 0.000. For the ADR state field,
Table 2 shows that the field was almost always present, but the
ADR_STATE_VALID bit ratio was 0.000, while the state-16 ratio was 1.000.
Therefore, ADR- and carrier-phase-related measurements were not treated as valid continuous carrier-phase observations and were excluded from the final 26-feature model. The frequency-related feature retained in the final model represents only the GNSS signal frequency or frequency-band context, not carrier-phase, carrier-cycle, or ADR information.
This design choice differentiates the proposed method from RTK- or PPP-oriented methods. The RTK-fixed solution was used only as the F9P reference trajectory for training-label generation and validation. The proposed smartphone correction method itself does not use ADR continuity, resolve carrier-phase ambiguities, apply differential carrier-phase processing, or construct precise carrier-phase residuals. PPP is mentioned in this paper only as a representative class of high-precision GNSS methods in the literature. No PPP solution was generated or evaluated in this study, and no precise orbit or clock products were used. Instead, the proposed method learns satellite-wise LOS projection errors from smartphone-observable quality features and reconstructs the horizontal position error using WLS.
Table 3 summarizes the candidate feature groups and their use in the final model.
Although pseudorange-rate and pseudorange-related quantities are available or derivable from the Android raw measurements, they were not used as direct final RF predictors in this study. The raw pseudorange-rate measurement was used only as an intermediate quantity for constructing code-derived temporal variation features, whereas the pseudorange-rate uncertainty was retained as a final quality-related feature. Similarly, absolute code pseudorange values can be derived from Android timing fields, but they were not used to construct full GNSS observation equations or precise pseudorange residuals.
2.2. LOS Projection Error Learning and Temporal WLS
Table 4 summarizes the main symbols used in the LOS projection and Temporal WLS formulation.
The horizontal position-error target was first defined in the local East–North plane. At epoch
k, the smartphone NMEA position and the F9P-derived reference position are denoted by
and
respectively. The latitude and longitude differences were converted to local East–North errors using a local tangent-plane approximation. In this approximation, one degree of latitude is assumed to correspond to approximately 111,320 m, and the longitude scale is additionally multiplied by the cosine of the reference latitude. This approximation is valid because the horizontal position differences between the smartphone and the reference receiver are small compared with the Earth’s radius.
Thus, the raw horizontal position error vector is defined as
The satellite-wise learning target was then constructed by projecting this horizontal error onto the satellite LOS direction. For satellite
i observed at epoch
k, the elevation and azimuth angles obtained from GSV information are denoted by
and
, respectively. Because these angles are provided in degrees, they are converted to radians inside the trigonometric functions. The horizontal line-of-sight (LOS) direction components are defined as
The horizontal LOS vector is
The satellite-wise learning target is defined by projecting the raw horizontal position error onto the negative LOS direction
This target represents how the raw horizontal position error is observed along the horizontal satellite direction.
Figure 2 illustrates this target definition. The projection converts a two-dimensional position-domain error into scalar satellite-wise learning targets while preserving the relation between the error vector and satellite geometry.
Using this satellite-wise target, a random forest model was trained to estimate LOS projection errors from smartphone GNSS features. For each satellite sample, a 26-dimensional feature vector is constructed
The feature set includes satellite geometry, signal strength, code-derived relative variation, uncertainty measures, automatic gain control, and GNSS state indicators.
The final 26 input features are listed in
Table 5. The feature set intentionally combines weak but complementary indicators rather than relying on a single signal-strength metric. The frequency-context feature should not be interpreted as carrier-phase information.
The uncertainty-related features in
Table 5 were derived from Android raw GNSS measurement fields. The SV time uncertainty represents the receiver-reported uncertainty of the received satellite time, and the pseudorange-rate uncertainty represents the receiver-reported uncertainty of the pseudorange-rate measurement. These quantities were used as quality indicators rather than as direct observation residuals. Log-transformed versions were also included to reduce scale imbalance and allow the random forest model to use both the original and compressed uncertainty scales. In the MATLAB preprocessing workflow, non-finite or unavailable values were replaced with predefined neutral values before model training and prediction. The raw pseudorange-rate measurement itself was used only as an intermediate quantity for constructing code-derived temporal variation features, whereas its uncertainty was retained as a final input feature.
A random forest estimator is trained to predict the satellite-wise LOS projection error
The supervised regression objective can be interpreted as minimizing the squared prediction error [
32]
where
is the number of training epochs,
is the number of satellites observed at epoch
k, and
denotes the trained random forest predictor.
In this study, the random forest estimator was implemented using 500 trees, a minimum leaf size of 1, and all available predictors considered at each split.
Figure 3 summarizes the overall processing pipeline from smartphone GNSS feature extraction to geometry-aware temporal correction.
The predicted LOS projection errors were first converted into a horizontal position correction using an epoch-wise WLS formulation. At epoch
k, let
be the number of satellites used in the solution. The predicted LOS projection error vector is
For each satellite, the observation equation is expressed as
where
and
are the horizontal position error components to be estimated,
is an epoch-wise common bias, and
is the residual.
In matrix form,
where the state vector and design matrix are
and
The satellite weight is based on
The corresponding weight matrix is
The weighted least-squares (WLS) solution is obtained as
The first two components of
yield the estimated horizontal error
Because
denotes the raw NMEA error relative to the reference position, the corrected residual error is computed as
To reduce epoch-wise prediction noise, the correction was further stabilized using exponential Temporal WLS. Because the RF-predicted LOS errors contain instantaneous prediction noise, the epoch-wise WLS solution can fluctuate. The prediction model can be expressed as
where
represents the prediction residual.
To reduce this noise, the proposed method jointly estimates a temporally consistent horizontal error using a causal window. For the current epoch
K, the temporal window is defined as
The final configuration uses
epochs. The exponential temporal weight for epoch
is
with
epochs.
Within this localized temporal window, the horizontal error is assumed to vary slowly
Here,
and
denote the common horizontal error components estimated for the current temporal window, not absolute coordinates. The common bias term is estimated separately for each epoch to absorb epoch-dependent offsets in the predicted LOS errors. The temporal observation equation is written as
Assume that the causal window contains
L unique epochs,
. The joint parameter vector is
Let
denote the local index of epoch
j within the window, i.e.,
. The design row corresponding to satellite
i at epoch
j is
The stacked temporal system is
The final observation weight is the product of the signal-strength weight and the exponential temporal weight
The temporal weight matrix is defined as
The temporal WLS solution is obtained as
The final horizontal error estimate for the current epoch is
The corrected residual error for the current epoch is therefore
The equivalent optimization problem for the final configuration is written as [
33]
The proposed method assumes that the smartphone and the F9P reference receiver are co-located during data collection. If a physical offset exists between the smartphone and the reference antenna, the observed label becomes
where
is the physical displacement between the two receivers. The corresponding target becomes
The second term is not caused by GNSS signal quality but by receiver placement. Therefore, a session suspected of non-co-located observation was separately reported in the results.
The positioning performance was evaluated using the two-dimensional root-mean-square (RMS) error, defined as
The raw RMS error is obtained by replacing the corrected components with the raw NMEA error components.