top of page

Predicting Visitation Forecasting

Screenshot 2024-04-26 at 9.53.34 PM.png

Forecasting is the process of making predictions about future events or trends based on historical data and current information. It involves analyzing patterns, relationships, and other relevant factors to estimate what is likely to happen in the future. Forecasting plays a crucial role in various domains, including business, economics, finance, weather, and many others.

The main goal of forecasting is to provide insights and guidance for decision-making and planning. By anticipating future outcomes, organizations and individuals can proactively prepare, allocate resources effectively, and make informed decisions to minimize risks and capitalize on opportunities.

​

The main goal of forecasting is to provide insights and guidance for decision-making and planning. By anticipating future outcomes, organizations and individuals can proactively prepare, allocate resources effectively, and make informed decisions to minimize risks and capitalize on opportunities.

​

There are several types of forecasting methods, including:

  1. Time series forecasting: This method involves analyzing historical data collected over regular intervals (e.g., daily, monthly, yearly) to identify patterns, trends, and seasonality. Time series models, such as ARIMA (AutoRegressive Integrated Moving Average) and exponential smoothing, are commonly used for this type of forecasting.

  2. Causal forecasting: This approach considers the cause-and-effect relationships between variables. It examines how changes in one or more independent variables (e.g., economic indicators, marketing campaigns) influence the dependent variable being forecasted (e.g., sales, demand).

  3. Judgmental forecasting: This method relies on expert opinions, intuition, and subjective assessments to make predictions. It is often used when historical data is limited or when dealing with unique or unprecedented situations.

  4. Machine learning forecasting: With the advancement of artificial intelligence and data analytics, machine learning techniques have gained popularity in forecasting. Models like neural networks, decision trees, and support vector machines can learn from historical data and make predictions based on complex patterns and relationships.

we applied time series forecasting techniques to predict the number of visitors to national parks. We used the ARIMA model, which captures the temporal dependencies and trends in the data, and an LSTM (Long Short-Term Memory) neural network, which can learn complex patterns and relationships from the historical visitor data.By analyzing historical visitor numbers and training these models, we were able to make predictions for the next 5 years, providing valuable insights for park management, resource allocation, and tourism planning.

ARIMA implementation

Screenshot 2024-04-26 at 9.14.51 PM.png

Step-by-step implementation of the ARIMA model in this project:

​

Step 1: Data Loading and Preprocessing

  • We start by loading the historical visitor data from the 'National_Parks_Dataset_for_Stats.csv' file using pandas.

  • We select a specific park to focus on by filtering the data based on the park name.

  • We extract the yearly visitation numbers for the selected park from the relevant columns in the dataset.

Step 2: Train-Test Split

  • To evaluate the performance of the ARIMA model, we split the data into training and testing sets.

  • We use a portion of the historical data (e.g., 80%) for training the model and the remaining data (e.g., 20%) for testing its predictions.

Step 3: ARIMA Model Creation

  • We create an instance of the ARIMA model using the ARIMA class from the statsmodels library.

  • The ARIMA model takes three key parameters: p (order of autoregressive term), d (degree of differencing), and q (order of moving average term).

  • In this project, we used the order (1, 1, 1) as a starting point, but the optimal values can be determined through techniques like the Box-Jenkins method or grid search.

Step 4: Model Training

  • We train the ARIMA model using the fit() method, passing in the training data.

  • During training, the model learns the patterns, trends, and correlations present in the historical visitor data.

Step 5: Model Evaluation

  • After training, we use the trained ARIMA model to make predictions on the testing data using the forecast()method.

  • We specify the number of steps to forecast, which corresponds to the length of the testing data.

  • We calculate the Root Mean Squared Error (RMSE) between the predicted values and the actual values to assess the model's performance.

  • The RMSE measures the average deviation of the predictions from the true values, providing an indication of the model's accuracy.

Step 6: Future Forecasting

  • Once we have evaluated the model's performance, we can use it to forecast future visitor numbers.

  • We use the forecast() method again, specifying the number of steps to forecast (e.g., the next 5 years).

  • The model generates predictions for the specified future period based on the patterns learned from the historical data.

Step 7: Visualization

  • To visualize the results, we create a plot using Matplotlib.

  • We plot the actual visitor numbers, the ARIMA predictions on the testing data, and the future forecasts.

  • We use different colors and line styles to distinguish between the actual values, predictions, and future forecasts.

  • We add labels, a title, and a legend to enhance the readability of the plot.

Step 8: Interpretation and Insights

  • By analyzing the plot and the RMSE value, we can assess the ARIMA model's performance and gain insights into the future visitor trends.

  • If the model's predictions align well with the actual values and the RMSE is relatively low, it indicates that the ARIMA model is capturing the underlying patterns and trends effectively.

  • The future forecasts provide an estimate of the expected visitor numbers for the next 5 years, allowing park management to plan accordingly.

we implemented the ARIMA (AutoRegressive Integrated Moving Average) model to forecast visitor numbers for a selected national park. The ARIMA model was chosen with an order of (1, 1, 1), representing the autoregressive, differencing, and moving average components, respectively.The historical visitor data was preprocessed and split into training and testing sets.

 

The ARIMA model was trained on the training set to capture the patterns and trends in the data. The model's performance was evaluated on the testing set using the Root Mean Squared Error (RMSE), which measured the average deviation between the predicted and actual values. The RMSE obtained was 99018.89, indicating that the model's predictions had an average error of around 99,019 visitors.Using the trained ARIMA model, we forecasted the visitor numbers for the next 5 years. The forecasts showed a decreasing trend, with the values ranging from approximately 3.67 million in the first year to 3.42 million in the fifth year.

 

The results were visualized using a plot that displayed the actual visitor numbers, the ARIMA predictions on the testing set, and the future forecasts.The ARIMA implementation in this project demonstrates the application of time series forecasting techniques to predict future visitor trends for national parks. The model's performance and forecasts provide valuable insights for park management and decision-making.

Screenshot 2024-04-26 at 9.18.00 PM.png
Screenshot 2024-04-26 at 9.30.46 PM.png
Screenshot 2024-04-26 at 9.31.16 PM.png

ARIMA vs LSTM

we compared the performance of ARIMA and LSTM models for forecasting visitor numbers in national parks. ARIMA, a statistical model, combines autoregressive, differencing, and moving average components to capture temporal dependencies. The ARIMA model with order (1, 1, 1) was trained on historical data and evaluated using RMSE, resulting in an average prediction deviation of 99,019 visitors.

On the other hand, LSTM, a recurrent neural network architecture, was employed to learn long-term dependencies and complex patterns. The LSTM model with 50 units and a lookback window of 3 years was trained on the same data. However, the LSTM model's performance was significantly worse, with an RMSE of 2,868,102 visitors.

The ARIMA model outperformed the LSTM model in terms of prediction accuracy, suggesting its ability to better capture the underlying patterns and trends in the visitor data. The ARIMA model's future forecasts indicated a decreasing trend in visitor numbers over the next 5 years.

The comparison highlights the importance of evaluating different modeling approaches and selecting the most suitable one based on the specific characteristics of the data and the forecasting task. While ARIMA proved superior in this case, the performance of models may vary in different scenarios.

Screenshot 2024-04-26 at 9.36.18 PM.png
Screenshot 2024-04-26 at 9.37.08 PM.png
Screenshot 2024-04-26 at 9.37.40 PM.png

Conclusion

we compared the performance of ARIMA and LSTM models for forecasting visitor numbers in national parks. The ARIMA model, capturing temporal dependencies and trends, outperformed the LSTM model with an RMSE of 99,019 visitors compared to 2,868,102 visitors for LSTM. The ARIMA model's future forecasts showed a decreasing trend over the next five years. This comparison highlights the importance of selecting the appropriate forecasting model based on the data and problem at hand. While ARIMA proved superior in this case, model performance can vary depending on the dataset and forecasting requirements. Accurate visitor number predictions aid in resource allocation, staffing decisions, and infrastructure planning for national parks. By leveraging historical data and advanced forecasting techniques, park authorities can make informed decisions to enhance visitor experiences and ensure sustainable management. This project demonstrates the application of ARIMA and LSTM models for forecasting visitor numbers, contributing to the effective management and planning of national parks.

bottom of page