)
I need help on creating a weighted random number for each column of my matrix and I would be very happy if someone could help me :-) I have a Matrix containing different probabilities of dying. This is a 55x200 Matrix (Probabilities of dying for the next 0 till 54 years for 200 individuals). I want to generate 1 random number which lies between 0 and 54 for each column. Every entry within a matrix-column should correspond to its respective number 0 till 54 indicating the probability of living x more years. Therefore I want to generate one random number for each individual based on its respective probability of living x more years!I tried to use the command randsample(years,1,true,Ptx1) in various constelations but nothing worked :-/ (years= Vector of 0:54, Ptx1 55x200 Matrix) and I even tried to define yearsm=as a 55x200 Matrix repeating the vector entries 200 times! I hope I could make clear what my problem is! Thank you in advance :-)
Aucun commentaire:
Enregistrer un commentaire