Assigning probability to each row of a matrix (observation); and creating exogenous demand sample based on observed matrix
1 view (last 30 days)
Show older comments
- I have an m by n matrix - would like to assign probability to each row of the matrix.
- Each row now has a probability associated with it and can be treated as one observation. I need to draw N (the sample size) number of these rows based on their assigned probability. Not sure how to do it. (referred to a link created in 2012 but don't understand the solution)
2 Comments
Mohammad Sami
on 30 Mar 2020
Do you have statistics and machine learning toolbox.
If so you can use the randsample function for a weighted selection of rows.
Answers (0)
See Also
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!