How do I define and plot a function involving random variable? [closed]











up vote
2
down vote

favorite












I am struggling to define and and plot the following function:



$qquad sin(x) + 0.15,u$



where u is a uniform random variable in the range [-1, 1].



How can I define such a function and then plot it for $x$ over the range [0, 500]?










share|improve this question















closed as unclear what you're asking by Pillsy, Sektor, JimB, N.J.Evans, gwr Nov 9 at 22:57


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 1




    Take a look at UniformDistribution and TransformedDistribution. I think it may help you.
    – Gustavo Delfino
    Nov 8 at 18:29






  • 2




    This is not really a well-defined problem. You are wanting to plot a realisation of a random process. Do you have one value of u for all values of x? Or do you have an independent value of u for every real value of x? If the latter, when you plot it (at any resolution) you will only see a vertical bar around the curve.
    – mikado
    Nov 8 at 19:31

















up vote
2
down vote

favorite












I am struggling to define and and plot the following function:



$qquad sin(x) + 0.15,u$



where u is a uniform random variable in the range [-1, 1].



How can I define such a function and then plot it for $x$ over the range [0, 500]?










share|improve this question















closed as unclear what you're asking by Pillsy, Sektor, JimB, N.J.Evans, gwr Nov 9 at 22:57


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.











  • 1




    Take a look at UniformDistribution and TransformedDistribution. I think it may help you.
    – Gustavo Delfino
    Nov 8 at 18:29






  • 2




    This is not really a well-defined problem. You are wanting to plot a realisation of a random process. Do you have one value of u for all values of x? Or do you have an independent value of u for every real value of x? If the latter, when you plot it (at any resolution) you will only see a vertical bar around the curve.
    – mikado
    Nov 8 at 19:31















up vote
2
down vote

favorite









up vote
2
down vote

favorite











I am struggling to define and and plot the following function:



$qquad sin(x) + 0.15,u$



where u is a uniform random variable in the range [-1, 1].



How can I define such a function and then plot it for $x$ over the range [0, 500]?










share|improve this question















I am struggling to define and and plot the following function:



$qquad sin(x) + 0.15,u$



where u is a uniform random variable in the range [-1, 1].



How can I define such a function and then plot it for $x$ over the range [0, 500]?







graphics function-construction probability-or-statistics






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Nov 8 at 19:25









m_goldberg

83.8k870193




83.8k870193










asked Nov 8 at 17:42









strange world

111




111




closed as unclear what you're asking by Pillsy, Sektor, JimB, N.J.Evans, gwr Nov 9 at 22:57


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.






closed as unclear what you're asking by Pillsy, Sektor, JimB, N.J.Evans, gwr Nov 9 at 22:57


Please clarify your specific problem or add additional details to highlight exactly what you need. As it's currently written, it’s hard to tell exactly what you're asking. See the How to Ask page for help clarifying this question. If this question can be reworded to fit the rules in the help center, please edit the question.










  • 1




    Take a look at UniformDistribution and TransformedDistribution. I think it may help you.
    – Gustavo Delfino
    Nov 8 at 18:29






  • 2




    This is not really a well-defined problem. You are wanting to plot a realisation of a random process. Do you have one value of u for all values of x? Or do you have an independent value of u for every real value of x? If the latter, when you plot it (at any resolution) you will only see a vertical bar around the curve.
    – mikado
    Nov 8 at 19:31
















  • 1




    Take a look at UniformDistribution and TransformedDistribution. I think it may help you.
    – Gustavo Delfino
    Nov 8 at 18:29






  • 2




    This is not really a well-defined problem. You are wanting to plot a realisation of a random process. Do you have one value of u for all values of x? Or do you have an independent value of u for every real value of x? If the latter, when you plot it (at any resolution) you will only see a vertical bar around the curve.
    – mikado
    Nov 8 at 19:31










1




1




Take a look at UniformDistribution and TransformedDistribution. I think it may help you.
– Gustavo Delfino
Nov 8 at 18:29




Take a look at UniformDistribution and TransformedDistribution. I think it may help you.
– Gustavo Delfino
Nov 8 at 18:29




2




2




This is not really a well-defined problem. You are wanting to plot a realisation of a random process. Do you have one value of u for all values of x? Or do you have an independent value of u for every real value of x? If the latter, when you plot it (at any resolution) you will only see a vertical bar around the curve.
– mikado
Nov 8 at 19:31






This is not really a well-defined problem. You are wanting to plot a realisation of a random process. Do you have one value of u for all values of x? Or do you have an independent value of u for every real value of x? If the latter, when you plot it (at any resolution) you will only see a vertical bar around the curve.
– mikado
Nov 8 at 19:31












2 Answers
2






active

oldest

votes

















up vote
4
down vote













You can define a function with randomness almost exactly like defining a regular (deterministic) function:



f[x_] := Sin[x] + 0.15*RandomVariate[UniformDistribution[{-1, 1}]];
Plot[f[x], {x, 0, 10}]


enter image description here



Between 0 and 500:



Plot[f[x], {x, 0, 500}]


enter image description here






share|improve this answer




























    up vote
    2
    down vote













    SeedRandom[0]

    data = Table[{x,
    Sin[x] + 0.15*RandomVariate[UniformDistribution[{-1, 1}]]}, {x, 0,
    500, 0.25}];

    ListLinePlot[data, Frame -> True, ImageSize -> Large]


    enter image description here






    share|improve this answer





















    • Thank you very much guys!!
      – strange world
      Nov 8 at 20:17


















    2 Answers
    2






    active

    oldest

    votes








    2 Answers
    2






    active

    oldest

    votes









    active

    oldest

    votes






    active

    oldest

    votes








    up vote
    4
    down vote













    You can define a function with randomness almost exactly like defining a regular (deterministic) function:



    f[x_] := Sin[x] + 0.15*RandomVariate[UniformDistribution[{-1, 1}]];
    Plot[f[x], {x, 0, 10}]


    enter image description here



    Between 0 and 500:



    Plot[f[x], {x, 0, 500}]


    enter image description here






    share|improve this answer

























      up vote
      4
      down vote













      You can define a function with randomness almost exactly like defining a regular (deterministic) function:



      f[x_] := Sin[x] + 0.15*RandomVariate[UniformDistribution[{-1, 1}]];
      Plot[f[x], {x, 0, 10}]


      enter image description here



      Between 0 and 500:



      Plot[f[x], {x, 0, 500}]


      enter image description here






      share|improve this answer























        up vote
        4
        down vote










        up vote
        4
        down vote









        You can define a function with randomness almost exactly like defining a regular (deterministic) function:



        f[x_] := Sin[x] + 0.15*RandomVariate[UniformDistribution[{-1, 1}]];
        Plot[f[x], {x, 0, 10}]


        enter image description here



        Between 0 and 500:



        Plot[f[x], {x, 0, 500}]


        enter image description here






        share|improve this answer












        You can define a function with randomness almost exactly like defining a regular (deterministic) function:



        f[x_] := Sin[x] + 0.15*RandomVariate[UniformDistribution[{-1, 1}]];
        Plot[f[x], {x, 0, 10}]


        enter image description here



        Between 0 and 500:



        Plot[f[x], {x, 0, 500}]


        enter image description here







        share|improve this answer












        share|improve this answer



        share|improve this answer










        answered Nov 8 at 19:16









        bill s

        52.2k375148




        52.2k375148






















            up vote
            2
            down vote













            SeedRandom[0]

            data = Table[{x,
            Sin[x] + 0.15*RandomVariate[UniformDistribution[{-1, 1}]]}, {x, 0,
            500, 0.25}];

            ListLinePlot[data, Frame -> True, ImageSize -> Large]


            enter image description here






            share|improve this answer





















            • Thank you very much guys!!
              – strange world
              Nov 8 at 20:17















            up vote
            2
            down vote













            SeedRandom[0]

            data = Table[{x,
            Sin[x] + 0.15*RandomVariate[UniformDistribution[{-1, 1}]]}, {x, 0,
            500, 0.25}];

            ListLinePlot[data, Frame -> True, ImageSize -> Large]


            enter image description here






            share|improve this answer





















            • Thank you very much guys!!
              – strange world
              Nov 8 at 20:17













            up vote
            2
            down vote










            up vote
            2
            down vote









            SeedRandom[0]

            data = Table[{x,
            Sin[x] + 0.15*RandomVariate[UniformDistribution[{-1, 1}]]}, {x, 0,
            500, 0.25}];

            ListLinePlot[data, Frame -> True, ImageSize -> Large]


            enter image description here






            share|improve this answer












            SeedRandom[0]

            data = Table[{x,
            Sin[x] + 0.15*RandomVariate[UniformDistribution[{-1, 1}]]}, {x, 0,
            500, 0.25}];

            ListLinePlot[data, Frame -> True, ImageSize -> Large]


            enter image description here







            share|improve this answer












            share|improve this answer



            share|improve this answer










            answered Nov 8 at 18:31









            Bob Hanlon

            57.5k23591




            57.5k23591












            • Thank you very much guys!!
              – strange world
              Nov 8 at 20:17


















            • Thank you very much guys!!
              – strange world
              Nov 8 at 20:17
















            Thank you very much guys!!
            – strange world
            Nov 8 at 20:17




            Thank you very much guys!!
            – strange world
            Nov 8 at 20:17



            Popular posts from this blog

            How to pass form data using jquery Ajax to insert data in database?

            National Museum of Racing and Hall of Fame

            Guess what letter conforming each word