{'fraction_non_alphanumeric': 0.03930380198302304, 'fraction_numerical': 0.006419858763107212, 'mean_word_length': 4.411038209185643, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 2, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Thinning process algorithms for compound poisson process having nonhomogeneous poisson process (NHPP) intensity functions

One stochastic process that is often used to model real phenomena is the compound Poisson process (CPP). CPP is a process in which a component in the process of the events occurred is assumed to be a Poisson process with a certain intensity function (homogeneous or nonhomogeneous). Thinning process algorithm is usually used to generate events that occurred in the Poisson process, but not yet in CPP. This study aims to find out the algorithm to produce CPP which has the function of Poisson nonhomogeneous (NHPP) intensity, where in addition to knowing the process of events that occur, it also takes into account the extent of the consequences of these events. The value of the load caused by the Poisson process is assumed to be a family of i.i.d random variables and the variables are also independent of the Poisson process. The results of this study have obtained the thinning process algorithm and its generalizations for compound Poisson process having nonhomogeneous Poisson process (NHPP) intensity functions. This algorithm is the result of theoretical development and analysis of computational simulations that can be applied in various fields of science such as the analysis of reliability and risk models.


Introduction
Reliability models that take into account random failures are usually based on stochastic processes. A Stochastic process is a process that describes an event or phenomenon that is uncertain. This process is useful for modelling phenomena related to probability rules. Stochastic processes can be classified into discrete stochastic processes and stochastic processes with continuous time. One continuous stochastic process is a Poisson process. This process is classified into two, namely homogeneous and nonhomogeneous Poisson process. The homogeneous Poisson process (HPP) can be described as the number of failures during a certain operating period or within a certain range that changes randomly for the next operating period or the next interval has a constant intensity function, while the NHPP has a non-constant intensity function (depending on time). One example of the application of homogeneous and nonhomogeneous Poisson processes in the engineering field can be seen in [1], [2] and [3]. The stochastic process theory allows random evolution modelling that does not only count the number of events that occur or fail at certain times or intervals but also can calculate corrective maintenance costs or the size of the consequences that occur. One stochastic process that is often used for calculating this problem is the compound Poisson process. The compound Poisson process (CPP) is useful in modelling real phenomena. CPP is a process in which a component in the process of the events occurred is assumed to be a Poisson process with a certain intensity function (homogeneous or nonhomogeneous). One example of the application of this process is in the fields of insurance and finance, physics, demography, seismology, biology (see the references in [4]) and engineering ( [5] and [6]). In this application, CPP mostly uses the assumption of an HPP. If an event has a greater chance to occur at a certain time interval compared to another time, then this assumption is not appropriate. Therefore, if an event that occurred is not constant (in the form of a time-dependent function), then we must use a CPP which has an NHPP. Furthermore, if the event is periodic or cyclic, then we must use a compound cyclic Poisson process (CCPP), a process where its Poisson component has a periodic intensity function. The period of this process can be one day, one week, one year, or in the form of another unit. The cyclic Poisson process, the intensity of the previous function is the same as that in the next period. Hence, this process is useful for predicting an event in a subsequent period. The distribution of a CPP is very difficult to find, so the first step is to find its mean and variant. Because this process depends on time, the mean and its variant are functions. The estimation of the mean and variance functions of a CCPP has been investigated by Ruhiyat et al. [7], Mangku et al. [8] and Makhmudah et al. [9]. Furthermore, the study is extended to a CCPP in the presence of linear trends. This process is very appropriate in describing the phenomenon that occurs periodically, but the increase follows the linear trend. The estimation of the mean and variance functions of this process has been investigated by Wibowo et al. [10] and Abdullah et al. [4].
Generating random numbers of events that occur from an HPP can be done by generating the first time units. While the most famous method for generating an NHPP is thinning process, where this process is a method of acceptance-rejection. This process was introduced by Lewis and Shedler [11]. The thinning process algorithm still does not discuss generating random numbers from a CPP. Thus, the study aims to construct the algorithm for generating CPP that have NHPP intensity functions. This research is very important because in order to see and approach the actual phenomenon, an appropriate random number must be generated.

Compound Poisson process having a nonhomogeneous Poisson process intensity functions (CPP-NHPP)
The counting process{ ( ), ≥ 0}, which represents the total number of events that occur by time , is said to be HPP if it has an intensity function in the form of a constant function > 0. Whereas if it has an intensity function in the form of non-constant function ( ) > 0, it is said to be NHPP. This means that the HPP does not depend on time because it is a constant function, whereas in NHPP it is a function that depends on the time. The definitions and theorems about HPP and NHPP can be seen in Ross [12]. The expectation and variance of HPP respectively as follows (1) While the expectation and variance of NHPP respectively as follows The CPP is generalizations of the Poisson process. The definition of a CPP, as follows Definition 2.1. A stochastic process { ( ) ≥ 0} is said to be a CPP if it can be represented as where { ( ), ≥ 0} is a Poisson process, and { , ≥ 1} is a family of independent and identically distributed (i.i.d) random variables that is also independent of { ( ), ≥ 0} [12]. CPP can be classified into two types based on the component of the Poisson process, which is a CPP that has an HPP intensity function (CPP-HPP) and a CPP that has an NHPP intensity function (CPP-  (1), (3) and with simple proofing, we get the mean and variance function of CPP-HPP, denoted by 1 ( ) and 1 ( ) respectively, given by While from equation (2), (3) and with simple proofing also obtained the mean and variance function of CPP-NHPP, ( ), denoted by 2 ( ) and 2 ( ) respectively, given by with Λ( ) = ∫ ( ) 0 . It should be noted because this process depends on time, the mean and its variance are functions of time as well.
The algorithm for generating random numbers from events that occur from an HPP can be done by generating the first time unit [12] and [13]. The most famous method for generating an NHPP is the thinning process. The intuitive idea behind thinning process is to first find a constant intensity function which dominates the desired intensity function ( ), next generate from the implied HPP with intensity function , and then reject an appropriate fraction of the generated events so that the desired intensity function ( ) is achieved. The basis of this process can be seen in [11]. Ross [12] and [13] provides modification to the thinning method to mitigate excessive rejection. Furthermore, in this paper, the algorithm and its generalizations will be modified and developed for generating CPP-HPP and CPP-NHPP.

Results and Discussion
Previous studies discuss the algorithm for generating random variables only on HPP or NHPP, which is about the events that occur. This research discusses where in addition to knowing the process of events that occur, it also calculates the extent of the consequences of these events, which is by obtaining algorithms about CPP-HPP and CPP-NHPP. So that the previous algorithms will be modified and developed into more complex algorithms.

Algorithm for generating CPP-HPP
According to the form of the CCP in equation (3), for generating a CCP-HPP has three major steps: (i) generating an HPP (say ), (ii) generating a family of i.i.d random variables ( ) and (iii) counting CCP ( ( )). According to the definition of HPP and the definition in equation (3), suppose a counting process { ( ), ≥ 0} is defined on a space Ω, such that for each ∈ Ω, and defined on a probability space (Ω, , P). This process has an intensity function and observed. The function ( ) is a realization of the number of events that occur in the interval (0, ], with (0) = 0.
Suppose that for each data point in the observed realization ( ) is corresponding with a family of i.i.d random variable that have a distribution. The algorithm to generate an HPP of can be seen in [13]. Every time is obtained, then bring in a single realization to be able to start generating and giving the value by the distribution . Suppose we already have an algorithm for generating . So ( ) will also be obtained by calculating the sum of each the value of the load of . The steps of the algorithm to generate the CPP-HPP as follows.

Thinning process algorithm for generating CPP-NHPP type 1
According to the form of the CCP in equation (3), for generating a CCP-NHPP type 1 has three major steps: (i) generating an NHPP (say ), (ii) generating a family of i.i.d random variables ( ) and (iii) counting CCP ( ( )). According to the definition of NHPP and the definition in equation (3), suppose a counting process { ( ), ≥ 0} is defined on a space Ω, such that for each ∈ Ω, and defined on a probability space (Ω, , P). This process has an intensity function ( ) and observed. The function ( ) is a realization of the number of events that occur in the interval (0, ], with (0) = 0.
Suppose that for each data point in the observed realization ( ) is corresponding with a family of i.i.d random variable that have a distribution. The algorithm to generate a NHPP of type 1 can be seen in [13]. Remember that to generate NHPP, we must choose the value so that ( ) ≤ for all ≤ and with probability ( )/ . Every time is obtained, then bring in a single realization to be able to start generating and giving the value by the distribution . Suppose we already have an algorithm for generating . So ( ) will also be obtained by calculating the sum of each the value of the load of . The following preposition is the basis of the method for generating CPP-NHPP with a thinning process. 10 : Go to step 2.
The meaning of the symbols in the flowchart and the algorithm are: represented as time, represented a number of events that have occurred by time , represented as CPP-NHPP, 1 and 2 represented as random number, ( ) represented as intensity function of NHPP that is non-constant function with ( ) ≤ , represented as first time units and represented as random variables that distributed as which has i.i.d properties. The final values and represent the number of events that occur by time and represent the total amount of sequence of , respectively. If the reader wants to show the time of the event, it can be added in Step 7-9.
According to the form of the CCP in equation (3), for generating a CCP-NHPP type 2 has four major steps: (i) break the interval into subinterval, (ii) generating an NHPP (say ), (iii) generating a family of i.i.d random variables ( ) and (vi) counting CCP ( ( )). Suppose that for each data point in the observed realization ( ) is corresponding with a family of i.i.d random variable that have a distribution. The algorithm to generate an NHPP of can be seen in [13]. Remember that to generate NHPP, we must choose the value so that ( ) ≤ for all ∈ ( −1 , ) and with the probability ( )/ . Because exponential has no memory, use [ − ( − )]/ +1 for the next exponential form with the rate +1 . Every time is obtained, then bring in a single realization to be able to start and giving the value by the distribution . Suppose we already have an algorithm for generating . So ( ) will also be obtained by calculating the sum of each the value of the load of . The steps to generate the CPP-NHPP type 2 describe in the flowchart in figure 3 as follows. The algorithms above are used by assuming that the random variable is a family of i.i.d random variables, such as exponential distribution, Gamma distribution or others. So that the algorithms can be modified and developed. The first algorithm (CPP-HPP) can be used to solve the equation (4) and (5). Whereas the second and third algorithms (CPP-NHPP Type 1 and 2) can be used to solve the equations (6) and (7). These algorithms can also be used to simulate and estimate the mean and variance functions of a CCP when we have the estimator. Furthermore, these algorithms can also be used in maintenance planning production, predicting the cost of corrective maintenance, the reliability model analysis, determining the price of premiums for policies, risk analysis for company products, determining reserve benefits for companies and in applied various fields of science as mentioned earlier.

Conclusions
The results of this study have obtained algorithms and generalizations for compound Poisson processes. The first algorithm is used to generate compound Poisson process having homogeneous Poisson process intensity functions (CPP-HPP), where it is a constant function. The second algorithm, the thinning process algorithm (CPP-NHPP Type 1), is used to generate compound Poisson process having nonhomogeneous Poisson process intensity functions, where it is a non-constant function. The second algorithm is modified and developed by breaking the interval into subintervals. From these results, the third algorithm (CPP-NHPP Type 2) is obtained.