Can I use Linear Regression to model a nonlinear function? Announcing the arrival of Valued Associate #679: Cesar Manara Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern) 2019 Moderator Election Q&A - Questionnaire 2019 Community Moderator Election ResultsMultivariate linear regression in PythonWhen to use Linear Discriminant Analysis or Logistic Regressionlinear regression with “partitioned” dataHow to decide power of independent variables in case of non-linear polynomial regression?Best way to normalize datasets for a linear regression model?non-binary nominal variable in linear regressionLinear Model for Linear RegressionFinding the equation for a multiple and nonlinear regression model?Linear regression space transformationDoubts on using linear regression for change attribution
Are my PIs rude or am I just being too sensitive?
Is 1 ppb equal to 1 μg/kg?
What LEGO pieces have "real-world" functionality?
Dominant seventh chord in the major scale contains diminished triad of the seventh?
Using et al. for a last / senior author rather than for a first author
What does '1 unit of lemon juice' mean in a grandma's drink recipe?
Determinant is linear as a function of each of the rows of the matrix.
Is there a "higher Segal conjecture"?
What is the longest distance a 13th-level monk can jump while attacking on the same turn?
Gastric acid as a weapon
If 'B is more likely given A', then 'A is more likely given B'
Super Attribute Position on Product Page Magento 1
How do I mention the quality of my school without bragging
ListPlot join points by nearest neighbor rather than order
What happens to sewage if there is no river near by?
What do you call a phrase that's not an idiom yet?
What do you call a plan that's an alternative plan in case your initial plan fails?
Storing hydrofluoric acid before the invention of plastics
What is the musical term for a note that continously plays through a melody?
How to motivate offshore teams and trust them to deliver?
Proof involving the spectral radius and the Jordan canonical form
Diagram with tikz
How does a Death Domain cleric's Touch of Death feature work with Touch-range spells delivered by familiars?
Sorting numerically
Can I use Linear Regression to model a nonlinear function?
Announcing the arrival of Valued Associate #679: Cesar Manara
Planned maintenance scheduled April 17/18, 2019 at 00:00UTC (8:00pm US/Eastern)
2019 Moderator Election Q&A - Questionnaire
2019 Community Moderator Election ResultsMultivariate linear regression in PythonWhen to use Linear Discriminant Analysis or Logistic Regressionlinear regression with “partitioned” dataHow to decide power of independent variables in case of non-linear polynomial regression?Best way to normalize datasets for a linear regression model?non-binary nominal variable in linear regressionLinear Model for Linear RegressionFinding the equation for a multiple and nonlinear regression model?Linear regression space transformationDoubts on using linear regression for change attribution
$begingroup$
I have recently started studying the basics about regression, and as a beginner I started by Linear Regression.
I read this article that says that for this particular type of regression the relationship between independent and dependent variables has to be linear, which to me implies that I can only predict "lines" with Linear regression:
https://www.analyticsvidhya.com/blog/2015/08/comprehensive-guide-regression/
But then I started wondering about how to model functions like "y = log(x)" or "y= sqrt(x)" or "y=exp(x)" or "y=tan(x)" or other nonlinear functions by definition which are not "lines" but "curves".
Then I carried on doing research until I found this article that says that it is not the relationship between the independent and dependent variables that should be linear, but the final functional form passed to the model:
https://medium.freecodecamp.org/learn-how-to-improve-your-linear-models-8294bfa8a731
I want to know if that is really the case, and is it always possible to do this "change" in the functional form? Also if it is possible to use linear regression for nonlinear functions, is it still correct to measure the performance of the model using R_square metric?
Thank you.
regression linear-regression
$endgroup$
bumped to the homepage by Community♦ 40 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
$begingroup$
I have recently started studying the basics about regression, and as a beginner I started by Linear Regression.
I read this article that says that for this particular type of regression the relationship between independent and dependent variables has to be linear, which to me implies that I can only predict "lines" with Linear regression:
https://www.analyticsvidhya.com/blog/2015/08/comprehensive-guide-regression/
But then I started wondering about how to model functions like "y = log(x)" or "y= sqrt(x)" or "y=exp(x)" or "y=tan(x)" or other nonlinear functions by definition which are not "lines" but "curves".
Then I carried on doing research until I found this article that says that it is not the relationship between the independent and dependent variables that should be linear, but the final functional form passed to the model:
https://medium.freecodecamp.org/learn-how-to-improve-your-linear-models-8294bfa8a731
I want to know if that is really the case, and is it always possible to do this "change" in the functional form? Also if it is possible to use linear regression for nonlinear functions, is it still correct to measure the performance of the model using R_square metric?
Thank you.
regression linear-regression
$endgroup$
bumped to the homepage by Community♦ 40 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
$begingroup$
I have recently started studying the basics about regression, and as a beginner I started by Linear Regression.
I read this article that says that for this particular type of regression the relationship between independent and dependent variables has to be linear, which to me implies that I can only predict "lines" with Linear regression:
https://www.analyticsvidhya.com/blog/2015/08/comprehensive-guide-regression/
But then I started wondering about how to model functions like "y = log(x)" or "y= sqrt(x)" or "y=exp(x)" or "y=tan(x)" or other nonlinear functions by definition which are not "lines" but "curves".
Then I carried on doing research until I found this article that says that it is not the relationship between the independent and dependent variables that should be linear, but the final functional form passed to the model:
https://medium.freecodecamp.org/learn-how-to-improve-your-linear-models-8294bfa8a731
I want to know if that is really the case, and is it always possible to do this "change" in the functional form? Also if it is possible to use linear regression for nonlinear functions, is it still correct to measure the performance of the model using R_square metric?
Thank you.
regression linear-regression
$endgroup$
I have recently started studying the basics about regression, and as a beginner I started by Linear Regression.
I read this article that says that for this particular type of regression the relationship between independent and dependent variables has to be linear, which to me implies that I can only predict "lines" with Linear regression:
https://www.analyticsvidhya.com/blog/2015/08/comprehensive-guide-regression/
But then I started wondering about how to model functions like "y = log(x)" or "y= sqrt(x)" or "y=exp(x)" or "y=tan(x)" or other nonlinear functions by definition which are not "lines" but "curves".
Then I carried on doing research until I found this article that says that it is not the relationship between the independent and dependent variables that should be linear, but the final functional form passed to the model:
https://medium.freecodecamp.org/learn-how-to-improve-your-linear-models-8294bfa8a731
I want to know if that is really the case, and is it always possible to do this "change" in the functional form? Also if it is possible to use linear regression for nonlinear functions, is it still correct to measure the performance of the model using R_square metric?
Thank you.
regression linear-regression
regression linear-regression
asked Mar 15 at 15:03
Ahl AhlAhl Ahl
111
111
bumped to the homepage by Community♦ 40 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
bumped to the homepage by Community♦ 40 mins ago
This question has answers that may be good or bad; the system has marked it active so that they can be reviewed.
add a comment |
add a comment |
1 Answer
1
active
oldest
votes
$begingroup$
You are asking two different questions:
- What is linear regression?
Linear regression means that, given a response variable $y$ and a set of predictors $x_i$, you are assuming (whether or not this is true is another matter) to model your response variable as
$$
y^(j)=sum_i=1^N x_i^(j)beta^i + epsilon^(j)
$$
for each observation $y^(j)$, where $epsilon^(j)$ is an error term with vanishing expectation value. The purpose of the algorithm is to find the set of $beta^i$ to minimise the errors between the above formula and the actual values of the response.
- May I use linear regressio to model non-linear functions?
You may use the linear regression to model anything you want, this does not necessarily mean that the results will be a good fit. The mere decision to use a model makes no assumptions on whether the underlying equation is in fact reflected by the model you choose. In case of linear regression you are essentially approximating an $N$-dimensional manifold (where all true points belong) with their projections onto a plane. Whether or not this is a good idea it depends on the data.
I want to know if that is really the case, and is it always possible to do this "change" in the functional form?
By using this or that other model you are not changing the functional form of the underlying variables. You are just dictating that the original relation (that you do not know) can be approximated by the model you choose.
Is it still correct to measure the performance of the model using R_square metric?
The $R^2$ is defined as the ratio between the residual sum of squares of your model over the residual sum of squares of the average. Basically it tells how much of the variance of the data is explained by your model compared to just taking a straight line (in correspondence of the average) passing through all your data points.
$endgroup$
$begingroup$
Thank you for you answer. It made a lot of dark points clearer in my mind!
$endgroup$
– Ahl Ahl
Mar 15 at 16:05
add a comment |
Your Answer
StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "557"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);
StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);
else
createEditor();
);
function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: false,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
imageUploader:
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
,
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);
);
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f47355%2fcan-i-use-linear-regression-to-model-a-nonlinear-function%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
1 Answer
1
active
oldest
votes
1 Answer
1
active
oldest
votes
active
oldest
votes
active
oldest
votes
$begingroup$
You are asking two different questions:
- What is linear regression?
Linear regression means that, given a response variable $y$ and a set of predictors $x_i$, you are assuming (whether or not this is true is another matter) to model your response variable as
$$
y^(j)=sum_i=1^N x_i^(j)beta^i + epsilon^(j)
$$
for each observation $y^(j)$, where $epsilon^(j)$ is an error term with vanishing expectation value. The purpose of the algorithm is to find the set of $beta^i$ to minimise the errors between the above formula and the actual values of the response.
- May I use linear regressio to model non-linear functions?
You may use the linear regression to model anything you want, this does not necessarily mean that the results will be a good fit. The mere decision to use a model makes no assumptions on whether the underlying equation is in fact reflected by the model you choose. In case of linear regression you are essentially approximating an $N$-dimensional manifold (where all true points belong) with their projections onto a plane. Whether or not this is a good idea it depends on the data.
I want to know if that is really the case, and is it always possible to do this "change" in the functional form?
By using this or that other model you are not changing the functional form of the underlying variables. You are just dictating that the original relation (that you do not know) can be approximated by the model you choose.
Is it still correct to measure the performance of the model using R_square metric?
The $R^2$ is defined as the ratio between the residual sum of squares of your model over the residual sum of squares of the average. Basically it tells how much of the variance of the data is explained by your model compared to just taking a straight line (in correspondence of the average) passing through all your data points.
$endgroup$
$begingroup$
Thank you for you answer. It made a lot of dark points clearer in my mind!
$endgroup$
– Ahl Ahl
Mar 15 at 16:05
add a comment |
$begingroup$
You are asking two different questions:
- What is linear regression?
Linear regression means that, given a response variable $y$ and a set of predictors $x_i$, you are assuming (whether or not this is true is another matter) to model your response variable as
$$
y^(j)=sum_i=1^N x_i^(j)beta^i + epsilon^(j)
$$
for each observation $y^(j)$, where $epsilon^(j)$ is an error term with vanishing expectation value. The purpose of the algorithm is to find the set of $beta^i$ to minimise the errors between the above formula and the actual values of the response.
- May I use linear regressio to model non-linear functions?
You may use the linear regression to model anything you want, this does not necessarily mean that the results will be a good fit. The mere decision to use a model makes no assumptions on whether the underlying equation is in fact reflected by the model you choose. In case of linear regression you are essentially approximating an $N$-dimensional manifold (where all true points belong) with their projections onto a plane. Whether or not this is a good idea it depends on the data.
I want to know if that is really the case, and is it always possible to do this "change" in the functional form?
By using this or that other model you are not changing the functional form of the underlying variables. You are just dictating that the original relation (that you do not know) can be approximated by the model you choose.
Is it still correct to measure the performance of the model using R_square metric?
The $R^2$ is defined as the ratio between the residual sum of squares of your model over the residual sum of squares of the average. Basically it tells how much of the variance of the data is explained by your model compared to just taking a straight line (in correspondence of the average) passing through all your data points.
$endgroup$
$begingroup$
Thank you for you answer. It made a lot of dark points clearer in my mind!
$endgroup$
– Ahl Ahl
Mar 15 at 16:05
add a comment |
$begingroup$
You are asking two different questions:
- What is linear regression?
Linear regression means that, given a response variable $y$ and a set of predictors $x_i$, you are assuming (whether or not this is true is another matter) to model your response variable as
$$
y^(j)=sum_i=1^N x_i^(j)beta^i + epsilon^(j)
$$
for each observation $y^(j)$, where $epsilon^(j)$ is an error term with vanishing expectation value. The purpose of the algorithm is to find the set of $beta^i$ to minimise the errors between the above formula and the actual values of the response.
- May I use linear regressio to model non-linear functions?
You may use the linear regression to model anything you want, this does not necessarily mean that the results will be a good fit. The mere decision to use a model makes no assumptions on whether the underlying equation is in fact reflected by the model you choose. In case of linear regression you are essentially approximating an $N$-dimensional manifold (where all true points belong) with their projections onto a plane. Whether or not this is a good idea it depends on the data.
I want to know if that is really the case, and is it always possible to do this "change" in the functional form?
By using this or that other model you are not changing the functional form of the underlying variables. You are just dictating that the original relation (that you do not know) can be approximated by the model you choose.
Is it still correct to measure the performance of the model using R_square metric?
The $R^2$ is defined as the ratio between the residual sum of squares of your model over the residual sum of squares of the average. Basically it tells how much of the variance of the data is explained by your model compared to just taking a straight line (in correspondence of the average) passing through all your data points.
$endgroup$
You are asking two different questions:
- What is linear regression?
Linear regression means that, given a response variable $y$ and a set of predictors $x_i$, you are assuming (whether or not this is true is another matter) to model your response variable as
$$
y^(j)=sum_i=1^N x_i^(j)beta^i + epsilon^(j)
$$
for each observation $y^(j)$, where $epsilon^(j)$ is an error term with vanishing expectation value. The purpose of the algorithm is to find the set of $beta^i$ to minimise the errors between the above formula and the actual values of the response.
- May I use linear regressio to model non-linear functions?
You may use the linear regression to model anything you want, this does not necessarily mean that the results will be a good fit. The mere decision to use a model makes no assumptions on whether the underlying equation is in fact reflected by the model you choose. In case of linear regression you are essentially approximating an $N$-dimensional manifold (where all true points belong) with their projections onto a plane. Whether or not this is a good idea it depends on the data.
I want to know if that is really the case, and is it always possible to do this "change" in the functional form?
By using this or that other model you are not changing the functional form of the underlying variables. You are just dictating that the original relation (that you do not know) can be approximated by the model you choose.
Is it still correct to measure the performance of the model using R_square metric?
The $R^2$ is defined as the ratio between the residual sum of squares of your model over the residual sum of squares of the average. Basically it tells how much of the variance of the data is explained by your model compared to just taking a straight line (in correspondence of the average) passing through all your data points.
answered Mar 15 at 15:52
gentedgented
33218
33218
$begingroup$
Thank you for you answer. It made a lot of dark points clearer in my mind!
$endgroup$
– Ahl Ahl
Mar 15 at 16:05
add a comment |
$begingroup$
Thank you for you answer. It made a lot of dark points clearer in my mind!
$endgroup$
– Ahl Ahl
Mar 15 at 16:05
$begingroup$
Thank you for you answer. It made a lot of dark points clearer in my mind!
$endgroup$
– Ahl Ahl
Mar 15 at 16:05
$begingroup$
Thank you for you answer. It made a lot of dark points clearer in my mind!
$endgroup$
– Ahl Ahl
Mar 15 at 16:05
add a comment |
Thanks for contributing an answer to Data Science Stack Exchange!
- Please be sure to answer the question. Provide details and share your research!
But avoid …
- Asking for help, clarification, or responding to other answers.
- Making statements based on opinion; back them up with references or personal experience.
Use MathJax to format equations. MathJax reference.
To learn more, see our tips on writing great answers.
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fdatascience.stackexchange.com%2fquestions%2f47355%2fcan-i-use-linear-regression-to-model-a-nonlinear-function%23new-answer', 'question_page');
);
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Sign up or log in
StackExchange.ready(function ()
StackExchange.helpers.onClickDraftSave('#login-link');
);
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Sign up using Google
Sign up using Facebook
Sign up using Email and Password
Post as a guest
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown
Required, but never shown