1

I have a single twelve-term equation for different classes of disease prevalence (nx) that looks like this:

y = f*b0*n0 + f*b1*n1 + f*b2*n2 + ... + f*b12*n12

I also have an equality constraint, such that

n0 + n1 + n2 + ... + n12 = 1  ## prevalence must add up to one

The unknowns are nx (where x=[1,12] ). I would prefer to solve this analytically, but can also make do with a numerical solution. I would be grateful for any pointers on R packages or approaches (or is this unsolvable?). The project is in support of the current humanitarian response in Iraq - so hopefully a worthwhile cause.

Web_Designer
  • 72,308
  • 93
  • 206
  • 262
  • Normally it has an infinite number of solutions. So the question is, which solution you are interested in? Till now it is an algebraic problem - not a programming problem. – jogo Apr 06 '17 at 19:22
  • 1
    Thanks both. All parameters are known save for n1..n12, namely the prevalences of (fractions of the population with) different disease risk factor profiles. y is the overall mean incidence (new disease cases) rate, f is the base incidence rate among the lowest risk profile, and the b's are multipliers for f that apply to each different risk profile (b0 is actually 1). I would like a solution that satisfies the constraint, and where each nx >0 and <1. Sorry if that doesn't help much! – Francesco Checchi Apr 06 '17 at 19:33
  • Just to clarify: how many observations (values of `y` corresponding to a vector of `b` values) do you have? If only a single one (or any value <12) then your problem is underdetermined (with the constraint, you need 11 separate y values). If exactly 11 then this can be solved by linear algebra. If >11 this is an optimization problem (finding the best possible fit) – Ben Bolker Apr 07 '17 at 03:19
  • Thanks Ben. You're right, it's underdetermined (I have only a single y data point), just wasn't thinking straight. I think I need to go back to the drawing board and try something different. Thanks again. – Francesco Checchi Apr 07 '17 at 13:56

0 Answers0