2 #include <eris/learning/BayesianLinearRestricted.hpp> 3 #include <eris/SharedMember.hpp> 36 class Demand :
public eris::learning::BayesianLinearRestricted {
52 template <
typename ...Args>
53 explicit Demand(Args &&...args) : BayesianLinearRestricted(
std::forward<Args>(args)...)
63 names({
"const",
"price",
"quality",
"prevSales",
"noSales"});
87 double predict(
unsigned int draws,
double P,
double q,
unsigned int S,
unsigned int nosales,
unsigned int age,
unsigned int otherBooks,
unsigned int lag_marketBooks);
89 using BayesianLinearRestricted::predict;
104 static Eigen::RowVectorXd
row(
double P,
double q,
unsigned S,
unsigned nosales,
unsigned age,
unsigned otherBooks,
unsigned lag_marketBooks);
146 std::pair<double, double>
argmaxP(
unsigned int draws,
double q,
unsigned int s,
unsigned int z,
unsigned int n,
unsigned int nosales,
unsigned int age,
unsigned int otherBooks,
unsigned int marketBooks,
double c,
double max_price);
156 static Eigen::RowVectorXd
bookRow(eris::SharedMember<Book> book,
double quality,
unsigned int lag_market_books);
Primary namespace for all Creativity library code.
Definition: config.hpp:4
std::pair< double, double > argmaxP(unsigned int draws, double q, unsigned int s, unsigned int z, unsigned int n, unsigned int nosales, unsigned int age, unsigned int otherBooks, unsigned int marketBooks, double c, double max_price)
Given a set of model parameters (other than ) and a per-unit cost this returns the value that maximi...
This class represents an author's belief about the per-period demand for books.
Definition: Demand.hpp:36
Definition: Variable.hpp:389
Demand(Args &&...args)
Constructs a demand model with the given prior information.
Definition: Demand.hpp:53
static Eigen::RowVectorXd row(double P, double q, unsigned S, unsigned nosales, unsigned age, unsigned otherBooks, unsigned lag_marketBooks)
Given various information about a book, returns an X matrix row of data representing that information...
static Eigen::RowVectorXd bookRow(eris::SharedMember< Book > book, double quality, unsigned int lag_market_books)
Given a book and perceived quality, this builds an X matrix row of data representing that book...
Demand()
Default constructor: note that unlike a default-constructed BayesianLinear model, this default constr...
Definition: Demand.hpp:43
virtual unsigned int fixedModelSize() const override
This model always has exactly parameters() parameters.
double predict(unsigned int draws, double P, double q, unsigned int S, unsigned int nosales, unsigned int age, unsigned int otherBooks, unsigned int lag_marketBooks)
Given a set of model parameters, this returns an expected value , the number of sales.
virtual std::string display_name() const override
Returns "Demand", the name of this model.
Definition: Demand.hpp:159
static unsigned int parameters()
Returns the number of parameters of this model (5)
Definition: Demand.hpp:67