# HP Forums

Full Version: Restricting random matrices
You're currently viewing a stripped down version of our content. View the full version with proper formatting.
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!
>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.
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?
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
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.
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-
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.
(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.
(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
Reference URL's
• HP Forums: https://www.hpmuseum.org/forum/index.php
• :