Post Reply 
Restricting random matrices
03-18-2014, 10:03 AM
Post: #1
Restricting random matrices
I would like to generate some random symmetric matrices. Specifically in Toeplitz form. Can the ranm, or randMat commands be configured in some way to restrict the generated matrices to specific forms?

More generally, I'm looking for command description/help suggesting ways to control the output of the Prime's randomly generated matrices.

Thanks!
Find all posts by this user
Quote this message in a reply
03-18-2014, 03:25 PM
Post: #2
RE: Restricting random matrices
>control the output of the Prime's randomly generated matrices.

I don't believe so in this release.

I think to do topelitz you'd need a routine to do that yourself though.

TW

Although I work for HP, the views and opinions I post here are my own.
Find all posts by this user
Quote this message in a reply
03-18-2014, 05:13 PM
Post: #3
RE: Restricting random matrices
I happened to discover that (in CAS) one could restrict lower and upper bounds of the random output by using something like:
randMat(3,3,x .. y), or ranm(3,3,x .. y), where x and y are integers. That hinted at other possibilities. Most of the things I tried did not succeed, however. So I am left to wonder what the real syntax is?
Find all posts by this user
Quote this message in a reply
03-19-2014, 07:00 AM
Post: #4
RE: Restricting random matrices
Hello,

randMat(3,2,'randnorm(0,1)') (for example) will generate a random 3*2 matrix that follows the normal distribution...

These are CAS commands.

cyrille
Find all posts by this user
Quote this message in a reply
03-19-2014, 08:32 AM
Post: #5
RE: Restricting random matrices
The giac syntax for generating random matrices according to a probability distribution is
randmatrix(nrows,ncols,distribution,optional_distributions_arguments)
for example:
randmatrix(5,5,binomial,10,.3)
randmatrix(5,5,normald)
randmatrix(5,5,normald,1,2) (mu=1, sigma=2)
Some distributions available on giac are unfortunately not available on the Prime: exponentiald, studentd, fisherd, geometric, negbinomial, uniformd.
Find all posts by this user
Quote this message in a reply
03-19-2014, 09:27 AM
Post: #6
RE: Restricting random matrices
Thank you for the command help. The command set description found at: http://www.hpcalc.org/prime/docs/
Doesn't quite say it all. I suppose someday someone much smarter than I, will put together an enhanced command reference. If only that time was near ...

-Dale-
Find all posts by this user
Quote this message in a reply
03-19-2014, 05:29 PM
Post: #7
RE: Restricting random matrices
One example of a Toeplitz matrix would be:

MAKEMAT(J-I, n, n) or some variation thereof. Caution: This seems to only work in Home.

For the general case, you'll have to create your vectors which you would like to propagate along the minor diagonals and write a short PPL program.
Find all posts by this user
Quote this message in a reply
03-19-2014, 08:08 PM
Post: #8
RE: Restricting random matrices
(03-19-2014 05:29 PM)Helge Gabert Wrote:  One example of a Toeplitz matrix would be:

MAKEMAT(J-I, n, n) or some variation thereof. Caution: This seems to only work in Home.

For the general case, you'll have to create your vectors which you would like to propagate along the minor diagonals and write a short PPL program.

Thanks for putting me onto these interesting results:
With n>0,
MAKEMAT(J-I,n,n) produces a symmetric matrix left leaning.
MAKEMAT(J+I,n,n) produces a symmetric matrix right leaning.
MAKEMAT(J==I,n,n) produces the identity matrix.
MAKEMAT(J==I^-1,n,n) produces a symmetric matrix with 1's on the main diagonal, and +/- infinity otherwise.

Other operators on J and I produce interesting results, as well.
Find all posts by this user
Quote this message in a reply
02-10-2015, 10:30 AM
Post: #9
RE: Restricting random matrices
(03-19-2014 08:32 AM)parisse Wrote:  ...
Some distributions available on giac are unfortunately not available on the Prime: exponentiald, studentd, fisherd, geometric, negbinomial, uniformd.

I wonder: is it a hardware limitation or a decision of programmers?
Thank you for info.

Salvo

∫aL√0mic (IT9CLU) :: HP Prime 50g 41CX 71b 42s 39s 35s 12C 15C - DM42, DM41X - WP34s Prime Soft. Lib
Visit this user's website Find all posts by this user
Quote this message in a reply
Post Reply 




User(s) browsing this thread: 7 Guest(s)