fit_cp_nls: Fit Nonlinear Cross-Price Model using NLS

View source: R/cross-price.R

fit_cp_nlsR Documentation

Fit Nonlinear Cross-Price Model using NLS

Description

Fit Nonlinear Cross-Price Model using NLS

Usage

fit_cp_nls(
  data,
  equation = c("exponentiated", "exponential", "additive"),
  start_vals = NULL,
  iter = 100,
  bounds = list(lower = c(qalone = 0.1, I = -2, beta = 1e-05), upper = c(qalone = NA, I =
    2, beta = 5)),
  fallback_to_nlsr = TRUE,
  return_all = TRUE
)

Arguments

data

A data frame containing columns: x and y.

equation

Type of equation ("exponential" or "exponentiated").

start_vals

Optional named list of starting values.

iter

Number of iterations for nls.multstart.

bounds

List with 'lower' and 'upper' bounds for parameters.

fallback_to_nlsr

Logical; if TRUE, try nlsr when others fail.

return_all

Logical; if TRUE, returns a list with model metadata.

Value

Fitted model object or list with model metadata.


bkaplan4/beezdemand documentation built on June 11, 2025, 2:36 a.m.