creativity  v1.3.0
Agent-based model of creativity and piracy
Public Member Functions | Static Public Member Functions | List of all members
creativity::belief::Profit Class Reference

This class represents an author's belief about the lifetime profitability of a work. More...

#include <creativity/belief/Profit.hpp>

Public Member Functions

 Profit ()
 Construct a noninformative profit model. More...
 
template<typename ... Args>
 Profit (Args &&...args)
 Constructs a profit model with the given parameter information. More...
 
virtual unsigned int fixedModelSize () const override
 Returns parameters()
 
double predict (unsigned int draws, double q, unsigned long previousBooks, unsigned long marketBooks)
 Given a set of model parameters, this returns an expected value \(\Pi_b\), the lifetime profit of the book. More...
 
std::pair< double, double > argmaxL (unsigned int draws, const std::function< double(const double &)> q, unsigned long previousBooks, unsigned long marketBooks, double l_min, double l_max)
 Given previousBooks and marketBooks parameters, a function \(q(\ell)\) that returns expected quality for a given value \(\ell\), and \(\ell_{max}\), this numerically determines the value of l in \([0, max_l]\) that maximizes the profit less effort. More...
 
virtual std::string display_name () const override
 Returns "Profit", the name of this model.
 

Static Public Member Functions

static unsigned int parameters ()
 Returns the number of parameters of this model (4)
 
static Eigen::RowVectorXd profitRow (double quality, int previous_books, int avg_market_books)
 Builds an X matrix row of profit data for a book. More...
 

Detailed Description

This class represents an author's belief about the lifetime profitability of a work.

The model is:

\(\pi_b = \beta_0 + \beta_1 q_b + \beta_2 q_b^2 + \beta_3 marketBooks + u\)

Specifically, the fields above are:

Although a \(\beta_3 \leq 0\) restriction would make some intuitive sense (more competition means lower profit), it isn't imposed because doing so induces volatile creation cycles: readers decide to create in low-book periods, which results in an immediate surge in on-market books, which induces readers to not create in the next period, and so on. Not imposing it still often has it be significant for many readers, but seems to avoid the strong behavioural cycles.

The model uses a natural conjugate prior for the purposes of updating the beliefs via Bayesian econometrics.

Constructor & Destructor Documentation

§ Profit() [1/2]

creativity::belief::Profit::Profit ( )
inline

Construct a noninformative profit model.

See also
eris::learning::BayesianLinear::BayesianLinear

§ Profit() [2/2]

template<typename ... Args>
creativity::belief::Profit::Profit ( Args &&...  args)
inlineexplicit

Constructs a profit model with the given parameter information.

Parameters
argsprior arguments to forward to the base BayesianLinear constructor.
See also
BayesianLinear::BayesianLinear

Member Function Documentation

§ argmaxL()

std::pair<double, double> creativity::belief::Profit::argmaxL ( unsigned int  draws,
const std::function< double(const double &)>  q,
unsigned long  previousBooks,
unsigned long  marketBooks,
double  l_min,
double  l_max 
)

Given previousBooks and marketBooks parameters, a function \(q(\ell)\) that returns expected quality for a given value \(\ell\), and \(\ell_{max}\), this numerically determines the value of l in \([0, max_l]\) that maximizes the profit less effort.

Initial fixed creation cost is not included.

Parameters
drawsthe number of beta draws to use for prediction
qA function, lambda or similar object that takes a double and returns the quality associated with that double. If the function returns a negative value, 0 will be substituted instead.
previousBooksthe previous books of the author
marketBooksthe books on the market in the previous period
l_minthe minimum value of l to consider. The value is typically at least the effort level associated with book of quality = MC + distancePenalty(0) + sizePenalty(1): as long as they can observe the quality, no reader would ever buy a book with lower quality. (Note, however, that this assumes readers directly observe the quality and have identical penalty functions).
l_maxthe maximum value of l to consider. This is typically the reader's money (income) on hand.
Returns
a pair of double values: the first is the double value \(\ell\) that maximizes expected net profit; the second is the maximized profit value after subtracting the maximizing \(ell\), but before subtracting fixed creation costs.
See also
eris::single_peak_search for the numerical algorithm used.

§ predict()

double creativity::belief::Profit::predict ( unsigned int  draws,
double  q,
unsigned long  previousBooks,
unsigned long  marketBooks 
)

Given a set of model parameters, this returns an expected value \(\Pi_b\), the lifetime profit of the book.

Parameters
drawsthe number of draws to use for prediction
qthe quality of the book
previousBooksthe number of previous books created by this book's author. This parameter also determines the firstBook dummy (= 1 iff previousBooks == 0).
marketBooksthe number of books on the market last period

§ profitRow()

static Eigen::RowVectorXd creativity::belief::Profit::profitRow ( double  quality,
int  previous_books,
int  avg_market_books 
)
static

Builds an X matrix row of profit data for a book.

This needs to be called after the period has advanced: typically in the inter-period optimization stage.

This method should only be called in periods \(t=3\) and later (because otherwise the lagged value is not useful: the first books are created in \(t=1\), and so the lagged value will be 0 at the beginning of \(t=2\), thus need to wait until the beginning of \(t=3\)).

Parameters
previous_booksthe number of previous books written by the same author
qualitythe mean quality of the book as determined at creation time by the book's author. Must be non-negative.
avg_market_booksthe average number of books on the market over the previous creation time periods
Returns
a row containing the book's information as used for this model
Inheritance diagram for creativity::belief::Profit:
[legend]
Collaboration diagram for creativity::belief::Profit:
[legend]

The documentation for this class was generated from the following file: