Skip to content
Back to formatted view

Raw Message

Message-ID: <85f3856f0902270815q630aaa17q82a74b9fd1d4a54@mail.gmail.com>
Date: 2009-02-27T16:15:50Z
From: Brigid Mooney
Subject: formula formatting/grammar for regression

Hi all,

I am doing some basic regression analysis, and am getting a bit
confused on how to enter non-polynomial formulas to be used.

For example, consider that I want to find A and r such that the
formula y = A*exp(r*x) provides the the best fit to the line y=x on
the interval [0,50].

I can set:
xpts <- seq(0, 50, by=0.1)
ypts <- seq(0, 50, by=0.1)

I know I can find a fitted polynomial of a given degree using
lm(ypts ~ poly(xpts, degree=5, raw=TRUE))

But am confused on what the formula should be for trying to find a fit
to y = A*exp(r*x).

If anyone knows of a resource that describes the "grammar" behind
assembling these formulas, I would really appreciate being pointed in
that direction as I can't seem to find much beyond basic polynomials.

Thanks for the help!