Predicting the Currency Market in Online Gaming via Lexicon-Based Analysis on Its Online Forum

. Transactions involving virtual currencies are becoming increasingly common, including those in online games. In response, predicting the market price of a virtual currency is an important task for all involved, but it has not yet attracted much attention from researchers. This paper presents user opinions from online forums in a massive multiplayer online game (MMOG) setting widely used around the world. We propose a method for predicting the next-day rise and fall of the currency used in an MMOG environment. Based on analysis of online forum users’ opinions, we predict daily fluctuations in the price of a currency used in an MMOG setting. Focusing specifically on the World of Warcraft game, one of the most widely used MMOGs, we demonstrate the feasibility of predicting the fluctuation in value of virtual currencies used in this game community.


Introduction
Individuals can engage in countless interactions over the Internet owing to advancements in network technologies and unprecedented computing power.The massive multiplayer online game (MMOG) environment is becoming popular with an increasing number of users.In this MMOG environment, many users carry out economic activities with a variety of purposes [1,2].In the World of Warcraft (WoW) MMOG, users engage in transactions using a particular virtual currency called Gold.In Second Life-another wellknown virtual world-a virtual currency called Linden dollars is used in transactions related to user-created items, such as houses and clothes [1].
The virtual economies based on these virtual currencies enable users to engage more fully in MMOGs, sometimes even achieving real economic value [3,4].Transactions between virtual currencies and real currencies have been gradually increasing [1,3,4].Most MMOG-related virtual currencies are exchanged with real currencies on eBay or with crypto-currencies such as Bitcoin [1,5].As the number of users engaging in such transactions increases, the market size is expected to grow [5].Many researchers have investigated the MMOG environment and related situations [1][2][3][4][5][6][7].However, most of these researchers have focused on the transaction environment rather than on the currency value [1].
Real financial transactions have, of course, been extensively studied.Research on techniques for predicting the stock price, for example, dates to the commencement of stock trading [8].More recently, stock market trends have been predicted using machine learning techniques, such as neural networks and support vector machines [9][10][11][12][13].Data used for training some prediction models have been based on financial news [11,12].Several previous studies focused on the analysis of stock markets using web-based data [9,10].However, few researchers have attempted to valuate virtual currencies and predict their future values.
Numerous transactions involving virtual currencies occur between online game users, forming a large market 2 Complexity [1,3,4].Thus, the ability to predict the next-day rise and fall of virtual currencies in conjunction with cash transactions has been considered important.The ability to predict the market prices of virtual currencies would help transaction agents engage in reasonable transactions and assist game developers in managing virtual environments as well as identifying and solving issues in virtual economies [1].
Virtual currencies for MMOGs exist in economic systems where an enormous amount of bidding competition is allowed, which is not the case for real currencies [14].All economic agents are fully informed, to the extent that there is no information asymmetry [1,14].Suppliers and consumers of virtual currencies act primarily as rational profit maximizers.Fewer variables exist for moderating the value fluctuations of virtual currencies than is the case with real currencies; hence, it is possible to observe value fluctuations easily.
MMOG environments are sources of "Big Data" and thus are suitable for the study of many subjects.In the game Pardus [15], data acquisition makes it feasible to study social theories in large-scale virtual-world populations [16][17][18][19][20][21][22].Various approaches to analyzing the structure and dynamic evolution of social networks in virtual worlds have been developed and have yielded significant findings [23,24].Related studies based on these findings have been conducted from a variety of perspectives [25][26][27][28][29][30].
Based on the above-mentioned studies, we have developed a method for predicting daily fluctuations in the value of a currency used in an MMOG environment via user opinion analysis.In this study, we demonstrated the application of this method for predicting daily fluctuations of the virtual currency used in the WoW game, the MMOG with the largest active user base.
The work by Kim et al. [1] parallels our research in terms of the objective; however, their predictions were based on trading data from only a small number of users who purchased virtual currencies in cash, which limits the quantity of available data.This makes it difficult to check the data on all daily transactions; therefore, the set price is not reliable.Tokens sold in WoW can earn in-game currency if sold by the developer via a qualified path; thus, experiments can be conducted based on more obvious data and using all transactions.
Furthermore, in the technical aspects, existing studies conducted sentiment analysis in a simple form, but the contribution of our study lies mainly in the application of our novel text mining approach based on a custombuilt lexicon.That is, to extract a meaningful feature of a document or a time point (containing documents posted in it), we first build a set of keywords, or a lexicon, defining a particular concept or notion, which we call the process of concept building.Afterwards, we measure how strongly such a concept is manifested in a given document or a time point, by counting those keywords (and possibly other relevant keywords) occurring in it.Building a custom concept and its lexicon plays a crucial role in analyzing a domain-specific document corpus, and, in our paper, we aim at revealing the signals from textual data that can lead to price prediction.For example, if we use an off-the-shelf sentiment analysis method that uses standard lexicon for positive and negative keywords, then there would be many domain-specific keywords not captured by the method, that is, false negatives.
Instead, we build our own lexicons closely related to the price of a virtual currency in the game of WoW.In this game, users buy tokens with cash at a fixed price (for example, 20 US dollars in the North America (NA) region or 20 Euro in the Europe (EU) region) and sell them to other users in exchange for the virtual currency referred to as Gold.The token/Gold exchange rate changes according to the demand and supply, as shown in Figure 1.
In general, acquiring Gold in the game environment requires an extended period of time and effort, but such time and effort can be reduced if tokens are bought in cash and then sold to another user for Gold.Tokens that are bought with Gold are generally used to buy time available for using the virtual world.Such tokens have two advantages.First, tokens prevent the virtual currency from being illegally transacted in cash.Second, the value of tokens can be traced continuously.We aim to predict the next-day rise and fall of the token/Gold exchange rate (also referred to as the token price) based on user opinion data analyzed on consecutive days.The proposed method can predict fluctuations in the value of virtual currency in the MMOG environment and can be applied to the selling/buying of virtual currency, allowing developers to determine the numerical values and probabilities of multiple effects that would otherwise be difficult to identify.

Proposed Approach
As shown in Figure 2, the proposed approach is characterized as follows.The data extracted include users' opinions concerning the MMOG environment and the prices of the virtual currency used in the transactions.User opinions are sorted with respect to their scores of our custom-built concept and then the causation between the user opinion and the virtual currency price is determined by conducting a causality analysis.Based on the user opinions scored afterward and the machine learning model, we predict the rise and fall of the virtual currency price in the next day.

Data Crawling
Initially, data required to generate the prediction model is crawled.We gathered data from official WoW forums.People use these Internet forums to upload postings and exchange opinions regarding particular topics of common interest [1,[31][32][33][34][35].Therefore, such online forums are good sources of information to gauge the daily reactions of many users to certain MMOGs.Communities or forums are widely used in MMOGs for information exchange [31].According to a previous study [1], WoW links its forums to economic activities among users, which we found to be relevant to predicting the fluctuations in the current number of virtualworld users.Topics and relevant replies posted by users on general discussion boards in official WoW forums were crawled.We also crawled the time when each comment and reply to it were posted, the number of replies to each comment, and the number of views.Replies quoting previous comments and replies were crawled, excluding overlapping sentences.Each HTML page was crawled using Python regex to parse HTML tags and extract the number of topics, the number of replies, the dates on which the topics and replies were posted, and the URL of each topic from the general discussion boards.Based on the URLs of extracted topics and content, the replies to them were also extracted.The data were saved in json format, which was in turn converted to other formats (e.g., csv and xlsx) for different purposes.
We collected data over a period of 460 days (April 23, 2015 to July 25, 2016).Within this period, the total number of topics collected was 166,651 (140,831 in the NA region and 25,820 in the EU region) and that of user replies was 2,931,748 (2,587,001 in the NA region and 344,747 in the EU region).We collected data in a manner that complied with the stipulated terms and conditions of use of the forums.The collected data did not include any personal information.WoW players use real currencies (e.g., USD and EUR) to purchase tokens and sell them for the virtual currency-Gold-in the auction house within the gaming environment.Tokens have only been in use for a short time; moreover, websites and tools continue to trace and show the value of the tokens.We employed one of these sites to crawl the daily closing price of the token.The use of such data does not violate WoW's Terms of Use agreement or include users' personal or identifying information.

Analysis of User Opinion Data
Our goal is to build lexicons of concepts, that is, meaningful keywords for predicting the price of the currency used in WoW from the crawled data.To this end, we initially ran topic modeling using the entire user comments to extract the representative keywords, the subset of which will then be used for building our initial lexicons.Afterwards, we retrieved relevant keywords to these initial keywords that we selected based on the similarity measure via a kernel density estimation technique.The main idea behind the kernel density estimation is to compute the similarity score of a given word to each keyword in our lexicon using a Gaussian kernel function in a word embedding space and take the average value of these similarity scores.Those highly relevant keywords would have high similarity values computed in this manner.For more details, refer to the subsequent section.

Data Preprocessing.
To remove noise or unnecessary information, we applied several preprocessing strategies for all user comments.First, we removed the URL string, stop words such as auxiliary verbs, prepositions, and special characters.Then, we tokenized the strings into words and lemmatized each word.In addition, we used only words with a frequency higher than  min , to exclude words used very sparsely.In this study, we set  min as 3.

Concept Building.
Next, we built a lexicon representing a concept for our own purpose.The lexicon-based document analysis plays an important role in document analysis in various fields, such as economics, politics, and social sciences.
Our main goal is to find significantly relevant concepts existing in the entire document corpus by analyzing user comments.For example, a document in the WoW forum can be composed of concepts such as an item, a raid, and game contents.These concepts can be explained by those words corresponding to their lexicons, respectively.Hereby, we can quantitatively score how relevant a document is to each concept by analyzing how strongly the signal of the concept appears in it.
The lexicon building of a concept comprises two steps: (1) generation of a candidate word set that is potentially relevant to the concept and (2) manual refinement of it to finalize the lexicon.To extract candidate words for each concept, we constructed topic modeling with user comments.Topic modeling will be discussed later.Once representative keywords are generated for each topic in this manner, we used a union set of keywords from each topic as our candidate word set for concepts.Then, based on the prior knowledge of the features of virtual world [36][37][38] targeted by the authors who had a major related to game and the developers in the game companies making games in the MMOG genre, we selected words from candidate words and categorized them as some suitable lexicon for our desired concepts; each word is allowed to be assigned to multiple concepts.Thus, we can collect words that can explain the corresponding concept.Table 1 shows examples of these lexicons generated by this process.

Topic Modeling for Initial Lexicon Building.
The topic modeling approach we used to extract representative keywords from a document corpus is nonnegative matrix factorization (NMF) [39], where the nonnegative constraint gives the interpretability on the resulting weights from factor matrices as the relevance score of a word or a document to each topic.
In detail, given a term-document matrix  ∈ R × , where  and  represent the size of the vocabulary and the number of documents, respectively, we normalized each column of this matrix to have a unit L2-norm.Given this matrix, NMF approximately factorizes it into two matrices  ∈ R × and  ∈ R × , where  represents the number of topics, that is, min ,       −        , where  ≥ 0,  ≥ 0. ( In this equation, the subscript  indicates the Frobenius norm, for example, where  ∈ R × .NMF has nonnegative constraints,  ≥ 0,  ≥ 0, as shown in (1), which makes the element in  and  nonnegative, thus maintaining the interpretability.The columns in the resulting matrix, , correspond to different topics, and the keywords correspond to the indices of the  largest value in each column function as the representative keywords of the topic.
In our analysis, we constructed a term-document matrix, , from 140,831 threads in the US and 25,820 threads in the EU collected from the WoW forum.Each article has content and date features, such that we can calculate the scores per day by summing up the frequency of each word in sentences or articles generated in the corresponding day.In topic modeling, we set the number of topics, , as 10.We also set the number of representative keywords for each topic, , as 30.

Lexicon Expansion of Concepts and Relevance Score Calculation.
In this subsection, we will describe details of how to expand concept keywords using kernel density estimation and to calculate the relevance scores with these concept keywords.Owing to the lack of expression resulting from the limited number of keywords a person could manage and the difficulty in determining the relevance to a concept in a user's mind, we utilized kernel density estimation (KDE), a statistical metric to estimate the probability density function, which can be smoothened using multiple kernels, to infer what other words' concepts are.In other words, we selected some keywords for each concept, but the problem is that the number of keywords for each concept is relatively small compared to the number of the total vocabulary.To overcome this problem, we trained word embedding vector representations for all words using Word2Vec [40], which can provide semantically and syntactically meaningful vector representations.Afterwards, we calculated all distances between concept keywords and other words.Then, we computed the conditional probabilities or distributions for all words given each concept by utilizing KDE.
In particular, we adopted a Gaussian kernel adopts as follows [41].For concept , the conditional probability can be calculated by the distance function, , which represents the distance between embedding vectors of words and vectors of word set in each concept, and the kernel, , which ensures proper balance between the given word and others.The conditional probability of the embedding vector of the keyword, , for a concept,   , that contains the embedding vector of concept keywords,   ∈   , can be computed as follows: Here, we used Euclidean distance and Gaussian kernel and these equations are as follows.
and we set the parameter, , as 1.
The conditional probability can also be considered as the relevance score to each class.Therefore, the score of the given sentence, , for concept,   , is defined as The range of the score is [0, ∞) because the score of the sentence sums up all the scores of the words in the sentence, and all the probabilities are nonnegative.In practice, the sentence is not very long, and the score of each word is less than 1; therefore, the score of the sentence is not very large.
After scoring all the comments, we calculated scores for each day by summing up the articles generated in that day.Thus, we can obtain the scores for each day.Through this analysis, we found that the scores were rising in August 2015 and July 2016 when a new expansion pack and patch to change virtual world greatly was announced.Figure 3 shows the line graph of each score in each concept, as presented in Table 1 in some periods.

Causality Analysis
A Granger causality test [42] was conducted to assess the relation between standardized token prices and scores of each concept.The Granger causality test is based on the assumption that if variable  causes , then changes in  will consistently occur before changes in  [1,9].We did not seek to test for actual causation but rather whether the time series of scores of each concept contained some predictive information regarding token prices.
Our time series for the selling price of tokens, denoted   , reflects daily changes in the price of tokens.We tested whether the time series of the collected data can predict changes in the token price by comparing the variance explained by two linear models.The first model uses only  lagged values of   (i.e.,  −1 , . . .,  − ) for prediction, while the second model uses  lagged values of both   and the time series of scores of each concept, denoted by  −1 , . . .,  − .We conducted the Granger causality test according to the models described in Based on the results of the Granger causality tests, we rejected the null hypothesis that the time series of scores of each concept does not predict token prices-that is,  ̸ = 0-with a high level of confidence.By analyzing their relevance, we extracted the concepts with the highest Granger causality relations ( value < 0.05).

Configuration of the Prediction Model
Using the collected data and the analyzed and rated comment data, we built machine learning models for predicting the fluctuation in the WoW token price using gradient boosting trees, random forest, and support vector machines (SVM), which are widely used in binary classification problems, used to investigate sensitivity to different machine learning algorithms.We used R packages called xgboost and cforest for the implementation in gradient boosting and random forest.The implementation of SVM was based on libSVM [43] with the radial basis function (RBF) kernel.Using LibSVM, the learning data was cross-validated to search for optimum parameters for the RBF kernel.We created a setup to apply machine learning to data spanning over a period of 460 days.
As the first step, we standardized the data to improve its applicability to the learning model.The -score,  E  = (E − (E))/(E), where (E) and (E) represent the mean and the standard deviation for every date, respectively, of data for the previous 12 days ( = 12) was used.An example of applicable input data is shown in Table 2.As for the input nodes, based on the input data provided in Table 2, 10 input data points were represented as serial vectors to allocate neurons based on the cumulative number of days spent on learning; that is,

Results of Granger Causality
Test.The Granger causality test was conducted on the Bitcoin transaction count and the price for time lag of 1 to 7 days.The time lag was omitted because it produced less significant results after 8 days.Tables 3 and 4 list the test results.
From the results, it was observed that in the NA region, most user opinions had an influence when the time lag was small and user opinions related to gear and PVP had causation when the time lag became larger.In the EU region, it was observed that user opinions related to gear, PVP, and patches had causation.This process was only used for verification.The entire data set was used to build the actual learning model for prediction.

Prediction Results
. We built and applied the machine learning model based on the gathered and scoring data to predict the daily fluctuation of the WoW token price.From April 23, 2015, to July 25, 2016, tests are conducted with 10fold cross validation.The accuracy rate, Matthews correlation coefficient (MCC), and -measure were used to evaluate the performance of the proposed model.
Table 5 presents the prediction results.The most accurate prediction model for the WoW token price in the NA region (accuracy rate = 82.55%) is based on the gradient boosting and previous seven days' learning data.The most accurate prediction model for the WoW token price in the EU region (accuracy rate = 81.52%) is based on the gradient boosting and the previous twelve days' learning data.Table 5 presents the results relative to the different machine learning models and learning data structures.Cumulative learning data for seven days or longer resulted in negligible difference, and cumulative learning data for less than five days proved insufficient for learning and compromised the prediction accuracy.

Discussion and Conclusion
In this paper, we presented a method for predicting the value fluctuation of the virtual currency in an MMOG, a

Figure 3 :
Figure 3: Scores of each concept for days.

Table 1 :
Concept building example created and used in this study.

Table 2 :
Example of a machine learning data set.

Table 3 :
Statistical significance ( values) of bivariate Granger causality test between WoW token price (NA Region) and concepts of forum opinions.

Table 4 :
Statistical significance ( values) of bivariate Granger causality test between WoW token price (EU Region) and concepts of forum opinions.