![]() |
LINE Solver (C++)
Templated C++ port of the LINE queueing solver
|
Typedefs | |
| using | Objective = std::function<double(const std::vector<double>&)> |
Functions | |
| double | nanmax (const std::vector< double > &v) |
| MATLAB's max over a vector: NaNs ignored, NaN when every entry is one. | |
| void | nm_run (const Objective &f, const std::vector< double > &x0, double tolx, double tolf, std::size_t maxit, std::vector< double > &xb, double &fb) |
| One run of the reference's Nelder-Mead (nmRun). | |
| std::vector< double > | nelder_mead (const Objective &f, const std::vector< double > &x0, const SmpOptions &opt) |
| nelderMead: restart nm_run from its own optimum, at most four runs. | |
| std::vector< double > | hessian_se (const Objective &f, const std::vector< double > &x) |
| hessianSE: central-difference Hessian with steps 1e-4 max(1, |x|), its Cholesky factor H = R'R, and se = sqrt(rowsum((R \ I). | |
| std::vector< double > | linpred (const Matrix< double > &Z, const std::vector< std::size_t > &rows, const std::vector< std::size_t > &cov, const double *beta) |
| Z(rows, cov) * beta, one value per row. | |
| void | fit_intensity_arc (const std::string &family, const std::vector< double > &t, const std::vector< char > &ev, const Matrix< double > &Z, const std::vector< std::size_t > &rows, const std::vector< std::size_t > &cov, const SmpOptions &opt, std::vector< double > &th, std::vector< double > &be, std::vector< double > &se, double &ll) |
| fitIntensityArc: one transition of Approach II, its events ev among the sojourns t. | |
| std::vector< double > | expand_beta (const std::vector< double > &be, const std::vector< std::size_t > &cov, std::size_t p) |
| expandBeta: the effects of the selected covariates, zero elsewhere. | |
| void | fit_sojourn_state (std::size_t i, const std::vector< std::size_t > &dests, const std::vector< std::vector< std::string > > &fam, const std::vector< double > &t, const std::vector< std::size_t > &to, const Matrix< double > &Z, const std::vector< std::size_t > &rows, const std::vector< std::vector< std::vector< bool > > > &mask, std::size_t p, const SmpOptions &opt, std::vector< SmpArc > &arcs, double &ll, std::size_t &np) |
| fitSojournState: state i of Approach I. | |
| using line::infer::smp_infer_detail::Objective = std::function<double(const std::vector<double>&)> |
Definition at line 258 of file infer_smp.h.
|
inline |
expandBeta: the effects of the selected covariates, zero elsewhere.
Definition at line 515 of file infer_smp.h.
References expand_beta().
Referenced by expand_beta(), and fit_sojourn_state().
|
inline |
fitIntensityArc: one transition of Approach II, its events ev among the sojourns t.
Definition at line 469 of file infer_smp.h.
References fit_intensity_arc(), hessian_se(), line::infer::infer_smp_family_logfs(), line::infer::infer_smp_family_npar(), line::infer::infer_smp_family_theta0(), linpred(), nelder_mead(), and line::infer::smp_family_name().
Referenced by fit_intensity_arc().
|
inline |
fitSojournState: state i of Approach I.
The parameter vector is laid out [logits of destinations 2..m; theta_1; beta_1; theta_2; beta_2; ...].
Definition at line 526 of file infer_smp.h.
References line::infer::SmpArc::beta, expand_beta(), line::infer::SmpArc::family, fit_sojourn_state(), line::infer::SmpArc::from, hessian_se(), line::infer::infer_smp_family_logfs(), line::infer::infer_smp_family_natural(), line::infer::infer_smp_family_npar(), line::infer::infer_smp_family_theta0(), linpred(), nelder_mead(), line::infer::SmpArc::nevents, line::infer::SmpArc::params, line::infer::SmpArc::prob, line::infer::SmpArc::se, line::infer::smp_family_name(), line::infer::SmpArc::theta, and line::infer::SmpArc::to.
Referenced by fit_sojourn_state().
|
inline |
hessianSE: central-difference Hessian with steps 1e-4 max(1, |x|), its Cholesky factor H = R'R, and se = sqrt(rowsum((R \ I).
^2)); NaN everywhere when H is not finite or not positive definite.
Definition at line 401 of file infer_smp.h.
References hessian_se().
Referenced by fit_intensity_arc(), fit_sojourn_state(), and hessian_se().
|
inline |
Z(rows, cov) * beta, one value per row.
Definition at line 457 of file infer_smp.h.
References linpred().
Referenced by fit_intensity_arc(), fit_sojourn_state(), and linpred().
|
inline |
MATLAB's max over a vector: NaNs ignored, NaN when every entry is one.
Definition at line 261 of file infer_smp.h.
References nanmax().
|
inline |
nelderMead: restart nm_run from its own optimum, at most four runs.
Definition at line 377 of file infer_smp.h.
References nelder_mead(), and nm_run().
Referenced by fit_intensity_arc(), fit_sojourn_state(), and nelder_mead().
|
inline |
One run of the reference's Nelder-Mead (nmRun).
Definition at line 271 of file infer_smp.h.
References nanmax(), and nm_run().
Referenced by nelder_mead(), and nm_run().