# How to estimate the intensity rate $\lambda$ of a Cox Process

In a Cox Process, or doubly stochastic Poisson process, the intensity rate itself is a stochastic process that varies across space or time.

Let us assume that the intensity rate has the following form and depends on covariates:

$$\lambda_t = \alpha + \beta'X_t$$, with $$\alpha$$ as intercept and $$X_t$$ as covariates.

Let us further assume that we have e.g. weekly data of any financial product (e.g. CDS contracts) and macroeconomic factors on a quarterly basis. Below are data from the U.S. between 2010-Q1 and 2017-Q4, for the gdp and pce (personal consumption expenditure):

date <- seq(from = as.Date('2010-01-01'), to = as.Date('2017-10-01'), by = 'quarter')

gdp <- c(14604.845, 14745.933, 14845.458, 14939.001, 14881.301, 14989.555, 15021.149, 15190.255, 15291.035, 15362.415,
15380.802, 15384.254, 15491.878, 15521.559, 15641.336, 15793.928, 15757.570, 15935.825, 16139.513, 16220.222,
16349.970, 16460.889, 16527.587, 16547.619, 16571.573, 16663.516, 16778.148, 16851.420, 16903.240, 17031.085,
17163.894, 17271.702)

pce <- c(101.282, 101.396, 101.696, 102.237, 103.002, 104.043, 104.595, 104.956, 105.563, 105.885, 106.232, 106.804,
107.184, 107.229, 107.625, 108.089, 108.654, 109.136, 109.456, 109.384, 108.947, 109.410, 109.761, 109.807,
109.985, 110.555, 111.034, 111.583, 112.198, 112.273, 112.699, 113.458)

df <- cbind.data.frame(date, gdp, pce)


How can this simple Cox process and especially the intensity rate $$\lambda$$ be estimated?