Farrelyto Theodorus
Farrelyto Theodorus

Reputation: 21

Is there any way to solve this equation in r?

Suppose I have this equation:

prev = P12/(P11 + P12)
 
with

P11 <- exp(-(sigma+alpha_h)*t-(beta1_dot_h/beta2_h)*(exp(beta2_h*(x+t))-exp(beta2_h*x)))

for P12 is a little bit long equation so I divided into 3 parts
part1 <- exp((beta1_dot_h/beta2_h)*exp(beta2_h*x)*(1-(1+gama)*exp(beta2_h*t)) - (alpha_dd + (1 + gama)*alpha_h)*t - (beta1_dot_dd/beta2_dd)*exp(beta2_dd*(x+t)))

part2 <- exp(gama*(beta1_dot_h/beta2_h)*exp(beta2_h*(x+t))*(1 - beta2_h*(t/2)) + (beta1_dot_dd/beta2_dd)*exp(beta2_dd*(x+(t/2)))*(1 - beta2_dd*(t/2))) * sigma

part3 <- (exp(((gama*alpha_h) + alpha_dd + (gama*beta1_dot_h)*exp(beta2_h*(x+(t/2))) + beta1_dot_dd*exp(beta2_dd*(x+(t/2))))*t) - 1) / ((gama*alpha_h) + alpha_dd - sigma + (gama*beta1_dot_h) * exp(beta2_h*(x+(t/2))) + (beta1_dot_dd*exp(beta2_dd*(x+t/2))))

P12 <- part1 * part2 * part3

I already obtained the value of variables except sigma

alpha_h = -0.001188
beta1_h = -5.85382
beta2_h = 0.43633
alpha_dd = -0.002006
beta1_dd = -6.24563
beta2_dd = 0.01495
beta1_dot_dd = exp(beta1_dd)
beta1_dot_h = exp(beta1_h)
prev = 0.057115867
t = 5
x = 15
gama = 0

How can I obtain the value of sigma?

Upvotes: 0

Views: 45

Answers (0)

Related Questions