Groups
Groups
Sign in
Groups
Groups
AMPL Modeling Language
Conversations
About
Send feedback
Help
How can I generate a vector of random numbers using the normal distribution?
181 views
Skip to first unread message
Krzysztof W
unread,
Apr 23, 2015, 3:04:32 AM
4/23/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to am...@googlegroups.com
Dear all,
could you tell me how can I generate a vector of random numbers using the normal distribution in AMPL with mean and variance listed below?
param mean :=
1 45
2 35
3 40;
param variance :
1 2 3 :=
1 1 -2 -1
2 -2 36 -8
3 -1 -8 9;
Kind regards,
Krzystof
Robert Fourer
unread,
May 14, 2015, 11:27:42 AM
5/14/15
Reply to author
Sign in to reply to author
Forward
Sign in to forward
Delete
You do not have permission to delete messages in this group
Copy link
Report message
Show original message
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to am...@googlegroups.com
AMPL and its extended function library (
http://ampl.com/resources/extended-function-library/
) only provide samples from univariate random distributions. If you know or can compute an AA^T factorization of your n x n covariance matrix, then you can compute a multivariate normal sample from n univariate samples -- according to
http://en.wikipedia.org/wiki/Multivariate_normal_distribution#Drawing_values_from_the_distribution
. Alternatively you may use a math or stat system (MATLAB, R, ...) to compute multivariate normal samples and then read them as data into AMPL.
Bob Fourer
am...@googlegroups.com
=======
Reply all
Reply to author
Forward
0 new messages