Skip to content

Linear Model with curve fitting parameter?

5 messages · Peter Ehlers, Steven McKinney, stephen sefick

#
Setting Z=Q-A would be the incorrect dimensions.  I could Z=Q/A.  Is
fitting a nls model the same as fitting an ols?  These data are
hydraulic data from ~47 sites.  To access predictive ability I am
removing one site fitting a new model and then accessing the fit with
a myriad of model assessment criteria.  I should get the same answer
with ols vs nls?  Thank you for all of your help.

Stephen
On Thu, Mar 31, 2011 at 8:34 PM, Steven McKinney <smckinney at bccrc.ca> wrote:

  
    
#
On 2011-04-01 05:44, stephen sefick wrote:
No, ols and nls won't give the same result.
If you use ols on the logged data, you're assuming
additive errors on the log scale. With nls, you
assume additive errors on the original scale.
But your model looks simple enough - why not run
it through both functions and see what the difference is.
Ultimately, everything depends on what assumptions
you're comfortable with.

Peter Ehlers
#
I suspect this is confusion about what Q is.  I was presuming that
the Q in this following formula was log(Q) with Q from the original data.
If the model is 
  
   Q=K*A*(R^r)*(S^s)

then

   log(Q) = log(K) + log(A) + r*log(R) + s*log(S)

Rearranging yields

   log(Q) - log(A) = log(K) + r*log(R) + s*log(S)

so what I labeled 'Z' below is

   Z = log(Q) - log(A) = log(Q/A)

so

   Z = log(K) + r*log(R) + s*log(S)

and a linear model fit of
   
   Z ~ log(R) + log(S)

will yield parameter estimates for the linear equation

   E(Z) = B0 + B1*log(R) + B2*log(S)

(E(Z) = expected value of Z)

so B0 estimate is an estimate of log(K)
   B1 estimate is an estimate of r
   B2 estimate is an estimate of s

More details and careful notation will eventually lead
to a reasonable description and analysis strategy.


Best

Steve McKinney
2 days later
#
Steven:

You are exactly right sorry I was confused.


#######################################################
so log(y-intercept)+log(K) is a constant called b0 (is this right?)

lm(log(Q)~log(A)+log(R)+log(S)-1)

is fitting the model

log(Q)=a*log(A)+r*log(R)+s*log(S) (no beta 0)

and

lm(log(Q)~log(A)+log(R)+log(S))


is fitting the model

log(Q)=b0+a*log(A)+r*log(R)+s*log(S)

######################################################

These are the models I am trying to fit and if I have reasoned
correctly above then I should be able to fit the below models
similarly.

manning
log(Q)=log(b0)+log(K)+log(A)+r*log(R)+s*log(S)

dingman
log(Q)=log(b0)+log(K)+a*log(A)+r*log(R)+s*(log(S))^2

bjerklie
log(Q)=log(b0)+log(K)+a*log(A)+r*log(R)+s*log(S)

#######################################################

Thank you for all of your help!

Stephen
On Fri, Apr 1, 2011 at 2:44 PM, Steven McKinney <smckinney at bccrc.ca> wrote:

  
    
#
Doesn't look right to me based on the information you've provided.
I don't see anything labeled "y" in your previous emails, so I'm
not clear on what y is and how it relates to the original model 
you described

   > >> I have a model Q=K*A*(R^r)*(S^s)
   > >>
   > >> A, R, and S are data I have and K is a curve fitting parameter. 

If the model is 
  
   Q=K*A*(R^r)*(S^s)

then

   log(Q) = log(K) + log(A) + r*log(R) + s*log(S)

Rearranging yields

   log(Q) - log(A) = log(K) + r*log(R) + s*log(S)

Let  Z = log(Q) - log(A) = log(Q/A)

so

   Z = log(K) + r*log(R) + s*log(S)

and a linear model fit of
   
   Z ~ log(R) + log(S)

will yield parameter estimates for the linear equation

   E(Z) = B0 + B1*log(R) + B2*log(S)

(E(Z) = expected value of Z)

so B0 estimate is an estimate of log(K)
   B1 estimate is an estimate of r
   B2 estimate is an estimate of s

and these are the only parameters you described in the original model.
K has disappeared from these equations so these model fits do
not correspond to the model originally described.  Now a b0
appears, and is used in models below.  I think changing notation
is also adding confusion.  What are "y" and "intercept" you
discuss above, in relation to your original notation?
You will be able to fit models appropriately once you have a
clearly defined system of notation that allows you to map between
the proposed data model, the parameters in that model, and the
corresponding regression equations.  

Once you have consistent notation, you will be able to see
if you can express your model as a linear regression, or
if not, what kind of non-linear regression you will need to
do to get estimates for the parameters in your model.

Best

Steve McKinney