I'm trying to find a mathematical model for the problem below but it seems much complicated than I thought and I can't find a way to express my problem mathematically.
Problem: For an insurance company, in a year, there are $N$ claims ($N$ is a random variable). Each claim can be 1 of 2 types $A$ or $B$. And each claim is associated with a claim amount.
I want to model the rank of the claim amount of claim type $B$ with respect to other events in a year. I mean, to say "if there is a event of type $B$, it should be the largest / second largest event in the year..."
Example to illustrate:
In Year 2021, there are 5 events $$ \begin{array}{ccc} \text{Event} & \text{Claim Amount} & \text{Type}\\ \hline 1 & 10 & A \\ 2 & 15 & A \\ 3 & 5 & B \\ 4 & 20 & A \\ 5 & 30 & B \\ \end{array} $$The rank of claim amount of event type $B$ in this year are $1$ and $5$.
I intend to use $R =$ rank (event type B in 1 year) and by doing so, I will obtain an empirical vector of rank so that I can eventually fit a distribution on it.
But the difficulty is that $N$ is also a random variable (for example, in a year, $N$ can be 10 events, but if in the past, the empirical vector of rank only contains the rank up to $9^{th}$, the model will be wrong).
Could you please suggest me a solution to overcome the difficulty? Thank you very much for your help!