james.foadi at diamond.ac.uk
2016-Feb-23 10:42 UTC
[R] multiple linear regression with quadratic function
Dear R community, this is probably a well-known topic to some of you, but I am not well into it and would like some clarifications or even jus some suggestions. I have a quadratic scalar field: F(x,y)=K*exp(-(a*x^2+b*y^2+c*x*y)) I also have a random set of positive x,y values and related F(x,y) values. It seems reasonable to estimate the parameters K, a, b, c with a linear regression, using the log of both sides of the equation. What worries me, though, is the interaction term, c*x*y. Are there well-known issues on the application of linear regression to cases like this one? Thanks in advance for your answers. James -- This e-mail and any attachments may contain confidential...{{dropped:16}}
peter dalgaard
2016-Feb-23 10:59 UTC
[R] multiple linear regression with quadratic function
That's pretty standard. Some call it "response surface analysis". Of course you need to check assumptions like homoscedasticity on the log scale, etc. It's not really an R question, specifically; so stats.stackexchange.com is a better avenue for more detailed discussions. As far as R goes, you just need to be aware that, due to an ancien misfeature, terms like x^2 need to be protected by writing I(x^2). -pd On 23 Feb 2016, at 11:42 , <james.foadi at diamond.ac.uk> <james.foadi at diamond.ac.uk> wrote:> Dear R community, > this is probably a well-known topic to some of you, but I am not well into it > and would like some clarifications or even jus some suggestions. > > I have a quadratic scalar field: > > F(x,y)=K*exp(-(a*x^2+b*y^2+c*x*y)) > > I also have a random set of positive x,y values and related F(x,y) values. > It seems reasonable to estimate the parameters K, a, b, c with a linear regression, > using the log of both sides of the equation. > > What worries me, though, is the interaction term, c*x*y. > > Are there well-known issues on the application of linear regression to cases like this one? > > Thanks in advance for your answers. > > James > > -- > This e-mail and any attachments may contain confidential...{{dropped:16}} > > ______________________________________________ > R-help at r-project.org mailing list -- To UNSUBSCRIBE and more, see > https://stat.ethz.ch/mailman/listinfo/r-help > PLEASE do read the posting guide http://www.R-project.org/posting-guide.html > and provide commented, minimal, self-contained, reproducible code.-- Peter Dalgaard, Professor, Center for Statistics, Copenhagen Business School Solbjerg Plads 3, 2000 Frederiksberg, Denmark Phone: (+45)38153501 Office: A 4.23 Email: pd.mes at cbs.dk Priv: PDalgd at gmail.com
Inline. -- Bert Bert Gunter "The trouble with having an open mind is that people keep coming along and sticking things into it." -- Opus (aka Berkeley Breathed in his "Bloom County" comic strip ) On Tue, Feb 23, 2016 at 2:42 AM, <james.foadi at diamond.ac.uk> wrote:> Dear R community, > this is probably a well-known topic to some of you, but I am not well into it > and would like some clarifications or even jus some suggestions. > > I have a quadratic scalar field: > > F(x,y)=K*exp(-(a*x^2+b*y^2+c*x*y)) > > I also have a random set of positive x,y values and related F(x,y) values. > It seems reasonable to estimate the parameters K, a, b, c with a linear regression, > using the log of both sides of the equation.Not necessarily. It depends on how the error term enters the model. I suggest you consult with a local statistician or post as Peter suggested. You appear to be out of your statistical depth here.> > What worries me, though, is the interaction term, c*x*y. > > Are there well-known issues on the application of linear regression to cases like this one? > > Thanks in advance for your answers. > > James > > -- > This e-mail and any attachments may contain confidenti...{{dropped:8}}