How many parameters are estimated in a 2PL model? I'm familiar with 1PL IRT models, where you have some data matrix, and you model the latent factors, theta (the trait/ability) and (item) difficulty.
data = np.array([[1,1,1,1],
                 [1,1,1,0],
                 [1,1,0,0],
                 [1,0,0,0],
                 [0,0,0,0]])

theta = [t1,t2,t3,t4,t5]
difficulty = [d1,d,2,d3,d4]

Consider a linguistic test for children, where each row represents a different child and each column represents a different question. So the data matrix at a specific row/col captures the response of a given child on a given question. The 1PL model sigmoid(t-d) learns these latent features, such that you can quantify the difficulty of each question and the ability of each child. Note there are 9 parameters in the 1PL model (5 children, 4 questions.)
Now, the 2PL model takes a slightly different form, sigmoid(a(t-d)), where a is the discrimination factor. I'm not sure if a is:

*

*A scalar value, which is the same, regardless of child/item pairing. (10 total parameters)

*An array of length 5, one element per child. (14 parameters)

*An array of length 4, one element per question. (13 parameters)

*A matrix, one element per each child/item pairing. (29 parameters)

Q1. which of the above is the canonical form of the 2PL model? (or if it is some other configuration not listed above.)
Q2. What is a good choice of prior for a? (I've used a normal distribution on interpretation 2 above to unstable results using MCMC methods for Bayesian approach.)
Thanks!
 A: Q1
The one-parameter logistic (1PL) model predicts the $i^{th}$ students response to the $j^{th}$ item as a function of student ability $\theta_i$, the $j^{th}$ item's difficulty $b_j$, and a common slope $a$. On a 4 item test (your example) this requires estimation of 5 item parameters - a common slope and 4 difficulty parameters.
$P(X_{ij} = 1|\theta_i) = \frac{exp[a(\theta_i-b_j)]}{1+exp[a(\theta_i-b_j)]}$
The two-parameter logistic (2PL) model differs from the 1PL in that it frees the common slope to vary across the $j$ items.  On your 4 item test this requires estimation of 8 item parameters - 4 slopes and 4 difficulty parameters.
$P(X_{ij} = 1|\theta_i) = \frac{exp[a_j(\theta_i-b_j)]}{1+exp[a_j(\theta_i-b_j)]}$
Q2
Regarding a choice of prior, I have used the lognormal distribution in the past (see reference 1 for more info). However, I am not sure if IRT is the appropriate tool for your problem (regardless of the estimation technique). Even with strong priors (which you appear not to have), your sample is quite small. Even rules of thumb for using IRT typically requires sample sizes > 100 (see reference 2 for more info).
(1) Natesan, P., Nandakumar, R., Minka, T., & Rubright, J. D. (2016). Bayesian prior choice in IRT estimation using MCMC and variational Bayes. Frontiers in psychology, 7, 1422.
(2) Cappelleri, J. C., Lundy, J. J., & Hays, R. D. (2014). Overview of classical test theory and item response theory for the quantitative assessment of items in developing patient-reported outcomes measures. Clinical therapeutics, 36(5), 648-662.
