# Extracting a 2 variable equation from a set of data

So I am currently trying to establish an equation based on experimental data. during the experiment, I varied 2 variables, the ambient temperature and the ambient pressure. Each variable was modified 49 times and so I have 2401 results for the engine power generated.

What's the best method to use in order to find an equation that uses those 2 variables to give me the power output? Power=F(Tamb,Pamb)

So far, I've tried generating a polynomial equation function of each variable independently and trying to combine them afterwards, however the results generated using this method produced errors too large to be considered successful.

Thank you,

Karim

If you have access to statistical software you can run a Nonlinear Least Squared analysis to estimate the structural parameters of the following model:

$$Power=Temp^{\alpha} + Pressure^{\beta}$$.

Estimating $\alpha$ and $\beta$ will give you parameters that best fit your data.

• Thanks for getting me started, looking up software at the moment. I'll take any recommendations if you'd be so kind. – Karim Sep 21 '16 at 14:42
• Stata has a nice package for NLS. I'm sure you can do it in R as well (and R is free), but I wouldn't know how to do it as I'm a Stata user. – Peter Sep 21 '16 at 14:55

I think you are asking what kind of model you can fit to data using $Y = \small \texttt{power output}$ as a response variable and $X_1 = \small \texttt{ambient temperature}$ and $X_2 = \small \texttt{ambient pressure}$ as predictor variables.
Your model is then $E(Y | X) = X^T\beta = X_1 \beta_1 + X_2 \beta_2 + \beta_0$, where $\beta_i$, for $i=\{0,1,2\}$, are estimated parameters.
• I use the statistical programming language called R with a user interface called RStudio (both free for all operating systems) for these types of problems. If you are interested, you can use the lm command in R to perform linear regression, there is a lot of literature on this. Good luck! – K. Brix Sep 21 '16 at 14:59