plot.cp_model_nls: Plot a Cross-Price Demand Model (Nonlinear)

plot.cp_model_nlsR Documentation

Plot a Cross-Price Demand Model (Nonlinear)

Description

Plot a Cross-Price Demand Model (Nonlinear)

Usage

## S3 method for class 'cp_model_nls'
plot(
  x,
  data = NULL,
  inverse_fun = NULL,
  n_points = 100,
  title = NULL,
  xlab = "Price",
  ylab = "Consumption",
  x_trans = "identity",
  y_trans = "identity",
  point_size = 3,
  ...
)

Arguments

x

A cross-price model object from fit_cp_nls with return_all=TRUE.

data

Optional data frame with x and y; if NULL, uses object$data.

inverse_fun

Optional function to inverse-transform predictions.

n_points

Number of points used for prediction curve.

title

Optional plot title.

xlab

X-axis label.

ylab

Y-axis label.

x_trans

Transformation for x-axis: "identity", "log10", or "pseudo_log".

y_trans

Transformation for y-axis: "identity", "log10", or "pseudo_log".

point_size

Size of data points.

...

Additional arguments (passed to predict).

Value

A ggplot2 object.


brentkaplan/beezdemand documentation built on June 11, 2025, 3:50 a.m.