Transferring probability histogram into a Beta distribution and adding this to an empty matrix

22 views Asked by At

I have the following info for when a person can get infected:

age <- c(15, 16, 17, 18, 19, 20, 21)
probabilityofinfection <- c(0.0010169, 0.054234662, 0.236308169, 0.419834391, 0.239213597, 0.047455329, 0.001936952)
sum(getinfected) #adds up to 1

How do I put this into an rbeta distribution by using optimisation to get the shape parameters? And how do I add this to an empty matrix (500 rows, 10 columns) in a binomial fashion (i.e. infected= 1, uninfected=0). Thanks

0

There are 0 answers