필터 지우기
필터 지우기

Multiplying two matrices of probabilities with different sizes.

조회 수: 2 (최근 30일)
Haya A
Haya A 2018년 8월 23일
댓글: Haya A 2018년 8월 24일
Hi guys,
I have two matrices, with different sizes,that represents the probabilities of occurrence for two independent events. I want to create a new matrix that represent the probability of occurrence for these two events together. I tried multiplying the matrices,but the sum of the probabilities did not produce 1.
any Ideas? this is the code :
attributesize=4;
FileNumber=10;
BSTotal=7;
Files=exprnd(1,attributesize,FileNumber);
Files=Files./repmat(sum(Files,1),attributesize,1);
BS=exprnd(1,BSTotal,attributesize);
BS=BS./repmat(sum(BS,2),1,attributesize);
R= BS*Files;
  댓글 수: 5
Torsten
Torsten 2018년 8월 23일
편집: Torsten 2018년 8월 23일
Your matrices contain random numbers from an exponential distribution. What makes you think they contain probabilities of occurence of a certain event ?
And why probabilitie s ? The occurence of an event has one unique probability.
Haya A
Haya A 2018년 8월 23일
I'm generating random probabilities of occurrence for each attributes, or feature, and the sum of all probabilities are 1. I want to calculate the probability that certain file x with the probability , for example 0.23, for feature m, will be requested by user y with certain probability to the same feature. I want to do it for all.

댓글을 달려면 로그인하십시오.

답변 (1개)

Kaushik Lakshminarasimhan
Kaushik Lakshminarasimhan 2018년 8월 24일
편집: Kaushik Lakshminarasimhan 2018년 8월 24일
I don't think there is anything wrong with your code. What is wrong is your interpretation of the outcome of multiplying your matrices.
Each entry of R denotes the probability that the file actually contains the attribute that the user requests. Specifically, R(i,j) denotes the probability that file number j contains the attribute that user number i requested. This number need not be 1. Also, the sum of columns or sum of rows of R need not be 1 --- the sums are not even probability values because they represent a sum of probabilities of events that are not mutually exclusive.
  댓글 수: 1
Haya A
Haya A 2018년 8월 24일
Yes, I understand that. But I am trying to generate random requests for these files with R probabilities using randsrc function, and I can't do that if the sum of columns or rows is not 1. do you have suggestion?

댓글을 달려면 로그인하십시오.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by