# 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

## 2 Answers

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

The question is very vague, so here is a broad answer.

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.

The estimation of the parameters are done using your data. How much do you know about linear regression?

• Not much at all apparently,I got hired for an internship for which I was perfectly qualified for and then I was told I'd be working on something else entirely... Thanks for pointing me in the right direction – Karim Sep 21 '16 at 14:40
• 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