Hello everybody! Spse I have the following X <- seq(1:100) #(a dim(100) sequence of integers 1:100 representing the possible actions of player 1 and player2 in a game) BR2X<- br2(X) #(a dim(100) sequence of points on range (1,100) representing the best response function of player 2 to player 1:s actions) BR1X<- br1(X) #(a dim(100) sequence of points on range (1,100) representing the best response function of player 1 to player 2:s actions) To illustrate Nash equilibrium , I would like to plot these in the same picture, with inverted axes, so that (X,BR2) is plotted with X on horizontal and BR2 on vertical axis (X, BR1) is plotted with X on vertical axis and BR1 on horizontal axis. How can I do that ? Juhana Vartiainen juhana.vartiainen at labour.fi -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
HI, On Wed, 20 Mar 2002, Juhana Vartiainen wrote: |Hello everybody! | |Spse I have the following | |X <- seq(1:100) #(a dim(100) sequence of integers 1:100 representing |the possible actions of player 1 and player2 in a game) |BR2X<- br2(X) #(a dim(100) sequence of points on range (1,100) |representing the best response function of player 2 to player 1:s |actions) |BR1X<- br1(X) #(a dim(100) sequence of points on range (1,100) |representing the best response function of player 1 to player 2:s |actions) | |To illustrate Nash equilibrium , I would like to plot these in the same |picture, with inverted axes, so that | |(X,BR2) is plotted with X on horizontal and BR2 on vertical axis |(X, BR1) is plotted with X on vertical axis and BR1 on horizontal axis. | |How can I do that ? You should do something like this: plot(X, BR2) lines(BR1, X) # or points(BR1, X) Note that plot() removes everything that were in the plot window before and calculates new axes etc., but lines() keeps the previous graph and uses the same axes. You may consider using plot(..., lwd=2) to get the BR-lines thicker than the axes. Note also that you may use X <- 1:100 instead of seq(1:100) -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Wed, Mar 20, 2002 at 09:41:04AM +0200, Juhana Vartiainen wrote:> (X,BR2) is plotted with X on horizontal and BR2 on vertical axis > (X, BR1) is plotted with X on vertical axis and BR1 on horizontal axis.help(plot) help(points) as in plot(X,BR2) points(BR1,X) help(par), with attention to "pch" would also probably help. This, and more, is all in "An Introduction to R" - $RHOME/doc/R-intro.pdf Cheers Jason -- Indigo Industrial Controls Ltd. 64-21-343-545 jasont at indigoindustrial.co.nz -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Jason Turner wrote:> > On Wed, Mar 20, 2002 at 09:41:04AM +0200, Juhana Vartiainen wrote: > > (X,BR2) is plotted with X on horizontal and BR2 on vertical axis > > (X, BR1) is plotted with X on vertical axis and BR1 on horizontal axis. > > help(plot) > help(points) > > as in > > plot(X,BR2) > points(BR1,X) > > help(par), with attention to "pch" would also probably help. > > This, and more, is all in "An Introduction to R" - $RHOME/doc/R-intro.pdfLet me add: You can also generate axis for the second set of data with axis() manually (e.g. at the top and right hand side of the plot), see ?axis for details. Uwe Ligges -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
Hello Juhana make the first ploot as normal: plot(X, BR2) and the second one with points: points(BR1, X, col='red') perhaps you have to set xlim and ylim in plot, so that every point in BR1 is shown another aproach is: plot(c(BR2,X),c(X,BR1),col=rep('black',length(X),),rep('red',length(X)) I hope it help gruess joerg Juhana Vartiainen wrote:> > Hello everybody! > > Spse I have the following > > X <- seq(1:100) #(a dim(100) sequence of integers 1:100 representing > the possible actions of player 1 and player2 in a game) > BR2X<- br2(X) #(a dim(100) sequence of points on range (1,100) > representing the best response function of player 2 to player 1:s > actions) > BR1X<- br1(X) #(a dim(100) sequence of points on range (1,100) > representing the best response function of player 1 to player 2:s > actions) > > To illustrate Nash equilibrium , I would like to plot these in the same > picture, with inverted axes, so that > > (X,BR2) is plotted with X on horizontal and BR2 on vertical axis > (X, BR1) is plotted with X on vertical axis and BR1 on horizontal axis. > > How can I do that ? > > Juhana Vartiainen > juhana.vartiainen at labour.fi > > -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- > r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html > Send "info", "help", or "[un]subscribe" > (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch > _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._-- Joerg Maeder .:|:||:..:.||.:: maeder at atmos.umnw.ethz.ch Tel: +41 1 633 36 25 .:|:||:..:.||.:: http://www.iac.ethz.ch/staff/maeder PhD student at INSTITUTE FOR ATMOSPHERIC AND CLIMATE SCIENCE (IACETH) ETH Z?RICH Switzerland -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._
On Wed, 20 Mar 2002, Wolfgang Huber wrote:> > Hi G?ran, > > Q1: first, it seems that the validity of this guarantee depends on the "method" used. Using method="L-BFGS-B", I found that that guarantee seemed to hold for the iterations towards the optimum, but was violated for the final evaluation of the hessian. After submitting a bug report it appears that the documentation will be updated in version 1.5. > > Q2: You can use e.g. a variable local to prov() which is visible both to > fun() and d.fun(), manipulating it with "<<-" in fun(). Given the > uncertainty about this guarantee, it seems advisable to also store the > fun() parameters in there, and explicitely verify in d.fun() whether the > parameters are really the same...Yes, that should work! I had totally erased "<<-" from my R-knowledge-database after all the condemnations of its use I have read on this very list. Maybe this is an exception...? Thanks, G?ran> > Best regards, > Wolfgang. > > > > Dr. Wolfgang Huber > DKFZ > Dep. Molecular Genome Analysis > 69120 Heidelberg > Germany >-- G?ran Brostr?m tel: +46 90 786 5223 professor fax: +46 90 786 6614 Department of Statistics http://www.stat.umu.se/egna/gb/ Ume? University SE-90187 Ume?, Sweden e-mail: gb at stat.umu.se -.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.-.- r-help mailing list -- Read http://www.ci.tuwien.ac.at/~hornik/R/R-FAQ.html Send "info", "help", or "[un]subscribe" (in the "body", not the subject !) To: r-help-request at stat.math.ethz.ch _._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._._