Abstract:
A method for generating hypotheses in a corpus of data comprises selecting a form of ontology; coding the corpus of data based on the form of the ontology; generating ontology space based on coding results and the ontology; transforming the ontology space into a hypothesis space by grouping hypotheses; weighing hypotheses included in the hypothesis space; and applying a science-based sorting algorithm configured to model a science-based treatment of the weighted hypotheses.

Description:
CROSS-REFERENCE TO RELATED APPLICATION 
       [0001]    The present application claims priority to U.S. Provisional Patent Application Ser. No. 61/927,532 entitled SYSTEM, METHOD, AND STORAGE MEDIUM FOR GENERATING HYPOTHESES IN DATA SETS filed on Jan. 15, 2014, the entirety of which is incorporated by reference hereby. 
     
    
     BACKGROUND 
       [0002]    1. Field of the Present Disclosure 
         [0003]    This present disclosure relates generally to a system, method, and storage medium for data analysis. 
         [0004]    2. Background Discussion 
         [0005]    The total amount of digital information on global networks is increasing exponentially. The service and information provided by the networks have grown from just emails to discussion forums, instant messaging, news reporting, content sharing, social networking, online shopping, publication, library, opinion polling, cloud services, and so on. A human is not capable of reviewing every piece of information from this sea of information and quickly identifying all relevant data for a given subject or project. Technologies employing artificial intelligence have been developed to ease the data mining and reviewing tasks to assist human users and digital agents to quickly discover relevant data from large data sets, knowledge stores, and associated computer networks. 
         [0006]    The demand for processing large amounts of digital data in real time is particularly heightened in the area of national security. Agencies faced with on-going digital and physical threats from various parts of the world are tasked with warning communities before an attack, implementing emergency preparedness, securing borders and transportation arteries, protecting critical infrastructure and key assets, and defending against catastrophic terrorism. What is most critical to achieve these tasks is an agency&#39;s capability to detect potential attacks early on and monitor such plots continuously before they are carried out. The data on global networks can potentially give an information seeking organization all the information they need. However, the key question is how to effectively and carefully sort and search vast amount of data. 
         [0007]    Similar demands also exist in other surveillance areas including public health, public opinion, consumer products, and morale. 
         [0008]    Current practices in identifying information of interest from a large amount of data includes the use of keyword searches to look for specific information, the use of Bayesian classifiers to divide information, and the use of logistic regression to look for risk factors of predefined or desired outcomes. These practices, by their nature, however cannot identify surprises, latest developments, or novel plots because these searches rely on a human conceived and defined set of interests or knowledge that a computer-aided search treats as a priori knowledge. This pre-set boundary limits the capability of a search to detect and identify unexpected events. 
       SUMMARY 
       [0009]    To overcome the issues associated with current hypothesis generation techniques, the present disclosure presents a computer implemented method that allows the data itself to define a space of possible hypotheses, which optionally merges and groups similar hypotheses, and then weights and selects a subset of relevant hypotheses for further consideration by a human analyst. The computerized method uses a theoretical and physical basis to implement hypothesis generation. Specifically, a simulated annealing technique is applied and provides an understood, validated theoretical construct by which the problem of hypothesis generation can be solved. A weighing algorithm is applied that expresses the goal as an optimization problem. Moreover, this end-to-end approach is easily communicated due to the physics-based analogue, which is applicable to textual, audio, and video data, executable in real time or near-real time, and scalable to realistic applications. The method is also domain agnostic; namely, the method is generalized and interoperable among various systems or domains. 
         [0010]    According to some embodiments, disclosed is a method for generating hypotheses in a corpus of data. The method comprises selecting a form of ontology configured as one or more ontology vectors; coding the corpus of data based on the form of the ontology vector; generating an ontology space based on coding results and the ontology form; transforming the ontology space into a hypothesis space by grouping hypotheses; weighing the hypotheses included in the hypothesis space; and applying a random-walk process configured to model a physics-based treatment process to the weighing results of the hypotheses. 
         [0011]    According to another embodiment, the random-walk process is configured as a simulated annealing process. 
         [0012]    According to yet another embodiment, the ontology space and the hypothesis space are fully computer-generated. 
         [0013]    According to yet another embodiment, a hypothesis surface of the hypothesis space includes troughs whose depth indicates relevancy of a hypothesis neighborhood. 
         [0014]    According to yet another embodiment, the method further comprises presenting a color map associated with the hypothesis space whose color brightness indicates the relevancy of a hypothesis neighborhood. 
         [0015]    According to yet another embodiment, the method further comprises presenting an R-dimensional space representation projected onto a lower dimensional space, namely, an S-dimensional space where S&lt;R. 
         [0016]    According to yet another embodiment, the method further comprises identifying global minima as the relevant hypothesis or hypotheses. 
         [0017]    According to yet another embodiment, the random-walk process is applied repeatedly with an increased hop-distance each time. 
     
    
     
       BRIEF DESCRIPTION OF DRAWINGS 
         [0018]    To the accomplishment of the foregoing and related ends, certain illustrative embodiments of the invention are described herein in connection with the following description and the annexed drawings. These embodiments are indicative, however, of but a few of the various ways in which the principles of the invention may be employed and the present application is intended to include all such aspects and their equivalents. Other advantages, embodiments and novel features of the invention may become apparent from the following description of the present invention when considered in conjunction with the drawings. The following description, given by way of example, but not intended to limit the present invention solely to the specific embodiments described, may best be understood in conjunction with the accompanying drawings, in which: 
           [0019]      FIG. 1  illustrates an embodiment of a network. 
           [0020]      FIG. 2  illustrates an embodiment of a computer device. 
           [0021]      FIG. 3  illustrates an embodiment of a corpus of information. 
           [0022]      FIG. 4(   a ) illustrates an embodiment of ontology. 
           [0023]      FIG. 4(   b ) illustrates another embodiment of ontology. 
           [0024]      FIG. 5  illustrates an embodiment of a hypothesis generation method. 
           [0025]      FIG. 6  illustrates an embodiment of ontology space. 
           [0026]      FIG. 7  illustrates an embodiment of ontology space. 
           [0027]      FIG. 8  illustrates an embodiment of a hypothesis space. 
           [0028]      FIG. 9  illustrates an embodiment of a hypothesis space. 
           [0029]      FIG. 10  illustrates an embodiment of a ranked hypothesis space. 
           [0030]      FIG. 11  illustrates an embodiment of a color map of a hypothesis space. 
           [0031]      FIG. 12  illustrates an embodiment of a hypothesis surface indicating weighted hypothesis space. 
           [0032]      FIG. 13  illustrate an embodiment of a cycle of a simulated annealing process. 
           [0033]      FIG. 14  illustrates an embodiment of a cycle of a simulated annealing process. 
           [0034]      FIG. 15  illustrates an embodiment of a result of a simulated annealing process. 
       
    
    
     DETAILED DESCRIPTION 
       [0035]    Those of ordinary skill in the art will realize that the description of the present application is illustrative only and not in any way limiting. Other embodiments of the invention will readily suggest themselves to such skilled persons, having the benefit of this disclosure. Reference will be made in detail to specific implementations of the present application as illustrated in the accompanying drawings. 
         [0036]    Further, certain figures in this specification are flow charts illustrating methods and systems. It will be understood that each block of these flow charts, and combinations of blocks in these flow charts, may be implemented by computer program instructions. These computer program instructions may be loaded onto a computer or other programmable apparatus to produce a machine, such that the instructions which execute on the computer or other programmable apparatus create structures for implementing the functions specified in the flow chart block or blocks. These computer program instructions may also be stored in a computer-readable memory or a storage medium that can direct a computer or other programmable apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory or storage medium produce an article of manufacture including instruction structures which implement the function specified in the flow chart block or blocks. The computer program instructions may also be loaded onto a computer or other programmable apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flow chart block or blocks. 
         [0037]    Accordingly, blocks of the flow charts support combinations of structures for performing the specified functions and combinations of steps for performing the specified functions. It will also be understood that each block of the flow charts, and combinations of blocks in the flow charts, can be implemented by special purpose hardware-based computer systems which perform the specified functions or steps, or combinations of special purpose hardware and computer instructions. 
         [0038]    For example, any number of computer programming languages, such as C, C++, C# (CSharp), Perl, Ada, Ruby, Python, Pascal, SmallTalk, FORTRAN, assembly language, and the like, may be used to implement aspects of the present application. Further, various programming approaches such as procedural, object-oriented or artificial intelligence techniques may be employed, depending on the requirements of each particular implementation. Compiler programs and/or virtual machine programs executed by computer systems generally translate higher level programming languages to generate sets of machine instructions that may be executed by one or more processors to perform a programmed function or set of functions. 
         [0039]    The term “machine-readable medium” or “storage medium” can be understood to include any structure that participates in providing data which may be read by an element of a computer system. Such a medium may take many forms, including but not limited to, non-volatile media, volatile media, and transmission media. Non-volatile media include, for example, optical or magnetic disks and other persistent memory. Volatile media include dynamic random access memory (DRAM) and/or static random access memory (SRAM). Transmission media include cables, wires, and fibers, including the wires that comprise a system bus coupled to processor. Common forms of machine-readable media include, for example, a floppy disk, a flexible disk, a hard disk, a magnetic tape, a compact flash card, a smart media cart, a SMS card, any other magnetic medium, a CD-ROM, a DVD, or any other optical medium. 
         [0040]    The term “ontology” can be understood to represent a formal conceptualization of a particular domain of interests or a definition of an abstract, view of a world a user desires to present. Such conceptualization or abstraction is used to provide a complete or comprehensive description of events, interests, or preferences from the perspective of a user who tries to understand and analyze a body of information. 
         [0041]    The term “hypothesis” can be understood to represent a specific description or example extracted, according to the form of ontology, from a body of information, which are collected to find certain events, interests, or preferences. If ontology is deemed as genus, then a hypothesis may be deemed as species. The content described in a hypothesis may be true, potentially true, potentially false, or false or may be relevant or unrelated to those events, interests, or preferences that are sought by a user. Thus, relevant hypotheses that may be interested by a user need to be detected from all possible hypotheses generated from the body of information. Succinctly stated, a hypothesis makes a statement of a tentative explanation for an observation that can be tested by further investigation. Hypotheses may be true, potentially true, potentially false or false. 
         [0042]      FIG. 1  depicts an exemplary networked environment  100  in which systems and methods, consistent with exemplary embodiments, may be implemented. As illustrated, networked environment  100  may include a content server  110 , a receiver  120 , and a network  130 . The exemplary simplified number of content servers  110 , receivers  120 , and networks  130  illustrated in  FIG. 1  can be modified as appropriate in a particular implementation. In practice, there may be additional content servers  110 , receivers  120 , and/or networks  130 . 
         [0043]    In certain embodiments, a receiver  120  may include any suitable form of multimedia playback device, including, without limitation, a computer, a gaming system, a cable or satellite television set-top box, a DVD player, a digital video recorder (DVR), or a digital audio/video stream receiver, decoder, and player. A receiver  120  may connect to network  130  via wired and/or wireless connections, and thereby communicate or become coupled with content server  110 , either directly or indirectly. Alternatively, receiver  120  may be associated with content server  110  through any suitable tangible computer-readable media or data storage device (such as a disk drive, CD-ROM, DVD, or the like), data stream, file, or communication channel. 
         [0044]    Network  130  may include one or more networks of any type, including a Public Land Mobile Network (PLMN), a telephone network (e.g., a Public Switched Telephone Network (PSTN) and/or a wireless network), a local area network (LAN), a metropolitan area network (MAN), a wide area network (WAN), an Internet Protocol Multimedia Subsystem (IMS) network, a private network, the Internet, an intranet, and/or another type of suitable network, depending on the requirements of each particular implementation. 
         [0045]    One or more components of networked environment  100  may perform one or more of the tasks described as being performed by one or more other components of networked environment  100 . 
         [0046]      FIG. 2  is an exemplary diagram of a computing device  200  that may be used to implement aspects of certain embodiments of the present application, such as aspects of content server  110  or of receiver  120 . Computing device  200  may include a bus  201 , one or more processors  205 , a main memory  210 , a read-only memory (ROM)  215 , a storage device  220 , one or more input devices  225 , one or more output devices  230 , and a communication interface  235 . Bus  201  may include one or more conductors that permit communication among the components of computing device  200 . 
         [0047]    Processor  205  may include any type of conventional processor, microprocessor, or processing logic that interprets and executes instructions. Moreover, processor  205  may include processors with multiple cores. Also, processor  205  may be multiple processors. Main memory  210  may include a random-access memory (RAM) or another type of dynamic storage device that stores information and instructions for execution by processor  205 . ROM  215  may include a conventional ROM device or another type of static storage device that stores static information and instructions for use by processor  205 . Storage device  220  may include a magnetic and/or optical recording medium and its corresponding drive. 
         [0048]    Input device(s)  225  may include one or more conventional mechanisms that permit a user to input information to computing device  200 , such as a keyboard, a mouse, a pen, a stylus, handwriting recognition, touchscreen display, voice recognition, biometric mechanisms, and the like. Output device(s)  230  may include one or more conventional mechanisms that output information to the user, including a display, a projector, an A/V receiver, a printer, a speaker, and the like. Communication interface  235  may include any transceiver-like mechanism that enables computing device/server  200  to communicate with other devices and/or systems. For example, communication interface  235  may include mechanisms for communicating with another device or system via a network, such as network  130  as shown in  FIG. 1 . 
         [0049]    As will be described in detail below, computing device  200  may perform operations based on software instructions that may be read into memory  210  from another computer-readable medium, such as data storage device  220 , or from another device via communication interface  235 . The software instructions contained in memory  210  cause processor  205  to perform processes that will be described later. Alternatively, hardwired circuitry may be used in place of or in combination with software instructions to implement processes consistent with the present application. Thus, various implementations are not limited to any specific combination of hardware circuitry and software. 
         [0050]    A web browser comprising a web browser user interface may be used to display information (such as textual and graphical information) on the computing device  200 . The web browser may comprise any type of visual display capable of displaying information received via the network  130  shown in  FIG. 1 , such as Microsoft&#39;s Internet Explorer browser, Mozilla&#39;s Firefox browser, Apple&#39;s Safari browser, Google&#39;s Chrome browser or any other commercially available or customized browsing or other application software capable of communicating with network  130 . The computing device  200  may also include a browser assistant. The browser assistant may include a plug-in, an applet, a dynamic link library (DLL), or a similar executable object or process. Further, the browser assistant may be a toolbar, software button, or menu that provides an extension to the web browser. Alternatively, the browser assistant may be a part of the web browser, in which case the browser would implement the functionality of the browser assistant. 
         [0051]    The browser and/or the browser assistant may act as an intermediary between the user and the computing device  200  and/or the network  130 . For example, source data or other information received from devices connected to the network  130  may be output via the browser. Also, both the browser and the browser assistant are capable of performing operations on the received source information prior to outputting the source information. Further, the browser and/or the browser assistant may receive user input and transmit the inputted data to devices connected to network  130 . 
         [0052]    Similarly, certain embodiments of the present application described herein are discussed in the context of the global data communication network commonly referred to as the Internet. Those skilled in the art will realize that embodiments of the present application may use any other suitable data communication network, including without limitation direct point-to-point data communication systems, dial-up networks, personal or corporate Intranets, proprietary networks, or combinations of any of these with or without connections to the Internet. 
         [0053]      FIG. 3  illustrates an embodiment of the corpus/body of data/information to be processed by a hypothesis generation method as set forth in the present application. The corpus of data includes a collection of available data sets that may be related to a group, a time period, a political campaign, an economic interest, a personal preference, a geographic area, a social class, or a past/future event. This corpus of data collects all type of data from the global network, either public or private, including digital and non-digital mediums or sources. As shown in  FIG. 3 , exemplary types of collected data include, emails, meta data, phone records, text messages, account information, social network postings and activities, online comments, purchase orders, blogs, GPS data, files shared with public or friends, friend lists in social platforms, and news articles, and so on without limitation. According to an embodiment, the corpus data includes data obtained by scanning from newspaper, printed report, archived files, books, or personal records. The corpus data may also include structured data from transaction logs. This collection of data, in their original form, may or may not be re-organized and every set of data or every piece of data may be treated as a document. 
         [0054]      FIG. 4(   a ) illustrates an embodiment of ontology. According to an embodiment, ontology represents a form of a vector having multiple fields. Depending on user&#39;s interests, each field may be assigned an attribute in a way that the vector represents a conception or an abstraction of a generalized and comprehensive description of human interactions, events, interests, or preferences rather than just a particular event. The attribute value can be generic so as to cover the full set of all possible examples and can be semantic so as to be understandable and interpretable by a machine, such as a computer. Exemplary generic descriptions that may be used to assign to the fields may include subject, verb, object, adjective, adverb, preposition, location, climate, mood, time, interaction, human interaction, interest, preference, as well as any other generic attributes. According to an embodiment, the ontology has a hierarchical structure, each hierarchy having a form of a vector of a matrix. In an alternative embodiment, the ontology does not support a hierarchical structure. 
         [0055]    An ontology space generated based on the ontology vector as shown in  FIG. 4(   a ) represents an N dimensional space with each Field(n) representing one dimension. When N is 1, the ontology space has one dimension, which is readily understood by a human being. When N becomes 2 and 3, the ontology space becomes more complicated, but an analyst can still visualize it and comprehend the ontology space. However, when N is greater than 3, going to 4, 5, or even 100 or more, the ontology space becomes so complex that a human analyst will find it difficult-to-impossible intuitively understand the ontology space. Thus, according to one embodiment of the present application, the N-dimensional space is transferred to a lower R-dimensional space, which may be transferred to an even lower S-dimensional space, where S&lt;R&lt;N. According to an embodiment, the N attributes in the ontology vector as shown in  FIG. 4(   a ) may be separated into R groups, where each group represents one dimension, thus reducing the N-dimensional ontology space into an R-dimensional space. 
         [0056]    According to an embodiment, the ontology vector as shown in  FIG. 4(   a ) is automatically generated by a computer. An analyst may simply input the corpus of information need to be analyzed and allow the machine to run the analysis by itself. The computer may create ontology vectors from the corpus of information without any specific instructions from the analyst. The computer may create abstraction or representation frameworks based on the genre of the information. In this way, a true comprehensive analysis may be applied to the corpus of information without any restriction by targeted interests of an analyst. 
         [0057]      FIG. 4(   b ) illustrates an embodiment of ontology vector. A vector form having three fields such as (subject, verb, object) is used as a form of ontology to detect all data corresponding to the notion “who did what to whom.” More so, such ontology can be, but need not be, produced using strictly automated means using natural language processing tools such as parts of speech taggers. This exemplary ontology can generate many sets of hypotheses in a corpus of information, which may or may not be of particular interest. For example, for an analysis of a set of reports on political violence using the ontology as shown in  FIG. 4(   b ), the following hypotheses may be generated: 
         [0058]    1. “Terrorists kill people” 
         [0059]    2. “AQAP bombs prime minister” 
         [0060]    3. “Late model car with known defect explodes while prime minster riding.” 
         [0061]    Generally speaking, the 1 st  hypothesis is likely a true statement, but it is such an apparent and generic statement that it would not likely attract the attention of a human analyst. Thus, the 1 st  hypothesis is ideally set to a lower priority or rank. The 3 rd  hypothesis is also potentially true and not an apparent point for an analyst. However where the 3 rd  hypothesis is not specifically related to an analyst&#39;s inquiry or interest—for example finding a terrorist threat—its rank would not be high for a human analyst. Among all the three hypotheses, an analyst would pay the most attention to the 2 nd  hypothesis because it is potentially true and not apparent and related to a relatively particular terror attack. Therefore, a hypothesis generation method can be configured not only to generate all hypotheses according to an ontology vector but also rank or weight those hypotheses so as to present the relevant one to a human analyst. 
         [0062]      FIG. 5  illustrates an embodiment of a hypothesis generation method  500 . At block  502 , the system collects and stores all data and information, either digital or non-digital, that could or would have relevant information for a targeted subject of interest, for example terror attacks or extreme weather. The collected data broadly includes any digitized or searchable data, including data from online, manually-input data, scanned and OCR′ed data from non-digital medium including books, print outs, and magnetic tapes, and structured data from transaction logs. Each set or piece of those collected data may be stored as one document or a combination of those data may be treated as a document or recorded or stored in another digital format known in the art. At block  504 , a user defines one or more forms of ontology as an ontology vector(s) for a target subject of interest. For example, a user may use (subject, verb, object) as a form of ontology. According to an embodiment, the forms of ontology are selected by a computer based on the computer&#39;s machine learning experience without any interaction from an analyst or user. It is, however, within the scope of the present application for the ontology to be selected by a user or by a combination of a user and machine learning. 
         [0063]    At block  506 , the system is coded to the collected data according to the attributes assigned to the ontology vectors. The coding may be implemented by humans exclusively or by a computer with human supervision or completely implemented by machines via entity extraction scheme. According to an embodiment, the coding is done for data in different languages and dialects. According to an embodiment, the coding is implemented by parallel computing in which plural machines code the data independently according to techniques known in the art. During the parallel computing process, the corpus of data/information is first mapped onto a platform of multiple machines and then is coded accordingly. 
         [0064]    After the data are coded, at block  508  the system is configured to create an ontology space. The ontology space includes all realizations of ontology that is assembled into an ordered multidimensional object such as a two dimensional object. The complete collection of different ontological combinations is referred to as ontology space. For example, a coding of data may show 100 choices for each field of the ontology vector (subject, verb, object). Then, the ontology space in these data includes 100 3 =1 million distinct events. At block  508  the system also populates the ontology space, in which data are classified according to the ontology of the targeted subject of interest. For example, events in documents contained in the corpus of the subject of interest are assigned to corresponding points in the ontology space. According to an embodiment, at block  508  the system is configured to support weighing or biasing certain events. When only a small number of neighborhoods of the total space are populated, the system can handle such sparse data without difficulty. 
         [0065]    The completeness of the ontology space depends on the expansiveness of the field of the selected ontology vector. If an attribute is conceptualized at a high level, it is likely to create more complete ontology space than a more specific one. For example, an attribute of “climate” could create more hypotheses than an attribute of “temperature.” According to an embodiment, the completeness degree of the ontology is evaluated by comparing results of different ontology selections because the degree or extent to which the ontology is complete depends on the nature of the ontology, i.e., what it was developed to do or the maturity of the work. In the exemplary ontology vector of (subject, verb, object), the set of all distinct (S, V, O) combinations is the set of distinct hypotheses, which explain events regarding human interactions contained in a corpus. The completeness of this (S, V, O) ontology depends on the number of choices for each triple element, whether the (subject, verb, objet) construct is sufficient to describe events of interest, and whether indirect objects are needed to be captured. 
         [0066]    At block  510  the system is configured to create a hypothesis space by transforming the ontology space created in the step  508 . The step  510  groups and merges similar and related concepts in ontology space, transforming the ontology space into an ordered hypothesis space. When the specific values coded out of the data have many choices for one field of ontology, many hypotheses may be very similar. For example, in the (S, V, O) ontology, two hypotheses (group, bombed, bunker) and (group, exploded, bunker) are not distinct events based on security interests. According to an embodiment, the merging process may implement clustering techniques including hierarchies, filters/thresholds, topic models, and conditional random fields as known in the art. According to an embodiment, the hypothesis space represents hypotheses that are grouped by relatedness of concepts, in which grouping/merging related concepts in the neighborhood of one another results in a space where position relates to clusters of similar hypotheses. As a result of the grouping/merging process, the hypothesis space can be intuitively perceived by a human analyst. When plural documents are mapped into hypotheses in a particular neighborhood, then a human analyst viewing this clustering could hypothesize that those types of events might have occurred. 
         [0067]    At block  512 , the system is configured to select relevancy criteria to weighing all the hypotheses. The relevance criteria may be a weighing schema, when applied to the hypotheses, defining a surface in the hypothesis space. The resulting surface has troughs, the depth of which corresponds to hypothesis neighborhood. The depth of the troughs is determined by the weighing schema applied and is interpreted as being related to likelihood of the neighborhood being a relevant set of hypotheses, i.e. the more relevant of the neighborhood, the deeper the trough is. According to an embodiment, the system can be configured to employ a weighing schema, for instance by employing weighting algorithm or module that weighs based on, for example, the frequency of a word or words, parts of speech, thresholding of concepts, and/or exclusions (e.g., excluding proper names or locations). By ranking the relative depths of the resulting N troughs in the hypothesis space, the method can identify a rank list of n, where n is less or equal to N, relevant hypotheses to present to a human analysis for testing. For example, the method may identify the deepest trough, and then the next deepest, and so on. 
         [0068]    At block  514 , the system is configured to apply an optimization algorithm to find the global and/or local minimum or minima of the hypothesis surface. According to an embodiment, the optimization algorithm in addition to simulated annealing includes, among others, Monte Carlo based or genetic algorithm based approaches as known in the art. According to an embodiment, at block  512 , the system is configured to employ a simulated annealing process to find the global and ranked local minima. The simulated annealing process builds an ensemble of simulated annealing runs, each of which corresponds to a random initial point in the hypothesis surface. This simulated annealing process is preferably implemented using parallel computing techniques. The resulting accounting of the N most frequently occupied wells correspond to the rank list of hypotheses potentially explaining the material in the corpus. 
         [0069]    According to an embodiment, the simulated annealing process is configured to model a physical process of heating a solid material and then slowly lowering the temperature. The physical process decreases defects in the material and thus minimizes the system energy. In this application, each iteration of the simulated annealing algorithm entails picking a new random point on the surface of interest. The distance of the new point from the current point, or the extent of a hop along the corrugated surface, is based on a probability distribution function that depends upon “temperature.” The hop is increased from a small distance to a longer one, similarly to the change of temperature in the corresponding physical process. The algorithm accepts all new points that lower the energy, but also, with a finite probability, points that raise the energy. By accepting some points that raise the energy, the algorithm avoids being trapped in local minima in early iterations and is able to explore globally for better solutions by hopping into potentially lower troughs on the surface that can only be accessed after traversing higher features on the surface. 
         [0070]    At block  516 , the system is configured to present the selected hypotheses that are relevant to a particular interest or event to a human analyst. According to an embodiment, the system can present specific hypotheses in a textual format to an analyst. According to an embodiment, the system can present a representation of a hypothesis surface to the analyst. According to an embodiment, the system can present a color map representation of the hypotheses to the analyst. On the color map, an identification number of a hypothesis can associated with a color whose brightness indicates ranking of a hypothesis or relevancy of a neighborhood. 
         [0071]      FIGS. 6-15  illustrate an embodiment of a hypothesis generation method applied to monitoring natural disasters as a target subject of interest. For an ontology defined by where a disaster hits, what the disaster is, and how it produces damage that is of interest, an ontology vector of {where, what, how} is selected as ontology. A system collects and/or data for news reports on disasters caused by storms in a few metropolitan areas. Table I depicts part of a hypothetical corpus of information that could be collected. Table II includes an exemplary computer program used for implementing the method according to an embodiment of the present disclosure. The program in Table II represents an R code. According to an embodiment, the program specifies a hypothetic ontology and generates a hypothetic corpus, hypothetic weights, and a graphical representation of the corresponding weighted hypotheses. Other graphical representations, including heat maps and dendrograms, may also be used. Non-limiting examples of software packages which can readily implement simulated annealing with interpreted languages include: R, Octave, Python, Ruby, and Scilab, Matlab, Mathematica, or other similar programs as known in the art. 
         [0072]    After coding the corpus of data as described herein, possibilities for each of the three elements are detected, shown as: 
         [0073]    Where: Pittsburgh, Carmichaels, New York, Cincinnati, San Francisco 
         [0074]    What: tornado, hurricane, tsunami, storms, earthquake 
         [0075]    How: wind, rain, flooding, lightning, shaking 
         [0076]    Such ontology can produce 125 potential hypotheses, the first 25 of which are shown in  FIG. 6 . The collection of distinct combinations defining these hypotheses can be represented in a one dimensional column of ontological triples. Each hypothesis is assigned an identifier, such as a hypothesis number as shown in  FIG. 6 . 
         [0077]    In another example, when news articles from the Internet are collected and their headlines are processed, not only are the interested elements corresponding to one ontology coded, but other potentially interested elements may also be coded, as shown in  FIG. 7 . The ontology space of the headlines of those articles is shown in  FIG. 8 . According to an embodiment, the ontology codes may be supplemented by other fields an analyst may be interested in. For example, the analyst may also want to know whether the disaster areas belong to urban or rural areas, coded as a “Type of place” field for the ontology vector, as shown in  FIG. 9 . 
         [0078]    The system can be configured to apply one or more weighing criteria. For example, the system can be configured to apply a relatively simple relevancy criterion or criteria, for example, the frequency of occurrences of the different hypotheses in the corpus. When such a criterion is applied, the weights are assigned to corresponding hypotheses.  FIG. 10  shows the weights for the first 24 hypotheses. 
         [0079]    According to an embodiment, the hypothesis space for the entire hypotheses may be represented as a color map, with the brightest color corresponding to the most heavily weighted hypotheses and the darkest color corresponding to the least weighted hypotheses, as shown in  FIG. 11 . In general, the hypothesis space will be m-dimensional, or a projection of the higher-dimensional space (e.g., via PCA or similar) into a simpler or lower-dimensional space representation. 
         [0080]    According to an embodiment, the weighted hypotheses form a hypothesis surface as shown in  FIG. 12 . This hypothesis surface corresponds to a surface with peaks and troughs, where the troughs represent the most highly weighted hypotheses. To apply simulated annealing to find the global minimum of this hypothesis surface, multiple “heating-cooling” cycles may be applied. 
         [0081]    As shown in  FIG. 13 , the simulated annealing process can be thought of as picking a random hypothesis and placing a ball at that location. By heating the system, the process applies energy to the ball and it hops from hypothesis to hypothesis, landing in some trough (cycle  1 ). Additional cycles as shown in  FIG. 14  allow the ball to hop and land into deeper troughs (cycle  2 ), until it does not have enough energy to escape (cycle L, in this example). This is identified as a candidate for the most likely hypothesis. According to an embodiment, plural simulated annealing cycles are made to build up rank list of relevant potential hypotheses. The following is a list of relevant hypotheses selected by this simulated annealing process: 
         [0082]    Hypothesis #91, “Pittsburgh storms lightning” 
         [0083]    Hypothesis #63, “New York tsunami flooding” 
         [0084]    Hypothesis #122, “Carmichaels earthquake shaking” 
         [0085]    Hypothesis #66, “Pittsburgh storms flooding” 
         [0086]    In this example, the conclusion would be that storms had affected Pittsburgh (#91). 
         [0087]    The particular embodiments disclosed above are illustrative only, as the invention may be modified and practiced in different but equivalent manners apparent to those skilled in the art having the benefit of the teachings herein. Furthermore, no limitations are intended to the details of construction or design herein shown, other than as described in the claims below. It is therefore evident that the particular embodiments disclosed above may be altered or modified and all such variations are considered within the scope and spirit of the invention. Although illustrative embodiments of the invention have been described in detail herein with reference to the accompanying drawings, it is to be understood that the invention is not limited to those precise embodiments, and that various changes and modifications can be effected therein by one skilled in the art without departing from the scope and spirit of the invention as defined by the appended claims. 
         [0000]    
       
         
               
               
               
               
               
               
             
           
               
                 TABLE I 
               
               
                   
               
               
                 City 
                 Subject 
                 Cause 
                 Verb 
                 Object 
                 Source 
               
               
                   
               
             
             
               
                 Pittsburgh 
                 tornado 
                 wind 
                 blew  
                 trailorpark 
                 CNN 
               
               
                   
                   
                   
                 dow           
                   
                   
               
               
                 Carmichae           
                 hurricane 
                 rain 
                 washed  
                 house 
                 UPI 
               
               
                   
                   
                   
                 a           
                   
                   
               
               
                 New York 
                 tsunami 
                 flooding 
                 destroyed 
                 sky- 
                 NPR 
               
               
                   
                   
                   
                   
                 scraper           
                   
               
               
                 Cincinnati 
                 storms 
                 light- 
                 burned 
                 tent 
                 CBS 
               
               
                   
                   
                 ning 
                 do           
                   
                   
               
               
                 San Franci           
                 earth- 
                 shaking 
                 leveled 
                 igloo 
                 Bloom- 
               
               
                   
                 quak           
                   
                   
                   
                 berg           
               
               
                   
               
               
                             indicates data missing or illegible when filed 
               
             
          
         
       
     
         [0000]    
       
         
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
               
             
               
             
               
               
               
             
               
             
               
               
               
             
               
             
               
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
               
             
               
             
               
               
             
               
             
           
               
                 TABLE II 
               
               
                   
               
             
             
               
                 rm(list=ls( )) 
               
               
                 # ----- Define a function for plotting a matrix ----- # 
               
               
                 myImagePlot &lt;− function(x, ...){ 
               
             
          
           
               
                   
                 min &lt;− min(x) 
               
               
                   
                 max &lt;− max(x) 
               
               
                   
                 yLabels &lt;− rownames(x) 
               
               
                   
                 xLabels &lt;− colnames(x) 
               
               
                   
                 title &lt;−c( ) 
               
               
                   
                 # check for additional function arguments 
               
               
                   
                 if( length(list(...)) ){ 
               
             
          
           
               
                   
                 Lst &lt;− list(...) 
               
               
                   
                 if( !is.null(Lst$zlim) ){ 
               
             
          
           
               
                   
                 min &lt;− Lst$zlim[1] 
               
               
                   
                 max &lt;− Lst$zlim[2] 
               
             
          
           
               
                   
                 } 
               
               
                   
                 if( !is.null(Lst$yLabels) ){ 
               
             
          
           
               
                   
                 yLabels &lt;− c(Lst$yLabels) 
               
             
          
           
               
                   
                 } 
               
               
                   
                 if( !is.null(Lst$xLabels) ){ 
               
             
          
           
               
                   
                 xLabels &lt;− c(Lst$xLabels) 
               
             
          
           
               
                   
                 } 
               
               
                   
                 if( !is.null(Lst$title) ){ 
               
             
          
           
               
                   
                 title &lt;− Lst$title 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                   
                 } 
               
               
                   
                 # check for null values 
               
               
                   
                 if( is.null(xLabels) ){ 
               
             
          
           
               
                   
                 xLabels &lt;− c(1:ncol(x)) 
               
             
          
           
               
                   
                 } 
               
               
                   
                 if( is.null(yLabels) ){ 
               
             
          
           
               
                   
                 yLabels &lt;− c(1:nrow(x)) 
               
             
          
           
               
                   
                 } 
               
               
                   
                 layout (matrix (data=c(1,2), nrow=1, ncol=2), widths=c(4,1), 
               
             
          
           
               
                 heights=c(1,1)) 
               
             
          
           
               
                   
                 # Red and green range from 0 to 1 while Blue ranges from 1 to 0 
               
               
                   
                 ColorRamp &lt;− rgb( seq(0,1,length=256), # Red 
               
             
          
           
               
                   
                 seq(0,1,length=256), # Green 
               
               
                   
                 seq(1,0,length=256)) # Blue 
               
             
          
           
               
                   
                 ColorLevels &lt;− seq(min, max, length=length(ColorRamp)) 
               
               
                   
                 # Reverse Y axis 
               
               
                   
                 reverse &lt;− nrow(x) : 1 
               
               
                   
                 yLabels &lt;− yLabels[reverse] 
               
               
                   
                 x &lt;− x[reverse,] 
               
               
                   
                 # Data Map 
               
               
                   
                 par(mar = c(3,5,2.5,2)) 
               
               
                   
                 image(1:length(xLabels), 1:length(yLabels), t(x), col=ColorRamp, xlab=“”, 
               
             
          
           
               
                   
                 ylab=“”, axes=FALSE, zlim=c(min,max)) 
               
             
          
           
               
                   
                 if( !is.null(title) ){ 
               
             
          
           
               
                   
                 title(main=title) 
               
             
          
           
               
                   
                 } 
               
               
                   
                 axis(BELOW&lt;−1, at=1:length(xLabels), labels=xLabels, cex.axis=0.7) 
               
               
                   
                 axis(LEFT &lt;−2, at=1:length(yLabels), labels=yLabels, las= HORIZONTAL&lt;−1, 
               
             
          
           
               
                   
                 cex.axis=0.7) 
               
             
          
           
               
                   
                 # Color Scale 
               
               
                   
                 par(mar = c(3,2.5,2.5,2)) 
               
               
                   
                 image(1, ColorLevels, 
               
             
          
           
               
                   
                 matrix(data=ColorLevels, ncol=length(ColorLevels),nrow=1), 
               
               
                   
                 col=ColorRamp, 
               
               
                   
                 xlab=“”,ylab=“”, 
               
               
                   
                 xaxt=“n”) 
               
             
          
           
               
                   
                 layout(1) 
               
             
          
           
               
                 } 
               
               
                 # ----- END plot function ----- # 
               
               
                 #========================================================================= 
               
               
                 =========================================== 
               
               
                 # CODE PART 1: DEVELOP A CORPUS OF DOCUMENTS 
               
               
                 # Define the functions that associate city, event, etc based on 
               
               
                 probabilities 
               
               
                 pick_subject &lt;− function(the_city, Ontology, ProbabilityMatrix){ 
               
             
          
           
               
                   
                 if(the_city == Ontology$City[1]){pick_subject &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Subject, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,1]))} 
               
             
          
           
               
                   
                 else if(the_city == Ontology$City[2]){pick subject &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Subject, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,2]))} 
               
             
          
           
               
                   
                 else if(the_city == Ontology$City[3]){pick_subject &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Subject, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,3]))} 
               
             
          
           
               
                   
                 else if(the_city == Ontology$City[4]){pick_subject &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Subject, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,4]))} 
               
             
          
           
               
                   
                 else if(the_city == Ontology$City[5]){pick_subject &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Subject, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,5]))} 
               
               
                 } 
               
               
                 pick_cause &lt;− function(the_subject, Ontology, ProbabilityMatrix){ 
               
             
          
           
               
                   
                 if(the_subject == Ontology$Subject[1]){pick_cause &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Cause, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,1]))} 
               
             
          
           
               
                   
                 else if(the_subject == Ontology$Subject[2]){pick_cause &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Cause, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,2]))} 
               
             
          
           
               
                   
                 else if(the_subject == Ontology$Subject[3]){pick_cause &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Cause, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,3]))} 
               
             
          
           
               
                   
                 else if(the_subject == Ontology$Subject[4]){pick_cause &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Cause, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,4]))} 
               
             
          
           
               
                   
                 else if(the_subject == Ontology$Subject[5]){pick_cause &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Cause, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,5]))} 
               
               
                 } 
               
               
                 pick_verb &lt;− function(the_cause, Ontology, ProbabilityMatrix){ 
               
             
          
           
               
                   
                 if(the_cause == Ontology$Cause[1]){pick_verb &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Verb, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,1]))} 
               
             
          
           
               
                   
                 else if(the_cause == Ontology$Cause[2]){pick_verb &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Verb, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,2]))} 
               
             
          
           
               
                   
                 else if(the_cause == Ontology$Cause[3]){pick_verb &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Verb, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,3]))} 
               
             
          
           
               
                   
                 else if(the_cause == Ontology$Cause[4]){pick_verb &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Verb, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,4]))} 
               
             
          
           
               
                   
                 else if(the_cause == Ontology$Cause[5]){pick_verb &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Verb, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,5]))} 
               
               
                 } 
               
               
                 pick_object &lt;− function(the_verb, Ontology, ProbabilityMatrix){ 
               
             
          
           
               
                   
                 if(the_verb == Ontology$Verb[1]){pick_object &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Object, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,1]))} 
               
             
          
           
               
                   
                 else if(the_verb == Ontology$Verb[2]){pick_object &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Object, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,2]))} 
               
             
          
           
               
                   
                 else if(the_verb == Ontology$Verb[3]){pick_object &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Object, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,3]))} 
               
             
          
           
               
                   
                 else if(the_verb == Ontology$Verb[4]){pick_object &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Object, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,4]))} 
               
             
          
           
               
                   
                 else if(the_verb == Ontology$Verb[5]){pick_object &lt;− 
               
             
          
           
               
                 as.character(sample(Ontology$Object, 1, replace = TRUE, 
               
               
                 ProbabilityMatrix[,5]))} 
               
               
                 } 
               
               
                 # Read in the ontology, heirarchy, and material to construct news 
               
               
                 headlines 
               
               
                 Ontology &lt;− 
               
               
                 read.csv(“~/Dropbox/Docs/DMH_WhitePapers/2013/EnergyWhitepaper2013/Ontolog 
               
               
                 y2.csv”) 
               
               
                 # Define the probabilities of events and places co-occurring, just to make 
               
               
                 it non-trivial 
               
               
                 p_subject_j_given_city1 &lt;− c(0.25, 0.25, 0.0, 0.45, 0.05) 
               
               
                 p_subject_j_given_city2 &lt;− c(0.25, 0.25, 0.0, 0.25, 0.25) 
               
               
                 p_subject_j_given_city3 &lt;− c(0.3, 0.3, 0.3, 0.05, 0.05) 
               
               
                 p_subject_j_given_city4 &lt;− c(0.2, 0.2, 0.0, 0.2, 0.2) 
               
               
                 p_subject_j_given_city5 &lt;− c(0.2, 0.2, 0.0, 0.2, 0.2) 
               
               
                 ProbMatrixSubjectCity &lt;− cbind(p_subject_j_given_city1, 
               
             
          
           
               
                   
                 p_subject_j_given_city2, 
               
               
                   
                 p_subject_j_given_city3, 
               
               
                   
                 p_subject_j_given_city4, 
               
               
                   
                 p_subject_j_given_city5) 
               
             
          
           
               
                 p_cause_j_given_subject1 &lt;− c(0.25, 0.25, 0.25, 0.25, 0.0) 
               
               
                 p_cause_j_given_subject2 &lt;− c(0.25, 0.25, 0.25, 0.25, 0.0) 
               
               
                 p_cause_j_given_subject3 &lt;− c(0.0, 0.0, 1.0, 0.0, 0.0) 
               
               
                 p_cause_j_given_subject4 &lt;− c(0.2, 0.2, 0.2, 0.40, 0.0) 
               
               
                 p_cause_j_given_subject5 &lt;− c(0.0, 0.0, 0.0, 0.0, 1.0) 
               
               
                 ProbMatrixCauseSubject &lt;− cbind(p_cause_j_given_subject1, 
               
             
          
           
               
                   
                 p_cause_j_given_subject2, 
               
               
                   
                 p_cause_j_given_subject3, 
               
               
                   
                 p_cause_j_given_subject4, 
               
               
                   
                 p_cause_j_given_subject5) 
               
             
          
           
               
                 p_verb_j_given_cause1 &lt;− c(0.5, 0.0, 0.0, 0.0, 0.5) 
               
               
                 p_verb_j_given_cause2 &lt;− c(0.0, 1.0, 0.0, 0.0, 0.0) 
               
               
                 p_verb_j_given_cause3 &lt;− c(0.3333333, 0.3333333, 0.3333333, 0.0, 0.0) 
               
               
                 p_verb_j_given_cause4 &lt;− c(0.0, 0.0, 0.0, 1.0, 0.0) 
               
               
                 p_verb_j_given_cause5 &lt;− c(0.0, 0.0, 0.3333333, 0.3333333, 0.3333333) 
               
               
                 ProbMatrixVerbCause &lt;− cbind(p_verb_j_given_cause1, 
               
             
          
           
               
                   
                 p_verb_j_given_cause2, 
               
               
                   
                 p_verb_j_given_cause3, 
               
               
                   
                 p_verb_j_given_cause4, 
               
               
                   
                 p_verb_j_given_cause5) 
               
             
          
           
               
                 p_object_j_given_verb1 &lt;− c(0.3333333, 0.3333333, 0.0, 0.3333333, 0.0) 
               
               
                 p_object_j_given_verb2 &lt;− c(0.3333333, 0.3333333, 0.0, 0.3333333, 0.0) 
               
               
                 p_object_j_given_verb3 &lt;− c(0.2, 0.2, 0.2, 0.2, 0.2) 
               
               
                 p_object_j_given_verb4 &lt;− c(0.2, 0.2, 0.2, 0.2, 0.2) 
               
               
                 p_object_j_given_verb5 &lt;− c(0.2, 0.2, 0.2, 0.2, 0.2) 
               
               
                 ProbMatrixObjectVerb &lt;− cbind(p_object_j_given_verb1, 
               
             
          
           
               
                   
                  p_object_j_given_verb2, 
               
               
                   
                  p_object_j_given_verb3, 
               
               
                   
                  p_object_j_given_verb4, 
               
               
                   
                  p_object_j_given_verb5) 
               
             
          
           
               
                 # Create a vector of random cities. This is also the number of documents 
               
               
                 in the corpus. 
               
               
                 how_many_cities_sample &lt;− 500 
               
               
                 SampleCity &lt;− as.vector(sample(Ontology$City, how_many_cities_sample, 
               
               
                 replace = TRUE, prob=c(0.4, 0.2, 0.2, 0.1, 0.1))) 
               
               
                 SampleSource &lt;− as.vector(sample(Ontology$Source, how_many_cities_sample, 
               
               
                 replace = TRUE, prob=c(0.2, 0.2, 0.2, 0.2, 0.2))) 
               
               
                 # Create the sample vectors 
               
             
          
           
               
                 SampleSubject 
                 &lt;− 0*c(1:how_many_cities_sample) 
               
               
                 SampleCause 
                 &lt;− 0*c(1:how_many_cities_sample) 
               
               
                 SampleVerb 
                 &lt;− 0*c(1:how_many_cities_sample) 
               
               
                 SampleObject 
                 &lt;− 0*c(1:how_many_cities_sample) 
               
             
          
           
               
                 for(i in 1:how_many_cities_sample){ 
               
             
          
           
               
                   
                 SampleSubject[i] 
                 &lt;− pick_subject(SampleCity[i], Ontology, 
               
             
          
           
               
                 ProbMatrixSubjectCity) 
               
             
          
           
               
                   
                 SampleCause[i] 
                 &lt;− pick_cause(SampleSubject[i], Ontology, 
               
             
          
           
               
                 ProbMatrixCauseSubject) 
               
             
          
           
               
                   
                 SampleVerb[i] 
                 &lt;− pick_verb(SampleCause[i], Ontology, 
               
             
          
           
               
                 ProbMatrixVerbCause) 
               
             
          
           
               
                   
                 SampleObject[i] 
                 &lt;− pick_object(SampleVerb[i], Ontology, 
               
             
          
           
               
                 ProbMatrixObjectVerb) 
               
               
                 } 
               
               
                 # Construct a matrix of headlines 
               
               
                 HeadlineMatrix &lt;− cbind(SampleSource, SampleCity, SampleSubject, 
               
               
                 SampleCause, SampleVerb, SampleObject) 
               
               
                 #========================================================================= 
               
               
                 =========================================== 
               
               
                 # CODE PART 2: CODE THE CORPUS 
               
               
                 # Define an ontology of {where, why, how} 
               
             
          
           
               
                 # 
                 The choices for where include: 5 US places, as contained in the object 
               
             
          
           
               
                 Ontology$City 
               
             
          
           
               
                 # 
                 The choices for why include: 5 reasons, as contained in the object 
               
             
          
           
               
                 Ontology$Subject 
               
             
          
           
               
                 # 
                 The choices for how include: 5 modalities, as contained in the object 
               
             
          
           
               
                 Ontology$Cause 
               
               
                 # Because the corpus was developed from these choices, coding the corpus 
               
               
                 is trivial: 
               
               
                 CodeTriple &lt;− cbind(SampleCity, SampleSubject, SampleCause) 
               
               
                 # Code higher-level attributes, too. For example, coding rural versus 
               
               
                 urban: 
               
               
                 Place &lt;− 0*c(1:how_many_cities_sample) 
               
               
                 for(i in 1:how_many_cities_sample){ 
               
             
          
           
               
                   
                 if(CodeTriple[i,1] == Ontology$City[1]){ Place[i] &lt;− “urban”} # 
               
             
          
           
               
                 Pittsburgh is urban 
               
             
          
           
               
                   
                 else if (CodeTriple[i,1] == Ontology$City[2]){Place[i] &lt;− “rural”} # 
               
             
          
           
               
                 Carmichaels is rural 
               
             
          
           
               
                   
                 else if (CodeTriple[i,1] == Ontology$City[3]){Place[i] &lt;− “urban”} # New 
               
             
          
           
               
                 York is urban 
               
             
          
           
               
                   
                 else if (CodeTriple[i,1] == Ontology$City[4]){Place[i] &lt;− “urban”} # 
               
             
          
           
               
                 Cincinnati is urban 
               
             
          
           
               
                   
                 else if (CodeTriple[i,1] == Ontology$City[5]){Place[i] &lt;− “urban”} # San 
               
             
          
           
               
                 Francisco is urbal 
               
               
                 } 
               
               
                 # Glue on the city to the triple 
               
               
                 CodeTripleMarkup &lt;− cbind(CodeTriple, Place) 
               
               
                 #========================================================================= 
               
               
                 =========================================== 
               
               
                 # CODE PART 3: CREATE THE ONTOLOGY AND HYPOTHESIS SPACES 
               
               
                 OntologySpace &lt;− expand.grid(Ontology$City, Ontology$Subject, 
               
               
                 Ontology$Cause) 
               
               
                 # Compute how many of each possible triple actually occurs 
               
               
                 Repeats &lt;− 0*c(1:length(OntologySpace[,1])) 
               
               
                 for(i in 1:length(OntologySpace[,1])){ 
               
             
          
           
               
                   
                 dummy_sum &lt;− 0 
               
               
                   
                 for (j in 1:length(CodeTriple[,1])){ 
               
             
          
           
               
                   
                 if((OntologySpace[i,1] == CodeTriple[j,1]) &amp; 
               
             
          
           
               
                   
                 (OntologySpace[i,2] == CodeTriple[j,2])&amp; 
               
               
                   
                 (OntologySpace[i,3] == CodeTriple[j,3]) == TRUE){ 
               
             
          
           
               
                   
                 dummy_sum &lt;− dummy_sum + 1 
               
             
          
           
               
                   
                 } 
               
               
                   
                 Repeats[i] &lt;− dummy_sum 
               
             
          
           
               
                   
                 } 
               
             
          
           
               
                 } 
               
               
                 OntologySpaceFrequency &lt;− cbind(OntologySpace, Repeats) 
               
               
                 # Then think about making contour plots or 3D plots of any two of the 
               
               
                 three dimensions of the resulting space. 
               
               
                 mRepeats &lt;− matrix(Repeats, 125, 3) 
               
               
                 myImagePlot(mRepeats) 
               
               
                 myImagePlot(1.01**(mRepeats)) 
               
               
                 # LOOK AT DEFINING A BETTER COLOR MAP, OR&lt; SAY&lt; ADD 1 AND TAKE LOG OF 
               
               
                 FREQUENCY DATA 
               
             
          
           
               
                 # 
                 TO IMPROVE VISUAL DYNAMIC RANGE 
               
             
          
           
               
                 plot(c(1:length(mRepeats[,1])), −mRepeats[,1], type=“1”, 
               
               
                 xlab=c(“Hypothesis number”)) 
               
               
                 #heatmap(mRepeats) 
               
               
                 #aaa &lt;− 1+mRepeats 
               
               
                 #aaa &lt;− matrix(aaa, 15, 25) 
               
               
                 #heatmap(aaa) 
               
               
                 #heatmap.2(aaa, col=redgreen(75), scale=“row”, key=T, keysize=1.5, 
               
               
                 density.info=“none”, trace=“none”,cexCol=0.9, labRow=NA)