LinearIVGMM.from_formula()

statsmodels.sandbox.regression.gmm.LinearIVGMM.from_formula classmethod LinearIVGMM.from_formula(formula, data, subset=None, *args, **kwargs) Create a Model from a formula and dataframe. Parameters: formula : str or generic Formula object The formula specifying the model data : array-like The data for the model. See Notes. subset : array-like An array-like object of booleans, integers, or index values that indicate the subset of df to use in the model. Assumes df is a pandas.DataFrame

LinearIVGMM.fititer()

statsmodels.sandbox.regression.gmm.LinearIVGMM.fititer LinearIVGMM.fititer(start, maxiter=2, start_invweights=None, weights_method='cov', wargs=(), optim_method='bfgs', optim_args=None) iterative estimation with updating of optimal weighting matrix stopping criteria are maxiter or change in parameter estimate less than self.epsilon_iter, with default 1e-6. Parameters: start : array starting value for parameters maxiter : int maximum number of iterations start_weights : array (nmoms, nmo

LinearIVGMM.fitgmm_cu()

statsmodels.sandbox.regression.gmm.LinearIVGMM.fitgmm_cu LinearIVGMM.fitgmm_cu(start, optim_method='bfgs', optim_args=None) estimate parameters using continuously updating GMM Parameters: start : array_like starting values for minimization Returns: paramest : array estimated parameters Notes todo: add fixed parameter option, not here ??? uses scipy.optimize.fmin

LinearIVGMM.fitgmm()

statsmodels.sandbox.regression.gmm.LinearIVGMM.fitgmm LinearIVGMM.fitgmm(start, weights=None, optim_method=None, **kwds) [source] estimate parameters using GMM for linear model Uses closed form expression instead of nonlinear optimizers Parameters: start : not used starting values for minimization, not used, only for consistency of method signature weights : array weighting matrix for moment conditions. If weights is None, then the identity matrix is used optim_method : not used, optim

Linear Regression

Linear Regression Linear models with independently and identically distributed errors, and for errors with heteroscedasticity or autocorrelation. This module allows estimation by ordinary least squares (OLS), weighted least squares (WLS), generalized least squares (GLS), and feasible generalized least squares with autocorrelated AR(p) errors. See Module Reference for commands and arguments. Examples # Load modules and data import numpy as np import statsmodels.api as sm spector_data = sm.datas

LinearIVGMM.fit()

statsmodels.sandbox.regression.gmm.LinearIVGMM.fit LinearIVGMM.fit(start_params=None, maxiter=10, inv_weights=None, weights_method='cov', wargs=(), has_optimal_weights=True, optim_method='bfgs', optim_args=None) Estimate parameters using GMM and return GMMResults TODO: weight and covariance arguments still need to be made consistent with similar options in other models, see RegressionResult.get_robustcov_results Parameters: start_params : array (optional) starting value for parameters ub m

LinearIVGMM.calc_weightmatrix()

statsmodels.sandbox.regression.gmm.LinearIVGMM.calc_weightmatrix LinearIVGMM.calc_weightmatrix(moms, weights_method='cov', wargs=(), params=None) calculate omega or the weighting matrix Parameters: moms : array, (nobs, nmoms) moment conditions for all observations evaluated at a parameter value weights_method : string ?cov? If method=?cov? is cov then the matrix is calculated as simple covariance of the moment conditions. see fit method for available aoptions for the weight and covarianc

Linear Mixed Effects Models

Linear Mixed Effects Models Link to Notebook GitHub In [1]: import numpy as np import statsmodels.api as sm import statsmodels.formula.api as smf In [2]: %load_ext rpy2.ipython In [3]: %R library(lme4) Loading required package: Matrix Loading required package: Rcpp Attaching package: ?lme4? The following object is masked from ?package:robustbase?: sigma Comparing R lmer to Statsmodels MixedLM The Statsmodels imputation of linear mixed mod

Linear Mixed Effects Models

Linear Mixed Effects Models Linear Mixed Effects models are used for regression analyses involving dependent data. Such data arise when working with longitudinal and other study designs in which multiple observations are made on each subject. Two specific mixed effects models are ?random intercepts models?, where all responses in a single group are additively shifted by a value that is specific to the group, and ?random slopes models?, where the values follow a mean trajectory that is linear in

LeastSquares.weights()

statsmodels.robust.norms.LeastSquares.weights LeastSquares.weights(z) [source] The least squares estimator weighting function for the IRLS algorithm. The psi function scaled by the input z Parameters: z : array-like 1d array Returns: weights : array weights(z) = np.ones(z.shape)