Calualte the model coefficients using maximum likelihood estimator for non-linear curve

55 Views Asked by At

I have a non-linear dataset that follows a certain distribution as such:

import numpy as np
from matplotlib import pyplot as plt


## Define the curve 
def curve(t,α,ξ,β1,β2):  

   ## Model parameters: (α, ξ, β1, β2)
   
   ## Covariate-1 of exponential distribution
   X1 = np.exp(t/20) 

   ## Covariate-2 of exponential distribution
   X2 = np.exp(t/10) 

   ## 2-parameter Weibull distribution
   ho = (α/ξ) * (t/ξ)**(α-1) 

   ## Data 
   h = ho * np.exp(β1*X1 + β2*X2)
   
   return h

## Time axis
T = np.linspace(0, 5, 1000)

## Generate the data
H = curve(T, α = 2.3 ,ξ = 4.8e-4, β1 = 1.1, β2 = 2.1)


## Plot the data
plt.rcParams["figure.figsize"] = [7.50, 7.50]
plt.rcParams["figure.autolayout"] = True
plt.plot(T, H, color='red')
plt.show()

Now let's say, given the data (T, H), that looks as such: enter image description here

how do I back-calculate the Model parameters(α, ξ, β1, β2) by using the maximum likelihood estimator?

Can somebody please help me out with this.

0

There are 0 best solutions below