scieee AI-readable full text Open interactive document viewer

Analysis of twitter traffic based on renewal densities

Esteban Zarza, Ángel Javier

Abstract

[ANGLÈS] We propose a novel approach for Twitter traffic analysis based on renewal theory. Even though Twitter datasets are of increasing interest to researchers, extracting information from message timing remains somewhat unexplored. Our approach, extending our prior work on anomaly detection, makes it possible to characterize levels of correlation within a message stream, thus assessing how much interaction there is between those posting messages. Moreover, our method enables us to detect the presence of periodic traffic, which is useful to determine whether there is spam in the message stream. Because our proposed techniques only make use of timing information and are amenable to downsampling, they can be used as low complexity tools for data analysis.

Full text

ANALYSIS OF TWITTER TRAFFIC BASED ON RENEWAL DENSITIES Javier Esteban Zarza Supervisor: Antonio Ortega Los Angeles, April 12, 2012 Dedicatoria Cuando tienes dolor de barriga es cuando piensas: "Con lo bien que se está sin estos dolores!", algo que ni se te pasa por la cabeza cuando estás bien. Es curioso que sea necesario irse a miles de quilómetros durante una temporada para darte cuenta de lo que siempre has tenido, pensabas que era normal, y no has acabado de valorar. Quiero Dedicar este proyecto a mis padres Pedro y Loren. Primero por darme la oportunidad de venir y segundo, por el fuerte y continuado apoyo a lo largo de un camino algo pedregoso. Hasta que no te encuentras en situaciones que lo requieren, no valoras cuanto vale. En segundo lugar, a Alex, Joan, Emilio, Gisela y Bea por saber que, siempre que necesitara algo, iban a estar ahí para apoyar, aconsejar o simplemente escuchar y conseguir que sientas tener alguien a tu lado aun y estar muy lejos. Aun y que saben lo que les valoro, no se imaginan cuanto crece una amistad cuando responde al necesitarla. Finalmente, en general a la gente que me ha seguido y se ha preocupado por saber como evolucionaba la aventura californiana. Des de luego, por lo bueno y por lo malo, es una experiencia que ha dejado huella, haciéndome crecer a marchas forzadas. When you have stomach ache you think: "How wonderful is feeling ok!". You do not realize it when you do not suffer it. It is curious that it is necessary to fly thousands of miles away for a long period in order to realize what have you always had, and even taken for granted, without thinking how valuable it was. I want to dedicate this thesis to my parents Pedro and Loren. First, for giving me this opportunity and second, for the strong and continuous support along this difficult journey. You don’t realize how valuable it is until you face certain situations. Also, to Alex, Joan, Emilio, Gisela and Bea as I have always known that if I needed anything, i ii they would be there to give support, advise or just listen and achieve that you feel that someone is by your side even though the distance. They already now how much I do appreciate them, but they can not even imagine the growth of a friendship when it responds when it is needed. Finally, in general to the people that has shown interest about the evolution of the californian adventure. I will never forget the experience, because of the good and the bad, which have made me grow up whether I want to or not. Acknowledgements I would like to thank the help given by some people without which this thesis would have been a harder journey. First of all, to the professor Dr. Antonio Ortega for his guidance and giving me the opportunity of coming to California and USC. However, I really want to thank for his patience and comprehension as not everything in my stay abroad has been as easy as it was supposed to be. I have always felt that I had a supporting point there, making me feeling better and being able to accomplish this challenge. I appreciate as well the advice and concern of professor Dr. Bart Kosko, who guided me in those kind of problems you never expect to have. A special mention as well for Tim Boston, who has always been helpful, efficient, fast and nice every time I needed something. I don’t want to miss Sean McPherson and Maheswaran Sathiamoorthy, that were the at the tough beginning with all the new concepts and methods coming up. Last but not least, thanks to all the friends and people that I have met in LA, which have made me feel like in home during this time even though the hard time, especially to Loay Salem, who introduced me to the LA’s life and without him anything would have been possible. iii iv Contents 1 Introduction 1 2 State of the art 3 2.1 Spamdetection .................................. 3 2.1.1 Graphbasedmethods .......................... 4 2.1.2 Content based methods . . . . . . . . . . . . . . . . . . . . . . . . . . 5 2.1.3 Graph and content based method . . . . . . . . . . . . . . . . . . . . 6 2.1.4 Downside of these methods . . . . . . . . . . . . . . . . . . . . . . . . 7 2.2 Classification and analysis . . . . . . . . . . . . . . . . . . . . . . . . . . . . 7 2.2.1 User classification tools . . . . . . . . . . . . . . . . . . . . . . . . . . 8 2.2.2 Other classification methods . . . . . . . . . . . . . . . . . . . . . . . 8 2.2.3 Twitteranalysis.............................. 9 3 Data Acquisition System 11 3.1 GeneralQueriesSystem ............................. 12 3.1.1 Resolution of the acquisition system . . . . . . . . . . . . . . . . . . . 13 v vi Contents 3.1.2 Storageprocess .............................. 13 3.1.3 Downsampling .............................. 15 3.2 InformationManagement............................. 15 3.3 Acquisition system parameter setting and experimental evaluation . . . . . . 16 3.3.1 Query rate reduction as a form of downsampling . . . . . . . . . . . . 16 3.3.2 Minimum downsampling rate avoiding overflow . . . . . . . . . . . . 18 3.3.3 Tweet losses in acquisition system . . . . . . . . . . . . . . . . . . . . 19 3.3.4 Timeouts ................................. 21 4 Renewal theory 23 4.1 Renewalprocess.................................. 23 4.2 Renewalfunction ................................. 25 4.3 Renewaldensity.................................. 25 4.4 Renewal density estimations . . . . . . . . . . . . . . . . . . . . . . . . . . . 26 4.4.1 Bin size optimization . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 4.4.2 Histogram as density estimation . . . . . . . . . . . . . . . . . . . . . 30 5 Twitter traffic analysis 33 5.1 Background traffic characterization . . . . . . . . . . . . . . . . . . . . . . . 33 5.2 Periodic events detection . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 34 5.2.1 Trimmedmean .............................. 35 5.2.2 Pearson’s Chi-Square test . . . . . . . . . . . . . . . . . . . . . . . . 35 Contents vii 6 Experimental results 41 6.1 Background traffic analysis results . . . . . . . . . . . . . . . . . . . . . . . . 42 6.2 Periodic events detection results . . . . . . . . . . . . . . . . . . . . . . . . . 45 7 Conclusion 47 A Empirical Renewal Density ans Convolution Renewal Density Estimations, Difference and Cumulative Difference 55 B Maximum Cumulative Difference for Different Time Windows 77 References........................................ 82 6Chapter 2. State of the art •followers-followees ratio •Fraction of tweets that have been replied •Number of tweets the user has replied •Number of tweets the user has received a reply from •Number of followees •Number of followers •Average number of hashtags per tweet Finally, in [7], a suffix tree data structure is used, combining self-learning and clustering analysis in the scam detector. 87 % accuracy is achieved with only 9labeled samples and 4000 unlabeled samples. The suffix tree construction follows the algorithm shown in Table 2.1. Latent Semantic Analysis with SVM is used to reduce the dimension of the feature space, which decomposes a large term-by-document matrix into a set of orthogonal factors using singular value decomposition (SVD). (1)Define tree length N. (2)Create sufixes w(1) −w(n), n =min{N;length(s)}. (3)For i= 1 to n,w(i) = m1m2···mj, j =length(w(i)): From the root, For k= 1 to j: If mkin level k: increase the frequency of node mkby 1, else: create a node for mk,frequency = 1 move down the tree to the node of mk Table 2.1: The suffix tree building algorithm. 2.1.3 Graph and content based method In [8] the graph based method and the content based method are used in order to detect spam. First, the true social network (TSN) of a Twitter user is defined as the social network 2.2. Classification and analysis 7 links such that the user really has a real relationship, based on whether those users are mentioned or their messages retweeted. Afterwards, the authors use PageRank with the TSN to compute a reputation value for each user which represents the user’s ability to either engage other users or provide information that is of interest to others. As malicious entities have low quality information, a large number of them will end up with low reputation values. The reputation value is decreased based on the number of initial friends who are malware. 2.1.4 Downside of these methods The different approaches detailed have some disadvantages when they are performed. Graph based methods need to know of the user’s social network structure in order to obtain different classification values, which are obtained for a certain social network structure. Thus, if this network changes, those values must be recalculated and a new list obtained. These methods ire focused only in a certain user that is being studied. In addition, the methods need a considerably large amount of data which needs to be stored and processed. Hence, those methods are computationally expensive in general. The acquisition of these data is not achieved with ease as well and makes it difficult to use it as a real time application. Content based methods uses labeled tweets as an starting point, which must be labeled manually. The more accuracy wanted, the larger the labeled data must be, which is time consuming. In order to label those tweets and to classify them automatically afterwards, the methods need many user information, with which build the vectors. As well as graph based methods, most of them are computationally expensive. 2.2 Classification and analysis Other authors have considered problems that can be defined as classifiers and tweet analysis. There are many applications that seek to extract different information about Twitter. However, none of them focuses on determining the existing correlation in a certain stream or uses time analysis to extract information from Twitter traffic. 8Chapter 2. State of the art 2.2.1 User classification tools Three different classes of user classification approaches have been proposed in the literature. The first one uses the number of status updates, the number of friends and the number of followers to determine if the user is a ’broadcaster’ (followers followees), ’acquaintances’ (followers ≈followees) or a ’miscreant’ (followers followees) [9]. The second one is based on Hits, which has been described in 2.1.1, to split users’ intention into ’information sharing’, ’information seeking’ and ’friendwise-relationships’ [10]. Finally, in [11], users are categorized into ’Personal, ’Aggregator’ and ’Marketing’. The results show that ’Personal’ users contribute to emerging trend topics, while ’Marketing’ types use trend topics to generate attention. A similar categorization as in [11] can be found in [12], which adds some new classes, classifying users into ’Personal’, ’Group’, ’Aggregator’, ’Satire’ and ’Marketing’. In [13], the authors define friend as a person whom the user has sent at least two direct messages. The results show that people communicate directly with only 13 % of their followees, separating the relationships in ’friends’ and "follower-followee". 2.2.2 Other classification methods A tweet classification approach aims to categorize Twitter messages based on their content and is done with three different targets: a) categorize messages based on their content in nine different categories, b) capture breaking news (TwitterStand) splitting them in ’junk’ and ’news’ and c) categorize users into groups [12]. Text classification labels natural language into a thematic category. There are many systems, such as Term-Document Matrix,Vector space model or n-grams among others [12]. Another curious finding relates to which type of questions users ask in their tweets [14], and concludes that questions themselves are 17 % factual and more than 50 % are opinionated or recommendation, while regarding to the topic, the majority asked for technical advice (29 %), followed by entertainment (17 %) and family questions (12 %). In [11] trend topics are analyzed and split into three categories depending on their life time: long-term, medium-term and short-term topics. 2.2. Classification and analysis 9 2.2.3 Twitter analysis The detection of the sentiment of the author in regard to some topic is approached in: Tweetfeel,Twitrratr and Twitter Sentiment [12]. All of them are sentiment searchers, revealing if the search term is rated positively or negatively. The method used in the two first approaches is not described, while the third imports a training set by searching for ’:)’ and ’:(’ and then uses different machine learning algorithms. In 2007, a detailed analysis of the geographical distribution was carried out [10]. The results show that United States (especially East Coast), Europe and Asia is were Twitter is used the most, being the ties between users closer in Europe and Asia than in North America. In [9], the anatomy of the status updates is studied, concluding that 60 % of the updates are sent over the Twitter website while the rest is sent with mobiles and custom applications, and that during the morning is when the updates have its maximum, leveling off during the day. Recommender systems can be found as Buzzer [15], which proposes ’topical new stories’ based on a list of RSS and user’s tweets (from public timeline or friends) or zerozero88 [16], that recommends URLs selecting them through three different algorithms: a) most relevant URLs posted, b) similarity with user’s posting topics and c) most mentioned URL in the neighborhood, named Candidate URL,topic relevance and social voting process respectively. Ebner and Schiefner [17] give a chance to e-learning, concluding that microblogging platforms lend to a community where less commitment is expected, thus being a good alternative to ‘classic’ e-learning systems like Blackboard or Moodle. In [18] a original idea is applied to live media events with a system that the authors called Statler. The video is segmented into different parts, and each part is annotated with several tags. This tag list is generated by tapping into the public Twitter timeline while the media is broadcasted. In the knowledge acquisition field, [19] generates a list of top topics and cross-links this list with the most influential Twitter users for those topics using ’homophily’ - a term from social network studies that describe the phenomenon that people with interests in common are more likely to bond together. On the other hand, [20] developed a model called Tweetonomies, which allows to distinguish different aggregations of social awareness streams. 10 Chapter 2. State of the art A measure of a user influence is given in [21] and [22]. In [21], an in-depth comparison of three measures of influence: indegree, retweets and mentions is presented. Focusing on different topics, this work examines how the three types of influential users performed in spreading popular news topics. It also investigate the dynamics of an individual’s influence by topic and over time to finally characterize the precise behaviors that make ordinary individuals gain high influence over a short period of time. In [22], a method is proposed to find influential individuals by considering both the link structure and the temporal order of information adoption in Twitter. Sharifi et al. [23] propose an automatic summarization into topics based on what they call Phase Reinforcement (PR) Algorithms. Chapter 3 Data Acquisition System Out goal is to work with real data, which requires querying Twitter. Thus, it is important to know how exactly the query system works in order to understand the quality of the data captured and thus be able to adapt all the data processing methods that are used afterwards. Figure 3.1, depicts the block diagram of the data acquisition system. In this section, we describe the Server component of the system, as it is where the data acquisition is done. Figure 3.1: Analysis of Twitter traffic based on renewal densities System. 11 12 Chapter 3. Data Acquisition System 3.1 General Queries System All the data we analyze is obtained from Twitter. The company provides an API with which an automatic collection code can be programmed, creating a server-client connection, where the server (Twitter) reveives queries are submitted based on code running at the client. Twitter defines several limitations on the way data can be accessed, namely: •Only the 10 first result pages can be accessed. •A maximum of 100 results can be included per page. •Minimum time between requests. A page is described as a block of information containing a certain number of tweets. All those limitations have been taken into account when programming the code that collects data from Twitter, which has been written in Java. Twitter’s API gives us the opportunity to use built-in functions, simplifying the programming process. One of those function is the one used for querying each page. One page is requested each time a query is done, specifying the page number that is requested. Between queries, it is necessary to add some sleep time in order not to exceed the maximum access rate restriction, which lends to wait times of 2,500 ms between queries. As a response, Twitter will send all the tweets (with a maximum of 100) that correspond to the page requested. Once the information arrives, it is stored in a MySQL’s database. With each publication, some metadata is also collected. Specifically, for each posted tweet we can obtain: •Tweet’s identification number •User’s identification number •User’s screen name •Tweet text •Date and time the tweet was ported •Retweet flag, which indicates whether or not the tweet was a retweet. •Identification number of the target user 3.1. General Queries System 13 •Screen name of the target user All those fields are compared with the ones that are already stored in the database and only the ones with at least one different field are added. Thus, no repeated tweets/metadata can be stored. After each page has been processed, our, our program returns the number of tweets that have been successfully stored. Once the ten pages have been requested, it is necessary to wait until new tweets are posted. Consequently, a sleep time is needed in order for new information to be available for the next query. The length of this sleep time should depend on the posting rate, as well as the number of tweets that are expected to be collected with each iteration. As will be described below, some tweets can be lost if the sleep time chosen is too long. 3.1.1 Resolution of the acquisition system Empirical estimation of the renewal density requires measuring the time in between tweets. Each message contains contains a date field, from which the time of the posting can be obtained. However, this timing information is relatively coarse (the resolution is one second), so that for high rate message streams (more than one message per second) multiple tweets can be recorded as having the same time. In our analysis, these tweets are treated as if they were submitted at the same time, i.e., their inter-arrival time is zero. Due to this limited time resolution, our empirical pdfs have "spikes" at the origin. While this is clearly an artifact of low time resolution, we decided to include these measurements in our pdf estimation. In any case, the phenomena of interest occur at larger time scales that should not be affected by this lack of resolution (e.g., spam messages may be posted with periods of the order of tens of minutes, while interactions between users in an active stream may be in a scale of minutes). 3.1.2 Storage process The way the database system stores the data will determine how it will be read and analyzed. Every time a query is done, new data is collected, which is situated at the bottom of the database. In order to be able to analyze the data stored, it is necessary to execute a MySQL command so as to obtain a ’.txt’ output file in which all the information per tweet requested will appear in one line in the stated order, with the different fields separated by tabs. The command used is 14 Chapter 3. Data Acquisition System mysql>select date,id,text from table into outfile path ; with an example output generated shown below. 2011-06-07 09:15:39 18182857 Aloha kakahiaka from Waikiki.Surf is 1-3 feet today with Kuhio looking the best. This way of storing data has some consequences in terms of how it will be read when the output file is generated. Twitter gives access to the first ten pages, which have chronological order. Those pages can be seen as boxes that each contain 100 tweets in a certain order. The first page will have the newest tweets and the tenth the oldest ones. Furthermore, in each page the tweets will go from the newest to the oldest. The page request order followed is from the first to the tenth. We will call those ten pages a pack. ! ! ! ! ! ! ! ! ! ! ! ! Page!1! Page!2! …! Page!10! Pack!1! Page!1! Page!2! …! Page!10! Pack!2! ! t!=!0! t!=!T1! t!=!T1+τ! t!=!T1+T2+τ! Figure 3.2: Data storage order with the time jump explanation. After a sleep time, another pack will be queried and stored at the database’s bottom as stated. This new pack will have information of newer tweets, with the first tweet of the first page being the newest one. When the information is displayed, the timestamps go backwards in time during a pack view, as an older tweet has a smaller timestamp than a newer one. However, once this pack ends and the new one comes, a time jump appears. This is because the pack will end with the oldest tweet of the tenth page (Pack 1, t= 0 in Fig. 3.2), while 3.2. Information Management 15 the following tweet is the next pack’s first tweet of the first page (Pack 2, t=T1+T2+τ in Fig. 3.2), which becomes the newest one in the database. Those time jumps would not appear if: 1. packs were stored at the beginning of the database, 2. page queries’ order was the opposite, i.e., the tenth page was requested first and the first page the last one and 3. tweets in each page went from older to newer. Nevertheless, those time jumps will be useful as will be shown below and rearranging all messages to be in chronological order can be done easily. All this can be proven taking a look at the collected timestamps. Comparing the information returned by the executed code, about the number of tweets collected during the first query, with the timestamp’s progress, it is easy to see that the timestamps go back in time and when the number of tweets corresponds to the ones collected in the first pack query, a forward jump appears, which corresponds to the last tweet posted and goes backwards again until the first tweet posted after the first query was done. 3.1.3 Downsampling A downsampling such as that introduced in [24] could also be used here. A random number of events would be grouped together and assigned the same timestamp, reducing the amount of data and, thus, the processing complexity. Lower complexity can facilitate analysis of multiple streams simultaneously and make it easier to perform this analysis in real-time. However, with downsampling a longer acquisition time would be necessary in order to observe a sufficient number of samples for the estimated histograms to converge [3]. 3.2 Information Management Every time a query is submitted, Twitter replies by sending information about tweets which contain the selected keyword, as explained in Section 3.1. In order to store all this data, 22 Chapter 3. Data Acquisition System tweet of the first page of the pack in which the tweet is missing and the timestamp of the missing tweet, which can be obtained in the file created with the short sleep time data. The process followed is the one that below: 1. Search in the short sleep data those tweets that do not appear in the long sleep data 2. Get the time stamp of the tweets that have not been found 3. Determine in which ten pages pack the tweet should be located 4. Obtain the time stamp of the first tweet in this page 5. Calculate time difference In order to accomplish step number three, we take advantage of the way data is stored. In Section 3.1 time jumps between packs is explained. Using those time jumps, the ten page pack containing the lost tweet would be the one where a timestamp with a higher value than the lost one is found for the first time. However, no pattern is observed. Except one, all the time values are higher than 100 s. Although, it does not determine a threshold as tweets after the lost one are found, which obviously have a higher time difference. In summary, no explanation can be found as the access is restricted to the host side, so we are not able to know how Twitter manages and sends the data. However the numbers are small and so measurements can be performed reliably even with lost tweets. Chapter 4 Renewal theory The renewal density allows to efficiently estimate long range information about time-based events. In our case, those events are tweets with a specific timestamp, from which inter-arrival times are also calculated. 4.1 Renewal process A renewal process is a stochastic process that models the random inter-arrival intervals of an arrival process. Those intervals are independent, identically distributed and positive random variables. Three different aspects define the process: The inter-arrival time between events, the partial sums and the renewal process. Let M1, M2, . . . , Mnbe a positive, independent and identically distributed random variable (denote Mas a generic random variable of the sequence), representing the inter-arrival time. The time data format for each tweet consists of the date and time (hours, minutes and seconds) of the event. Thus, a conversion to seconds followed by the calculation of the time difference between tweets is needed in order to get the relative time used for the renewal density. As a result, every tweet becomes a renewal process arrival. Figure 4.1 ilustrates what those random variables represent. The partial sum Snreflects the elapsed time since the beginning to the nth event. It is 23 24 Chapter 4. Renewal theory Figure 4.1: Graphic interpretation of the random variables Mrepresenting the inter-arrival time. defined as the sum of the nfirst inter-arrival times Sn= n X i=0 Mi=M1+M2+···+Mn=Sn−1+Mn where S0= 0.(4.1) Finally, The renewal process {N(t); t > 0}represents the number of arrivals to the system in the interval (0, t]. The name renewal process comes from the fact that with every event, the process starts over again. If the nth event occurs at Sn=τ, the inter-arrival time of the following mth event is Sn+m−Sn=Mn+···+Mn+m. Thus, given Sn=τ, the renewal counting process {N(t+τ)−N(τ); t > 0}is the same as the original one. The partial sums are important when the long term behavior of a point process is analyzed. In this case, when a spammer posts with a certain period Tspam in Twitter, the arrival events will not be consecutive if 1 λTspam, where 1 λis the average time between arrivals, so it can be modeled as a new renewal process, where the arrivals corresponding to the spam tweets will be a subset of those observed [25]. Those new variables M0would be defined as the difference between the partial sums of the periodic events. If the original process is defined as {N(t); t > 0}, and the spam one as N0(t); t > 0 M0 1=M0 2=··· =M0 n=ST(j)−ST(j−1) =Tspam∀j∈[2, k] ; T⊆I, (4.2) where Idefines the set of arrivals {1,2, . . . , n}of the original process and Tthe subset of periodic arrivals {T(1), T(2), . . . , T(k)}. Hence S0 n= n X i=0 M0 i.(4.3) Note that the partial sums and the renewal process N(t)are related by [25] {Sn> t}={N(t)< n};{Sn≤t}={N(t)≥n}.(4.4) 4.2. Renewal function 25 4.2 Renewal function The renewal function represents the expected number of events in a certain period of time [0, t]. The renewal function, denoted R(t), is defined as R(t) = E[N(t)]. The exact calculation of R(t)makes use of the fact that the expectation of a nonnegative random variable is defined as the integral of its complementary distribution function [25], R(t) = E[N(t)] = ∞ X n=1 Pr{N(t)≥n}.(4.5) Using (4.4), R(t) = ∞ X n=1 Pr{Sn≤t}.(4.6) Let be FSn(t)be the cumulative distribution function (cdf) of the partial sum with nrandom variables (Sn). The cdf FSn(t)is defined as the probability that Snis smaller or equal to t or FSn(t) = P(Sn≤t). Thus, combining it with (4.6) R(t) = ∞ X n=1 FSn(t).(4.7) As a result, the renewal function is the sum of the cumulative distribution function of all the partial sums. This leads to the renewal equation shown in [25] R(t) = ∞ X n=1 FSn(t) = FSn(t) + Zt x=0 R(t−x) dFSn(x); t≥0.(4.8) 4.3 Renewal density The renewal density r(t)describes the probability that an event occurs in the period of time (t, t + ∆t). It is defined as r(t) = lim ∆t→0+ E(Nt,t+∆t) ∆t=δR(t) δt ,(4.9) which shows the relation with the renewal function. Let be fMn(t)the probability density function (pdf) of the random variable Mn. As the partial sum Snis the sum of nindependent random variables, the pdf of the nth partial sum 26 Chapter 4. Renewal theory fSnis defined as the convolution of the the pdfs of the first nrandom variables, which are also identically distributed. Thus, the pdf fSnis given by the n-fold convolution of the pdf of M fSn(t) = f∗n M(t)=(fM∗fM∗···fM)(t)where S0= 0.(4.10) The pdf of the partial sum describes the probability that the nth event arrives at a certain time t. The renewal density is obtained considering all the arrivals instead of only the nth event. Hence, the probability of an arrival at tindependently of its number, would be the sum of the probabilities of all the possible arrivals, which leads to the result [24] r(t) = ∞ X n=0 fSn(t).(4.11) If users are assummed to tweet randomly and independently of each other then a Poisson process could be used to model the timing of tweets. In this particular case, the pdf of a particular partial sum would be a Poisson distribution. From (4.11) it is known that the renewal density is the sum of all the partial sums’ probability density functions. Thus, as illustrated in Figure 4.2, it is easy to prove that the resulting renewal density will be constant ??. Furthermore, it is known that for a Poisson process with mean inter-arrival time λ, the renewal density and renewal function are given by [24] R(t) = t λ r(t) = 1 λ, (4.12) which is consistent with the intuition provided by Figure 4.2. Thus, if the renewal density is not constant, this means that it is not a Poisson process, i.e. it is not memoryless traffic, hence, there is some correlation between the data. 4.4 Renewal density estimations The renewal density of the empirical data is unknown and needs to be estimated. In order to extract useful information, we propose to compare it with a second renewal density based on the empirical data with only the first order information needs to be obtained. 4.4. Renewal density estimations 27 creates a flat renewal density show as the bottom distribution in Figure 3.2. Figure 3.2: Generating renewal density for Poisson process 3.2.3 Estimating the Renewal Density If fMis unknown then most methods to estimate the renewal density rely on generating multiple instances of the point process to compute estimates of fnand r(t), denoted ˆ fnand ˆr(t) where we use ˆ ·to denote empirical estimates [29]. However, for practical signals, e.g., packet arrivals, it is not feasible to generate multiple realizations of the point process. Instead, given empirical measurements we generate time averages using observations from a single set of Internet traffic measurements, i.e., the renewal density estimate represents the average of multiple observations from different periods of time. This is accomplished by using multiple observations of the same set of measurements where each observation reflects a different starting point in the measured signal, a technique derived in [51]. 59 Figure 4.2: Generating renewal density for a Poisson process. Several estimations of the renewal function have been developed for a known inter-arrival distribution. In general, it is not possible to obtain the renewal function explicitly and it is a more realistic situation that the distribution is unknown or just general information describing it is available. Only in some rare cases it can be obtained, as for example, if the inter-arrival times have a uniform distribution. Thus, several attempts have been made to evaluate the renewal function computationally [3]. In the matter that concerns this thesis, a non-parametric estimation of the renewal density by empirical data is necessary as no information about the distribution of the arrivals is known. It is important to note that only one realization of the data can be obtained. In [3], the authors propose to estimate the renewal function without any information about the form of the underlying distribution. The stated nonparametric estimate is related to a histogram-type estimate where the unknown probabilities Pr{Sn≤t}in (4.7) are replaced by the corresponding empirical distribution functions and a limited number of terms kis used in the summation. The method in [3] divides the realization with mevents into groups of kterms with k≤m. It starts with the first event M0and gets the partial sums of the first kelements {S0 1= M1, S0 2=S0 1+M2, . . . , S0 k=S0 k−1+Mk}. After that, the same process is done changing 28 Chapter 4. Renewal theory the starting point to the following event M1obtaining the sequence {S1 1, S1 2, . . . , S1 k}. This is repeated until the element Mkcorresponds to the last of the realization. In other words, a sliding windows filters a subset of events of the complete realization, obtaining the partial sums of the events in the window. As a result, a group of m−kpartial sums of the same order j(Si j) is returned for j= 1, . . . , k. The estimation of the pdf e fSnis based on a non-parametric computation using histograms that tabulate the data from each partial sum realization. Each sequence of partial sums only contributes to the estimation of the respective order, i.e., Si jcontributes to fionly [24]. Following (4.11), the resulting renewal density estimation er(t)is obtained by summing all the estimated histograms. Obviously, the different subsequences are not independent between them as in each iteration the difference between the previous subsequence is only one event. It would be possible to generate additional subsequences by rearranging the inter-arrivals as described in [26]. However, the order of tweets is important, as it may describe for example some kind of dependency between consecutive tweets. The influence between users or tweets is some of the information that may be obtained from the renewal density, so no rearranging can be applied. The second estimation of the renewal density er0(t)is obtained using (4.10) and (4.11). The different pdfs e f0 Snare computed through the n-fold convolution of the pdf e fS1, which is estimated empirically following the previous method. Thus, this renewal density only uses first order inter-arrival information. Hence, it is possible to consider this renewal density as an approximation for orders greater than one, under the assumption that message arrivals are memoryless. This will help us determine how correlated the acquired data is. Note that its shape is similar to that of the rd obtained by a Poisson distribution: it is constant until it decreases abruptly due to the highest order pdf’s tail shape. The algorithms used to obtain both estimations are described in Algorithm 1 and Algorithm 2. In both estimations, the maximum inter-arrival time taken into account depends on the maximum pdf order used and the data rate. The lower the rate or the higher the order, the higher maximum inter-arrival time. It is necessary to normalize the renewal density converting time into tweets taking into account the data rate if it is necessary to compare the characteristics of different Twitter streams. 4.4. Renewal density estimations 29 Algorithm 1 Calculate er(t) Set maximum order N for order = 1 →Ndo window_size ←order; repeat shift window one position i←Pwindow_size Mk fSorder[i]++; until reaches the end NormalizefSorder end for er(t) = PNfSi Algorithm 2 Calculate er0(t) Set maximum order N window_size ←1; repeat shift window one position i←Pwindow_size Mk fSorder[i]++; until reaches the end for order = 2 →Ndo fSorder ←fSorder−1∗fS1; NormalizefSorder end for er(t) = PNfSi 30 Chapter 4. Renewal theory 4.4.1 Bin size optimization The estimation depends on the amount of data obtained from Twitter, hence, we run the risk of getting a noisy renewal density unless we carefully choose the bin size. In [27] the size is optimized by the minimizating the cost function: C(h) = 2k−v h2.(4.13) The method consists in dividing the data range into Nbins of width hand counting the number of events that enter the jth bin kj. Next, the mean, k, and the variance, v, of the number of events are calculated as k=1 N N X j=1 kj, v=1 N N X j=1 (k−kj)2. (4.14) Finally, the value of the cost function C(h)is obtained, repeating the process until a minimum is reached. 4.4.2 Histogram as density estimation The histogram may be considered an "old-fashioned" way of estimating densities. However, it is really easy to represent and widely used in applied work, in contrast with kernel estimators. The kernel estimation as well as general estimators have been widely studied [28] and their results show that asymptotically the mean square error of histograms tend to zero with a worse rate than the kernel and general estimators. However, in [28] it is proved that the histogram estimator can achieve the same rate as kernel and general estimators for finite sample sizes. We now discuss the estimation of the renewal density and the inter-arrival probability density functions when a histogram approach is used. Let t0be a reference point, hthe bin width in seconds and kjthe number of events falling in the jth bin interval [t0+jh, t0+ (j+ 1)h). In [28] the authors use a binomial random variable to model the number of events falling in the jth bin interval. Then the value of the renewal density’s histogram at a point tin this interval, e f(t), will be given by e f(t) = kj/mh, 4.4. Renewal density estimations 31 where mis the total number of events. Thus, e f(t)is normalized so that the area under the histogram is 1. The minimum square difference δ2=E[R[e f(t)−f(t)]2dt]can be made small by choosing a bin width h=k−1/3. However, it depends on an unknown parameter γ=Re f0(t)2dtthat can be estimated from the data. The expected value and variance of the histogram are given by E[e f(t)] = fh(t) V ar[e f(t)] = 1 mhfh(t)(1 −h·fh(t)) (4.15) where fh(t) = 1 h t0+(n+1)h Z t0+nh e f(t) dtfor t∈[t0+nh, to+ (n+ 1)h)(4.16) and the success probability Pnh =hfh(t). Now, let us get the expressions for the estimated renewal density. Using (4.11), the estimated renewal density is obtained by the sum of the pdfs. Thus, the expected value of the estimated renewal density er(t)is [24] E[er(t)] = E[ ∞ X i=1 e fi(t)] = ∞ X i=1 E[e fi(t)] E[er(t)] = ∞ X i=1 fi h(t) = rh(t), (4.17) where rh(t)is the integral of the estimated renewal density over the bin interval in which t is in. Similarly to the expected value (4.17), the variance of the estimated renewal density is defined as V ar[er(t)] = V ar[ ∞ X i=1 fi h(t)] = rh(t).(4.18) However it is not possible to determine it with the same ease. Although the different random variables of the renewal process are iid, the partial sums Snare not because each of them depends on the previous one Sn−1, as it is obtained by just summing the inter-arrival time of the nth event. Thus, the same happens with the estimated pdfs of the partial sums e fn(t). 38 Chapter 5. Twitter traffic analysis parameter βincreases as well, leading to a shift in the distribution, and hence, less overlap between the distribution, resulting in a lower chance for false alarms or false negatives. 5.2. Periodic events detection 39 0 2000 4000 6000 8000 10000 12000 14000 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 Inter−arrival time [s] er(t) (a) Empirical renewal density er(t) 0 2000 4000 6000 8000 10000 12000 0 0.02 0.04 0.06 0.08 0.1 0.12 0.14 Inter−arrival time [s] er′ (t) (b) Convolution renewal density er0(t) 0 2000 4000 6000 8000 10000 12000 −0.08 −0.06 −0.04 −0.02 0 0.02 0.04 0.06 Inter−arrival time [s] e(t) (c) Difference e(t) 0 2000 4000 6000 8000 10000 12000 14000 −60 −50 −40 −30 −20 −10 0 10 20 30 Inter−arrival time [s] E(t)[#inter-arr x sec] (d) Cumulative difference E(t) Figure 5.1: er(t),er0(t),e(t)and E(t)of traffic with the keyword surf and maximum pdf order estimated 1,000. 40 Chapter 5. Twitter traffic analysis Figure 5.2: Design of Periodic Events Detection System Figure 5.3: Example of central and non-central χ2distributions. The solid line corresponds to the central distribution with 5degrees of freedom, while the dashed line is the non-central distribution with 5degrees of freedom and a shift parameter β= 10. Chapter 6 Experimental results The aims of this thesis are (i) to determine how correlated the traffic in Twitter corresponding to a certain keyword is and (ii) detection of periodic events overlying on the traffic. Different types of keywords have been used to collect data from Twitter in our experiments. We have classified them into three categories: a) ’General’, b) ’Events’ and c) ’Trending Topic’. The first set of keywords corresponds to general words that can be used in multiple topics. The second group consists of keywords related to social events and the third one are trending topics, which Twitter ranks and publishes on its webpage. In Table 6, a classification of the used keywords we chose according to their type is shown. Messages in the ’Events’ category were collected during the event, as well as immediately following it. For each of those keywords, er(t)and er0(t)are calculated and the bin size of the empirical version is optimized as explained in Section 4.4.1. General Events Trending topics bbc lakers #shedidntcallbecause blue #supercopa #dospalabras deals Warped Tour #iwannaslap #nikon pirates #tooYoungForYouBro piano #ows #KimKWedding run #iSad #oneofthesedays surf #youknowbetter viagra Table 6.1: Keywords classification. 41 42 Chapter 6. Experimental results Some characteristic values for each keyword are summarized in Table 6. Specifically, the total number of tweets collected, the period of time during which the collection was performed and the average data rate, which is used to normalize the time values in Section 6.1. Keyword #Tweets ∆Time [s] Rate [10−3tweets/s] bbc 3,600 13,542 273.15 blue 162,394 113,411 1,431.9 deals 231,470 499,296 463.59 #shedidntcallbecause 30,359 40,990 740.64 #dospalabras 69,069 229,854 300.49 #iwannaslap 1784 171,673 10.39 lakers 92,789 134,372 690.54 #nikon 2,391 345,688 6.92 piano 270,379 991,632 272.66 pirates 14,151 585,831 24.16 run 176,721 77,439 2,282.07 #supercopa 43,835 902,940 48.55 surf 8,428 79,079 106.58 #tooYoungForYouBro 44,016 21,380 2,058.75 viagra 13,036 312,900 41.66 WarpedTour 14,761 366,211 40.31 #ows 163,929 206,441 794.07 #oneofthesedays 127,744 66,126 1914.46 #KimKWedding 65,853 33,323 106.36 #iSad 116,372 41,247 2821.34 #youknowbetter 163,929 312,900 1976.2 Table 6.2: Details of each collected data: number of tweets, collection time and rate. 6.1 Background traffic analysis results The term ’background traffic’ refers to the resulting traffic when anomalies are not considered. As detailed in Section 5.1, the difference between both estimations er(t)and er0(t), denoted as e(t), and the cumulative error, E(t), are calculated and used to determine the memory in the sequence of inter-arrival times. Figure 6.1, shows for each of the keywords the maximum value of E(t)and its position, which is normalized by the average data rate. 6.1. Background traffic analysis results 43 0123456789 x 105 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 bbc youKnowBetter deals didntcall dospalabras iwannaslap lakers nikon blue piano pirates run supercopa surf iSad tooyoung warpedTour oneofthesedays viagra ows wedding Inter−arrival time x rate [tweets] Emax Figure 6.1: Maximum value of E(t)versus the normalized position for each keyword. With those results, three zones can be differentiated with ease. The lower value ones (’+’ symbol) correspond to the more random traffic; the middle zone (squares) have some more correlation, while the upper zone (circles) is for the more correlated ones. The ’General’ type keywords have a memoryless behavior, which was expected as each user posts a tweet containing the keyword in a wide range of different topics. In contrast, keywords associated with events have a higher correlation as they are influenced by other messages in the stream as well as specific occurrences within the event (for example, multiple messages may be sent if a goal is scored in a soccer game). However, Warped Tour and pirates are in the middle zone. This is due to the fact that their rate is very low, which indicates that the posted tweets are not very dependent on each other. Finally, the ’Trending topics’ type are distributed in all the zones. Analyzing the text and users of the tweets, it is possible to find thematic bursts in the correlated ones, while tweets seem independent in the rest. In Appendix B, all the figures for difference e(t)and the cumulative difference E(t)for each used keyword are shown. 44 Chapter 6. Experimental results In order to determine if the values of Emax have a dependence with the window size, we have analyzed the value of Emax for time periods of 5,10,15,20,25,30,45 and 60 minutes. Note that the rate of each keyword stream is different. Thus, in order to set a certain time window, the maximum order (or window size) for each keyword in each time window is different and computed using the keyword rate with a simple operation: Max_order =time xrate. The results show that there is no window dependency as the maximum value of the cumulative difference converges, as shown in Figure 6.2. Thus, once Emax has converged, all the information of the process has been obtained. In other words, there is no correlation between inter-arrivals so the difference between estimations remains constant and, thus, the maximum cumulative difference remains constant as well. At the end, the window effect produces a different tail shape. However, for lower inter-arrival times, a transient part is observed with two main different behaviors: ascending and descending. The descending evolution can be observed in cases with low correlation level as shown in Figure 6.2(a) obtained with the keyword pirates. A higher Emax for low orders indicates that the convolution estimation overestimates the inter-arrival time. This effect appears due to the fact that the mean of the pdfs is lower than the expected value determined by the convolution estimation. Hence, the pdfs are closer, resulting in a higher value. Thus, observing really small time periods, a certain correlation can be detected. This case is possible when, for example, an influent user posts and right after it, a small burst of correlated tweets with the first one are posted by other users. This would cause the appearance of correlation for low inter-arrival times. On the other hand, an ascending evolution appears in more correlated streams as displayed in Figure 6.2(b). If low orders are evaluated, the empirical estimation is closer to the convolution estimation, which implies a lower correlation level. As higher orders are taken into consideration, the pdfs estimated using convolution are more dispersed, resulting in a lower cumulative difference value. A simple example that produces this effect is the presence of bursts or a influent user, as seen in Figure 6.3. As explained before, the pdf of first order is the same for both estimations. Once this one is obtained, the convolution estimation will obtain the higher orders using the n-fold convolutions. Thus, in the convolution based estimation having multiple consecutive inter-arrivals with time THis possible while such events cannot be observed in the empirical distribution. Hence, as the pdfs are normalized, a lower value is obtained in the convolution estimation due to the fact that the pdfs are expanded. 6.2. Periodic events detection results 45 0 500 1000 1500 2000 2500 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [min] Emax [#inter−arrivals x sec] (a) Descending Emax for #nikon. 0 100 200 300 400 500 600 700 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [min] Emax [#inter−arrivals x sec] (b) Ascending Emax for pirates. Figure 6.2: Different types of evolution of Emax using different maximum time window sizes. Figure 6.3: Example of a real situation in which Emax would increase as the maximum time window size increases. 6.2 Periodic events detection results For the periodic event detection, only keywords with over 5000 tweets have been tested to ensure the convergence of the histogram. As explained in Section 5.2, the Pearson’s Chi- Squared test performs the detection method. We select T=Nbins/2in order to compute the trimmed mean in an interval equal to the sub-density and Trim = 35% as it gives a more robust behavior [24]. Some keywords are widely used by spammers, i.e., spam appears interspersed with the background traffic. Figure 6.4(a) shows the empirical renewal density estimation with this periodic traffic, obtained with the keyword viagra. Note that in some cases (e.g., as in Fig. 6.4) the volume of spam is so significant that it is easy to detect. However, our method can detect the presence of spam even in cases where the volume of spam messages is relatively low. For example our algorithm has detected the presence of spam traffic under the keyword #nikon, 46 Chapter 6. Experimental results which cannot clearly be seen from observing the renewal density plot or the difference e(t) plot shown in Fig. 6.4(b), but was confirmed by observing the messages’ text. No periodic events have been detected for the other keywords. 0 0.5 1 1.5 2 2.5 3 x 104 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 0.01 0.015 0.02 Inter−arrival time [s] e(t) (a) Difference e(t)of keyword viagra 0 2 4 6 8 10 12 14 16 18 x 104 −0.035 −0.03 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 0.01 Inter−arrival time [s] e(t) (b) Difference e(t)of keyword #nikon Figure 6.4: Difference e(t)of keywords viagra and #nikon with overlaying spam. Chapter 7 Conclusion "Everything has an ending... for good or for bad" In this thesis we approach the information extraction from Twitter’s traffic about the memory in the sequence of inter-arrival times using renewal theory, and use this also to detect periodic events in the stream. Three types of keywords have been used in order to obtain different testing scenarios and evaluating the presented method, which consists in the classification of different data sets depending on the maximum value of the cumulative difference between the convolution renewal density estimation and the empirical renewal density estimation. We note that most of the techniques considered to date do not make use of tweet timing information, or more specifically, they do not study how the relative timing of tweets can provide useful information about the corresponding message streams. The key novelty of our work is to use timing information to detect the presence of spam (since spam messages are more likely to be posted in regular intervals) and to infer the level of interaction between users. To the best of our knowledge, we are the first to consider twitter message timing information for these purposes. In addition to uncovering new types of information from twitter data, timing based techniques have the advantage of being relatively low cost and of being amenable to efficient data downsampling [2]. All the data collected from Twitter thought its API has been processed, obtaining the empirical renewal density as well as the convolution renewal density estimations. However, some aspects of the acquisition system are yet unknown as no access to Twitter’s distribution system or any information about its internal behavior is provided. With the cumulative difference of the estimations, we get a maximum value that is used as a memory indicator. 47 54 List of Tables Appendix A Empirical Renewal Density ans Convolution Renewal Density Estimations, Difference and Cumulative Difference In this section, the different empirical and convolution renewal densities, difference between them and the cumulative difference for each keyword are displayed, specifying the window size used. Those histograms are the ones used to analyze the traffic in sections 6.1 and 6.2. 55 56 Appendix A. Empirical Renewal Density ans Convolution Renewal Density Estimations, Difference and Cumulative Difference 0 500 1000 1500 2000 2500 3000 3500 4000 4500 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 0.4 0.45 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 500 1000 1500 2000 2500 3000 3500 4000 4500 0 0.05 0.1 0.15 0.2 0.25 0.3 0.35 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 500 1000 1500 2000 2500 3000 3500 4000 4500 −0.1 −0.05 0 0.05 0.1 0.15 0.2 0.25 Inter−arrival time [s] e(t) (c) Difference between estimations e(t) 0 500 1000 1500 2000 2500 3000 3500 4000 4500 −60 −50 −40 −30 −20 −10 0 10 Inter−arrival time [s] E(t)[#inter-arr x sec] (d) Cumulative difference E(t) Figure A.1: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t), difference e(t)and cumulative difference E(t)of keyword bbc and window size 1,000. 57 0 500 1000 1500 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 100 200 300 400 500 600 700 800 900 0 0.5 1 1.5 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 100 200 300 400 500 600 700 800 900 −0.8 −0.6 −0.4 −0.2 0 0.2 0.4 0.6 Inter−arrival time [s] e(t) (c) Difference between estimations e(t) 0 500 1000 1500 −50 −40 −30 −20 −10 0 10 20 30 Inter−arrival time [s] E(t)[#inter-arr x sec] (d) Cumulative difference E(t) Figure A.2: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t) of keyword blue and window size 1,000. 58 Appendix A. Empirical Renewal Density ans Convolution Renewal Density Estimations, Difference and Cumulative Difference 0 500 1000 1500 2000 2500 3000 3500 4000 4500 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 500 1000 1500 2000 2500 3000 3500 4000 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 500 1000 1500 2000 2500 3000 3500 4000 −0.2 −0.15 −0.1 −0.05 0 0.05 0.1 0.15 0.2 0.25 0.3 Inter−arrival time [s] e(t) (c) Difference between estimations e(t) 0 500 1000 1500 2000 2500 3000 3500 4000 4500 −80 −60 −40 −20 0 20 40 Inter−arrival time [s] E(t)[#inter-arr x sec] (d) Cumulative difference E(t) Figure A.3: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t) of keyword deals and window size 1,000. 59 0 1000 2000 3000 4000 5000 6000 7000 0 0.2 0.4 0.6 0.8 1 1.2 1.4 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 200 400 600 800 1000 1200 1400 1600 1800 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 200 400 600 800 1000 1200 1400 1600 1800 −0.6 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 Inter−arrival time [s] e(t) (c) Difference between estimations e(t) 0 1000 2000 3000 4000 5000 6000 7000 −100 −50 0 50 100 150 200 250 Inter−arrival time [s] E(t)[#inter-arr x sec] (d) Cumulative difference E(t) Figure A.4: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t) of keyword #shedidntcallbecause and window size 1,000. 60 Appendix A. Empirical Renewal Density ans Convolution Renewal Density Estimations, Difference and Cumulative Difference 0 1 2 3 4 5 6 7 8 x 104 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 −0.3 −0.2 −0.1 0 0.1 0.2 0.3 0.4 0.5 0.6 Inter−arrival time [s] e(t) (c) Difference between estimations e(t) 012345678 x 104 −100 0 100 200 300 400 500 Inter−arrival time [s] E(t)[#inter-arr x sec] (d) Cumulative difference E(t) Figure A.5: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t) of keyword #dospalabras and window size 1,000. 61 0 1 2 3 4 5 6 7 8 x 104 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 x 104 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 0.09 0.1 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 5 x 104 −0.06 −0.05 −0.04 −0.03 −0.02 −0.01 0 0.01 0.02 0.03 Inter−arrival time [s] e(t) (c) Difference between estimations e(t) 0 1 2 3 4 5 6 7 8 x 104 −80 −70 −60 −50 −40 −30 −20 −10 0 10 Inter−arrival time [s] E(t)[#inter-arr x sec] (d) Cumulative difference E(t) Figure A.6: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t) of keyword #iwannaslap and window size 500. 62 Appendix A. Empirical Renewal Density ans Convolution Renewal Density Estimations, Difference and Cumulative Difference 0 0.5 1 1.5 2 2.5 x 104 0 1 2 3 4 5 6 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 500 1000 1500 2000 2500 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 500 1000 1500 2000 2500 −1 0 1 2 3 4 5 Inter−arrival time [s] e(t) (c) Difference between estimations e(t) 0 0.5 1 1.5 2 2.5 x 104 −200 −100 0 100 200 300 400 500 Inter−arrival time [s] E(t)[#inter-arr x sec] (d) Cumulative difference E(t) Figure A.7: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t) of keyword lakers and window size 1,000. 63 0 2 4 6 8 10 12 14 16 18 x 104 0 0.002 0.004 0.006 0.008 0.01 0.012 0.014 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 2 4 6 8 10 12 14 16 18 x 104 0 0.005 0.01 0.015 0.02 0.025 0.03 0.035 0.04 0.045 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 2 4 6 8 10 12 14 16 18 x 104 −0.035 −0.03 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 0.01 Inter−arrival time [s] e(t) (c) Difference between estimations e(t) 0 2 4 6 8 10 12 14 16 18 x 104 −35 −30 −25 −20 −15 −10 −5 0 5 Inter−arrival time [s] E(t)[#inter-arr x sec] (d) Cumulative difference E(t) Figure A.8: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t) of keyword #nikon and window size 1,000. 70 Appendix A. Empirical Renewal Density ans Convolution Renewal Density Estimations, Difference and Cumulative Difference 0 0.5 1 1.5 2 2.5 3 3.5 4 x 104 0 0.01 0.02 0.03 0.04 0.05 0.06 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 0.5 1 1.5 2 2.5 3 x 104 0 0.01 0.02 0.03 0.04 0.05 0.06 0.07 0.08 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 0.5 1 1.5 2 2.5 3 x 104 −0.025 −0.02 −0.015 −0.01 −0.005 0 0.005 0.01 0.015 0.02 Inter−arrival time [s] e(t) (c) Difference between estimations e(t) 0 0.5 1 1.5 2 2.5 3 3.5 4 x 104 −70 −60 −50 −40 −30 −20 −10 0 10 20 30 Inter−arrival time [s] E(t)[#inter-arr x sec] (d) Cumulative difference E(t) Figure A.15: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t) of keyword viagra and window size 1,000. 71 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 0 0.5 1 1.5 2 2.5 3 3.5 4 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 0 0.5 1 1.5 2 2.5 3 3.5 4 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 −2 −1.5 −1 −0.5 0 0.5 1 Inter−arrival time [s] e(t) (c) Difference between estimations e(t) 0 1000 2000 3000 4000 5000 6000 7000 8000 9000 −60 −50 −40 −30 −20 −10 0 10 20 30 40 Inter−arrival time [s] E(t)[#inter-arr x sec] (d) Cumulative difference E(t) Figure A.16: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t) of keyword #iSad and window size 1,000. 72 Appendix A. Empirical Renewal Density ans Convolution Renewal Density Estimations, Difference and Cumulative Difference 0 1000 2000 3000 4000 5000 6000 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 200 400 600 800 1000 1200 1400 1600 1800 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 1000 2000 3000 4000 5000 6000 −0.7 −0.6 −0.5 −0.4 −0.3 −0.2 −0.1 0 0.1 0.2 Inter−arrival time [s] e(t) (c) Difference between estimations e(t) 0 1000 2000 3000 4000 5000 6000 −80 −60 −40 −20 0 20 40 60 80 100 120 Inter−arrival time [s] E(t) (d) Cumulative difference E(t) Figure A.17: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t) of keyword #ows and window size 1,000. 73 0 200 400 600 800 1000 1200 1400 1600 1800 2000 0 0.5 1 1.5 2 2.5 3 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 100 200 300 400 500 600 700 0 0.5 1 1.5 2 2.5 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 100 200 300 400 500 600 700 −1.5 −1 −0.5 0 0.5 1 Inter−arrival time [s] e(t) (c) Difference between estimations e(t) 0 200 400 600 800 1000 1200 1400 1600 1800 2000 −100 −50 0 50 100 150 Inter−arrival time [s] E(t)[#inter-arr x sec] (d) Cumulative difference E(t) Figure A.18: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t) of keyword #youknowbetter and window size 1,000. 74 Appendix A. Empirical Renewal Density ans Convolution Renewal Density Estimations, Difference and Cumulative Difference 0 500 1000 1500 2000 2500 3000 3500 4000 4500 0 0.5 1 1.5 2 2.5 3 3.5 4 4.5 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 100 200 300 400 500 600 700 800 900 0 0.5 1 1.5 2 2.5 3 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 100 200 300 400 500 600 700 800 900 −2 −1.5 −1 −0.5 0 0.5 1 1.5 2 2.5 Inter−arrival time [s] e(t) (c) Difference between estimations e(t) 0 500 1000 1500 2000 2500 3000 3500 4000 4500 −100 −50 0 50 100 150 200 250 300 350 Inter−arrival time [s] E(t)[#inter-arr x sec] (d) Cumulative difference E(t) Figure A.19: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t) of keyword #oneofthesedays and window size 1,000. 75 0 2 4 6 8 10 12 x 104 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 Inter−arrival time [s] er(t) (a) Empirical Renewal Density er(t) 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 x 104 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 Inter−arrival time [s] er′ (t) (b) Convolution Renewal Density er0(t) 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 x 104 −0.2 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 Inter−arrival time [s] e(t) (c) Empirical Renewal Density er(t) 0 0.2 0.4 0.6 0.8 1 1.2 1.4 1.6 1.8 2 x 104 −200 −100 0 100 200 300 400 500 600 Inter−arrival time [s] E(t) (d) Cumulative difference E(t) Figure A.20: Renewal Densities er(t)and er0(t), difference e(t)and cumulative difference E(t) of keyword #KimKWedding and window size 1,000. 76 Appendix A. Empirical Renewal Density ans Convolution Renewal Density Estimations, Difference and Cumulative Difference Appendix B Maximum Cumulative Difference for Different Time Windows In this section, the maximum value of the cumulative difference obtained for different maximum orders normalized to a time domain for each keyword are displayed. 0 50 100 150 200 250 300 350 400 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [min] Emax [#inter−arrivals x sec] Figure B.1: Evolution of Emax for bbc. 0 20 40 60 80 100 120 140 160 180 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [min] Emax [#inter−arrivals x sec] Figure B.2: Evolution of Emax for blue. 77 78 Appendix B. Maximum Cumulative Difference for Different Time Windows 0 50 100 150 200 250 300 350 400 450 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [min] E [#inter−arrivals x sec]max Figure B.3: Evolution of Emax for #shedidntcallbecause. 0 50 100 150 200 250 300 350 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [min] Emax [#inter−arrivals x sec] Figure B.4: Evolution of Emax for deals. 0 100 200 300 400 500 600 700 800 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [min] Emax [#inter−arrivals x sec] Figure B.5: Evolution of Emax for #dospalabras. 0 10 20 30 40 50 60 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [min] Emax [#inter−arrivals x sec] Figure B.6: Evolution of Emax for #iSad. 79 0 100 200 300 400 500 600 700 800 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [min] Emax [#inter−arrivals x sec] Figure B.7: Evolution of Emax for #iwannaslap. 0 20 40 60 80 100 120 140 160 180 200 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [min] Emax [#inter−arrivals x sec] Figure B.8: Evolution of Emax for lakers. 0 500 1000 1500 2000 2500 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [min] Emax [#inter−arrivals x sec] Figure B.9: Evolution of Emax for #nikon. 0 10 20 30 40 50 60 0 0.1 0.2 0.3 0.4 0.5 0.6 0.7 0.8 0.9 1 Inter−arrival time [min] Emax [#inter−arrivals x sec] Figure B.10: Evolution of Emax for #oneofthesedays. 86 Bibliography [32] S. Narang, “Compress sensing of public opinion in a social network using ising model,” 2009. [33] K. J. Liszka, C.-C. Chan, C. Shekar, and S. Wakade, “Detecting pharmaceutical spam in microblog messages.” [34] S. K. Narang and A. Ortega, “Lifting based wavelet transforms on graphs.” [35] D. R. Cox, Renewal Theroy. David Roxbee Cox, 1962.