1
$\begingroup$

I'm trying to determine how I can estimate the following model:

$y = at^bexp(ct)$, where $a$, $b$ and $c$ are estimate from a set of data.

But I can't figure out how to derive the formula into something more manageable.

I'm trying to fit the model but I'm unsure how to estimate it with the following data:

Yield<-c(0.31, 0.39, 0.50, 0.58, 0.59, 0.64, 0.68, 0.66, 
         0.67, 0.70, 0.72, 0.68, 0.65, 0.64, 0.57, 0.48, 
         0.46, 0.45, 0.31, 0.33, 0.36, 0.30, 0.26, 0.34, 
         0.29, 0.31, 0.29, 0.20, 0.15, 0.18, 0.11, 0.07,
         0.06, 0.01, 0.01)
Week<-1:35
$\endgroup$
2
  • $\begingroup$ Is this all your data are do you have more data for other animals? It looks like you only have data here for one animal. Is this right? $\endgroup$ Dec 14 '20 at 5:37
  • $\begingroup$ Take a look at the lactcurves package in R. It will fit wood's model, but note that the package implements $y = at^bexp(-ct)$ (note the negative sign): cran.r-project.org/web/packages/lactcurves/lactcurves.pdf $\endgroup$ Dec 14 '20 at 5:44
1
$\begingroup$

How about nonlinear least squares? This is what the package lactcurves already mentioned uses under the hood. In R you can feed the formula directly in to the nls() function without modification - provided it has some reasonable start points.

# Fit model using nls
fit <- nls(Yield ~ a * Week^b * exp(c*Week), 
           data = data.frame(Yield, Week),
           start = list(a = 1, b = 1, c = .01))

# Plot curve against data
plot(Week, Yield)
lines(Week, predict(fit), col = "blue")

nls curve

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.