如何基于拟合得到的Gompertz方程参数计算中点值?
Calculating Midpoint Values with Your Fitted Gompertz Growth Curve
First, let's recap the work you've already completed: you've fitted a Gompertz growth model using the grofit package in R, and extracted the key parameters:
- μ (growth rate) = 36.162016
- λ (lag phase) = 7.9800164
- A (asymptotic value) = 100
The Gompertz equation you're using is:
y = A * exp(-exp( (μ * e * (λ - time)) / μ + 1 ))
Where time ranges from 1 to 12, each representing the midpoint of a 15-day cycle.
Step 1: Optional - Extract Parameters Directly from the Model
Instead of manually typing the parameters, you can pull them directly from your fitted mdl object to avoid human error:
# Extract coefficients from the fitted model gompertz_params <- coef(mdl$gcFit) mu <- gompertz_params["mu"] lambda <- gompertz_params["lambda"] A <- gompertz_params["A"]
Step 2: Calculate Midpoint Values
Use the Gompertz equation to compute the predicted midpoint values for each time point. Here's the full R code:
# Define your time vector (midpoints of 15-day cycles) time <- 1:12 # Calculate predicted values using the Gompertz equation y_midpoints <- A * exp(-exp( (mu * exp(1) * (lambda - time)) / mu + 1 )) # Combine time and midpoint values for easy viewing results <- cbind(Time_Cycle_Midpoint = time, Predicted_Midpoint_Value = y_midpoints) # Print the results print(results)
What this does:
exp(1)calls the natural constant e required for the equation- The
cbind()function organizes the time points and their corresponding predicted values into a clean table - Running
print(results)will show you the midpoint value for each of the 12 15-day cycles
内容的提问来源于stack exchange,提问作者89_Simple
相关产品推荐
相关产品推荐

