Ok, I'll take that as an admonition to not give up too soon. =) It does feel like a toolset that would give me a lot of capability if I can only learn to control it...
Thanks again for the help. Cheers-- Greg On Apr 2, 4:31 pm, William Stein <[email protected]> wrote: > On Fri, Apr 2, 2010 at 3:30 PM, G B <[email protected]> wrote: > > That did it. I found the section in the tutorial explaining the > > different interpretations of functions more fully, and while I don't > > quite have my head around it, I think I understand the problem at a > > basic level to be that my f(x) is a symbolic expression, but > > get_random_element() is a Python function, and there's some odd > > interaction under the hood. > > > Is this something that will ever be able to be worked around > > (excepting things like trying to symbolically integrate a Python > > function)? Is Sage doomed to have these similar but not quite > > compatible entities interacting in strangely subtle ways, or is there > > Yep. Except when you understand them, they do not seem similar or strange. > > William > > > > > > > the hope that as the package matures everything will begin to play > > more nicely? > > > My concern is that, as a newbie, I'm carefully double checking each > > step of my calculation because I know that I don't know what I'm > > doing-- but eventually I'm liable to gain confidence, lose track of > > these various function types, and not realize that the results I'm > > getting are incorrect. > > > On Mar 30, 7:04 pm, William Stein <[email protected]> wrote: > >> On Tue, Mar 30, 2010 at 7:01 PM, G B <[email protected]> wrote: > >> > Apologies for being dense, but I'm missing something. All three forms > >> > ( f(x), def f(x) and f=lambda x: ) are giving the same results. > > >> > Trying: > >> > --------- > >> > var('x') > >> > T=RealDistribution('gaussian',1) > >> > def f(x): > >> > return sin(x)+ T.get_random_element() > >> > plot(f(x),(x,0,2*pi)) > >> > --------- > > >> > and > >> > -------- > >> > var('x') > >> > T=RealDistribution('gaussian',1) > >> > f=lambda x: sin(x)+ T.get_random_element() > >> > plot(f(x),(x,0,2*pi)) > >> > --------- > > >> > all give me a clean sine with a random offset, rather than sine > >> > +noise... > > >> Use > > >> plot(f, (0,2*pi)) > > >> William > > >> > On Mar 30, 2:30 pm, William Stein <[email protected]> wrote: > >> >> On Tue, Mar 30, 2010 at 2:21 PM, G B <[email protected]> wrote: > >> >> > Hi-- > > >> >> > I'm trying to figure out how to use RealDistributions to model noise. > >> >> > For example, I would like to model a signal+noise and tried using this > >> >> > construct: > > >> >> > T=RealDistribution('gaussian',1) > >> >> > f(x)=sin(x)+T.get_random_element() > >> >> > plot(f(x),(x,0,2*pi)) > > >> >> > Unfortunately, that only calls get_random_element() once, at the > >> >> > definition of f(x) and results in a perfect sinusoid offset by a > >> >> > random value. > > >> >> def f(x): > >> >> return sin(x) + T.get_random_element() > > >> >> or > > >> >> f = lambda x : sin(x) + T.get_random_element() > > >> >> William > > >> >> > How do I write this so that get_random_element() is called each time > >> >> > f(x) is evaluated? I would like to see a noisy sinusoid. > > >> >> > Thanks-- > >> >> > Greg > > >> >> > -- > >> >> > To post to this group, send email to [email protected] > >> >> > To unsubscribe from this group, send email to > >> >> > [email protected] > >> >> > For more options, visit this group > >> >> > athttp://groups.google.com/group/sage-support > >> >> > URL:http://www.sagemath.org > > >> >> > To unsubscribe from this group, send email to > >> >> > sage-support+unsubscribegooglegroups.com or reply to this email with > >> >> > the words "REMOVE ME" as the subject. > > >> >> -- > >> >> William Stein > >> >> Associate Professor of Mathematics > >> >> University of Washingtonhttp://wstein.org > > >> > -- > >> > To post to this group, send email to [email protected] > >> > To unsubscribe from this group, send email to > >> > [email protected] > >> > For more options, visit this group > >> > athttp://groups.google.com/group/sage-support > >> > URL:http://www.sagemath.org > > >> -- > >> William Stein > >> Associate Professor of Mathematics > >> University of Washingtonhttp://wstein.org > > > -- > > To post to this group, send email to [email protected] > > To unsubscribe from this group, send email to > > [email protected] > > For more options, visit this group > > athttp://groups.google.com/group/sage-support > > URL:http://www.sagemath.org > > -- > William Stein > Associate Professor of Mathematics > University of Washingtonhttp://wstein.org -- To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/sage-support URL: http://www.sagemath.org
