# Non-linear regression where dependent variables are dependent on different independent variables in R

I would like to know how to proceed with the following non linear regression analysis, which is a simplified version of my real problem.

5 Participants where asked to observe the speed of three different cars: Audis, VWs and Porsches over a ten second time frame. This gives me the following data set:

+-------+--------+------+-----------+
| time  | S_audi | S_vw | S_porsche |
+-------+--------+------+-----------+
|     1 |     20 |   15 |        40 |
|     2 |     45 |   30 |        50 |
|     3 |     60 |   45 |        60 |
|     4 |     75 |   60 |        60 |
|     5 |     90 |   70 |        60 |
|     6 |    105 |   70 |        90 |
|     7 |    120 |   70 |       120 |
|     8 |    125 |   70 |       140 |
|     9 |    130 |   70 |       160 |
|    10 |    145 |   70 |       180 |
+-------+--------+------+-----------+


After observing the last 10 seconds, the 5 participants where then asked to guess how fast the car would go in t=11. This gives me this data:

+-------------+--------+------+-----------+
| participant | F_audi | F_vw | F_porsche |
+-------------+--------+------+-----------+
|           1 |    150 |   70 |       190 |
|           2 |    155 |   70 |       200 |
|           3 |    150 |   75 |       195 |
|           4 |    160 |   80 |       190 |
|           5 |    150 |   75 |       180 |
+-------------+--------+------+-----------+


I now want to execute a non linear regression to estimate the free parameters of the following model:

$F_{i,c}=\beta_0+\beta_1*\sum_{s=0}^{n=9}w_s*S_{t-s,c}+\epsilon&space;,&space;with&space;:&space;w_s=\frac{\beta_2^s}{\sum_{j=0}^{n=9}\beta_2^j}$

$0<&space;\beta_2&space;<1$

The indices stand for the following:

i= participant
c=car brand
t=time


My problems are the sums as well as the fact that I have to estimate the parameters based on three different observations sets (for each car one). Is there a prober way to code this in R?

• Check your equation. In particular, I expect there's a missing term after the $\beta_1$. If not, the two coefficients in $\beta_0+\beta_1$ are unidentifiable – Glen_b -Reinstate Monica Jul 2 '19 at 5:23
• @Glen_b you are right there is not supposed to be a + after beta1 – Jj Blevins Jul 2 '19 at 9:06
• Now note that the $\beta_2$ term looks like you need a restriction on it or it will also not be identifiable. Do you need $-1<\beta_2<1$? – Glen_b -Reinstate Monica Jul 2 '19 at 9:16
• Sorry, yes! I need 0<beta_2<1 – Jj Blevins Jul 2 '19 at 9:20
• Okay. Lastly, as presently phrased your question appears to be purely a question about implementation in R rather than about any statistical issue. If that's a correct understanding it would not fall within the scope of our site (it would be off-topic) -- see the help center under programming for guidance. If your question is intended to be statistical in nature you would need to clarify that in the question (a question that would make sense whatever language you were using is more likely to be on topic) – Glen_b -Reinstate Monica Jul 2 '19 at 9:28