~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
More...
|
virtual double | human_chance_lp (const typename datum_t::output_t &r, const datum_t &hd) const override |
|
virtual void | recompute_LL (std::vector< HYP > &hypotheses, const data_t &human_data) override |
|
virtual std::map< typename HYP::output_t, double > | compute_model_predictions (const data_t &human_data, const size_t i, const Matrix &hposterior) const override |
|
virtual double | compute_likelihood (const data_t &human_data, const double breakout=-infinity) override |
| Compute the likelihood of a collection of data, by calling compute_single_likelihood on each. This stops if our likelihood falls below breakout. More...
|
|
| MyGrammarHypothesis (std::vector< HYP > &hypotheses, const data_t *human_data) |
|
| DeterministicGrammarHypothesis (std::vector< HYP > &hypotheses, const std::vector< HumanDatum< MyHypothesis > > *human_data) |
|
virtual void | recompute_P (std::vector< HYP > &hypotheses, const std::vector< HumanDatum< MyHypothesis > > &human_data) override |
| Recompute the predictions for the hypotheses and data. More...
|
|
virtual std::map< typename HYP::output_t, double > | compute_model_predictions (const std::vector< HumanDatum< MyHypothesis > > &human_data, const size_t i, const Matrix &hposterior) const override |
| This uses hposterior (computed via this->compute_normalized_posterior()) to compute the model predictions on a the i'th human data point. To do this, we marginalize over hypotheses, computing the weighted sum of outputs. More...
|
|
| BaseGrammarHypothesis () |
|
| BaseGrammarHypothesis (std::vector< HYP > &hypotheses, const std::vector< HumanDatum< MyHypothesis > > *human_data) |
|
void | set_decay (const ExponentialVariable &ev) |
|
void | set_decay_untransformed (double v) |
|
void | set_alpha (const UniformVariable &a) |
|
void | set_alpha_untransformed (double v) |
|
void | copy_parameters (const BaseGrammarHypothesis &h) |
|
float | get_alpha () const |
|
float | get_decay () const |
|
size_t | ndata () const |
|
virtual void | set_hypotheses_and_data (std::vector< HYP > &hypotheses, const std::vector< HumanDatum< MyHypothesis > > &human_data) |
| This is the primary function for setting hypothese and data on construction. More...
|
|
virtual void | set_can_propose (size_t i, bool b) |
| Set whether I can propose to a value in logA – this is handled by VectorNormalHypothesis Here, though, we warn if the value is not 1.0. More...
|
|
void | set_flat_prior (bool fp) |
|
virtual size_t | nhypotheses () const |
| A convenient function that uses C to say how many hypotheses. More...
|
|
virtual void | recompute_C (const std::vector< HYP > &hypotheses) |
| Computes our matrix C[h,r] of hypotheses (rows) by counts of each grammar rule. (requires that each hypothesis use the same grammar) More...
|
|
virtual void | recompute_LL (std::vector< HYP > &hypotheses, const std::vector< HumanDatum< MyHypothesis > > &human_data) |
| Recompute LL[h,di] a hypothesis from each hypothesis and data point to a vector of prior responses. (We need the vector instead of just the sum to implement memory decay. More...
|
|
virtual void | recompute_decayedLikelihood (const std::vector< HumanDatum< MyHypothesis > > &human_data) |
| Recomputes the decayed likelihood (e.g. at the given decay level, the total ll for each data point. NOTE: This does create a new decayed likelihood each time we compute. More...
|
|
virtual const HYP & | computeMAP (const size_t di, const Matrix &hposterior) const |
|
virtual double | human_chance_lp (const typename HumanDatum< MyHypothesis > ::output_t &r, const HumanDatum< MyHypothesis > &hd) const |
| Get the chance probability of response r in hd (i.e. of a human response). This may typically be pretty boring (like just hd.chance) but w we need to be able to overwrite it. More...
|
|
virtual double | compute_prior () override |
|
virtual Matrix | compute_normalized_posterior () const |
| This returns a matrix hposterior[h,di] giving the posterior on the h'th element. NOTE: not output is NOT logged. More...
|
|
virtual double | compute_likelihood (const std::vector< HumanDatum< MyHypothesis > > &human_data, const double breakout=-infinity) override |
| This computes the likelihood of the human data. More...
|
|
virtual MyGrammarHypothesis | restart () const override |
|
virtual std::optional< std::pair< MyGrammarHypothesis, double > > | propose () const override |
| Propose to the hypothesis. The sometimes does grammar parameters and sometimes other parameters, which are all stored as VectorHypotheses. It is sure to call the recompute functions when necessary. More...
|
|
virtual Vector | hypothesis_prior () const |
| Compute a vector of the prior (one for each hypothesis) using the given counts matrix (hypotheses x rules), AT the specified temperature. More...
|
|
virtual bool | operator== (const MyGrammarHypothesis &h) const override |
|
virtual std::string | string (std::string prefix="") const override |
| This returns a string for this hypothesis. Defaulty, now, just in tidy format with all the parameters, one on each row. Note these parameters are shown after transformation (e.g. the prior parameters are NOT logged) More...
|
|
virtual void | show (std::string prefix="") override |
| Need to override print since it will print in a different format. More...
|
|
virtual size_t | hash () const override |
|
virtual std::string | serialize () const override |
|
| MCMCable () |
|
virtual bool | operator!= (const MyGrammarHypothesis &h) const |
|
| Bayesable () |
|
virtual double | compute_single_likelihood (const datum_t &datum) |
| Compute the likelihood of a single data point. More...
|
|
virtual void | clear_bayes () |
|
virtual double | compute_tempered_likelihood (const data_t &data, int ladder_rank, const double breakout=-infinity) |
|
virtual double | compute_posterior (const data_t &data, const std::pair< double, double > breakoutpair=std::make_pair(-infinity, 1.0)) |
| Compute the posterior, by calling prior and likelihood. This includes only a little bit of fanciness, which is that if our prior is -inf, then we don't both computing the likelihood. More...
|
|
virtual double | at_temperature (double t) const |
|
auto | operator (const Bayesable< datum_t, data_t > &other) const |
|
| DeterministicGrammarHypothesis (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > *human_data) |
|
virtual void | recompute_P (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > &human_data) override |
| Recompute the predictions for the hypotheses and data. More...
|
|
virtual std::map< typename HYP::output_t, double > | compute_model_predictions (const std::vector< MyHumanDatum > &human_data, const size_t i, const Matrix &hposterior) const override |
| This uses hposterior (computed via this->compute_normalized_posterior()) to compute the model predictions on a the i'th human data point. To do this, we marginalize over hypotheses, computing the weighted sum of outputs. More...
|
|
| BaseGrammarHypothesis () |
|
| BaseGrammarHypothesis (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > *human_data) |
|
void | set_decay (const ExponentialVariable &ev) |
|
void | set_decay_untransformed (double v) |
|
void | set_alpha (const UniformVariable &a) |
|
void | set_alpha_untransformed (double v) |
|
void | copy_parameters (const BaseGrammarHypothesis &h) |
|
float | get_alpha () const |
|
float | get_decay () const |
|
size_t | ndata () const |
|
virtual void | set_hypotheses_and_data (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > &human_data) |
| This is the primary function for setting hypothese and data on construction. More...
|
|
virtual void | set_can_propose (size_t i, bool b) |
| Set whether I can propose to a value in logA – this is handled by VectorNormalHypothesis Here, though, we warn if the value is not 1.0. More...
|
|
void | set_flat_prior (bool fp) |
|
virtual size_t | nhypotheses () const |
| A convenient function that uses C to say how many hypotheses. More...
|
|
virtual void | recompute_C (const std::vector< HYP > &hypotheses) |
| Computes our matrix C[h,r] of hypotheses (rows) by counts of each grammar rule. (requires that each hypothesis use the same grammar) More...
|
|
virtual void | recompute_LL (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > &human_data) |
| Recompute LL[h,di] a hypothesis from each hypothesis and data point to a vector of prior responses. (We need the vector instead of just the sum to implement memory decay. More...
|
|
virtual void | recompute_decayedLikelihood (const std::vector< MyHumanDatum > &human_data) |
| Recomputes the decayed likelihood (e.g. at the given decay level, the total ll for each data point. NOTE: This does create a new decayed likelihood each time we compute. More...
|
|
virtual const HYP & | computeMAP (const size_t di, const Matrix &hposterior) const |
|
virtual double | human_chance_lp (const typename MyHumanDatum ::output_t &r, const MyHumanDatum &hd) const |
| Get the chance probability of response r in hd (i.e. of a human response). This may typically be pretty boring (like just hd.chance) but w we need to be able to overwrite it. More...
|
|
virtual double | compute_prior () override |
|
virtual Matrix | compute_normalized_posterior () const |
| This returns a matrix hposterior[h,di] giving the posterior on the h'th element. NOTE: not output is NOT logged. More...
|
|
virtual double | compute_likelihood (const std::vector< MyHumanDatum > &human_data, const double breakout=-infinity) override |
| This computes the likelihood of the human data. More...
|
|
virtual MyGrammarHypothesis | restart () const override |
|
virtual std::optional< std::pair< MyGrammarHypothesis, double > > | propose () const override |
| Propose to the hypothesis. The sometimes does grammar parameters and sometimes other parameters, which are all stored as VectorHypotheses. It is sure to call the recompute functions when necessary. More...
|
|
virtual Vector | hypothesis_prior () const |
| Compute a vector of the prior (one for each hypothesis) using the given counts matrix (hypotheses x rules), AT the specified temperature. More...
|
|
virtual bool | operator== (const MyGrammarHypothesis &h) const override |
|
virtual std::string | string (std::string prefix="") const override |
| This returns a string for this hypothesis. Defaulty, now, just in tidy format with all the parameters, one on each row. Note these parameters are shown after transformation (e.g. the prior parameters are NOT logged) More...
|
|
virtual void | show (std::string prefix="") override |
| Need to override print since it will print in a different format. More...
|
|
virtual size_t | hash () const override |
|
virtual std::string | serialize () const override |
|
| MCMCable () |
|
virtual bool | operator!= (const MyGrammarHypothesis &h) const |
|
| ThunkGrammarHypothesis (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > *human_data) |
|
virtual void | recompute_LL (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > &human_data) override |
| Recompute LL[h,di] a hypothesis from each hypothesis and data point to a vector of prior responses. (We need the vector instead of just the sum to implement memory decay. More...
|
|
virtual void | recompute_P (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > &human_data) override |
| For a thunk, the predictions don't depend on the data. More...
|
|
virtual std::map< typename HYP::output_t, double > | compute_model_predictions (const std::vector< MyHumanDatum > &human_data, const size_t i, const Matrix &hposterior) const override |
| In this variant, we need to always use P->at(h,0) since we only have one prediction stored for thunks. More...
|
|
| BaseGrammarHypothesis () |
|
| BaseGrammarHypothesis (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > *human_data) |
|
void | set_decay (const ExponentialVariable &ev) |
|
void | set_decay_untransformed (double v) |
|
void | set_alpha (const UniformVariable &a) |
|
void | set_alpha_untransformed (double v) |
|
void | copy_parameters (const BaseGrammarHypothesis &h) |
|
float | get_alpha () const |
|
float | get_decay () const |
|
size_t | ndata () const |
|
virtual void | set_hypotheses_and_data (std::vector< HYP > &hypotheses, const std::vector< MyHumanDatum > &human_data) |
| This is the primary function for setting hypothese and data on construction. More...
|
|
virtual void | set_can_propose (size_t i, bool b) |
| Set whether I can propose to a value in logA – this is handled by VectorNormalHypothesis Here, though, we warn if the value is not 1.0. More...
|
|
void | set_flat_prior (bool fp) |
|
virtual size_t | nhypotheses () const |
| A convenient function that uses C to say how many hypotheses. More...
|
|
virtual void | recompute_C (const std::vector< HYP > &hypotheses) |
| Computes our matrix C[h,r] of hypotheses (rows) by counts of each grammar rule. (requires that each hypothesis use the same grammar) More...
|
|
virtual void | recompute_decayedLikelihood (const std::vector< MyHumanDatum > &human_data) |
| Recomputes the decayed likelihood (e.g. at the given decay level, the total ll for each data point. NOTE: This does create a new decayed likelihood each time we compute. More...
|
|
virtual const HYP & | computeMAP (const size_t di, const Matrix &hposterior) const |
|
virtual double | human_chance_lp (const typename MyHumanDatum ::output_t &r, const MyHumanDatum &hd) const |
| Get the chance probability of response r in hd (i.e. of a human response). This may typically be pretty boring (like just hd.chance) but w we need to be able to overwrite it. More...
|
|
virtual double | compute_prior () override |
|
virtual Matrix | compute_normalized_posterior () const |
| This returns a matrix hposterior[h,di] giving the posterior on the h'th element. NOTE: not output is NOT logged. More...
|
|
virtual double | compute_likelihood (const std::vector< MyHumanDatum > &human_data, const double breakout=-infinity) override |
| This computes the likelihood of the human data. More...
|
|
virtual MyGrammarHypothesis | restart () const override |
|
virtual std::optional< std::pair< MyGrammarHypothesis, double > > | propose () const override |
| Propose to the hypothesis. The sometimes does grammar parameters and sometimes other parameters, which are all stored as VectorHypotheses. It is sure to call the recompute functions when necessary. More...
|
|
virtual Vector | hypothesis_prior () const |
| Compute a vector of the prior (one for each hypothesis) using the given counts matrix (hypotheses x rules), AT the specified temperature. More...
|
|
virtual bool | operator== (const MyGrammarHypothesis &h) const override |
|
virtual std::string | string (std::string prefix="") const override |
| This returns a string for this hypothesis. Defaulty, now, just in tidy format with all the parameters, one on each row. Note these parameters are shown after transformation (e.g. the prior parameters are NOT logged) More...
|
|
virtual void | show (std::string prefix="") override |
| Need to override print since it will print in a different format. More...
|
|
virtual size_t | hash () const override |
|
virtual std::string | serialize () const override |
|