Skip to content
Back to formatted view

Raw Message

Message-ID: <BLU171-W3008743CA8E23E4C29E050D89E0@phx.gbl>
Date: 2013-06-04T20:32:07Z
From: Joseph Clark
Subject: how to compute maximum of fitted polynomial?

My script fits a third-order polynomial to my data with something like this:

model <- lm( y ~ poly(x, 3) )

What I'd like to do is find the theoretical maximum of the polynomial (i.e. the x at which "model" predicts the highest y).  Specifically, I'd like to predict the maximum between 0 <= x <= 1.

What's the best way to accomplish that in R?

Bonus question: can R give me the derivative or 2nd derivative of the polynomial?  I'd like to be able to compute these at that maximum point.

Thanks in advance!


// joseph w. clark , phd , visiting research associate
\\ university of nebraska at omaha - college of IS&T