Prometheus Posted April 13, 2022 Posted April 13, 2022 I don't think she was doing any more than eyeballing the graph. It's maybe easiest to see at x=0, y seems to be about 1 at its max, and so too when y=0 x is about 1. Depends how much experience you have in R. Try following this example. Wolfram alpha might be better if easy is all you want.
joigus Posted April 13, 2022 Posted April 13, 2022 https://www.wolframalpha.com/input?i=plot+(x^2%2By^2)exp((-x^2-y^2)) The intuitive idea you can get from highlighting x=1 and y=1 curves: And another analytic tool is using polar coordinates, \[ \left(x^{2}+y^{2}\right)\exp\left(-x^{2}-y^{2}\right)=r^{2}\exp\left(-r^{2}\right) \] and then do a Taylor-series expansion around r=1 in a small positive parameter \( \varepsilon \), \[ r=1+\varepsilon \] \[ \varepsilon>0 \] \[ r^{2}\exp\left(-r^{2}\right)=\left(1+\varepsilon\right)^{2}\exp\left(-\left(1+\varepsilon\right)^{2}\right)=\left(1+2\varepsilon+\varepsilon^{2}\right)\exp\left(-1-2\varepsilon-\varepsilon^{2}\right)= \] \[ =e^{-1}\left(1+2\varepsilon+\varepsilon^{2}\right)\exp\left(-2\varepsilon-\varepsilon^{2}\right)= \] \[ =e^{-1}\left(1+2\varepsilon+\textrm{order}\left(\varepsilon^{2}\right)\right)\left(1-2\varepsilon+\textrm{order}\left(\varepsilon^{2}\right)\right)= \] \[ =e^{-1}\left(1-4\varepsilon^{2}\right)+\textrm{order}\left(\varepsilon^{2}\right) \] And, as you see, the first-order correction is negative no matter what orientation with respect to the origin (just where the bump is) you place yourself. Same goes for 1-epsilon, of course. 2
studiot Posted April 13, 2022 Posted April 13, 2022 (edited) The easiest way to visualise this since the circle is symmetric is to consider the simpler function f(p) = pe-p, where p = (x2 + y2) any plane section will have this form. When p = 0.5 f(p) is approximately 0.3 When p =1, f(p) is approximately 0.4 When p = 2 f(p) is approximately 0.2 and f(p) is continuous so there is a max between p = (x2 + y2) = 0.3 and p = (x2 + y2) = 2 Edited April 13, 2022 by studiot 2
Dhamnekar Win,odd Posted April 13, 2022 Author Posted April 13, 2022 (edited) 4 hours ago, joigus said: https://www.wolframalpha.com/input?i=plot+(x^2%2By^2)exp((-x^2-y^2)) The intuitive idea you can get from highlighting x=1 and y=1 curves: And another analytic tool is using polar coordinates, (x2+y2)exp(−x2−y2)=r2exp(−r2) and then do a Taylor-series expansion around r=1 in a small positive parameter ε , r=1+ε ε>0 r2exp(−r2)=(1+ε)2exp(−(1+ε)2)=(1+2ε+ε2)exp(−1−2ε−ε2)= =e−1(1+2ε+ε2)exp(−2ε−ε2)= =e−1(1+2ε+order(ε2))(1−2ε+order(ε2))= =e−1(1−4ε2)+order(ε2) And, as you see, the first-order correction is negative no matter what orientation with respect to the origin (just where the bump is) you place yourself. Same goes for 1-epsilon, of course. So, we will get the same first order correction for [math]1-\epsilon[/math] Isn't it? 6 hours ago, Prometheus said: I don't think she was doing any more than eyeballing the graph. It's maybe easiest to see at x=0, y seems to be about 1 at its max, and so too when y=0 x is about 1. Depends how much experience you have in R. Try following this example. Wolfram alpha might be better if easy is all you want. In which R package De Jong function is available ? Edited April 13, 2022 by Dhamnekar Win,odd removed reply from the quote
joigus Posted April 13, 2022 Posted April 13, 2022 49 minutes ago, Dhamnekar Win,odd said: Taylor series expansion of the function (r2⋅e−r2;r;1;2)=e−1−0.73576⋅r2 From this expansion, what is the conclusion we can draw out? I understood your all calculations but didn't understand your secondlast sentence 'the first order correction is - ve" . Would you explain your answer a little bit more? Sorry. I meant the next-to-zeroth-order correction. If you Taylor-series expand you immediately see it's a maximum, because there0s no 1st-order correction and the 2nd-order correction is negative. That's what I mean, and sorry for the confusion. 1
Prometheus Posted April 15, 2022 Posted April 15, 2022 On 4/13/2022 at 3:43 PM, Dhamnekar Win,odd said: In which R package De Jong function is available ? You don't need a package if you can specify the function yourself, which you did in the OP. Check out the link i embedded above - you just need to respecify the function.
Dhamnekar Win,odd Posted April 15, 2022 Author Posted April 15, 2022 1 hour ago, Prometheus said: You don't need a package if you can specify the function yourself, which you did in the OP. Check out the link i embedded above - you just need to respecify the function. > fdejong <- function(x,y){return(x^2 +y^2)* exp(-(x^2+y^2))} > x<- seq(-1,1 , length=2) > y <- x > z <- outer (x,y, fdejong) > require(lattice) Loading required package: lattice > wireframe(z, drape=T, col.regions=rainbow(100)) What is this? I don't get it.😕🤔😧
Prometheus Posted April 17, 2022 Posted April 17, 2022 On 4/15/2022 at 1:29 PM, Dhamnekar Win,odd said: What is this? I don't get it.😕🤔😧 Learning to code is learning to troubleshoot. I suggest you go through each line of code separately and see if they're doing what you think they should do. I don't use r, but i can see 2 places this snippet of code fails. 1
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now