0

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?

  • 1
    if you can use algebra to reformat the equation to a `sigma = ` format then `solve()` should do the job I believe - check the documentation for that function. – Paul Stafford Allen Jul 07 '23 at 07:00
  • that is actually the case sir. in my opinion, by doing manual reformat using algebra, I am afraid that I will make a mistake that will affect the result of the 'sigma'. that's why I was wondering whether r can do it automatically – Farrelyto Theodorus Jul 07 '23 at 07:33
  • 2
    This may be worth exploring: https://stackoverflow.com/a/75689443/16730940 – Paul Stafford Allen Jul 07 '23 at 08:30

0 Answers0