A Proposal For COVID-19 Applications Enabling Extensive Epidemiological Studies

During the next phase of COVID-19 outbreak, mobile applications could be the most used and proposed technical solution for monitoring and tracking, by acquiring data from subgroups of the population. A possible problem could be data fragmentation, which could lead to three harmful effects: i) data could not cover the minimum percentage of the people for monitoring efficacy, ii) it could be heavily biased due to different data collection policies, and iii) the app could not monitor subjects moving across different zones or countries. A common approach could solve these problems, defining requirements for the selection of observed data and technical specifications for the complete interoperability between different solutions. This work aims to integrate the international framework of requirements in order to mitigate the known issues and to suggest a method for clinical data collection that ensures to researchers and public health institution significant and reliable data. First, we propose to identify which data is relevant for COVID-19 monitoring through literature and guidelines review. Then we analysed how the currently available guidelines for COVID-19 monitoring applications drafted by European Union and World Health Organization face the issues listed before. Eventually we proposed the first draft of integration of current guidelines.

Introduction
While the acute and emergency phase of the Coronavirus pandemic is not over yet, the world is trying to prepare to the phase dedicated to the economy restart, still characterized by the virus presence. This phase will be focused on the main challenge of contagion minimization, without the need for extreme solutions like the current lockdown that is affecting a vast number of countries around the world. At the moment of this paper drafting, many tasks force and experts panels are trying to define the correct policies for the post-emergency phase management. For example, in Italy, the government instituted one task force for the organization of the "Phase 2" of the coronavirus emergency, while other actors, like the Politecnico di Torino, are dedicating remarkable resources in the definition of good practices for the limitation of the virus spread without affecting the life of the citizens. In this context, many thoughts are directed toward new technologies that could help to confine the spread of the virus. In particular, mobile applications are widely discussed across different media, introducing discussions, proposals and political/ethical debates. The app choice for contact tracing is the main topic across newspapers and breaking news channels. The themes touched by the newspapers and local media are mainly linked to privacy aspects of data collection performed by the app and to the problems given by the app imposition by the government.
While the public opinion is focused on these (not trivial) problems, at least four other issues should be faced: • Localism: The use of different applications in different zones could lead to deviations in the data collection method and policy (minor deviations, since it is assumed that all the data collection campaigns are based on the World Health Organization indications), introducing biases in different zones, thus leading to non-comparable data across different regions and countries. • Effectiveness: At the moment, there is no clear evidence of this approach efficacy, but the use of this application should be as immediate as possible. Which is the correct compromise between urge for introduction and request of efficacy evidence? • Population coverage: different studies [1,2] suggest that the app should reach 60% of the population to be effective. The use by a high percentage of the population should increase the chance of correct and complete contact tracing. Also, higher coverage population would mean higher significance for epidemiological purposes.
In the case of fragmentation of the population percentage among the use of different apps, how can each app be useful? • Cross platform: if a subject has a different app, because he/she comes from another country or because there is the possibility to choose the app that the user prefers, how can the other people trace correctly contact with such person?
While the app selection, especially if adopted by a whole country, is a political and economic choice, these issues can be solved with technical solutions. Therefore, we focused on the proposal of a set of technical requirements designed to overcome these problems. The next sections will tackle the phases of the work that lead to the technical requirements definitions, starting from the regulatory framework analysis, analyzed to determine the context of such applications. Then the data bias problem is analyzed, introducing a literature review intended to propose the relevant epidemiological and clinical data that each app should trace and the integration of such evidence with available guidelines and author experience. Eventually, the technical requirements intended to tackle the problems of interoperability, population coverage and efficacy, starting from available literature and guidelines are proposed. Author name / Procedia Computer Science 00 (2019) 000-000 3

Regulatory Framework
Given the nature of these apps, that are designed to collect information about the users and use them, even informing subjects that have been in close contact with a patient positive to the novel coronavirus, the primary regulatory reference, in Europe, is the General Data Protection Regulation (GDPR) [3]. On the other hand, the app intended use determines whether it is a medical device or not. Any functionality that could help the single subject (e.g. any COVID-19 prevention functionality) would configure the application as medical device, thus leading to conformity to the current directive [4]. At the moment of the paper drafting, the 93/42/EEC is still in force and it will still be in force for one year, since the Coronavirus outbreak in Europe led the European Commission and the European Parliament to delay the day of full application of the MDR [5]. The definition of the regulatory context in which the app will be developed should be one of the first step for manufacturers, so that they could act to comply with relevant standards from the first phases of development, which in this case for medical devices are ISO 14971, ISO 62304, ISO 62366 [6][7][8], that can be used as guidelines for the development of the app from the early stage to the preclinical validation of the software [9].

Data bias
Uncontrolled application development could lead to improper data collection and therefore biases in data collection determined, for example, by loss of certain data or improper frequency of monitoring. Biased data collection can lead to a not consistent application of guidelines for outbreaks identification and can lead to impossibility of comparison of data collected from different regions. While this could seem a minor problem because it does not affect the main functionality of the app (i.e. contact tracing) can impair the subsequent use of the collected data. Applications are intended to control citizen contacts and are designed to allow to describe precisely the contacts of each person without the need of relying on interviews and patient memory. Consequently, if the database is significant, all the data can also be used for the early identification of outbreaks. Furthermore, if data are collected with the correct procedure, and the privacy of the user is ensured during all the process, data could be used, after the proper anonymization procedure, for epidemiological studies. In this context, uniformity of data format and data exchange interoperability are crucial, so that epidemiologists will not be blocked by the time-spending procedure of databases integration, but will have access to numerous databases all compatible with each other, and therefore of easy integration and combination, allowing to broaden the scope of the epidemiological studies. To guarantee the compatibility of databases across regions and countries, the type of data requested and obtained from the patient should be the same. Therefore, here we propose to tackle the problem of data selection suggesting to complete a systematic review of the literature and to define a set of data characterized by mandatory collection. We suggest completing as a first step a systematic literature review intended to understand which are the symptoms, clinical signs, risk factors, and comorbidities associated with the novel coronavirus disease. The results of the first literature review should then be integrated with information collected from guidelines drafted by national and international bodies. At the end of this first phase, the lists of symptoms, clinical signs, comorbidities and risk factors should be used as the base for the subsequent proposal of data structure.
These lists should be comprehensive of all observation reported in the literature and all information that according to the international bodies should be monitored. The identification and timely update of such lists is an important activity to ensure the comparability and integrability of the data collected from the population. In addition, consistent data collecting methods and data format should be ensured. We propose some requirements for data collection that should allow for interoperability and a subsequent smooth data analysis step. First of all, we suggest to reduce the open-ended questions and to allow only closed-ended questions. The only exceptions to this suggestion could be the definition of additional symptoms or signs not already identified as associated with COVID-19 and the input of measurements (e.g. temperature, blood pressure). Hence, our proposal can be described as follows: • implementation of a daily symptom diary that allows to the user to tick from a list consistent with the one identified by the literature and guidelines review any symptom or sign that can be easily identified by the patient (i.e. all the signs that do not need either radiologically and haematological exams or the objective evaluation performed by a clinician). We suggest to include a temperature diary that allows multiple Author name / Procedia Computer Science 00 (2019) 000-000 entries per day. It is crucial for data comparability that each temperature measurement is coupled with its associated body location. • Possibility of reporting any additional sign that is identified through clinical exams and diagnosed medical findings. Ideally, these findings should be inserted by health professionals, but this would require additional work to the many already overloaded healthcare professionals. Therefore, we think that a dedicated section for user self-reporting is appropriate, particularly if accompanied by appropriate instructions for use and precise identification of the possible hazards in case of wrong self-reporting. It is noteworthy that this solution could possibly lead to a bias of the signs and findings reporting towards the low severity findings. In fact, if this section is completed through self-reporting, the disproportion between low severity and high severity conditions is foreseeable due to the need of hospitalization and intubation in the most severe COVID-19 cases, leading to less self-reports. The bias can be mitigated through the definition of interfaces, API, or automatic systems to import in the platform the data from Electronic Health Records used by the professionals. The inverse process can be used as well, with the use of platforms by professional users and then the export of data to the healthcare facility database. • Possibility of reporting the therapies that the patient is following, with particular attention to pharmaceutical therapies. Intake methodology and intake timing should be inserted too. To ease the data insertion and the reliability of the data, pharmaceutical therapies could be inserted through research of the drug in a dedicated database. Databases of pharmaceuticals substances are clinically recognized and frequently used for similar purposes in software for hospital management. • Onboarding phase comprising the definition of the risk factors, with the chance to select at least the ones identified during the literature and guidelines review. It is extremely relevant to select the age, which is a known major risk factor. Therefore, the most appropriate way to insert the patient age is through the definition of the birth date. It could be relevant to assign to each variable the date of diagnosis/beginning of condition to monitor how this information is related to the risk for the patient. However, this could be additional information and therefore not mandatory. It is important to notice that the list of risk factors may include factors related to the severity of the COVID-19 condition and could be expressed through scores and physiological measurements. Therefore, it should be correct to add to the signs to be monitored such data. For example, it is suggested to monitor blood pressure values.

Interoperability
Interoperability has been a major issue in healthcare information systems for many years. While some advances have been completed with the definition of some standards for interoperability, a framework able to ensure complete interoperability between different systems has yet to be issued. In the context of contact tracing in the COVID-19 pandemic, the primary reference guide for the development is the toolbox for the development of contact tracing apps in European union, issued by the European Commission [10]. The toolbox published by the European Commission tackles the development of contact tracing applications with attention to different themes and topics ranging from the privacy, which is discussed in detail in a second document [11], to the cybersecurity aspect. The document correctly identifies three main core requirements needed to assess the interoperability: -definition of close contacts as per international guidelines; -the app should allow contact tracing with users using different applications; -the data should be exportable by backend procedures for the communication between different countries. Such requirements allow the development of an efficient contact tracing app, only if countries have foreseen to select just one app per country. In accordance with the general definition of the aim of the app and in accordance with the aims defined by the toolbox, these applications should be integrated into the contact tracing and in the monitoring systems already implemented to manage the epidemic. Therefore, the solutions are just a piece of the complex strategy of the public health institution for the control of the epidemic and the minimization of the virus spread. The easiest way to ensure this fit of the applications within the public health remedies frame, is, as said, the definition of requirements. In particular, the data transmission is one of the main challenges in this context. We suggest to use a Author name / Procedia Computer Science 00 (2019) 000-000 5 centralized method, that shall be constructed in respect of the GDPR and with privacy constraints, but without precluding to the scientific community the possibility to have extensive and comprehensive knowledge regarding the infection dynamics and the clinical manifestation. To ensure access to such information, we analysed the relevant requirements for interoperability drafted by the European toolbox and proposed a variation of such requirement that should allow easier communication and export of data. The main integrations to the toolbox that we propose here are the following: • Each app should have a central database with pseudonymized user information, correctly encrypted and protected as required by GDPR and cybersecurity standards. Pseudonymization is the reversible process that unlinks personal data and the subject [12]. The database should be accessible only for maintenance and for error resolution, with respect to users' data. After a proper anonymization process, the database should be easily exportable and aggregated to databases of other manufacturers. Therefore, to ease the inclusion, it should be possible to extract only the epidemiologically relevant data.

•
We suggest the use of document-based databases so that each patient can be associated with different records.
Consistently with the analysis completed in the previous section, we suggest a set of records that can be associated to the patient with associated mandatory fields that should be completed: Onboarding, daily symptoms diary, healthcare professional visit, end of monitoring, temperature measurement, diagnostic swab, serological examination, therapy diary. Each one of these records is associated with time and date and with the mandatory information for each field, defined as follows: Therapy diary: description of the therapy completed by the patient. Regarding the pharmaceuticals substances assumed by the patient, the description should include the intake modality and the dose. Also, each intake should be inserted with the associate date and time. The location information is beneficial for ex-post studies to evaluate data having regard for the swab policy of the region and epidemic outbreaks. For this reason, it is essential to give the users the possibility to change location information and to tag all records with the correct location.
• The confirmation of a COVID case should be defined uniformly across different platforms, therefore uniforming the response to the close contact of a patient that is confirmed as infected from coronavirus. The toolbox already suggests using pseudo-random codes for the confirmation of data produced by the public health authorities. However, it could be a heavy workload for the local public health institutions, so we suggest to define the procedure that could lead to the less risky situation without the need of additional work for public health institution. For example, we propose to use the identifiers of the reports of the clinical exams or visits.
All these requirements drafted here are intended to ease the management of the epidemics for researchers and public health institutions. Therefore, the use of such anonymized data should not be allowed for any other reason that is not research or epidemic monitoring. In the ideal case, the ministry of public health should access the databases and merge them and then be responsible for the distribution to the research centres.

Population coverage
To be effective, the apps should be used indicatively by at least 60% of the population [1,2]. Currently, the toolbox declares that the design of the applications should be based on accessibility and inclusive principles. These solutions and the additional solutions proposed by the European Commission can allow the broad use of such applications. Furthermore, the interoperability requirements can ease the population coverage, as each user can select many applications that are all interoperable. Even in the best case of inclusive and accessible applications, the voluntary basis for the download and use can limit the penetration among the population of the app use. At the meantime, the inclusion of the use of contact tracing app between the means decided by employers to ensure the safety of the workplace, (as supposed by the Politecnico di Torino [13]) could allow broader coverage of the population, and allow an actual contact tracing especially in the riskier environments, which are the common area and the places where workers should pass the majority of their day. Even in this case, the limits of the collection modalities should be remembered: an application for mobile phones can be inclusive as far as possible, but it will not include all people that cannot have access to a mobile phone for monetary or any other reason, and will not include all people that had not the chance to have an education and therefore are not able to read and write.
In any case, it is important to define the proper data flow of all data to ensure the population of the correct usage of their personal data. We suggest utilizing a data flow that focuses on the Country Government (by definition of laws or regulations) the role of the data controller as by GDPR and European Guidelines [11]. Then, we propose to use the scheme proposed by the Politecnico di Torino, where employers distribute and activate applications to employees, but they do not have access to any data. All data are received and analyzed by the General Practitioner (GP) in charge, or by the local public health institution, thus being the central data processor of all the data flow. Finally, the GP anonymize data, preserving only the predetermined and clinically relevant fields and send anonymized data to the Health Ministry, which will be responsible for the distribution of anonymized data to the authorized research centres. In addition, we suggest to include in the design of the application the evaluation of the human factors and to rely on the Zhang heuristics for medical device design, in order ensure a safe and pleasurable user interface design. In addition, the authors think that ancillary functions could improve the diffusion of the app (e.g. the implementation of an electronic self-declaration for movements justification).

Efficacy
As said above, these applications can be identified as medical devices, and therefore their suppliers should ensure that they are safe, effective and of constant quality level. While the constant quality level of the app can be verified and validated by means of software life-cycle management procedures, safety and efficacy (that is effectiveness in ideal conditions) should be validated by other means. The currently available reference is the same mentioned above for interoperability problems, i.e., the European commission toolbox. The European Commission toolbox for contact tracing recommends the countries members of the Union to define suitable Key Performance Indicators (KPIs) to assess and monitor the app effectiveness: this is intended in terms of both technical performance, and its balance with the preservation of the fundamental rights. However, no requirements have been drafted for the whole process of contact tracing, which includes the app and the public health institution procedures. In fact, it is worthy to remind that any technological solution (e.g., a contact-tracing app) must be conceived as a component of a more holistic program where also other aspects are carefully designed and deployed, like conceiving a set of incentives to properly use the app; organizing a call center to give feedback to those notified by the app; organizing teams that can collect nasopharyngeal swabs (possibly two subsequent swabs for each case, for the relatively low accuracy of the molecular test), directly at home of those people, or at least in the immediate vicinity of where they live; organizing a set of shelters that can accommodate those people in need of strict quarantine, so that they do not infect their close relatives. Author name / Procedia Computer Science 00 (2019) 000- 000 7 For this reason, the only technical verification of the contact tracing function in terms of accuracy of distance measurements and duration, which is still of unknown accuracy and reliability, does not address the efficacy of the whole procedure that is triggered by contact tracing. In particular, the technical solutions could exhibit an alarming high rate of false positives: these must be divided in technical and clinical false positives: the former ones are due to the Bluetooth shortcomings and can occur in many real-life situations, like while one is stopped in one's car at the traffic light close to other drivers, or when two colleagues are close together but separated by a plasterboard wall. The measures that many employers and managers are taking in workplaces and places open to the public, such as Plexiglas dividers, could increase this type of false contact to a great extent. The clinical false positives regards the relatively low probability that a proximity contact, which nevertheless must still be defined both in terms of distance and duration, could actually be cause of infection. Some simulations estimate the probability of being infected by the SARS-Cov-2 virus in casual contatcs very low: being 4-foot apart as low as 6 out of 1,000; if wearing a surgical mask the figure is even much lower: 1 out of 100,000 [14]. Even assuming abuse by no-trax activism and agitators be negligible, the overall false positives rate, due to either the technical and clinical components, can jeopardise the whole contact-tracing process, by overwhelming the socio-technical structure with a number of notifications, engagements, and tests that cannot be sustained not even in the short-mid-term. Besides the false positives, the efficacy of a digital contact-tracing solution can be negatively affected by false negatives, also. In this case, the estimation is much simpler: if the app is adopted by the 30% of potential susceptible subject (which is a reasonable, if not optimistic, estimate considering the first experiences in South Korea and Singapore [15]) the app helps detect less than 10% of contacts actually occurred, not to mention how misuse (like not always carrying the cell phone on or having it connected all the time) could make this estimate even lower. Furthermore, if one quarter of the population downloaded and properly used the application (which would still be a remarkable result provided that in a country like Italy, where the smartphone penetration is among the highest ones in the Western societies, only two thirds of the population own a smartphone, and likely fewer users own a sufficiently advanced device to be compatible with the solution), slight more than 1 contact out of 20 would be actually detected. Thus, false positives (related to technical shortcomings and epidemiological aspects) and false negatives (related to low adoption rates) are obstacles between these kinds of solutions and the achievement of their full effectiveness.
Therefore, in order to obtain adequate evidence of the full effectiveness of these applications evaluated in terms of their capability to reduce infection rate, hospital admission rate and, eventually, Infection Fatality Rate (or IFR) and overall casualty rate (the only results that could justify the necessary and proportional nature of this privacythreatening solutions as a viable response to the emergency), their use should be experimented in a set of real-world local settings representative of population in terms of age, mobile phone use diffusion and percentage or workers (like a set of medium-small municipalities in different regions of the country). These experimentations would help understand the cost-effectiveness of the whole digitally-supported strategy and the impact of adoption rate on the effectiveness. In the lack of a quick and agile experimentation where the technical effectiveness and socio-technical responsiveness of the related interventions can be assessed, we assert that the minimum-impact solution should be preferred over the fully digital contact-tracing one. For instance, we would argue for the adoption of an app that does not perform automatic contact tracing, but rather allows users to record the name of the people with whom they have been in close contact (less than, say, 3 meters) for more than, e.g., 5-10 minutes, and to keep a diary of their health conditions as a memory-aid to be used or possibly shown to a professional human contact tracer at a due time and if needed. Low-fi solutions seem preferable, and more feasible, solutions, than full-fledged Bluetooth enabled contacttracing apps, unless and until the effectiveness of these latter solutions has been proved [13]. Once again, although the beneficial character of contact-tracing apps is often just taken for granted, rather the futile, or possibly harmful, character of any technological solution should be explicitly vetted, or let be assumed until proven otherwise, especially in the case of techno-surveillance or artificial intelligence solutions.

Conclusions
In this paper we propose to integrate the requirements already drafted for the contact tracing applications, trying to leverage the opportunities of such applications and keeping attention on the major flaws that could affect these


extfieldsofstudy:
Computer Science
Mathematics

text:
Functorial Language Models

We introduce functorial language models: a principled way to compute probability distributions over word sequences given a monoidal functor from grammar to meaning. This yields a method for training categorical compositional distributional (DisCoCat) models on raw text data. We provide a proof-of-concept implementation in DisCoPy, the Python toolbox for monoidal categories.

Introduction
We introduce functorial language models: a principled way to compute probability distributions over word sequences given a monoidal functor from grammar to meaning. This yields a method for training categorical compositional distributional (DisCoCat) models on raw text data. We provide a proof-of-concept implementation in Dis-CoPy , see appendix A.
Language models, i.e. probability distributions over word sequences, are a cornerstone of natural language processing and information retrieval (Ponte and Croft, 1998). Neural models (Bengio et al., 2003), where these distributions are learnt by a neural network, are now built in everyday tools such as virtual assistants, automatic translation, etc. However effective they may be, neural models are not compositional in the sense that they do not take the grammatical structure of sentences into account, at least not explicitly. This severely limits our ability to interpret them: if we open the black box, we only see matrices of weights.
On the other hand, categorical compositional distributional (DisCoCat) models (Clark et al., 2008(Clark et al., , 2010 use grammatical structure to compose the distributional meaning of words together into a meaning for the sentence. Grammar is explicitly represented as string diagrams, which allow formal reasoning about natural language semantics, for example analysing ambiguity (Kartsaklis et al., 2013(Kartsaklis et al., , 2014Piedeleu et al., 2015) and entailment (Sadrzadeh et al., 2018a;de Felice et al., 2019).
However, despite emprical validation on small-scale examples (Grefenstette and Sadrzadeh, 2011), applying DisCoCat models at a large scale to real-world text data appears like a far-away goal. The challenge is at least two-fold: 1) we need a robust way to predict the grammatical structure of a given word sequence, 2) we need an efficient way to learn the meaning of each word, given the grammatical structures in which it occurs. The first point requires a probabilistic grammar: it is not enough to know whether a sequence is grammatical, we need a probability distribution over its possible parsings.
It has also been argued that a robust model ought to be incremental (Sadrzadeh et al., 2018b): scanning through the given word sequence left-to-right and updating its prediction for what comes next. This plays a crucial role in the context of informal language and dialogues (Purver et al., 2006). Previous work by the first author and collaborators (Shiebler et al., 2020) characterise these incremental, probabilistic parsers in terms of a functor from formal grammars to automata.
The second challenge, i.e. how to use grammar for learning the meaning of words, is essential if we want DisCoCat to work as a standalone model for natural language. Indeed, the first experiments (Grefenstette and Sadrzadeh, 2011) assumed the vector embedding for nouns to be given by some other means, such as co-occurence counts or neural language models. On the other hand, in more recent experiments on quantum hardware (Meichanetzidis et al., 2020a,b;Coecke et al., 2020) the meaning of words is learnt directly from the training data of a supervised questionanswering task. We coin the term functorial learning for this approach, as it can be understood as learning a functor from data.
We give a formal definition of this functorial approach and define functorial language models by composition with a probabilistic grammar. Concretely, we train a DisCoCat model to predict which word is missing in a sentence with a hole. We argue that this captures precisely the idea of distributional compositionality: extending Firth's principle, we shall know a word by the company it keeps and by the grammatical structure in which it occurs.
DisCoCat models have a one-sentence definition: they are rigid monoidal functors from the category generated by a pregroup grammar to vector spaces and linear maps. Let's unpack this definition and repack it in a format suitable for computation.
Fix a set of words , called the vocabulary, and a set of basic types . A rule is a pair of sequences of words and types ∈ ( + ) ★ × ( + ) ★ , where ×, + and ★ denote respectively the Cartesian product, the disjoint union and the free monoid ★ = ∈N with unit 1 the empty string. A grammar = ( , , , ) is given by a set of such rules together with a distinguished ∈ called the sentence type. This defines a signature in the sense of (Selinger, 2010) which generates a free monoidal category G. The objects are sequences of words and types, the arrows are progressive planar string diagrams with rules as boxes. The language of is defined as the sequences ∈ ★ such that there is a diagram : → in G: its grammatical structure.
This definition merely reformulates the notion of semi-Thue system (Thue, 1914) in the language of monoidal category theory. (Post, 1947) and (Markov, 1947) independently proved the undecidability of the parsing problem, i.e. given and ∈ ★ decide whether there exists : → in G. (Chomsky, 1957) then put the equivalent notion of unrestricted grammar at the bottom of his well-known hierarchy. In parallel, (Lambek, 1958) defined his calculus in terms of closed monoidal categories, taking inspiration from the categorial grammars of (Adjukiewicz, 1935) and (Bar-Hillel, 1953). Half a century later, pregroup grammars (Lambek, 1999(Lambek, , 2001(Lambek, , 2008 simplified this calculus by going from closed to rigid monoidal categories. Pregroup grammars are at the basis of the original DisCoCat model of (Clark et al., 2008). Definition 1.1. A pregroup grammar has types × Z where for ∈ N the types ( , − ) and ( , + ) are written ... and ... respectively and are called iterated left and right adjoints. The rules are of two kinds: cups and triangles. Cups have the shape ( , ) ( , + 1) → 1 for ∈ Z, i.e. they cancel a basic type with its right adjoint. Triangles have the shape → for a word ∈ and a type We only consider finite dimensional vector spaces. A diagram is progressive when its wires go monotonously top to bottom, i.e. they do not bend up or down.
A diagram is planar when its wires do not cross.
∈ ( × Z) ★ . Note that we draw words as the labels of triangle boxes rather than as input wires.
A pregroup grammar = ( , , , ) defines a rigid signature: the generating objects are given by words and types + , the generating arrows are given by dictionary entries → ∈ . Thus, it generates a free rigid monoidal category G where the object are sequences of words and types with iterated adjoints, the arrows are planar string diagrams with triangles as boxes. Cups are given by the rigid structure of G, they are drawn as bent wires. Again, the language of is defined as The main distinction between Chomsky's phrase structure grammars and the categorial grammar tradition of Adjukiewicz, Bar-Hillel and Lambek is that in the latter "all the grammar is in the lexicon". The only language-dependent rules are dictionary entries of the form : → for a word ∈ and a type ∈ Ob(G). They are drawn as triangle boxes. All the grammatical rules come from the structure of the category G, e.g. the cups of pregroups from the rigid structure. This has both conceptual and computational advantages. Conceptually, it makes categorial grammars universal: the same rules apply to all languages, only the dictionaries change. Computationally, these universal rules have a canonical semantics, thus it is enough to define the meaning of each dictionary entry.

Definition 1.2. A DisCoCat model is a rigid monoidal functor
: G → Vect from the category generated by a pregroup grammar. On objects is defined by a mapping 0 : → N which sends each basic type to the dimension of a vector space. The image of word types ∈ is the monoidal unit ( ) = 1, the image of complex types = ( 1 , 1 ). . .( , ) is the product of the dimensions of their basic types ( ) = 0 ( 1 ). . . 0 ( ). On arrows is defined by a mapping 1 ∈ ( , ) ∈ R ( ) that sends each dictionary entry ( , ) ∈ to a vector ( , ) ∈ R for = ( ) the dimension of its type. Cups are sent to the rigid monoidal structure of Vect. The meaning of a sentence : → is given by the vector ( ) ∈ R for = ( ) the dimension of the sentence type. When ( ) = 1, the meaning of sentences is given by real-valued scalars that can encode either truth value or likelihood.

Remark 1.3. DisCoCat models have been generalised both in their domain and codomain:
one can vary the grammar category as in (Coecke et al., 2013) or the semantic category as in (Piedeleu et al., 2015;Coecke et al., 2018b;Delpeuch, 2019). While we stick to the original definition, our proposal can apply to any model, so long as the meaning of words lives in some vector space, regardless of how these word vectors are composed together.
We fix the map 0 : → N and consider it as the hyper-parameters of the model. All the data defining the DisCoCat model is contained in the finite set of vectors 1 ∈ ( , ) ∈ R ( ) . Thus, we may consider these = ( , ) ∈ ( ) parameters as a machine learning landscape. The idea of functorial learning is to take a training set of pairs ⊆ (G) × (Vect) of diagrams ∈ (G) and vectors ∈ (Vect), and learn a functor such that ( ) = . In practice, this exact functor may not exist thus we fix a loss : ∈N R × R → R + and a regularisation : R → R + then using gradient-based methods we approximate: arg min :G→Vect

Example 1.4. Fix a type
∈ for yes-no questions with ( ) = 1, i.e. the meaning of a question : 1 ... → is a scalar ( ) ∈ R. Take a training set of such questions together with their answer in {0, 1} ⊆ R. Then the functor may be seen as a DisCoCat model for question-answering, see (de Felice et al., 2019). This model has been deployed on quantum hardware, see (Meichanetzidis et al., 2020a,b;Coecke et al., 2020).

Functorial language models
The definition of DisCoCat models can be recast in terms of encoding matrices, first introduced in (Toumi, 2018;Coecke et al., 2018a). The set of meaning vectors 1 ∈ ( , ) ∈ R ( ) can be packed into a set of matrices : | | → 0 ( ) indexed by grammatical types ∈ ( × Z) ★ , where ⊆ is the set of words ∈ with ( , ) ∈ . If we compose the matrix with the one-hot vector for a word : 1 → | |, we get its image under the functor ( , ) = o 9 . In the other direction, if we compose a meaning (co)vector : 0 ( ) → 1 with , we get a (co)vector o 9 : | | → 1 which gives its inner product with the words in . The key insight of our functorial language models is to take softmax( o 9 ) as the probability distribution over words in given a meaning : 0 ( ) → 1.
Remark 2.1. softmax is not a linear map, hence technically we cannot draw it as a box in a Vectvalued diagram. We can however draw it as a bubble, see (Toumi et al., 2021). We can then consider functors which send bubbles to softmax.
Fix a corpus of grammatical sentences ⊆ ∈ ★ G( , ) and assume ( ) = 1, i.e. the meaning of sentences are scalars. We generate a training set from this by taking each sentence : 1 ... → , removing one dictionary entry → by replacing it with the identity → . Thus, we get a diagram : → and take the one-hot vector for the word as target label. Intuitively, given the diagram of a sentence with a hole, we want to predict what word is missing.
This does not yet define a language model in the usual sense, indeed we are assuming that text data comes annotated with grammatical structure. That is, we are computing the conditional distribution ( | ) over words ∈ of type ∈ Ob(G) given the grammatical structure : → in which they occur. In order to get a language model, we need to compose this conditional with a distribution ( | 1 ... ) over diagrams given word sequences: a probabilistic grammar. Learning this distribution from data is called probabilistic grammar induction, which (Shiebler et al., 2020) formulate in terms of monoidal categories. In future work, we plan to train our functorial language model end-to-end on raw text data, i.e. learning both the probabilistic grammar and the DisCoCat model at once.

Implementation
We implemented a proof-of-concept in Dis-CoPy (de Felice et al., 2020) and used jax (Bradbury et al., 2020) for automatic differentiation and just-in-time compilation on GPU. We initialise the encoding matrices at random and use singular value decomposition to obtain word vectors that are close to orthogonal. We used crossentropy loss, a weighted sum of l1 and l2 (1e−1 and 5e−2 resp.) regularisation and Adam optimization (Kingma and Ba, 2017) (learning rate = 5e−2). We set the hyper-parameters to ( ) = 1 and ( ) = 7. After training on a subset of handcrafted data (~100 sentences with three distinct grammatical structures), the model was able to infer the missing word in previously unseen sentences with accuracy > .75, see appendix A. The notebook can be found on DisCoPy's GitHub.

A Experiment
We reproduce our hand-crafted dataset together with some sample predictions from our model. In the following cherrypicked examples, the prediction is correct in the first three cases and incorrect in the last one. This failure can be explained by the fact the word "krill" only appears once in the training set.


text:
Regenerativity of Viterbi process for pairwise Markov models

For hidden Markov models one of the most popular estimates of the hidden chain is the Viterbi path -- the path maximising the posterior probability. We consider a more general setting, called the pairwise Markov model (PMM), where the joint process consisting of finite-state hidden process and observation process is assumed to be a Markov chain. It has been recently proven that under some conditions the Viterbi path of the PMM can almost surely be extended to infinity, thereby defining the infinite Viterbi decoding of the observation sequence, called the Viterbi process. This was done by constructing a block of observations, called a barrier, which ensures that the Viterbi path goes trough a given state whenever this block occurs in the observation sequence. In this paper we prove that the joint process consisting of Viterbi process and PMM is regenerative. The proof involves a delicate construction of regeneration times which coincide with the occurrences of barriers. As one possible application of our theory, some results on the asymptotics of the Viterbi training algorithm are derived.

1 Introduction and preliminaries 1

.1 Introduction
We consider a Markov chain Z = {Z k } k≥1 with product state space X × Y, where Y is a finite set (state space) and X is an arbitrary separable metric space (observation space). Thus, the process Z decomposes as Z = (X, Y ), where X = {X k } k≥1 and Y = {Y k } k≥1 are random processes taking values in X and Y, respectively. The process X is identified as an observation process and the process Y , sometimes called the regime, models the observations-driving hidden state sequence. Therefore our general model contains many well-known stochastic models as a special case: hidden Markov models (HMM), Markov switching models, hidden Markov models with dependent noise and many more. The segmentation or path estimation problem consists of estimating the realization of (Y 1 , . . . , Y n ) given a realization x 1:n of (X 1 , . . . , X n ). A standard estimate is any path v 1:n ∈ Y n having maximum posterior probability: v 1:n = arg max y1:n P (Y 1:n = y 1:n |X 1:n = x 1:n ).
Any such path is called Viterbi path and we are interested in the behaviour of v 1:n as n grows. The study of asymptotics of Viterbi path is complicated by the fact that adding one more observation, x n+1 can change the whole path, and so it is not clear, whether there exists a limiting infinite Viterbi path.
It has been recently proven [28] that under some conditions the infinite Viterbi path exists for almost every realization x 1:∞ of X, allowing to define an infinite Viterbi decoding of X, called the Viterbi process. This was done trough construction of barriers. A barrier is a fixed-sized block in the observations x 1:n that fixes the Viterbi path up to itself: for every continuation of x 1:n , the Viterbi path up to the barrier Also p(z 1 ) = p(x 1 , y 1 ) denotes the initial distribution density of Z with respect to measure µ 1 × c, where µ 1 is some σ-finite measure on B(X ). Thus the joint density of Z 1:n is p(z 1:n ) = p(z 1 )p(z 2:n |z 1 ). For every n ≥ 2 and i, j ∈ Y we also denote p ij (x 1:n ) = max y1:n : y1=i,yn=j n k=2 q(x k , y k |x k−1 , y k−1 ), x 1:n ∈ X n .
Density functions f j are also called the emission densities.
If p(y 2 |x 1 , y 1 ) doesn't depend on x 1 , and p(x 2 |y 2 , x 1 , y 1 ) doesn't depend on y 1 , then following [4] we call Z a Markov switching model. Thus HMM's constitute a sub-class of Markov switching models. In the case of Markov switching model, denoting f j (x|x ) = p(x 2 = x|y 2 = j, x 1 = x ), the transition kernel density becomes q(x, j|x , i) = p ij f j (x|x ).
It is easy to confirm that in case of Markov switching model (and therefore also in case of HMM) Y is a homogeneous Markov chain with transition matrix (p ij ) [33]. Most PMM's used in practice fall into the class of Markov switching models. Figure 1 depicts the directed dependence graph of HMM, Markov switching model and the general PMM.
Throughout this paper we write P z (A) = P (A|Z 1 = z) for any event A and E z [S] = E[S|Z 1 = z] for any random variable S.

Infinite Viterbi path
The segmentation problem in general consists of guessing or estimating the unobserved realization of process Y 1:n -the true path -given the realization x 1:n of the observation process X 1:n . Since the true path cannot be exactly known, the segmentation procedure merely consists of finding the path that in some sense is the best approximation. Probably the most popular estimate is the path with maximum posterior probability. This path will be denoted with v(x 1:n ) and also with v 1:n , when x 1:n is assumed to be fixed: v 1:n = v(x 1:n ) = arg max y1:n p(y 1:n , x 1:n ) = arg max y1:n P (Y 1:n = y 1:n |X 1:n = x 1:n ).
Typically v 1:n is called Viterbi or MAP path (also Viterbi or MAP alignment). It can be found by a dynamic programming algorithm called Viterbi algorithm [34]. Clearly v 1:n might not be unique. For more detailed discussion about the segmentation problem and the properties of different estimates, we refer to [30,21,38,23,24]. Although these papers deal with HMM's only, the general theory applies for any model including PMM's.
To study the statistical properties of Viterbi path-based inferences, one has to know the long-run or typical behaviour of random vectors v(X 1:n ). As argued in [29], behaviour of v(X 1:n ) is not trivial since . . . . . . . If this happens again and again, then the first element of v(x 1:n ) keeps changing as n grows and there is not such thing as limiting Viterbi path. On the other hand, it could be intuitively claimed that sometimes there is a positive probability to observe x 1:n such that regardless of the value of the (n + 1) th observation (provided n is sufficiently large), the paths v(x 1:n ) and v(x 1:n+1 ) agree on first u elements, where u < n. If this is true, then no matter what happens in the future, the first u elements of the paths remain constant. Provided there is an increasing unbounded sequence u i (u < u 1 < u 2 < . . .) such that the path up to u i remains constant, one can define limiting or infinite Viterbi path. Let us formalize the idea. In the following definition v(x 1:n ) is a Viterbi path and v(x 1:n ) 1:t are the first t elements of the n-elemental vector v(x 1:n ).
Hence v 1:∞ is the infinite Viterbi path of x 1:∞ if for any t, the first t elements of v 1:∞ are the first t elements of a Viterbi path v(x 1:n ) for all n big enough (n ≥ m(t)). In other words, for every n big enough, there exists at least one Viterbi path so that v(x 1:n ) 1:t = v 1:t . For the definition of infinite Viterbi path in the case Y is infinite, see [6,28].
As we shall see, for many PMM's the infinite Viterbi path exists for almost every realization of X. However, it is possible to construct a model where almost no realization has an infinite Viterbi path (see [28,Example 1.1]).
Nodes Suppose now x 1:∞ is such that infinite Viterbi path exists. It means that for every time t, there exists time m(t) ≥ t such that the first t elements of v(x 1:n ) are fixed as soon as n ≥ m. Note that if m(t) is such a time, then m(t) + 1 is such a time too. Theoretically, the time m might depend on the whole sequence x 1:∞ . This means that after observing the sequence x 1:m , it is not yet clear, whether the first t elements of Viterbi path are now fixed (for any continuation of x 1:m ) or not. In practice, one would not like to wait infinitely long, instead one prefers to realize that the time m(t) is arrived right after observing x 1:m . In this case, the (random) time m(t) is the stopping time with respect to the observation process. In particular, it means the following: for every possible continuation x m+1:n of x 1:m , the Viterbi path at time t passes the state v t , let that state be i. This requirement is fulfilled, when the following holds: for every two states j, k ∈ Y where δ 1 (y) = p(x 1 , y 1 = y), δ t (y) = max y1:t : yt=y p(x 1:t , y 1:t ), t ≥ 2.
and p ij (·) is defined in (1). Indeed, there might be several states satisfying (3), but the ties can always be broken in favour of the state i, so that whenever n ≥ m, there is at least one Viterbi path v(x 1:n ) that passes the state i at time t. Therefore, if at time t, there is a state i satisfying (3), then m is the time m(t) required in (2) and it depends on x 1:m only.
Definition 1.2. Let x 1:m be a vector of observations. If inequalities (3) hold for any pair of states j and k, then the time t is called an i-node of order r = m − t. Time t is called a strong i-node of order r, if it is an i-node of order r, and the inequality (3) is strict for any j and k = i for which the left side of the inequality is positive. We call t a node of order r if for some i, it is an i-node of order r = m − t.
In [36] the concept of node is used under the name "coalescence point" to describe a memory-efficient modification of the Viterbi algorithm. Our theory justifies the use of such algorithm and could be used to derive bounds on its memory complexity.
Barriers Whether a time t is a node of order r or not depends, in general, on the sequence x 1:t+r . Sometimes, however, there is some small block of observations that guarantees the existence of a node regardless of the other observations. Let us illustrate this by an example.
Then δ t (i)q(x t+1 , y t+1 |x t , i) = max We thus have that t is an i-node of order 1, because for every pair j, k ∈ Y Whether (4) holds or not, depends on triplet (x t−1 , x t , x t+1 ). In case of Markov switching model, (4) is And in a more special case of HMM, (4) is equivalent to The inequalities (5) have very clear meaning -when the observation x t has relatively big probability of being emitted from state i (in comparison of being emitted from any other state), then regardless of the observations before or after x t , time t is a node. On the other hand, for many models, there are no such x t possible, so (5) is rather an exception than a rule. Suppose now that an i-barrier of order r occurs in x 1:∞ infinitely often. By definition of a barrier, there must exist infinitely many i-nodes of order r in x 1:∞ , let these nodes be u 1 < u 2 < · · · . Let m ≥ u 2 + r. There must exist a Viterbi path v(x 1:m ) passing state i at time u 1 . There also exists a Viterbi path passing i at time u 2 . If v(x 1:m ) is unique, then the path passes i at both times, but if Viterbi path is not unique and u 1 and u 2 are too close to each other, then there might not be possible to break ties in favour of i at u 1 and u 2 simultaneously (see [28,Example 1.4]). This problem does not occur, if the nodes are strong or if u 2 ≥ u 1 + r. Indeed, since u 1 is an i-node of order r, then by definition of r-order node, between times u 1 and u 1 + r + 1, the ties can be broken so that whatever state the Viterbi path passes at time u 2 , it passes i at time u 1 . Thus, if the locations of nodes u 1 < u 2 < · · · are such that u k ≥ u k−1 + r for all k ≥ 2, it is possible to construct the infinite Viterbi path so that it passes the state i at every time u k . In what follows, when the nodes u k and u k−1 are such that u k ≥ u k−1 + r, then the nodes are called separated. Of course, there is no loss of generality in assuming that the nodes u 1 < u 2 < · · · are separated, because from any non-separated sequence of nodes it is possible to pick a separated subsequence. Another approach is to enlarge the barriers so that two barriers cannot overlap and, therefore, are separated. This is the way barriers are defined in [27].
Piecewise construction of infinite Viterbi path Having infinitely many separated nodes u 1 < u 2 < · · · or order r, it is possible to construct the infinite Viterbi path piecewise. Indeed, we know that for every n ≥ u k + r, there is a Viterbi path v 1:n = v(x 1:n ) such that v uj = i, j = 1, . . . , k. Because of that property and by optimality principle clearly the piece v uj−1:uj depends on the observations x uj−1:uj , only. Therefore v 1:∞ can be constructed in the following way: first use the observations x 1:u1 to find the first piece v 1:u1 as follows: v 1:u1 = arg max y1:u 1 : yu 1 =i p(x 1:u1 , y 1:u1 ).
Then use x u1:u2 to find the second piece v u1:u2 as follows: v u1:u2 = arg max yu 1 :u 2 : yu 1 =yu 2 =i p(x u1:u2 , y u1:u2 ), and so on. Finally use x u k :n to find the last piece v u k :n as follows: v u k :n = arg max yu k :n : yu k =i p(x u k :n , y u k :n ).
The last piece v u k :n might change as n grows, but the rest of the Viterbi path is now fixed. Thus, if x 1:∞ contains infinitely many nodes, the whole infinite path can be constructed piecewise. If the nodes u k are strong (not necessarily separated) then regardless of tie-breaking scheme v(x 1:n ) u k = i for all k ≥ 1 and n ≥ u k +r. Therefore the piecewise construction detailed above is in that case achieved when the Viterbi estimation is done by a lexicographic * tie-breaking scheme induced by some ordering on Y. Furthermore, under lexicographic ordering, each piece in the piecewise construction is also found by lexicographic ordering. The latter observation will be crucial to our proof of regenerativity.
If the nodes u k are not strong, then the lexicographic ordering may fail to produce the piecewise construction. However from practice point of view the lexicographic ordering is clearly advantageous, since it can easily be implemented via Viterbi algorithm. For that reason we will from now on almost exclusively focus on strong nodes and strong barriers. Fortunately, this does not seem to impose any significant restrictions.

Viterbi process
The notion of infinite Viterbi path of a fixed realization x 1:∞ naturally carries over to an infinite Viterbi path of X, called the Viterbi process. Formally, this process is defined as follows.
is not an infinite Viterbi path of X} is contained in a set of zero probability measure.
If there exists a barrier set X * ⊂ X M consisting of i-barriers of fixed order and satisfying P (X ∈ X * i.o.) = 1, where then the Viterbi process can be constructed by applying the piecewise construction detailed above to the process X. Having infinitely many barriers not only ensures the existence of the Viterbi process, but -as we shall see briefly -will also provide a rather straightforward route to proving that the Viterbi process is regenerative. As follows we state two theorems which ensure the existence of Viterbi process. The first one only concerns HMM while the latter applies to any PMM.
Recall that in case of HMM f i are the emission densities with respect to measure µ. Denote The conditions for the HMM-theorem are the following.
and the sub-stochastic matrix P C = (p ij ) i,j∈C is primitive in the sense that P R C consists of only positive elements for some positive integer R.
Note that condition (HMM2) only depends on transition matrix P = (p ij ) and the probability laws induced by densities f i . Also, this condition is not very restrictive. It is fulfilled when P consists of only positive elements. It is also fulfilled when P is primitive and there exists some µ-positive set such that f i are positive on that set. Theorem 1.4 is not the only result in literature guaranteeing the existence of Viterbi process for HMM, but it is the latest and has the most general conditions (cf. [3,2,27,20]).
In order to state the PMM-theorem we need introduce some general state Markov chain terminol- [32,Prop. 4.2.2.]) a maximal irreducibility measure ψ in the sense that for any other irreducibility measure ϕ the measure ψ dominates ϕ , ψ ϕ . The symbol ψ will be reserved to denote the maximal irreducibility measure of For ψ-irreducible Z, the point z is reachable if and only if it belongs to the support of ψ [32, Lemma 6.1.4]. Since we have equipped space Z with product topology τ × 2 Y , where τ denotes the topology induced by the metrics of X , the above-stated definition of reachable point is in fact equivalent to the following: For any n ≥ 2 define For any set A consisting of vectors of length n we adopt the following notation: Hence Observe The conditions for the PMM-theorem are the following.
(PMM1) For any N ≥ 1 there exist 1 < n 1 < . . . < n 2N , an open set B ⊂ X n 2N , and > 0 such that denoting n 0 = 1 we have for all k = 1, . . . , 2N and all x ∈ B (n k−1 ,n k ) where either inequalities (7) or (8) could be non-strict. We assume that and B (1) are independent of N , and that there exists a compact set K, which is independent of N , such that is the same for every x ∈ E and satisfies the following property: (i, j) ∈ Y + for every i ∈ Y + (1) and j ∈ Y + (2) . Furthermore, we assume that there exists a reachable point in E (1) × Y + (1) . For discussion on conditions (PMM1) and (PMM2) and applications of Theorem 1.2 to specific models we refer the reader to [28].

Regenerativity
For any sequence u = (u k ) k≥1 and a sequence of times [19,37] (in the classic sense), if there exists a sequence of random times S = {S k } k≥1 , 1 ≤ S 1 < S 2 < . . ., called regeneration times, such that for each n ≥ 1 Let from now on V = {V k } k≥1 denote the Viterbi process, whenever it exists, obtained by a lexicographic tie-breaking scheme. The main goal of the present paper is to prove that under some conditions the joint process (Z, V ) = {(Z k , V k )} k≥1 is regenerative. Regenerativity of a general state space Markov chain is typically proved by applying the so-called splitting method [19,37]. If the regeneration times of Z obtained by the splitting method are also strong nodes, then (Z, V ) is regenerative as well. This is the idea behind our main regeneration theorem below. The theorem is proven under assumptions (R1)-(R3), where (R1) ensures the existence of an appropriate barrier set, (R2) ensures that the splitting method can be applied to obtain suitable regeneration times for Z and (R3) guarantees that the inter-regeneration times have finite expectation.
For any A ∈ B(Z) let τ A denote the number of time-steps for Z to reach A after time 1: (R1) There exists a set X * ⊂ X M satisfying the following conditions: (ii) there exist state i 0 ∈ Y, such that for every z ∈ Z There exists a probability measure ν on B(Z) and β ∈ (0, 1) such that ν(Z 1 ) = 1 and Theorem 2.1. If (R1) and (R2) hold, then (i) X * satisfies P (X ∈ X * i.o.) = 1 and hence the Viterbi process V is well-defined; If also (R3) holds, then the inter-regeneration times have finite mean.
Proof. Construction of regeneration times. Denote By (R2) we have that Q(z, ·) are probability measures. Hence for all z ∈ Z 0 the measure P (z, ·) is a mixture of measures ν and Q(z, ·): We now apply the standard splitting technique to construct regeneration times for Markov chain Z. We define a homogeneous Markov chain , and whenever W 1 k ∈ Z 0 we flip a coin: with probability 1 − β we take W 2 k = 0 and generate W 1 k+1 according to Q(W 1 k , ·) and with probability β we take W 2 k = 1 and generate W 1 k+1 according to ν (independently of W 1 k ). The initial distribution of W is defined by Since S 1 k − 1 are stopping times for W and W S 1 k −1 ∈ Z 0 × {1}, we have by strong Markov property that S 1 k are regeneration times for W and therefore also for Z def = {W 1 k } k≥1 . In fact, for every k ≥ 1, {Z S 1 k +u } u≥0 is a Markov chain with initial distribution ν and transition kernel P (z, A).
, where ∨ denotes maximum, and let Times S 2 k (l) are regeneration times for Z (since S 1 k are regeneration times), with {Z S 2 k (l)+u } u≥0 being a Markov chain with initial distribution ν and transition kernel P (z, A) for each k ≥ 1. But this time we always have some separation between regeneration times: Define where I denotes the indicator function and Z is as defined in (R1)(ii). Since b ≥ M − r − 1, then (10) implies that {I k (l)} k≥2 are i.i.d. sequences. We will show that there exists l * such that Denote J 1 = min n | Z n−M +r+2:n ∈ Z , J k = min n > J k−1 | Z n−M +r+2:n ∈ Z , k ≥ 2.
By (R1)(ii) every J k is almost surely finite. Denote {U k } k≥1 = {W 2 J k } k≥1 and note that {U k } k≥1 is i.i.d. sequence with P (U 1 = 1) = β. Indeed, fix k ≥ 1 and consider the homogeneous Markov chain Since J k is stopping time for that Markov chain, we have by strong Markov property for every z ∈ Z 0 Since Z J k ∈ Z 0 by definition of J k , then P (U k = 1) = β. Furthermore, by strong Markov property U k depends on U 1:k−1 only through (Z J k , W 2 J k −1 ). But, as we saw, U k is independent of (Z J k , W 2 J k −1 ) and therefore also of which implies that l * satisfying (11) indeed exists.

Take now
Note that by (11) S 3 k are almost surely finite. Again, S 3 k − 1 are stopping times for W and W S 3 k −1 ∈ Z 0 × {1}, so it follows from strong Markov property and (10) that S 3 k are regeneration times for Z, with {Z S 3 k +u } u≥0 being a Markov chain with initial distribution ν and transition kernel P (z, A) for each k ≥ 1. Also, by construction S 3 k satisfies X S 3 Note that by (R1)(iv) and the assumption ν(Z 1 ) = 1 of (R2) S k are almost surely finite. We will now show S k are regeneration times for W . Let and let N (k) be such that S 3 N (k) = S k . Hence N (k) = n if and only if n−1 l=1 H l = k − 1 and H n = 1. Also note that by (10) S k − S k−1 ≥ r + 1. We can express the conditional distribution of W S k :S k +u , u ≥ 1, given past history: n +u ∈ A|H n = 1) · I(N (k) = n) = P (W S 3 1 :S 3 1 +u ∈ A|H 1 = 1). Here the first equality follows because σ(W 1:S k −1 , S 1:k ) = σ(W 1:S k −1 ); the second equality can be easily confirmed using the fact that B ∩ {N (k) = n} ∈ σ(W 1:S 3 n −1 , H n ) for every B ∈ σ(W 1:S k −1 ) and n ≥ 1; the third equality follows from the fact that W 1:S 3 n −1 is independent of (W S 3 n :S 3 n +u , H n ) (recall that S 3 n is a regeneration time); the fourth equality follows from the fact that {N (k) = n} ⊂ {H n = 1}. That S k are regeneration times for W easily follows. Also, we have X S k −M +r+1:S k +r ∈ X * for all k ≥ 1 by construction and by the assumption X * = X * (1,M −r−1) × X * (M −r,M ) ((R1)(iii)). Therefore P (X ∈ X * i.o.) = 1. Also by (R1)(i) S k are strong 1-nodes, and so by piecewise construction with lexicographic tie-breaking inside each piece the process {(Z k , V k )} k≥1 is regenerative as claimed.
Inter-regeneration times have finite mean. We will now show that where ∧ denotes minimum. Indeed, note that for any k ≥ 1 and z ∈ Z 0 Therefore, for every z ∈ Z 0 , This implies (12).
Next, we will show that E[S 1 2 − S 1 1 ] < ∞. Denote Here we used the fact that {N ≥ k} ∈ σ(W 1:S 1 1 −1+T k−1 ) for second equality, that S 1 1 − 1 + T k−1 is a stopping time for W and strong Markov property for third equality, and (12) for the inequality. Thus we have Since N has a geometric distribution, then c 0 Recall the sequence n 1 < . . . < n N and set B ⊂ X n N of (PMM1). A set A ∈ B(Z) is called regular when Z is ψ-irreducible, if for all B satisfying ψ(B) > 0, sup z∈A E z [τ B ] < ∞. When conditions of Theorem 1.2 hold, then regularity of (B (n N −1) × Y) is sufficient for (R1)-(R3) to hold: Lemma 2.1. If the following conditions are fulfilled, then (R1)-(R3) hold: µ is strictly positive, function (x , x ) → q(x, j|x , i) is lower semi-continuous and bounded for all i, j ∈ Y, Z is Harris recurrent, (PMM1) holds with set (B (n N −1) × Y) being regular, and (PMM2) holds.
Proof. We omit some of the technical details from the proof since they largely concern the specific construction of the barrier set given in [28]. By Theorem 1.2 there exists barrier set X * ⊂ X M consisting of strong 1-barriers of order r ∈ {1, . . . , M − 2}. Using the lower semi-continuity assumption, this barrier set can be constructed so that it satisfies (R1) with some i 0 ∈ Y and i 1 = 1. Furthermore, denoting B = B (n N −1,n N ) , we may with no loss of generality assume that q(x, 1|x , i 0 ) > 0 for all (x , x) ∈ B . There exists 0 > 0 such that set is non-empty. Since B is open, then by the lower semi-continuity assumption (13) is also open, so there exist open balls B 0 , B 1 ⊂ X such that B 0 × B 1 is contained in (13).
By construction of X * (see [28] for details) we may with no loss of generality assume that X * Then for all x ∈ B 0 Proof. Since (R1)(ii) implies that P z (Z k ∈ Z 0 i.o.) = 1 for every z ∈ Z, then for every z ∈ Z there exists k(z) ≥ 2 such that P z (Z k(z) ∈ Z 0 ) > 0. Also note that by (R2) It follows that Z must be ν-irreducible. That Z is Harris recurrent now follows from [32, Prop. 9.1.7(ii)] and that Z is positive follows from (R3) and [32, Th. 11.0.1].

Hidden Markov model
We consider some simple examples of applications of Theorem 2.1 to specific models. For HMM no additional conditions than those of barrier construction theorem 1.1 are needed for (R1)-(R3) to hold. Proof. The assumptions of the statement guarantee the existence of the barrier set X * ⊂ X M consisting of strong 1-barriers with fixed order r for some labelling of Y. Furthermore, it follows from the construction of X * that (R1) holds with i 1 = 1 and i 0 = arg max i p i1 -see [28] for details. Recall that f j denote the emission densities with respect to measure µ. For j ∈ Y denote P j (A) = A f j (x) µ(dx). The barrier set X * is constructed in such a way that P 1 (X * (M −r) ) > 0 -see [28]. For any A ∈ B(Z) and j ∈ Y we write [32,Prop. 8.3.7]). It is not difficult to show that in case of HMM with irreducible Y every set in B(Z) is regular and so (R3) holds.

Discrete X
Consider the case where X is discrete (finite or countable) and Z is an irreducible and positive recurrent Markov chain with (discrete) state space Z ⊂ X × Y. Here the state-space refers to the set of possible values of Z. Note that Z can be a proper subset X × Y. Recall the definition of Y + (·) (6). We assume that the transition kernel q(z|z ) is defined on Z and so (i, x 1 ) ∈ Z for every i ∈ Y + (x 1:q ) (1) . Lemma 3.2. Let X be discrete and let Z be an irreducible and positive recurrent Markov chain with the state-space Z ⊂ X × Y. Then the following conditions ensure that (R1)-(R3) hold.

it holds
where either inequalities (14) or inequalities (15) could be non-strict.
Proof. It is shown in [28] that the conditions of the statement imply (PMM1)-(PMM2) with B (n N −1) = {x * n−1 } and B (n N ) = {x * n }. Since Z is positive recurrent on Z then with no loss of generality we may assume that all finite sets in B(Z) are regular. The statement now follows from Lemma 2.1.

Linear Markov switching model
Let X = R d for some d ≥ 1 and for each state i ∈ Y let {ξ k (i)} k≥2 be an i.i.d. sequence of random variables on X with ξ 2 (i) having density h i with respect to Lebesgue measure on R d . We consider the "linear Markov switching model", where X is defined recursively by Here F (i) are some d × d matrices, Y = {Y k } k≥1 is a Markov chain with transition matrix (p ij ), X 1 is some random variable on X , and random variables {ξ k (i)} k≥2, i∈Y are assumed to be independent and independent of X 1 and Y . Recall that for Markov switching model, the transition density expresses as q(x, j|x , i) = p ij f j (x|x ). For the current model measure µ is Lebesgue measure on R d and f j (x|x ) = h j (x − F (j)x ). When F (i) are zero-matrices, then the linear Markov switching model simply becomes HMM with h i being the emission densities. When d = 1, we obtain the "switching linear autoregression of order 1". The switching linear autoregressions are popular in econometric modelling, see e.g. [14,15,16,13].
In what follows, for any x ∈ X and r > 0 let B(x, r) denote an open ball in X with respect to 2-norm with center point x and radius r > 0. The conditions for (PMM2) are given by (i) There exists set C ⊂ Y and r > 0 such that the following two conditions are satisfied: 1. for x ∈ B(0, r), h i (x) > 0 if and only if i ∈ C; 2. the sub-stochastic matrix P C = (p ij ) i,j∈C is primitive, i.e. there exists R ≥ 1 such that matrix P R C has only positive elements.
Conditions (i) and (ii) are not very restrictive. For example, when all the elements of P = (p ij ) are positive, then (i) is fulfilled if densities h i are either positive around 0 or zero around 0 and there exists at least one j ∈ Y such that h j is positive around 0. If densities h i are all positive around 0, then (i) is fulfilled when P is primitive with C = Y. If h i are positive everywhere and Y is irreducible, then all points in Z are reachable and so (ii) trivially holds.
For x ∈ X we denote with x 1 the 1-norm of x, and for a d × d matrix A we denote with A 1 the 1-norm of matrix A, that is A 1 is the maximum absolute column sum of A. The following lemma addresses Harris recurrence of Z and regularity of sets in B(Z). This can be proved analogously to Lemma 4.3 in [28] by using [32,Th. 11.3.11] instead of [32, Th. 9.1.8].
Lemma 3.5. Let Z be the linear Markov switching model. If the following conditions are fulfilled, then Z is Harris recurrent and every compact set in B(Z) is regular: (i) Z is ψ-irreducible and support of ψ has non-empty interior; (iii) max i∈Y j∈Y p ij F (j) 1 < 1. (i) Matrix P = (p ij ) is primitive, i.e. there exists R such that P R consists of only positive elements.
(ii) It holds p 11 = max i∈Y p i1 .
(iii) Matrix I d − F (1), where I d denotes the identity matrix of dimension d, is non-singular, and for all i ∈ Y and j ∈ Y \ {1} Proof. It is shown in [28] that under given conditions the assumptions of Lemmas 3.3, 3.4 and 3.5 are fulfilled. The statement now follows from Lemma 2.1.

Asymptotics of Viterbi training: regeneration-based analysis
Regenerative property of (Z, V ) has numerous potential theoretical applications ranging from SLLN's and CLT's to proving the existence of asymptotic risks. In this section we look at one such application, namely regeneration-based analysis of the Viterbi training algorithm.
Convergence of empirical measures Firstly, let us state a general SLLN that provides a theoretical basis for several regeneration-based inferences, including the ones in the present section. The proof of the theorem is a rather straightforward application of the regenerative property of (Z, V ) and is given in Appendix A. An analogous result for HMM was proven in [29]. Let V n 1:n denote, the Viterbi path of X 1:n , i.e. V n 1:n = v(X 1:n ). Here the tie-breaking scheme is assumed lexicographic as above. Whenever (R1)-(R3) hold, let {S k } k≥1 denote the regeneration times of (Z, V ), as constructed in the proof of Theorem 2.1. Then In what follows, we study empirical measures where I A denotes the indicator function on A. Also define measure From Theorem 4.1 it follows that P n ⇒ P ∞ a.s., where ⇒ stands for the weak convergence of measures: then g is P ∞ -integrable, and g dP n − → n g dP ∞ , a.s.

Proof.
Denote It follows from Theorem 4.1 that g dP n − → n I(g), a.s.
-just take f ((x 1 , y 1 , v 1 ), (x 2 , y 2 , v 2 )) = g((x 1 , v 1 ), (x 2 , v 2 )). To prove (18), we need to show that I(g) = g dP ∞ . This follows by the standard machinery of measure theory: if g is a simple function, then the equality I(g) = g dP ∞ follows by definition of P ∞ . For non-negative measurable g take a monotone convergent sequence of simple functions g m g and use Monotone Convergence Theorem to see that the equality I(g) = g dP ∞ holds also in the limit. For arbitrary g we have by (17) that I(g + ) < ∞ and I(g − ) < ∞, and hence I(g) = g dP ∞ follows.
The weak convergence now follows from the standard theory of weak convergence of probability measures, see e.g. proof of [9,Th. 11.4.1].
Note that when (R1)-(R3) hold, then there exists γ such that where I denotes the indicator function. Indeed, this follows directly from Theorem 4.1, by taking The limit γ is simply the asymptotic pairwise misclassification rate of the Viterbi estimation. For any pair of measures ν and ν on common σ-field, we denote with ν − ν the total variation distance of measures ν and ν : where supremum is taken over all measurable A. Recall (Lemma 2.2) that when (R1)-(R3) hold, then the transition kernel of Z admits an invariant probability measure π. Let P π denote the probability measure with respect to the stationary initial distribution π. The following result is useful for our purposes.
Proof. Note that by Theorem 4.1 Similarly, denoting where η is a probability measure defined by

Now we have for every A ∈ B(Z) ⊗ B(Z)
and so by (19) By Lemma 2.2 (R1)-(R3) imply that Z is Harris recurrent and positive. To prove the statement, it suffices to show that η = P π (Z 1:2 ∈ ·). From the ergodic theorem for aperiodic and positive Harris Markov chains [32,Th. 13.3.3.] it follows that for all A, B ∈ B(Z) it holds Thus applying Dominated Convergence Theorem to (20) Viterbi training The empirical measures P n are central in many Viterbi-inferences based applications. In this section we look at one of such applications, namely Viterbi training.
For any application of PMM one needs to estimate the parameters of the model. The standard go-to method of parameter estimation in case of Markov switching models is the EM-algorithm, also known as Baum-Welch or forward-backward algorithm [4,1,34,14]. In practice the EM-algorithm is often replaced with the Viterbi training algorithm (VT) [35,17,31] (also known as segmental K-means algorithm [10,18] and classification EM in the mixture case [5,11]) due to its ease of implementation and significantly smaller computational cost. However, compared to the EM-algorithm, VT can sometimes lead to sub-optimal results. It could be argued that the closer the Viterbi path is to the real path, the better VT performs. Thus VT is expected to work well when the dimension of observation space X is relatively high compared to the number of hidden states, since the Viterbi path is in that case -in ‡ See [32] for the definition of aperiodicity of general state ψ-irreducible Markov chain. some sense -probably very similar to the real hidden path. By the same logic, replacing a HMM with a more general PMM (for instance the linear Markov switching model) can improve the accuracy of the Viterbi path estimation and therefore also that of VT. We will see that asymptotic analysis of VT is made possible by the convergence of empirical measures P n and, therefore, by regenerativity of (Z, V ).
We start by formulation of VT for PMM's. We assume that transition densities q(z|z ) are known up to a parametrization q(z|z ) = q(z|z ; θ), where θ is the unknown "true" parameter vector belonging to parameter space Θ ⊂ R d , d ≥ 1. For any parameter vector θ ∈ Θ denote with v(x 1:n ; θ ) the Viterbi path of x 1:n obtained by using the parameters θ . Hence v(x 1:n ) = v(x 1:n ; θ). Viterbi training is a method of estimating the unknown parameters using the following algorithm.
As a special case, we can consider the Markov switching model defined by transition kernel density p ij f j (x|x ; α j ), where θ = (p ij , α j ) i,j∈Y is the unknown parameter vector. Then (as one can see by applying Lagrange multipliers method) the estimates of l+1 p ij of p ij at the 3rd step of Viterbi training algorithm can simply be calculated by Then also l+1 α j , the estimates of α j at the 3rd step of Viterbi training algorithm, can be calculated separately by where A j is the parameter space corresponding to α j . Recall that Markov switching model also includes HMM in which case f j (x|x ; α j ) is independent of x . Assume for now that (R1)-(R3) hold and Z is aperiodic. In the light of Theorem 4.1 we may want to seek the answer to the following question: what is the output of the 3rd step of the Viterbi training algorithm if the input is the correct parameter θ? Ideally, we would like to see that that the output is in that case close to the input: θ = l θ ≈ l+1 θ. This is called the fixed point property. Write q(θ ) for (z , z) → q(z|z ; θ ). Assuming that q(θ ) is positive everywhere on Z 2 and ln q(θ ) satisfies (17) we have by Corollary 4.1 that ln q(θ ) dP n (· ; X 1:n , θ) − → n ln q(θ ) dP ∞ , a.s. This gives hope that at least under some conditions arg max θ ∈Θ ln q(θ ) dP n (· ; X 1:n , θ) − → n arg max θ ∈Θ ln q(θ ) dP ∞ , a.s.
In [22] an analogous convergence is proved under certain conditions. Although [22] deals with HMM's only, we believe that the same idea can be applied to PMM as well to obtain the convergence (21). Denote Assuming that (21) holds and that the sample size n is sufficiently large, the fixed point property holds when θ * ≈ θ. It is not difficult to confirm that P ∞ has a density with respect to measure (µ×c)×(µ×c), where c denotes counting measure on 2 Y . Let p (z , z) denote this density. Writing d(z , z) in place of (µ × c) × (µ × c)(d(z , z)) we have It is not difficult to confirm that the invariant measure π has a density with respect to measure µ × cdenote this density with p π . Assuming that ln p (z , z) and (z , z) → ln p π (z ) are both P ∞ -integrable, we have Defining measure Q θ by we can see that (22) minimizes the Kullback-Leibler divergence of P ∞ from Q θ . If the Viterbi path is perfect estimate of the hidden path, i.e. V ≡ Y , then by Proposition 4.1 P ∞ = P π (Z 1:2 ∈ ·) = Q θ . The Kullback-Leibler divergence of Q θ from Q θ is minimal when θ = θ, implying that the fixed point property θ * ≈ θ indeed holds when the Viterbi path is perfect, at least under appropriate identifiability conditions. In practice however the Viterbi path is almost never perfect and so whether θ * ≈ θ holds or not depends on how closely P ∞ resembles P π (Z 1:2 ∈ ·). If the pairwise misclassification rate γ is small, then by Proposition 4.1 P ∞ − P π (Z 1:2 ∈ ·) ≤ γ, and so the fixed point property is in that case expected to hold. If P ∞ is not close to P π (Z 1:2 ∈ ·), we can correct the estimation error at the 3rd step of the VT by taking the estimate l+1 θ to be l+1 θ = θ − θ * (θ) + arg max θ ∈Θ ln q(z|z ; θ ) P n (d(z , z); X 1:n , l θ).
In case of HMM this modified version of the VT has been called the adjusted Viterbi training (AV) [29,26,22]. AV ensures that the fixed point property holds simply by virtue of convergence (21). The simulations in [26,22] show how the fixed point property significantly improves the accuracy of the estimator so that AV outperforms VT and is comparable to EM-algorithm. The key component of AV is the map θ → θ * (θ). This map is generally not known analytically and should therefore be estimated by simulations. The estimation takes some time and effort but could be worthwhile if a single model is to be applied repeatedly.
It remains to show that the second term on the right side of (23) converges to


Cloud Computing in Agricultural Enterprises in Slovakia

We are currently making great strides in the field of ICTs, which is associated with the availability of other larger volumes of information any species. There are problems with their analysis, storage, as well as security in companies. The aim of the paper was to focus on the agricultural sector in terms of innovation. In the presented article we deal with the issue of cloud computing and its use in management in agricultural enterprises in Slovakia. We characterize cloud computing, its advantages and disadvantages, as well as the current use of this service by agricultural entreprises in Slovakia. We used the method of questionnaire survey and personal interview to investigate the above problems. We also focused on the study of cloud computing and related issues from available foreign sources. The results show that agricultural enterprises in Slovakia use cloud computing services less with comparing to the countries of EU.

Introduction
The development of ICT in business increases the dependence of enterprises on their use and managers must pay an necessary attention of this. ICT penetration also influences agricultural enterprises (Szabo et al., 2017). Their development influences economic environment and ranks among factors of business prosperity and competitiveness. Nowadays, it is not possible to manage enterprises and take professional decisions without information and using of ICT (Bolek et al., 2018). Some professionals consider cloud computing to be a significant advance in the area of development of computing technology over the last decade (Rajaraman, 2014). It is a new generation of information technology that integrates grid and cluster computing, virtualization, distributed processing, and computing (Sui and Sui, 2018). Cloud computing is a model that provides convenient network access to shared configurable computing resources on demand, which can be quickly provided and released with minimal effort in the area of management or interact from the service provider (Mell and Grance, 2011). The goal of cloud computing is to deliver applications over the Internet using hardware and software existing in data centers that provide these services in a transparent manner without the user needing to know the details of the underlying software and hardware. It offers cost-effective development of scalable web applications on a highly available fault-tolerant infrastructure (Wazzan and Fayoumi, 2012). Cloud computing is used for efficient data processing to make better decisions. It is an affordable, scalable and highly available platform technology (Tan, 2016). Many companies are interested in moving from their old system to a cloud computing system, with a view to minimizing the cost of using computing resources (Amanatullah et al., 2013). Cloud computing is a way to integrate a stateof-the-art background computing infrastructure to provide computing services to a large number of users (Goraya and Harjinder, 2015).
Choosing the right service model is a crucial success factor for a business. Therefore, it is necessary to understand what each model involves, what responsibility the cloud service provider as well as the consumer himself has. There are 3 cloud service models: Software as a Service (SaaS), Platform as a Service (PaaS), Infrastructure as a Service (IaaS) (Figure 1).
SaaS is the provider's applications that run in a cloud infrastructure, and these applications are accessible to the consumer from various client devices either through a web browser or through a programming interface. The provider manages the entire infrastructure, networks, servers, operating systems, storage, as well as the applications themselves. The consumer has the option to configure only some user-specific application parameters. PaaS provides the ability to deploy consumer-created applications to the cloud infrastructure. With PaaS, the provider also manages the cloud infrastructure. However, in addition to the possibility of setting the application parameters, the consumer also has control ver the entire application. With IaaS, the consumer also does not manage the cloud infrastructure, but has control over the operating systems, storage and deployed applications. Limited control over selected network components is also possible (Mell and Grance, 2011). Data as a Service (DaaS) is less talked about compared to the above layers, as many vendors currently offer cloud services in one or all of these layers. Given that people in the research field are interested in using the cloud, there is great interest in the availability of data as a service, especially for geographic data. It is thus the provision of valuable data as a service over the Internet on the basis of payment for its use (Patil et al., 2012).

Cloud
computing includes three types of deployment models: public cloud, private cloud, and hybrid cloud. The public cloud offers services to every consumer over the Internet, which means that the cloud infrastructure is owned by a specific organization that sells services to the public. Private cloud offers services to selected customers, which means that the cloud infrastructure is owned by one organization, which manages it itself.
The hybrid cloud is a combination of public and private cloud; offers services from both public and private sources (Wazzan and Fayoumi, 2012). Many companies are implementing private clouds on their premises due to distrust of data security. With a private cloud, an enterprise can design, develop, and implement a customized cloud service and have complete control over data and other security issues, which is not possible in a public cloud (Wang, Rashid and Chuang, 2011).
Hori, Kawashima and Yamazaki (2010) report the following benefits of cloud computing: -lower start-up costs, -unrestricted allocation of resources on request, -maintenance and updates are performed in the background, -easy and rapid development, including cooperation with other cloud systems, -more opportunities for the development of global services. Patel and Patel (2013) include to the benefits of cloud computing its easy service management (there are no worries about procuring of licences, hardware, data center operations), scalability (easy extensibility of the service with new users), device and location independence (the way of accessing to the cloud can be your computer, someone else's computer, smart phone or solar powered touch pad). Abdalla and Varol (2019) also see certain issues with cloud storage services, such as control, security, support, performance and vendor blocking. in the agricultural sector. With the introduction of the latest technologies, management is very simple. Cloud computing facilitates the storage, management, access and dissemination of agricultural information quickly and at low cost (Goraya and Harjinder, 2015). In the modern era of cloud computing technology, it is very useful to centralize an agricultural database (soil, weather, research, crops, farmers, agricultural marketing, fertilizer and pesticide information) in the cloud (Choudhary, Jadoun and Mandoriya, 2016). Cloud computing enables farms to provide all necessary services at affordable costs (Patil et al., 2012).
With the growing use of mobile devices and the development of wireless technologies, cloud computing has become a widely used model for providing services over the Internet (Alqahtani and Arishi, 2020). Mobile cloud computing is currently the primary element of research direction in mobile applications (Hao et al., 2018). Mobile cloud computing offers several benefits to the agricultural sector. Without worrying about investing in hardware and software, farmers can send their requests for specific data via cloud services using their mobile phones and internet connection. The cloud service provider processes these requests and sends back the results to clients (Athmaja and Hanumanthappa, 2016). The integration of cloud computing into the mobile environment also provides other benefits, such as longer battery life or lower processing load (Alonso-Monsalve, Garcia-Carballeira and Calderon, 2018). Involving cloud computing in the agricultural sector results in efficiently higher production, cost control, performance monitoring, and the like (Nanami and Gonen, 2020).
Mobile cloud computing is also important in the field of accounting processing. There are many applications that create invoices, track income and expenses, generate financial statements and other.

Materials and methods
The main goal of this article is to present the results of research in the field of cloud computing, specifically its use in agricultural enterprises in Slovakia. We specify the main goal in more detail into sub-goals, which are: 1. clarification of cloud computing issues, 2. finding out the measure of use of cloud computing in agricultural enterprises in Slovakia, 3. introducing the advantages and disadvantages of using cloud computing based on the answers of respondents, 4. comparison of selected aspects of the solved problem with EU countries.
Primary data are obtained by the questionnaire method. Due to the scientific research activities of our university (SPU in Nitra) and solved research tasks at the Department of Accounting, we focused on agricultural enterprises. The article presents partial results of the research project VEGA 1/0489/15 "Increasing the effectiveness of managers' decision-making with the support of information systems and accounting" in the period of years 2015-2018 and research activities 2019-2020. We examined the issue of cloud computing in more detail using the questionnaire method. The compiled questionnaire was available online, where we received answers from 73 respondents (enterprises). We used the MS EXCEL spreadsheet processor to evaluate the questionnaire. In addition to the questionnaire, the following methods are also used: analysis, synthesis, selection, comparison, mathematical-statistical and graphical methods. We also used the method of guided interview, where we consulted supplementary questions with managers of selected enterprises. Then, we focused on the study of cloud computing and related issues from available foreign sources.

Results and discussion
Information has long been one of the important factors in increasing the enterpise's competitiveness in the market. That is why it is important for enterprises to pay increased attention to innovations in the field of ICTs, as these are currently the ones that greatly influence theirs market position.
Based on the published questionnaire, we received answers from 73 respondents. According to the number of employees, we speak of small and medium-sized enterprises, where 69.86 % stated the number of employees less than 10; 8.22 % employ 11-50 employees and 21.92 % have a number of employees in the range of 51-250.
We were mainly interested in answers to questions about the use of cloud computing in these enterprises. Based on the obtained answers, we introduce the following results.
Answers od respondents to the question

[90]
Cloud Computing in Agricultural Enterprises in Slovakia about the availability of data from the corporate information system differ. 54.79 % of respondents stated that access to data is possible only from individual computers in the enterprise. 19.18% claim that they also have remote access in the enterprise, which also allows them to work from home. 13.70 % of respondents also use external storage (cloud computing) and 17.81 % said "I don't know" (Figure 2).
Businesses that do not use cloud computing services have their own information system with their own database. These enterprises need employees specializing in the care of ICTs which in turn increases labor and personnel costs.
In cloud computing, the enterprise does not own an information system or database, but leases software and data storage from the company that provides these services.  (Figure 3).
The use of an Internet connection for e-mail communication is a matter of course for all 73 respondents. This is the most common way to use cloud computing over a period of several years. This is also confirmed by Eurostat research for the period 2014, 2016 and 2018, when on average 67 % of EU-28 enterprises also put e-mail communication in the first place ( Figure 4).
A more detailed use of cloud computing services by enterprises in individual countries is shown in Figure 5. Businesses using cloud computing services cite online access to data from anywhere with an Internet connection as the biggest advantage. We can say that in today's globalized environment, this approach is almost everywhere where an entrepreneur or manager needs it, and the coverage of the Internet connection is constantly expanding to less developed areas. 10.96 % of respondents agree on the other 2 advantages of cloud computing, namely in lower initial costs, as well as in the fact that updates and information security are handled by a company that provides cloud computing services ( Figure 6).
On the contrary, 62.50 % of respondents consider the biggest disadvantage of using cloud services to be the failure of the Internet connection, which will make it impossible to work with the data needed for decision-making and management. Only 37.50 % fear data misuse and 25 % data loss. 6.85 % of respondents also identified increased operating costs as a disadvantage (Figure 7).
The fact that the loss of the Internet connection is a threat to enterprises using cloud computing is also confirmed by the Gartner company's analysis, which shows that two out of five enterprises are forced to close within five years of experiencing a major IT outage (Štětka, 2014).
In the following figure we can see a comparison of the use of cloud computing services by enterprises in individual EU countries in 2018. The Slovak Republic is almost among the last countries with 21.10 %, which is also confirmed by the results of our research. Finland is the leader in the use of cloud services with 61.30 %.
On the contrary, Bulgaria is the worst with 8.30 % (Figure 8).

Conclusion
In the last decades, ICTs have been developing at a rapid pace. If a company wants to stay in the market, it needs to adapt to these changes. The introduction of ICTs in the area of farm management is a necessity. The requirements for recording and reporting data for the management needs of the managers themselves, as well as for various external entities, are growing. Today, we do not find an agricultural enterprise that does not have its information system handled automatically. The level of either computing technology or implemented software is in single enterprises various.
Based on the research, we came to the conclusion that agricultural enterprises in Slovakia still do not trust cloud computing. Most enterprises have their own information system with their own database. Businesses using cloud computing have cited online access to data as its biggest advantage. On the contrary, they consider the failure of the internet connection to be the biggest disadvantage, which will prevent them from working in the information system.
The SR has large reserves in the use of cloud computing services. Within the EU-28 countries, according to Eurostat, the SR ranks as high as 21 place in the use of cloud computing, where only 21 % of enterprises use these services.
Based on the processed data, we obtained an overview of the state of use of cloud computing in agricultural enterprises in Slovakia. It is important to realize how much this issue needs to be addressed at this time.
The results of the research can be further used in a more detailed analysis of these problems with the application of mathematical and statistical methods. Using the Chi-square test of the square contingency, it is possible to examine the dependence between the qualitative features -the answers of the respondents to the individual questions of the questionnaire.
In our opinion, cloud computing is very promising for the future, which is confirmed by the opinions of foreign authors. The growth of the use of cloud computing services can be achieved by realizing more extensive and massive foreknowledging of managers and business owners about the possibilities of using cloud computing, its advantages and disadvantages. Poor awareness of new possibilities in the field of ICTs especially in the agricultural field, causes the lagging progress of these enterprises, which to a large extent also ultimately affects their competitiveness.