1. Introduction
Namely, we will show how to solve the following two portfolio investment problems.
(1) Merton portfolio optimization problem in finance (
Merton 1969, 
1971) aims to find the optimal investment strategy for the investor with those two objects of investment, namely risk-less asset (e.g., investment grade government bonds)), with a fixed rate of interest 
 and a number of risky assets (e.g., stocks) whose price GCHP. In this way, in our case, we suppose that 
 and 
 follows the following dynamics, respectively:
      where 
 is the GCHP, 
 is a discrete-time Markov chain (MC) with finite or infinite states, 
 is the interest rate, and 
 is a continuous and finite function on 
 We note, that the justification of using HP in finance may be found in (
Da Fonseca and Zaatour 2013), and using GCHP that based on HP 
 and 
 may be found in (
Swishchuk and He 2019; 
Swishchuk and Huffman 2020). The model for a stock price 
 that based on GCHP is a new and original in this paper. The investor starts with an initial amount of money, say 
 and wishes to decide how much money to invest in risky and risk-less assets to maximize the final wealth 
 at the maturity 
(2) Merton portfolio optimization problem in insurance aims to find an optimal investment for the capital 
 of an insurance company at time 
t (
 is actually the risk model based on general compound Hawkes process (GCHP) (
Swishchuk 2018; 
Swishchuk et al. 2020), when an investor decides to invest some capital 
 in risky assets (e.g., stocks) and the rest, (
 in risk-free assets (e.g., bonds or bank account). We note, that the risk model 
 based on GCHP, has the following representation:
 Here 
 is an insurance company’s initial capital, 
 is the premium rate, 
 is the Hawkes process, 
 is a discrete-time finite or infinite state Markov chain with state space 
 or 
, respectively, and 
 is a continuous and finite function on 
 We note, that the justification for the Hawkes-based risk model in the form of the above equation may be found in (
Swishchuk et al. 2020).
The investor starts with an initial capital, say  and wishes to decide how much money to invest in risky and risk-less assets to maximize the capital 
We solve both problems using diffusion approximation for GCHP 
 (see 
Section 4 and 
Section 5). We note, that it is not a simplification of the initial models: the resulting models contain all the parameters of the initial models, including the parameters of Hawkes process. Furthermore, significance and insights of the results are discussed in Remark 6 and Remark 7 (Some Insights into the Results). In this case both problems can be solved explicitly. However, we cannot say this if we would like to dal with initial models and going without diffusion approximation (see 
Section 6. Discussion). We believe that these two problems for those two different models in finance and insurance are considered in the literature for the first time, because none of author’s 9 papers in the References contain similar or even close results.
The novelties of the paper are the following ones: (1) we consider a new model for the stock price  in the form  where  is the GCHP; we call it Hawkes-based model for the stock price (or geometric general compound Hawkes process, similar to geometric Brownian motion); (2) solution of Merton investment problem for this Hawkes-based model; (3) solution of Merton investment problem for the Hawkes-based risk model.
The structure of the paper is the following one. Literature review is presented in 
Section 2. 
Section 3 is devoted to the definitions and properties of Hawkes process and general compound Hawkes processes, and LLN (Law of Large Numbers) and FCLT (Functional Central Limit Theorem) for them. 
Section 4 deals with Merton investment problem in finance for the stock price described by GCHP, and 
Section 5 deals with Merton investment problem in insurance for the risk model based on GCHP. 
Section 6 contains some discussions and describes the future work, and 
Section 7 concludes the paper.
  2. Literature Review
We note that an alternative approach to consumption-portfolio optimization problem based on martingale methods were developed by (
Karatzas et al. 1986; 
Pliska 1986; 
Cox and Huang 1989). Applications of martingale methods to the basic optimization problems can be found in (
Cox and Huang 1989; 
Karatzas 1997; 
Korn and Korn 2000). Investment problem is also closely associated with risk management problems, such as, e.g., insurance/reinsurance and risk prevention. Probably Arrow’s 1963 paper (
Arrow 1963) was the first one that drown attention to risk management with insurance. How insurance can be used as a risk prevention tool was shown by (
Ehrlich and Becker 1972). Some early contributions to insurance/reinsurance problems may be found in Louberge (
Louberge 1998; 
Dionne 2001).
  3. General Compound Hawkes process
This section contains main definitions and results on one-dimensional Hawkes and general compound Hawkes processes which we will use in our paper. For the completeness, we present them in three subsections below.
  3.1. Hawkes Process
Definition 1. (One-dimensionalHawkes Process) (Hawkes 1971a, 1971b). The one-dimensional Hawkes process is a point process  which is characterized by its intensity  with respect to its natural filtration: where  and the response function or self-exciting function  is a positive function and satisfies   If 
 denotes the observed sequence of past arrival times of the point process up to time 
 the Hawkes conditional intensity is
        
The function  is sometimes also called the excitation function, and the constant  is called the background intensit .
To avoid the trivial case, we suppose that  which is, a homogeneous Poisson process. Therefore, the Hawkes process is a non-Markovian extension of the Poisson process.
We note, that the Hawkes process is a self-exciting simple point process first introduced by A. Hawkes in 1971 (
Hawkes 1971a, 
1971b). Thus, the future evolution of a self-exciting point process is influenced by the timing of past events.
Except for some very special cases (e.g., exponential self-exiting function ), the Hawkes process is non-Markovian . In this way, the Hawkes process has a long memory and depends on the entire past history .
Among many applications of the Hawkes process, we mention applications in finance, insurance, neuroscience, seismology, genome analysis, to name a few.
The above equation for  has the following interpretation: the events occur according to an intensity with a background intensity  which increases by  at each new event then decays back to the background intensity value according to the function 
Therefore, choosing  leads to a jolt in the intensity at each new event. This feature is often called a self-exciting feature: an arrival causes the conditional intensity function  in (1) and (2) to increase then the process is said to be self-exciting.
The following LLN and CLT for HP may be found in (
Bacry et al. 2013). The convergences are considered in weak sense for the Skorokhod topology.
Remark 1. By LLN  for large 
 FCLT for HP (
Bacry et al. 2013). Under LLN and 
 conditions
        
        where 
 is the c.d.f. of the standard normal distribution.
 Remark 2. By FCLT  for large  where  is a standard Wiener process (see Bacry et al. 2013).  Remarks 1 and 2 above give the ideas about the averaged and diffusion approximated HP on a large time interval.
  3.2. General Compound Hawkes Process
Definition 2. (General Compound Hawkes Process). General compound Hawkes Process is defined as (Swishchuk 2020; Swishchuk and Huffman 2020; Swishchuk 2017b) Here,  is a discrete-time finite or infinite state Markov chain with state space  or  , respectively,  is a continuous and bounded function on  and  is a Hawkes process with intensity  independent of   This general model is rich enough to:
• incorporate non-exponential distribution of inter-arrival times of orders in HFT or claims in insurance (hidden in )
• incorporate the dependence of orders or claims (via MC )
• incorporate clustering of of orders in HFT or claims (properties of )
• incorporate order or claim price changes different from one single number (in ).
This model is also very general to include:
-in finance:
• compound Poisson process:  where  is a Poisson process and  are i.i.d.r.v.
• compound Hawkes process (
Swishchuk et al.  2019): 
 where 
 is a Hawkes process and 
 are i.i.d.r.v.
• compound Markov renewal process:  where  is a renewal process and  is a Markov chain;
-in insurance:
• classical Cramer-Lundberg model:  are i.i.d.r.v., and  (then  is a poisson process);
• Sparre-Andersen model:  are i.i.d.r.v.,  and  is a renewal process;
• Markov-modulated model: 
 are i.i.d.r.v., 
 where 
 is a MC; we call this model regime-switching risk model based on GCHP (
Swishchuk 2020, 
2017b).
  3.3. LLN and FCLT for GCHP
Here:  is defined as  where  are ergodic probabilities for Markov chain 
Theorem 1. (FCLT (or Jump-Diffusion Limit) for GCHP)  Then
        
        in weak sense for the Skorokhod topology, where 
 is a standard Wiener process, 
 is defined as:
 P is a transition probability matrix for 
, i.e., 
 denotes the matrix of stationary distributions of 
 and 
 is the jth entry of 
 The expressions above are valid for both finite and infinite state Markov chain, that is why we used the notation 
 where 
X is the states space of a MC 
 Remark 3. The formulas for  and σ look much simpler in the case of two-state Markov chain   are transition probabilities of Markov chain  and   From FCLT for HP, 
Section 3, and from Theorem 1 above follow the following FCLT for GCHP (pure jump diffusion limit).
Theorem 2. (FCLT (or Pure Diffusion Limit) for GCHP  Then
        
        in weak sense for the Skorokhod topology, where 
 is the standard normal c.d.f., and 
 is defined as: 
        where 
 and 
 are defined in Theorem 1 and Lemma above, respectively.
Remark 4. From Theorem 2 it follows that  can be approximated by the pure diffusion process: where  is a standard Wiener process. This Remark 4 gives the idea about the pure diffusion approximation of GCHP on a large time interval.  Remark 5. We note, that the rate of convergence in the Theorem 2 is  where  is a constant (Swishchuk et al. 2020). Thus, the error of approximation for  in Remark 4 is small for large     4. Merton Investment Problem in Finance for the Hawkes-Based Model
Let us consider Merton portfolio optimization problem. We suppose that 
 and 
 follows the following dynamics, respectively:
      where 
 is the GCHP, 
 a discrete-time finite or infinite state Markov chain with state space 
 or 
, respectively, 
 is the interest rate.
The investor starts with an initial amount of money, say  and wishes to decide how much money to invest in risky and risk-less assets to maximize the expected utility of the terminal wealth  at the maturity , i.e., 
We denote by 
 an investor portfolio, where 
 and 
 are the amounts in cash invested in the bonds and the risky assets, respectively. The value 
 at time 
t of such portfolio is
      
We suppose that our portfolio is admissible, i.e., 
 a.s., 
 and self-financing, i.e.,
      
Suppose that 
 follows FCLT when 
 (
Swishchuk 2018; 
Swishchuk et al. 2020), thus 
 can be approximated as (see 
Section 3, Remark 4)
      
      where 
 is a average of 
 over stationary distribution of MC 
 is a background intensity, 
 is defined in 
Section 3, Theorem 2. For exponential decaying intensity 
Thus, 
 in (1) can be presented in the following way using (2):
Using 
 formula we can get from (3):
Then the change of the wealth process 
 can be rewritten in the following way, taking into account (1)–(4):
Let  be the portion of wealth invested in the assets/stocks at time 
Then, from (1)–(5), we have the following expression for 
Finally, after replacing 
 with 
 to stress the dependence of 
 on 
 from (6) we have the following equation for 
Our main goal is to solve the following optimization problem:
      meaning to maximize the wealth/value function or performance criterion
 where  is a utility function.
To find optimal 
 we follow the standard procedure in this case (see 
Bjork 2009; 
Karatzas and Shreve 1998). For the utility function we take the logarithmic one, 
 Therefore, we have to maximize 
 Solving the Equation (
7) and maximizing non-martingale term in the exponent for the solution, we can find the optimal investment solution 
      where
      
      and 
 and 
 are defined in 
Section 3, Theorem 2.
Thus, we have arrived to the following proposition:
Proposition 1. Let the conditions of Theorem 2, Section 3, are satisfied. Then the optimal investment solution for the Merton portfolio optimization problem is presented by  in (8) with  in (9).  Remark 6. (Some Insights into the Results). As we can see from the expression for  the optimal investment solution depends on all parameters of the Hawkes-based model, namely, Hawkes process’s parameters λ and  Markov chain  and function  through  For example, if  increases then  increase, and if  increases then  decreases, which follows from (8). The latter is obvious: in a very volatile market we should avoid a risk associated with investing in stocks. Furthermore, also obvious that if r increases then  decreases: it’s better to invest in bonds than in stocks.
   5. Merton Investment Problem in Insurance for the Hawkes-Based Risk Model
Let us consider 
 as the risk model based on GCHP, namely,
      
	  Here, 
 (claim sizes) is a discrete-time finite or infinite state Markov chain with state space 
 or 
, respectively, 
 is a bounded and continuous function on 
- space state for 
 and 
 is a Hawkes process with intensity 
 independent of 
 and satisfying:
Here,  is self-exiting function.
We note, that the justification for the Hawkes-based risk model in the form of the above Equation (
10) may be found in (
Swishchuk et al. 2020).
As long as we will consider optimization for a first insurer, thus we will focus on problems with infinite planning horizon.
Let 
 be an amount invested in a risky asset, and suppose that the price 
 of the risky asset follows GBM, i.e.,
      
      where 
a is a real constant, 
Further, the leftover, 
 is invested in a bank account (or bonds) with interest rate 
 thus
      
By 
 we define the number of assets held at time 
 Thus, the position of the insurer has the following evolution:
Therefore, the dynamics for 
 is (taking into account all above equations for 
 and dR(t)):
Here, 
Let  be the fraction of the total wealth  invested in the risky assets.
Then, we can rewrite the equation for 
 in the following way (we use notation 
 to stress dependence of 
 from 
):
      where 
 is a standard Brownian motion.
As for the control at time t we will take the function , i.e., the fraction of the total wealth  which should be invested in risky assets.
We will show how to find the optimal strategy  which maximizes our expected utility function,  where  is a special utility function.
We suppose that 
 follows FCLT when 
 (
Swishchuk 2018; 
Swishchuk et al. 2020), thus 
 can be approximated as (see 
Section 3, Remark 4)
      
      where 
 is a average of 
 over stationary distribution of MC 
 is a background intensity, 
 is defined in 
Section 3. For exponential decaying intensity 
Here,  is a Wiener process independent of  (the case for correlated  with , i.e., such that  can be considered as well with some modifications).
(safety loading condition (SLC)).
After substituting (12) into (11) for dR(t) we get:
      where 
 is a standard Wiener process independent of 
 and 
Generator for 
 in (13) is (here, 
)
      
 Thus, we have to maximize 
 where 
 is a utility function.
The HJB equation has the following form:
      where 
We take the exponential utility function 
Solving the HJB equation we get the optimal control 
      where 
 and 
 depends on 
 After finding
      
      where 
 we can finally find that
      
      where
      
  and 
 are defined in Theorem 1 and Lemma, 
Section 3, respectively.
Thus, we arrived to the following proposition:
Proposition 2. Let the conditions of Theorem 2, Section 3, are satisfied. Then the optimal investment solution for the Merton investment problem in insurance is presented by  in (14) with  in (15).  As we can see, the optimal control  does not depend on  thus is a constant, and contains all initial parameters of the risk model based on GCHP.
Remark 7. (Some Insights into the Results). As we can see from the expression for  the optimal control depends not only from interest rate  but also from all parameters of the Hawkes-based model, namely, Hawkes process’s parameters λ and  Markov chain  and function  through  and the asset’s parameters a and  For example, from (14) we can see that  decreases if  increases, where  is, as we could call it, a ’volatility of all volatilities’, and thus it is not a good idea to invest in stocks in highly volatile market; also, if, for example, self-exiting function  is exponential, then we can see from (14) that  depends on parameters α and β in the following way (here: ): if α increases then  is also increases, and when β increases then  decreases. Furthermore,  has a significant dependence on parameter  as we could call it, ’rate of increase of company’s capital’,  ( which follows from SLC): if θ increases, then  decreases (see (14)). The latter is understandable: if the capital of a company increases due to interest r and premium  then there is no need to take a risk investing in stocks, and as a result,  should be decreased.
 Corollary 1. Merton Investment Problem for Poisson-based Risk Model in Insurance.
The optimal control  for Poisson Risk Model (in this case,  is a Poisson process,  are i.i.d.r.vs) is (which follows from (14)): Here: