Notices
Results 1 to 7 of 7
Like Tree2Likes
  • 1 Post By mathman
  • 1 Post By MagiMaster

Thread: Normal distributions in Mathematica

  1. #1 Normal distributions in Mathematica 
    Forum Freshman
    Join Date
    Aug 2013
    Posts
    12
    Hello, I'm fairly new to programming and I have an upcoming due date for an assignment. I'm implementing a recursion based on normal (or Gaussian) variables. R is very useful here because it has a built-in function for generating normal distributions. The problem is, R seems to be way more difficult to work with than Mathematica (and there are fewer resources available), so I'd really rather do this in Mathematica. The trade-off is that in Mathematica I'd have to construct my own normal variables from scratch.

    Is there any simple way for me to just generate a list of 500 normally distributed numbers and then just "copy and paste" this into Mathematica? Ideally I'd like to end up in Mathematica with 5 sets of 500 normally distributed numbers with each of the sets indexed by u_1, u_2, ..., u_500.


    Reply With Quote  
     

  2.  
     

  3. #2  
    Forum Radioactive Isotope MagiMaster's Avatar
    Join Date
    Jul 2006
    Posts
    3,440
    Check the RandomReal function.


    Reply With Quote  
     

  4. #3  
    Forum Professor
    Join Date
    Jul 2008
    Location
    New York State
    Posts
    1,005
    Quote Originally Posted by oldfold View Post
    Hello, I'm fairly new to programming and I have an upcoming due date for an assignment. I'm implementing a recursion based on normal (or Gaussian) variables. R is very useful here because it has a built-in function for generating normal distributions. The problem is, R seems to be way more difficult to work with than Mathematica (and there are fewer resources available), so I'd really rather do this in Mathematica. The trade-off is that in Mathematica I'd have to construct my own normal variables from scratch.

    Is there any simple way for me to just generate a list of 500 normally distributed numbers and then just "copy and paste" this into Mathematica? Ideally I'd like to end up in Mathematica with 5 sets of 500 normally distributed numbers with each of the sets indexed by u_1, u_2, ..., u_500.
    Box

    The above describes a method to generate pairs of independent normal random variables, given pairs of random numbers.
    oldfold likes this.
    Reply With Quote  
     

  5. #4  
    Forum Freshman
    Join Date
    Aug 2013
    Posts
    12
    Quote Originally Posted by mathman View Post

    Box

    The above describes a method to generate pairs of independent normal random variables, given pairs of random numbers.
    Okay that doesn't look too bad. Just two questions:

    1. Can I just substitute every mention of U_1 and U_2 with "RandomReal[]"?

    2.Do I use Z_0 or Z_1 for my recursion based on normal variables? Some combination of both? Should I just make sure that each of Z_0 and Z_1 is used an equal number of times as the input for my recursion?
    Reply With Quote  
     

  6. #5  
    Forum Radioactive Isotope MagiMaster's Avatar
    Join Date
    Jul 2006
    Posts
    3,440
    Mathematica also has a NormalDistribution... distribution, so there's no need to use a transformation, and actually using the Box-Muller method would be a pain since it works on pairs at a time.
    oldfold likes this.
    Reply With Quote  
     

  7. #6  
    Forum Freshman
    Join Date
    Aug 2013
    Posts
    12
    Quote Originally Posted by MagiMaster View Post
    Mathematica also has a NormalDistribution... distribution, so there's no need to use a transformation, and actually using the Box-Muller method would be a pain since it works on pairs at a time.
    Wow, thank you so much. I thought I tried to look this up earlier but I think my using "Gaussian Distribution" as my key words rather than "Normal Distribution" had me doomed from the start of my search.
    Reply With Quote  
     

  8. #7  
    Forum Radioactive Isotope MagiMaster's Avatar
    Join Date
    Jul 2006
    Posts
    3,440
    I'm surprised nothing came up as the two are synonymous.
    Reply With Quote  
     

Similar Threads

  1. Normal distributions?
    By m84uily in forum Mathematics
    Replies: 13
    Last Post: March 8th, 2011, 08:31 AM
  2. Probability distributions
    By MagiMaster in forum Mathematics
    Replies: 13
    Last Post: March 13th, 2010, 01:18 PM
  3. Philosophiae naturalis principia mathematica.
    By Heinsbergrelatz in forum Physics
    Replies: 2
    Last Post: February 13th, 2010, 06:27 AM
  4. a question about mathematica 6.0
    By explorer in forum Mathematics
    Replies: 1
    Last Post: November 3rd, 2007, 02:31 PM
  5. a question about mathematica 6.0
    By explorer in forum Computer Science
    Replies: 0
    Last Post: October 28th, 2007, 10:57 AM
Tags for this Thread

View Tag Cloud

Bookmarks
Bookmarks
Posting Permissions
  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •