creativity
v1.3.0
Agent-based model of creativity and piracy
|
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... | |
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:
creation_time
periods (so that it includes one full creation cycle). Ideally we'd want books in the current period can't be used because it is unknown at the time the reader is making the decision of whether or not to create.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.
|
inline |
Construct a noninformative profit model.
|
inlineexplicit |
Constructs a profit model with the given parameter information.
args | prior arguments to forward to the base BayesianLinear constructor. |
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.
draws | the number of beta draws to use for prediction |
q | A 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. |
previousBooks | the previous books of the author |
marketBooks | the books on the market in the previous period |
l_min | the 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_max | the maximum value of l to consider. This is typically the reader's money (income) on hand. |
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.
draws | the number of draws to use for prediction |
q | the quality of the book |
previousBooks | the number of previous books created by this book's author. This parameter also determines the firstBook dummy (= 1 iff previousBooks == 0 ). |
marketBooks | the number of books on the market last period |
|
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\)).
previous_books | the number of previous books written by the same author |
quality | the mean quality of the book as determined at creation time by the book's author. Must be non-negative. |
avg_market_books | the average number of books on the market over the previous creation time periods |