ich möchte ein Gleichungssystem mit 3 Gleichungen nach 3 Variablen (m1, m2, alpha) auflösen. Hat jemand bitte eine Idee? Ich verzweifele
Ich habe die Gleichungen definiert (funktioniert das so?):
Code: Alles auswählen
#define constants
gamma = 0.9
rho = -0.7
d = 1.5
sigma1 = 2.0
sigma2= 3.0
mu1 = 0.5
mu2 = 0.5
d1=2
d2=2
#define functions
my_func1 = function(x,z)
{1/(2*pi*sigma1(sigma1+sigma+2*rho*sigma1*sigma2*sqrt(1-rho^2)))
*exp(-(1/(2*(1-rho^2)))*((x-mu1)/sigma1^2 + (x+y-mu1-mu2)^2/(sigma1+sigma2+2*rho*sigma1*sigma2)^2)
-(2*rho*(x-mu1)*(x+y-mu1-mu2))/sigma1*(sigma1+sigma2+2*rho*sigma1*sigma2))}
my_func2 = function(y,z)
{1/(2*pi*sigma2(sigma1+sigma+2*rho*sigma1*sigma2*sqrt(1-rho^2)))
*exp(-(1/(2*(1-rho^2)))*((y-mu2)/sigma2^2 + (x+y-mu1-mu2)^2/(sigma1+sigma2+2*rho*sigma1*sigma2)^2)
-(2*rho*(y-mu2)*(x+y-mu1-mu2))/sigma2*(sigma1+sigma2+2*rho*sigma1*sigma2))}
#define equations
eq1 = function(m1,m2, alpha)
{integrate(my_func1, lower = -Inf, upper = d2-m2+alpha) - integrate(my_func2, lower = -Inf, upper = d1-m1+alpha)}
eq2 = function(m1,m2, alpha)
{(integrate(1/(sqrt(2*pi))*exp(-x^2/2), lower = -Inf, upper= (d1-mu1-m1)/sigma1)
+ integrate(integrate(my_func1, lower= -Inf, upper= d) lower=-Inf, upper=d1-m1))
-(integrate(1/(sqrt(2*pi))*exp(-x^2/2), lower = -Inf, upper= (d2-mu2-m2)/sigma2)
+ integrate(integrate(my_func1, lower= -Inf, upper= d) lower=-Inf, upper=d2-m2)}
eq3 = function(m1,m2, alpha)
{-simga1/(sqrt(2*pi))*exp(-(d1*mu1-m1)^2/(2*sigma1^2))+(m1-mu1-d1)*integrate(1/(sqrt(2*pi))*exp(-x^2/2), lower=-Inf, upper=(d1-mu1-m1)/sigma1)
+(m1-d1+alpha)*integrate(integrate(my_func1), lower=-Inf, upper=d)lower=-Inf, upper=d1-m1
+integrate(integrate(x*my_func1, lower=-Inf, upper=d),lower=d1-m1-alpha, upper=d1-m1)
+integrate(integrate(my_func2, lower=-Inf, upper=d),lower=-Inf, upper=d2-m2)
-(m2-alpha-d2)*integrate(integrate(my_func2, lower=-Inf, upper=d),lower=-Inf, upper=d2-m2-alpha)
-integrate(integrate(y*my_func2, lower=-Inf, upper=d), lower=d2-m2+alpha, upper=d2-m2) - gamma}
Anna