Hi, I need to solve following simultaneous equations for A, B, Y1, Y2: B * Phi(Y1 - A) + (1-B) * Phi(Y1 + A) = 0.05 B * Phi(Y2 - A) + (1-B) * Phi(Y2 + A) = 0.01 Y1 <= -1.65 Y2 >= -2.33 0 <= B <=1 Phi is CDF for standard normal If there is no unique solution, then I should be able to get some feassible solution(s) Is there any way that using R I can achieve that? Thanks for your time
Homework? We don't do homework here. Otherwise, the answer is yes, R can be used to do this. Cheers, Bert On Tue, Oct 15, 2013 at 6:24 AM, Ron Michael <ron_michael70 at yahoo.com> wrote:> Hi, > > I need to solve following simultaneous equations for A, B, Y1, Y2: > > B * Phi(Y1 - A) + (1-B) * Phi(Y1 + A) = 0.05 > B * Phi(Y2 - A) + (1-B) * Phi(Y2 + A) = 0.01 > > Y1 <= -1.65 > Y2 >= -2.33 > > 0 <= B <=1 > > Phi is CDF for standard normal > > If there is no unique solution, then I should be able to get some feassible solution(s) > > Is there any way that using R I can achieve that? > > Thanks for your time > > ______________________________________________ > R-help at r-project.org mailing list > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Bert Gunter Genentech Nonclinical Biostatistics (650) 467-7374
On 15-10-2013, at 15:24, Ron Michael <ron_michael70 at yahoo.com> wrote:> Hi, > > I need to solve following simultaneous equations for A, B, Y1, Y2: > > B * Phi(Y1 - A) + (1-B) * Phi(Y1 + A) = 0.05 > B * Phi(Y2 - A) + (1-B) * Phi(Y2 + A) = 0.01 > > Y1 <= -1.65 > Y2 >= -2.33 > > 0 <= B <=1 > > Phi is CDF for standard normal > > If there is no unique solution, then I should be able to get some feassible solution(s) > > Is there any way that using R I can achieve that?You cannot solve a system of 2 equations with 4 unknowns (variables). You can only try to find 4 values that get as close as possible (in whatever sense) to solving the system. In other words you must define a function that returns some scalar measure of closeness to a solution. Assuming this is homework I'll only give you a hint. Have a look at the functions optim and constrOptim. Both can do what you want and both are able to solve your problem. good luck, Berend