---
title: "Legacy estimation example"
output: rmarkdown::html_vignette
vignette: >
  %\VignetteIndexEntry{Legacy estimation example}
  %\VignetteEngine{knitr::rmarkdown}
  %\VignetteEncoding{UTF-8}
---

```{r, include = FALSE}
knitr::opts_chunk$set(collapse = TRUE, comment = "#>")
set.seed(123)
```

This vignette is kept for backward compatibility with the original package
article structure. New users should start with "Getting started with GLBFP",
then read "Package overview and workflow map".

```{r}
library(GLBFP)
data("ashua")

river_data <- ashua[, c("flow", "level")]
x0 <- c(mean(river_data$flow), mean(river_data$level))
b <- c(8, 0.4)

fit <- GLBFP(x0, river_data, b = b, m = c(1, 1))
fit

grid_fit <- GLBFP_estimate(
  river_data,
  b = b,
  m = c(1, 1),
  grid_size = 12
)

head(as.data.frame(grid_fit))
```
