MATLAB code to Generate Raleigh Random Variable

Click For Summary

Discussion Overview

The discussion revolves around generating Rayleigh random variables using MATLAB code, specifically focusing on the use of the rand command. Participants also explore related topics such as generating uniform random variables and comparing their ratios to a standard Cauchy density.

Discussion Character

  • Technical explanation
  • Homework-related

Main Points Raised

  • One participant requests MATLAB code to generate 100,000 Rayleigh random variables with a specified variance, using only the rand command and generating a normalized histogram.
  • Another participant provides references to MATLAB functions raylrnd and hist, suggesting they may be useful for the task.
  • A separate post introduces a different homework problem involving the generation of uniform random variables and their ratios, proposing the use of the Box-Muller transform and comparing the resulting histogram to a Cauchy density function.

Areas of Agreement / Disagreement

The discussion includes multiple competing views, with one thread focused on Rayleigh random variables and another on uniform random variables and their ratios. No consensus is reached regarding the best approach for either problem.

Contextual Notes

Participants reference specific MATLAB functions and methods, but there may be limitations in the assumptions made about the use of these functions and the mathematical properties involved in the problems presented.

neeraj.patel1
Messages
3
Reaction score
0
What is the Matlab code for generating 100,000 Raleigh Random Variable with sigma^2=2 using rand command only. Generate histogram and normalize it by dividing 1,00,000 times the bin width
 
Physics news on Phys.org
MATLAB code to find ratio of pair of uniform RV

Homework Statement



Generate 100000 pairs of Uniform RV. Find ratio of each pair of RV.Plot histogram and compare to standard Cauchy density.

Homework Equations



rand()
box muller
cauchy=1/pi*(1+x^2)
hist()

The Attempt at a Solution



use box muller to generate rv
 
(two similar threads merged)
 

Similar threads

  • · Replies 2 ·
Replies
2
Views
3K
  • · Replies 1 ·
Replies
1
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 10 ·
Replies
10
Views
2K
  • · Replies 13 ·
Replies
13
Views
3K
  • · Replies 4 ·
Replies
4
Views
1K
  • · Replies 8 ·
Replies
8
Views
2K
  • · Replies 1 ·
Replies
1
Views
9K
Replies
2
Views
2K
  • · Replies 5 ·
Replies
5
Views
3K