[personal profile] barking_iguana
For once, this is not recreational, but part of the project from which I hope to make my living.

I have a matrix and a vector. Consider the vector to be vertical. I know the values of the vector and of all but one column of the matrix. I want to find the values for the remaining column. each column, including the vector, is composed of non-negative real numbers, and sums to 1. (I have a hunch constraint may not be necessary, assuming a general solution exists at all, but it is true and available if needed.) Each element of the vector is the product of all elements in the same row of the matrix, divided by the sum of all such products.

That's it. It took some work to formulate the probabilistic model and more work to recognize it as such a simply defined matrix operation, but now that I have, it's quick to state. It may not be quick to solve. If anyone cares to help, I'd be grateful.

I recognize a solution will probably be best expressed with subscripts, but standard ascii characters should be fine, using Product() and Sum() rather than capital PIs and SIGMAs.

Doh! And Yippee!!

Date: 2011-12-09 09:55 pm (UTC)
From: [identity profile] barking-iguana.livejournal.com
Well, that turned out to be embarrassingly easy, once I saw it. First, the whole problem is about ratios, scaled to be probabilities. So just deal with the ratios and re-scale when done. Now, since that denominator was only there to scale, throw it out. Now each row is independent of very other row (until scaling) so just fucking divide.

Re: Doh! And Yippee!!

Date: 2011-12-10 06:25 am (UTC)
From: [identity profile] chemoelectric.livejournal.com
Before reading the D’oh I was trying to decide whether to say wasn’t that just a series of divisions or to phrase it as being the inverse of a diagonal matrix.

Re: Doh! And Yippee!!

Date: 2011-12-10 11:59 am (UTC)
From: [identity profile] barking-iguana.livejournal.com
Well, I do need to scale after the divisions if I want probabilities. And I need the sum even if I don't scale to kno what the largest number on the 'die' is.

Re: Doh! And Yippee!!

Date: 2011-12-10 06:27 am (UTC)
From: [identity profile] chemoelectric.livejournal.com
The solution is one statement in Fortran 90. :) Has vector-elementwise arithmetic.

Re: Doh! And Yippee!!

Date: 2011-12-10 12:00 pm (UTC)
From: [identity profile] barking-iguana.livejournal.com
So does Domino's Formula Language, but I'm writing this in LotusScript.

Re: Doh! And Yippee!!

Date: 2011-12-10 06:17 pm (UTC)
From: [identity profile] chemoelectric.livejournal.com
Yeah, but Fortran is the fastest language in the West, short of writing in assembly code. You’d get your answer almost immediately. :D

Re: Doh! And Yippee!!

Date: 2011-12-10 06:22 pm (UTC)
From: [identity profile] barking-iguana.livejournal.com
Id Forth (my dad's favorite) (when compiled) the fastest language in the East?

Re: Doh! And Yippee!!

Date: 2011-12-10 08:04 pm (UTC)
From: [identity profile] chemoelectric.livejournal.com
No, I doubt it is even close. In the East, according to what I have read, they use the High Performance Fortran dialect, which never caught on in the West. :)

Re: Doh! And Yippee!!

Date: 2011-12-10 08:34 pm (UTC)
From: [identity profile] chemoelectric.livejournal.com
May interest: http://www.forthfreak.net/index.cgi?BashForth

Doesn’t interest me, because I use ZShell. :) Also I don’t use Forth these days (though I might if I had embedded programming to do).

If there is such a thing as a supercomputer-optimized Forth, whoever made it should see a psychiatrist. Also so should the people who made this: https://sites.google.com/site/visualbf/

:)
Edited Date: 2011-12-10 08:35 pm (UTC)

Re: Doh! And Yippee!!

Date: 2011-12-11 03:31 pm (UTC)
From: [identity profile] barking-iguana.livejournal.com
That is indeed, er, something else.

Re: Doh! And Yippee!!

Date: 2011-12-11 07:32 pm (UTC)
From: [identity profile] chemoelectric.livejournal.com
Almost as scary looking as Perl or C++.

Profile

Dvd Avins

March 2020

S M T W T F S
123 4567
891011121314
15161718192021
22232425262728
293031    

Style Credit

Expand Cut Tags

No cut tags
Page generated Mar. 16th, 2026 10:53 am
Powered by Dreamwidth Studios