Predict a predictor in a non-linear model

29 Views Asked by At

I have a non-linear model that I fit in brms:

mod <- bf(y~(I*N*X^b)/(A+k*B),
                I ~ 1,
                b ~ 1,
                k~1+(1|group),
                nl = T,
                family = gaussian())

Where y, N, X, A and B are measured continious variables.

The model fits well and now I want to predict N for my measured y and the parameters estimated with all the data. I am not sure how to acheive that. I tried using the mi() function as in this post here :

mod <- bf(y~(I*N*X^b)/(A+k*B),
          y~(I*mi(N)*X^b)/(A+k*B),
                I ~ 1,
                b ~ 1,
                k~1+(1|group),
                nl = T,
                family = gaussian())

However, if I try to run anyting such as get_prior(mod) or brm(), I get:

Error in terms.formula(formula, ...) : 
incorrect power in the formula

I am not sure if it's because mi() was not built for non-linear models or if I am using it wrong. Is there a way I can predict N from a the fitted model?

Data example:

structure(list(y = c(592200, 551335.652173913, 1720408.69551196, 
5135100, 3710068.69230388, 1904819.95681897), N = c(145L, 41L, 
72L, 3173L, 2966L, 1262L), X = c(404.822115384615, 398.5, 514.76, 
184.786096256684, 184.460601961447, 245.710784313725), A = c(10662371.6311457, 
1924044.03258699, 8519963.12725198, 44606197.3266835, 7148806.05247308, 
40475049.9899619), B = c(107809.545032839, 107809.545032839, 
107809.545032839, 319346.983077122, 319346.983077122, 319346.983077122
), group = c("A", "A", "A", "B", "B", "B")), row.names = c(NA, 
6L), class = "data.frame")
0

There are 0 best solutions below