Drexel dragonThe Math ForumDonate to the Math Forum



Search All of the Math Forum:

Views expressed in these public forums are not endorsed by Drexel University or The Math Forum.


Math Forum » Discussions » Software » comp.soft-sys.matlab

Topic: Simulating data
Replies: 0  

Advanced Search

Back to Topic List Back to Topic List  
Farjana Misu

Posts: 1
Registered: 12/29/12
Simulating data
Posted: Dec 29, 2012 5:04 AM
  Click to see the message monospaced in plain text Plain Text   Click to reply to this topic Reply

Hi


If Z is logistic binary with probability P(Z=1|W)=1/(1+exp(2-5W)),
where W is uniform(0,1) then i have tried in this way to simulate Z.


rand('seed',1);
W=rand(500,1);
p=1./(1+exp(2-5*W));
for i=1:500;
Z(i)=random('bino',1,p(i),1,1);
end
Z;

Is it the correct way?



Point your RSS reader here for a feed of the latest messages in this topic.

[Privacy Policy] [Terms of Use]

© Drexel University 1994-2014. All Rights Reserved.
The Math Forum is a research and educational enterprise of the Drexel University School of Education.