Estimates initial parameter values from the data, providing a starting point for optimization.
Details
A good initial guess is crucial for successful optimization. The method should estimate parameters from local features of the data (peak height, width at half maximum, asymmetry, etc.).
Examples
model <- create_peak_model("gaussian")
x <- seq(0, 10, by = 0.1)
y <- dnorm(x, mean = 5, sd = 1)
peak_idx <- which.max(y)
initial <- peak_model_initial_guess(model, x, y, peak_idx)
initial
#> $height
#> [1] 0.3989423
#>
#> $center
#> [1] 5
#>
#> $width
#> [1] 1.019186
#>