#ifndef BPROBITEX_INCLUDED
#define BPROBITEX_INCLUDED

#import <maximize>
#import <modelbase>

enum // variable types
{   Y_VAR, X_VAR, W_VAR, SEL_VAR
};
enum // estimation types
{   M_LOGIT, M_PROBIT, M_POISSON, M_NEGBIN
};
enum // model classes
{   MC_BINARY, MC_COUNT
};

/*-------------------------- BprobitEx : Bprobit -----------------------------*/
class BprobitEx : Modelbase
{
	decl m_iModel;								    /* current model number */
	decl m_iModelClass;
	decl m_mW;								   /* weight variable [m_cT][1] */
	decl m_cW;					      /* number of weight variables, 0 or 1 */
	decl m_mSel;							   /* sample selection variable */
	decl m_cSel;
	decl m_mIdx;	/* observation index (in database) of estimation sample */
	decl m_fCovarUnweighted;		  /* TRUE: unweighted covariance matrix */
	decl m_asY, m_asX, m_asW, m_asSel;							   /* names */

    BprobitEx();
	virtual GetPackageName();
	virtual GetPackageVersion();
	virtual GetParNames();
    virtual InitData();                       /* extract data from database */
    virtual InitPar();             // initialize parameters
    fProbit(const vP, const adFunc, const avScore, const amHess);
    virtual DoEstimation(vP);		                   /* do the estimation */
    virtual Covar();  // compute variance-covariance matrix
	virtual Output();

	// OxPack related
	virtual Buffering(const bBufferOn);
	virtual GetMethodLabel();
	virtual GetModelLabel();
	virtual GetModelSettings();
	virtual LoadOptions();
	virtual ReceiveDialog(const sDialog, const asOptions, const aValues);
	virtual ReceiveModel();
	virtual SaveOptions();
	virtual DoOption(const sOpt, const val);
	virtual DoGraphicsDlg();
	virtual ReceiveMenuChoice(const sDialog);
	virtual SendMenu(const sMenu);
	virtual IsCrossSection();
	virtual SendSpecials();
	virtual SendVarStatus();
	virtual SetModelSettings(const aValues);
	virtual BatchCommands();
	virtual BatchMethod(const sMethod);
};
/*------------------------ END BprobitEx : Database ---------------------------*/

#endif	// BPROBITEX_INCLUDED
