grzegorzmazur / yacas

Computer calculations made easy
http://www.yacas.org
GNU Lesser General Public License v2.1
120 stars 23 forks source link

[Question] Defining linear algebra vectors and matrices with arbitrary dimensions #337

Open jeksterslab opened 2 years ago

jeksterslab commented 2 years ago

This is more of a question than an issue really. I tried to look at the Google group, but there seems to be a lack of activity there so I am asking the question here. I'll remove the issue if this is not the appropriate place.

Let's say I wish to symbolically get the gradient and the hessian matrix of the log likelihood of the multivariate normal distribution in a general sense without specifying the p dimensions, is there a way to define vectors and matrices without defining the dimensions? Can I define the p by 1 the vectors x and mu and the symmetric positive p by p matrix Sigma without defining p first?

Thanks for all the work on yacas.

Jek

grzegorzmazur commented 2 years ago

Hi,

This is a very good place, the group seems to be in coma unfortunately.

Unfortunately, what you want to achieve is not not going to be simple in yacas, and AFAIK in majority in symbolic algebra packages. In yacas a vector is just a list of expressions, so it must have a well defined size (dimension). The same holds for matrices which are just lists of rows, which in turn a lists as well.

What described is doable by defining a function which would contain a description of how to generate results and could generate them once the arguments are set to specific values, but I don't know enough about what you want to achieve to say whether this approach would work for you.