#ifndef BPROBITEX_INCLUDED
#define BPROBITEX_INCLUDED

#import <maximize>
#import <modelbase>
#import <../tutorial/bprobit>

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 : Bprobit
{
	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();
	SetSelSample(const iYear1,				   /* replaces Database version */
		const iPeriod1, const iYear2, const iPeriod2);
    virtual InitData();                       /* extract data from database */
    virtual DoEstimation(vP);		                   /* do the estimation */
	virtual Output();

	// OxPack related
	virtual BatchVarStatus(const sTypes, const vcTypes);
	virtual Buffering(const bBufferOn);
	virtual GetMethodLabel();
	virtual GetModelLabel();
	virtual GetModelSettings();
	virtual IsCrossSection();
	virtual LoadOptions();
	virtual ReceiveDialog(const sDialog, const asOptions, const aValues);
	virtual ReceiveModel();
	virtual SaveOptions();
	virtual DoOption(const sOpt, const val);
	virtual DoSettingsDlg();
	virtual DoEstimateDlg(const iFirstMethod, const cMethods, const sMethods,
		const bForcAllowed, const bRecAllowed, const bMaxDlgAllowed);
	virtual DoGraphicsDlg();
	virtual ReceiveMenuChoice(const sDialog);
	virtual SendMenu(const sMenu);
	virtual SendSpecials();
	virtual SendVarStatus();
	virtual SetModelSettings(const aValues);
};
/*------------------------ END BprobitEx : Database ---------------------------*/

#endif	// BPROBITEX_INCLUDED
