2 #include <eris/learning/BayesianLinear.hpp> 3 #include <eris/learning/BayesianLinearRestricted.hpp> 33 class Profit :
public eris::learning::BayesianLinearRestricted {
47 template <
typename ...Args>
48 explicit Profit(Args &&...args) : BayesianLinearRestricted(
std::forward<Args>(args)...)
56 names({
"const",
"quality", u8
"quality²",
"marketBooks"});
74 double predict(
unsigned int draws,
double q,
unsigned long previousBooks,
unsigned long marketBooks);
76 using BayesianLinearRestricted::predict;
103 std::pair<double, double>
argmaxL(
105 const std::function<
double(
const double &)> q,
106 unsigned long previousBooks,
unsigned long marketBooks,
126 static Eigen::RowVectorXd
profitRow(
double quality,
int previous_books,
int avg_market_books);
double predict(unsigned int draws, double q, unsigned long previousBooks, unsigned long marketBooks)
Given a set of model parameters, this returns an expected value , the lifetime profit of the book...
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 that returns expected quality for a given...
Primary namespace for all Creativity library code.
Definition: config.hpp:4
virtual unsigned int fixedModelSize() const override
Returns parameters()
Definition: Variable.hpp:389
virtual std::string display_name() const override
Returns "Profit", the name of this model.
Definition: Profit.hpp:129
Profit()
Construct a noninformative profit model.
Definition: Profit.hpp:39
static Eigen::RowVectorXd profitRow(double quality, int previous_books, int avg_market_books)
Builds an X matrix row of profit data for a book.
This class represents an author's belief about the lifetime profitability of a work.
Definition: Profit.hpp:33
Profit(Args &&...args)
Constructs a profit model with the given parameter information.
Definition: Profit.hpp:48
static unsigned int parameters()
Returns the number of parameters of this model (4)
Definition: Profit.hpp:60