简体   繁体   中英

How to estimate parameters of exponential function with R?

I am working on an investigation on ichthyofauna (study of fishes). I need to find the condition factor of the fish. The steps to find the condition factor are as follows:

1. W = aL^b... (1)

Where:

  • W: The weight of fish in grams.
  • L: Total length of fish in centimeters.
  • a: Exponent describing the rate of change of weight with length (= the intercept of the regression line on the Y axis).
  • b: The slope of the regression line (also referred to as the Allometric coefficient).

2. Log w = log a + b log L... (2)

Where:

  • a: constant
  • b: the regression co-efficient

3. K = 100 w/L^b... (3)

Where:

  • W: Weight of the fish in grams
  • L: The total length of the fish in centimeters
  • b: The value obtained from the length-eight equation formula

I understand that to calculate K, I must first obtain the regression slope (b of 1), then the co-efficient regression (b of 2) and finally K. I need help to do it in R. I would be very grateful for your support. Thanks and regards!

so for a very simple regression, you may want to start with a linear model, and you'd do something like this:

reg1 <- lm(log(W) ~ log(L), data=yourdataframename)

then check the summary for coefficients:

summary(reg1)

Note you don't need to take a log of the intercept because it is a column of ones essentially (but it is included implicitly unless you put '-1' in your parameters)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM