Simply I have a function which looks like this: $$\lambda =\lambda_0 \cdot \exp(-T_0/T)\;,$$, where $\lambda_0$ and $T_0$ are unknown constants. By appplying to both sides ln() I get : $$\ln(\lambda)=\ln(\lambda_0)-T_0(1/T)$$ It's of form $y=b+a/x$. The question is how can I apply linear regression formulae? Maybe smart substitution will be enough ?
Asked
Active
Viewed 49 times
2
-
1As long as $x$ is known, clearly also $1/x$ is known! This is just the usual linear regression with $1/x$ as precictor. Just calculate $z=1/x$ and use linear regression with $z$ as predictor. Or, if you are using R, use in the model formula $y \sim I(1/x)$. – kjetil b halvorsen Feb 20 '17 at 10:25
-
@kjetil b halvorsen thanks for claryfying the issue, what do you mean by R ? – Sebastian Pinocy Feb 20 '17 at 10:39
-
@kjetilbhalvorsen why not write in as an answer instead of comment ? – Branislav Cuchran Feb 20 '17 at 10:44
-
R is a statistical programming language / software package. See here. To apply a linear regression, you should include an additive error term in your model. – Richard Hardy Feb 20 '17 at 10:44
-
Your second model is not the same as the first: it posits a different pattern of errors. Depending on what patterns are likely to hold for your data, you might need weighted least squares, a nonlinear regression, or even something else. – whuber Feb 20 '17 at 15:48
-
@SebastianPinocy Whether it makes sense to linearize and fit by least squares, or to fit the original equation by nonlinear least squares - or indeed whether some other approach is indicated, such as a generalized linear model - depends on the behavior of the error term (which you have ignored in your formulation). Numerous posts on site address this issue in a bit more detail (on a number of functions). See Pitfalls in Fitting Nonlinear Models by Transforming to Linearity...ctd – Glen_b Feb 21 '17 at 02:44
-
ctd... and Regression when response variable is a function and Need GLM ideas for nonlinear biochemical model. Also see some of the images and discussion here which may help clarify some issues. – Glen_b Feb 21 '17 at 03:04
1 Answers
-1
Yes, if you take $\frac{1}{T}$ as predictor and $\ln(\lambda)$ as response, you just have a very usual linear regression problem.
Anyway, you should remember to check linear regression assumptions with the transformed variables.
Pere
- 6,583
-
1Note that $T_0$ is unknown so you can't use it to make a predictor. (You may want to read whuber's comment under the question as well) – Glen_b Feb 21 '17 at 02:41