Module Expr Str ImportFrom alias Import alias identifier ImportFrom alias alias ImportFrom alias ImportFrom alias ImportFrom alias ImportFrom alias Import alias ImportFrom alias ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam defaults body Pass decorator_list FunctionDef arguments args NameParam NameParam defaults body Expr Str Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Num Assign NameStore BinOpMult AttributeLoad AttributeLoad NameLoad attr attr BinOpSub AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr NameLoad AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr BinOpDiv AttributeLoad AttributeLoad NameLoad attr attr NameLoad Return BinOpMult Num Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam NameParam defaults NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad body Expr Str Assign NameStore Num Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad Assign SubscriptStore NameLoad Index NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Num Assign NameStore AttributeLoad NameLoad attr Assign NameStore AttributeLoad NameLoad attr While BoolOpAnd CompareLt NameLoad NameLoad CompareGt NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr Num Num BinOpDiv Num Call AttributeLoad SubscriptLoad NameLoad Index NameLoad attr Num Num Assign NameStore Call NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad keyword Num Assign NameStore SubscriptLoad NameLoad Index TupleLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index NameLoad Assign AttributeStore AttributeLoad NameLoad attr attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr BinOpSub NameLoad NameLoad Assign NameStore NameLoad Assign NameStore BinOpAdd NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr Slice Num Assign NameStore SubscriptLoad NameLoad Slice Num Assign NameStore BinOpAdd UnaryOpUSub NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad Assign NameStore BinOpDiv Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr NameLoad Assign NameStore SubscriptLoad Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Slice Num Slice Num Assign NameStore BinOpAdd Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad If CompareEq NameLoad NameLoad body Expr Call AttributeLoad NameLoad attr Str NameLoad Return BinOpMult Num BinOpSub NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body Expr Str Return BinOpSub SubscriptLoad Call AttributeLoad NameLoad attr ListLoad NameLoad ListLoad NameLoad Index Num AttributeLoad NameLoad attr decorator_list decorator_list ClassDef bases NameLoad body Expr Str FunctionDef arguments args NameParam NameParam NameParam NameParam defaults body Assign AttributeStore NameLoad attr SubscriptLoad Call AttributeLoad NameLoad attr NameLoad Index Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad AttributeLoad NameLoad attr attr Index Num Assign NameStore Call AttributeLoad NameLoad attr TupleLoad UnaryOpUSub SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num SubscriptLoad AttributeLoad NameLoad attr ExtSlice Slice Index Num Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr Index NameLoad Assign SubscriptStore AttributeLoad NameLoad attr Index Num Num Assign AttributeStore NameLoad attr Call NameLoad Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr attr NameLoad Assign AttributeStore NameLoad attr Call AttributeLoad SubscriptLoad AttributeLoad NameLoad attr ExtSlice Index NameLoad Slice attr Num Num Assign AttributeStore NameLoad attr SubscriptLoad AttributeLoad NameLoad attr ExtSlice Index NameLoad Slice decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Call NameLoad AttributeLoad NameLoad attr Assign NameStore CompareEq SubscriptLoad NameLoad Index Call AttributeLoad NameLoad attr BinOpSub NameLoad Num SubscriptLoad NameLoad Index BinOpAdd Call AttributeLoad NameLoad attr BinOpSub NameLoad Num Num Assign NameStore CompareEq SubscriptLoad NameLoad Index Call AttributeLoad NameLoad attr BinOpSub NameLoad Num SubscriptLoad NameLoad Index BinOpAdd Call AttributeLoad NameLoad attr BinOpSub NameLoad Num Num Assign NameStore BinOpMult NameLoad NameLoad Return Call AttributeLoad NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore Num Assign NameStore ListLoad For NameStore SubscriptLoad Call AttributeLoad NameLoad attr Call NameLoad BinOpSub AttributeLoad NameLoad attr Num Slice Num body If CompareEq SubscriptLoad NameLoad Index NameLoad Num body Expr Call AttributeLoad NameLoad attr NameLoad Assign NameStore BinOpAdd NameLoad Num Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index BinOpAdd NameLoad Num orelse If BoolOpAnd CompareEq SubscriptLoad NameLoad Index NameLoad Num CompareGt NameLoad Num body Expr Call AttributeLoad NameLoad attr BinOpAdd Call NameLoad NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign SubscriptStore NameLoad Index NameLoad SubscriptLoad NameLoad Index NameLoad Assign NameStore Num Assign NameStore ListLoad Return Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults body Expr Str Assign NameStore AttributeLoad NameLoad attr Assign NameStore BinOpSub NameLoad BinOpAdd Call AttributeLoad NameLoad attr NameLoad Num Assign NameStore BinOpAdd BinOpSub NameLoad BinOpAdd Call AttributeLoad NameLoad attr NameLoad Num Num Assign NameStore Call AttributeLoad BinOpDiv NameLoad NameLoad attr NameLoad Num Assign NameStore BinOpPow NameLoad Call AttributeLoad NameLoad attr BinOpSub NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad Return Call AttributeLoad BinOpDiv NameLoad NameLoad attr NameLoad Num decorator_list FunctionDef arguments args NameParam defaults body Expr Str Return Call NameLoad NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam defaults NameLoad body If CompareIs NameLoad NameLoad body Assign NameStore AttributeLoad NameLoad attr Return Call AttributeLoad NameLoad attr NameLoad NameLoad decorator_list decorator_list ClassDef bases NameLoad body FunctionDef arguments args NameParam NameParam defaults body Assign AttributeStore NameLoad attr NameLoad decorator_list FunctionDef arguments args NameParam defaults body Expr Str Assign AttributeStore AttributeLoad NameLoad attr attr Call AttributeLoad NameLoad attr AttributeLoad AttributeLoad NameLoad attr attr Assign SubscriptStore AttributeLoad AttributeLoad NameLoad attr attr Index Num Num Assign NameStore Call AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad Call NameLoad AttributeLoad AttributeLoad NameLoad attr attr AttributeLoad AttributeLoad NameLoad attr attr NameLoad attr Assign NameStore AttributeLoad NameLoad attr Return NameLoad decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam NameParam defaults BinOpPow Num Num Num Num body Expr Str Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad CompareEq NameLoad Num attr Assign NameStore Call AttributeLoad CompareEq NameLoad Num attr Assign NameStore SubscriptLoad NameLoad Index NameLoad Assign NameStore SubscriptLoad NameLoad ExtSlice Index NameLoad Slice Assign NameStore Call AttributeLoad Call NameLoad NameLoad NameLoad attr Assign TupleStore NameStore NameStore NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad keyword NameLoad Assign NameStore Call AttributeLoad Call AttributeLoad AttributeLoad NameLoad attr attr NameLoad NameLoad attr Assign NameStore AttributeLoad AttributeLoad NameLoad attr attr Assign NameStore Call AttributeLoad Call AttributeLoad NameLoad attr NameLoad attr NameLoad Assign NameStore Call AttributeLoad NameLoad attr Assign NameStore Call AttributeLoad NameLoad attr CompareEq NameLoad Num Assign NameStore BinOpSub SubscriptLoad NameLoad Index Num Call AttributeLoad NameLoad attr Call NameLoad SubscriptLoad NameLoad Index Num Assign NameStore Call AttributeLoad NameLoad attr Call AttributeLoad NameLoad attr BinOpSub Num NameLoad If CompareEq Call NameLoad NameLoad Call NameLoad NameLoad body Assign NameStore Call AttributeLoad NameLoad attr ListLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword NameLoad keyword Num Return TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad AttributeLoad AttributeLoad NameLoad attr attr orelse Assign NameStore Call AttributeLoad NameLoad attr NameLoad NameLoad TryExcept body Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad TupleLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad NameLoad keyword Num keyword Num Assign NameStore SubscriptLoad NameLoad Index Num Return TupleLoad NameLoad Call AttributeLoad NameLoad attr NameLoad Call NameLoad NameLoad handlers ExceptHandler type AttributeLoad AttributeLoad AttributeLoad NameLoad attr attr attr body Return TupleLoad AttributeLoad NameLoad attr Num decorator_list FunctionDef arguments args NameParam NameParam NameParam NameParam NameParam defaults Num body Expr Str Assign NameStore Call AttributeLoad NameLoad attr Assign AttributeStore NameLoad attr Call AttributeLoad NameLoad attr BinOpSub Num NameLoad Num Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr NameLoad SubscriptLoad NameLoad Index NameLoad NameLoad Assign NameStore Call AttributeLoad NameLoad attr AttributeLoad NameLoad attr SubscriptLoad NameLoad Index NameLoad NameLoad NameLoad Return TupleLoad NameLoad NameLoad decorator_list decorator_list
N/A N/A 

Accelerated Failure Time (AFT) Model with empirical likelihood inference.

AFT regression analysis is applicable when the researcher has access
to a randomly right censored dependent variable, a matrix of exogenous
variables and an indicatior variable (delta) that takes a value of 0 if the
observation is censored and 1 otherwise.

AFT References
--------------

Stute, W. (1993). "Consistent Estimation Under Random Censorship when
Covariables are Present." Journal of Multivariate Analysis.
Vol. 45. Iss. 1. 89-103

EL and AFT References
---------------------

Zhou, Kim And Bathke. "Empirical Likelihood Analysis for the Heteroskedastic
Accelerated Failure Time Model." Manuscript:
URL: www.ms.uky.edu/~mai/research/CasewiseEL20080724.pdf

Zhou, M. (2005). Empirical Likelihood Ratio with Arbitrarily Censored/
Truncated Data by EM Algorithm.  Journal of Computational and Graphical
Statistics. 14:3, 643-656.


 __future__ division N/A numpy np statsmodels.regression.linear_model OLS WLS statsmodels.tools add_constant scipy optimize scipy.stats chi2 descriptive _OptFuncts N/A warnings statsmodels.tools.sm_exceptions IterationLimitWarning OptAFT N/A _OptFuncts N/A N/A 
    Provides optimization functions used in estimating and conducting
    inference in an AFT model.

    Methods
    ------

    _opt_wtd_nuis_regress:
        Function optimized over nuisance parameters to compute
        the profile likelihood

    _EM_test:
        Uses the modified Em algorithm of Zhou 2005 to maximize the
        likelihood of a parameter vector.

     __init__ N/A N/A self N/A N/A N/A N/A _opt_wtd_nuis_regress N/A N/A self test_vals N/A N/A N/A 
        A function that is optimized over nuisance parameters to conduct a
        hypothesis test for the parameters of interest

        Parameters
        ----------

        params: 1d array
            The regression coefficients of the model.  This includes the
            nuisance and parameters of interests.

        Returns
        -------

        llr: float
            -2 times the log likelihood of the nuisance parameters and the
            hypothesized value of the parameter(s) of interest.

         N/A test_params N/A N/A test_vals reshape N/A N/A self model nvar 1 N/A est_vect N/A N/A N/A self model uncens_exog N/A N/A N/A self model uncens_endog N/A N/A np dot N/A N/A self model uncens_exog test_params N/A eta_star N/A N/A self _modif_newton N/A N/A np zeros N/A N/A self model nvar est_vect N/A N/A self model _fit_weights N/A denom N/A N/A N/A np sum N/A N/A self model _fit_weights N/A N/A np dot eta_star N/A est_vect T N/A N/A self new_weights N/A N/A N/A self model _fit_weights denom N/A N/A -1 N/A N/A np sum N/A N/A np log N/A self new_weights N/A _EM_test N/A N/A self nuisance_params params param_nums b0_vals F survidx uncens_nobs numcensbelow km uncensored censored maxiter ftol N/A None None None None None None None None None None None None N/A N/A 
        Uses EM algorithm to compute the maximum likelihood of a test

        Parameters
        ---------

        Nuisance Params: array
            Vector of values to be used as nuisance params.

        maxiter: int
            Number of iterations in the EM algorithm for a parameter vector

        Returns
        -------
        -2 ''*'' log likelihood ratio at hypothesized values and
        nuisance params

        Notes
        -----
        Optional parameters are provided by the test_beta function.
         N/A iters 0 N/A N/A params N/A param_nums b0_vals N/A nuis_param_index N/A N/A np int_ N/A N/A np delete N/A N/A np arange N/A N/A self model nvar param_nums N/A N/A params N/A nuis_param_index nuisance_params N/A to_test N/A N/A params reshape N/A N/A self model nvar 1 N/A opt_res N/A np inf N/A diff N/A np inf N/A N/A N/A iters maxiter N/A diff ftol N/A N/A F N/A N/A F flatten N/A death N/A N/A np cumsum N/A F N/A -1 N/A survivalprob N/A death N/A -1 N/A surv_point_mat N/A N/A np dot N/A N/A F reshape -1 1 N/A 1.0 N/A N/A N/A survivalprob N/A survidx reshape 1 -1 N/A surv_point_mat N/A add_constant surv_point_mat N/A summed_wts N/A N/A np cumsum surv_point_mat axis 1 N/A wts N/A summed_wts N/A N/A N/A N/A np int_ N/A N/A np arange uncens_nobs N/A numcensbelow N/A uncensored N/A N/A N/A self model _fit_weights wts N/A new_opt_res N/A N/A self _opt_wtd_nuis_regress to_test N/A F N/A self new_weights N/A diff N/A N/A np abs N/A new_opt_res opt_res N/A opt_res new_opt_res N/A iters N/A iters 1 N/A death N/A N/A np cumsum N/A N/A N/A F flatten N/A -1 N/A survivalprob N/A death N/A -1 N/A llike N/A N/A opt_res N/A N/A np sum N/A N/A np log N/A survivalprob N/A survidx N/A wtd_km N/A N/A N/A km flatten N/A N/A np sum km N/A survivalmax N/A N/A N/A np cumsum N/A wtd_km N/A -1 N/A -1 N/A llikemax N/A N/A N/A np sum N/A N/A np log N/A wtd_km N/A uncensored N/A N/A np sum N/A N/A np log N/A survivalmax N/A censored N/A N/A iters maxiter N/A N/A N/A N/A warnings warn The EM reached the maximum number of iterations IterationLimitWarning N/A N/A -2 N/A llike llikemax N/A _ci_limits_beta N/A N/A self b0 param_num N/A None N/A N/A 
        Returns the difference between the log likelihood for a
        parameter and some critical value.

        Parameters
        ---------
        b0: float
            Value of a regression parameter

        param_num: int
            Parameter index of b0
         N/A N/A N/A N/A N/A self test_beta N/A b0 N/A param_num N/A 0 N/A self r0 N/A N/A emplikeAFT N/A object N/A N/A 

    Class for estimating and conducting inference in an AFT model.

    Parameters
    ---------

    endog: nx1 array
        Response variables that are subject to random censoring

    exog: nxk array
        Matrix of covariates

    censors: nx1 array
        array with entries 0 or 1.  0 indicates a response was
        censored.

    Attributes
    ----------

    nobs: float
        Number of observations

    endog: array
        Endog attay

    exog: array
        Exogenous variable matrix

    censors
        Censors array but sets the max(endog) to uncensored

    nvar: float
        Number of exogenous variables

    uncens_nobs: float
        Number of uncensored observations

    uncens_endog: array
        Uncensored response variables

    uncens_exog: array
        Exogenous variables of the uncensored observations

    Methods
    -------

    params:
        Fits model parameters

    test_beta:
        Tests if beta = b0 for any vector b0.

    Notes
    -----

    The data is immediately sorted in order of increasing endogenous
    variables

    The last observation is assumed to be uncensored which makes
    estimation and inference possible.
     __init__ N/A N/A self endog exog censors N/A N/A N/A N/A self nobs N/A N/A N/A np shape exog N/A 0 N/A N/A self endog N/A N/A endog reshape N/A self nobs 1 N/A N/A self exog N/A N/A exog reshape N/A self nobs -1 N/A N/A self censors N/A N/A censors reshape N/A self nobs 1 N/A N/A self nvar N/A N/A N/A self exog shape N/A 1 N/A idx N/A N/A np lexsort N/A N/A N/A N/A self censors N/A N/A N/A 0 N/A N/A self endog N/A N/A N/A 0 N/A N/A self endog N/A N/A self endog N/A idx N/A N/A self exog N/A N/A self exog N/A idx N/A N/A self censors N/A N/A self censors N/A idx N/A N/A N/A self censors N/A -1 1 N/A N/A self uncens_nobs N/A int N/A N/A np sum N/A self censors N/A mask N/A N/A N/A N/A N/A self censors ravel astype bool N/A N/A self uncens_endog N/A N/A N/A N/A self endog N/A N/A mask N/A reshape -1 1 N/A N/A self uncens_exog N/A N/A self exog N/A N/A mask N/A N/A _is_tied N/A N/A self endog censors N/A N/A N/A 
        Indicated if an observation takes the same value as the next
        ordered observation.

        Parameters
        ----------
        endog: array
            Models endogenous variable
        censors: array
            arrat indicating a censored array

        Returns
        -------
        indic_ties: array
            ties[i]=1 if endog[i]==endog[i+1] and
            censors[i]=censors[i+1]
         N/A nobs N/A int N/A self nobs N/A endog_idx N/A N/A endog N/A N/A N/A np arange N/A nobs 1 N/A endog N/A N/A N/A N/A np arange N/A nobs 1 1 N/A censors_idx N/A N/A censors N/A N/A N/A np arange N/A nobs 1 N/A censors N/A N/A N/A N/A np arange N/A nobs 1 1 N/A indic_ties N/A endog_idx censors_idx N/A N/A N/A np int_ indic_ties N/A _km_w_ties N/A N/A self tie_indic untied_km N/A N/A N/A 
        Computes KM estimator value at each observation, taking into acocunt
        ties in the data.

        Parameters
        ----------
        tie_indic: 1d array
            Indicates if the i'th observation is the same as the ith +1
        untied_km: 1d array
            Km estimates at each observation assuming no ties.

         N/A num_same 1 N/A idx_nums N/A N/A obs_num N/A N/A N/A np arange N/A int N/A N/A self nobs 1 N/A -1 N/A N/A N/A N/A tie_indic N/A obs_num 1 N/A N/A N/A N/A idx_nums append obs_num N/A num_same N/A num_same 1 N/A N/A untied_km N/A obs_num N/A untied_km N/A N/A obs_num 1 N/A N/A N/A N/A N/A tie_indic N/A obs_num 0 N/A num_same 1 N/A N/A N/A N/A idx_nums append N/A N/A max idx_nums 1 N/A idx_nums N/A N/A np asarray idx_nums N/A N/A untied_km N/A idx_nums N/A untied_km N/A idx_nums N/A num_same 1 N/A idx_nums N/A N/A N/A N/A untied_km reshape N/A self nobs 1 N/A _make_km N/A N/A self endog censors N/A N/A N/A 

        Computes the Kaplan-Meier estimate for the weights in the AFT model

        Parameters
        ----------
        endog: nx1 array
            Array of response variables
        censors: nx1 array
            Censor-indicating variable

        Returns
        -------
        Kaplan Meier estimate for each observation

        Notes
        -----

        This function makes calls to _is_tied and km_w_ties to handle ties in
        the data.If a censored observation and an uncensored observation has
        the same value, it is assumed that the uncensored happened first.

         N/A nobs N/A self nobs N/A num N/A nobs N/A N/A N/A np arange nobs 1.0 N/A denom N/A N/A nobs N/A N/A N/A np arange nobs 1.0 1.0 N/A km N/A N/A N/A num denom reshape nobs 1 N/A km N/A km N/A N/A np abs N/A censors 1.0 N/A km N/A N/A np cumprod km N/A tied N/A N/A self _is_tied endog censors N/A wtd_km N/A N/A self _km_w_ties tied km N/A N/A N/A N/A censors wtd_km reshape nobs 1 N/A fit N/A N/A self N/A N/A N/A 

        Fits an AFT model and returns results instance

        Parameters
        ---------
        None


        Returns
        -------
        Results instance.

        Notes
        -----
        To avoid dividing by zero, max(endog) is assumed to be uncensored.
         N/A N/A AFTResults self N/A predict N/A N/A self params endog N/A None N/A N/A N/A endog None N/A N/A endog N/A self endog N/A N/A N/A np dot endog params N/A N/A AFTResults N/A OptAFT N/A __init__ N/A N/A self model N/A N/A N/A N/A self model model N/A params N/A N/A self N/A N/A N/A 

        Fits an AFT model and returns parameters.

        Parameters
        ---------
        None


        Returns
        -------
        Fitted params

        Notes
        -----
        To avoid dividing by zero, max(endog) is assumed to be uncensored.
         N/A N/A N/A self model modif_censors N/A N/A np copy N/A N/A self model censors N/A N/A N/A N/A self model modif_censors N/A -1 1 N/A wts N/A N/A N/A self model _make_km N/A N/A self model endog N/A N/A self model modif_censors N/A res N/A N/A N/A WLS N/A N/A self model endog N/A N/A self model exog wts fit N/A params N/A res params N/A params N/A test_beta N/A N/A self b0_vals param_nums ftol maxiter print_weights N/A N/A 10 -5 30 1 N/A N/A 
        Returns the profile log likelihood for regression parameters
        'param_num' at 'b0_vals.'

        Parameters
        ----------
        b0_vals: list
            The value of parameters to be tested

        param_num: list
            Which parameters to be tested

        maxiter: int, optional
            How many iterations to use in the EM algorithm.  Default is 30

        ftol: float, optional
            The function tolerance for the EM optimization.
            Default is 10''**''-5

        print_weights: bool
            If true, returns the weights tate maximize the profile
            log likelihood. Default is False

        Returns
        -------

        test_results: tuple
            The log-likelihood and p-pvalue of the test.

        Notes
        ----

        The function will warn if the EM reaches the maxiter.  However, when
        optimizing over nuisance parameters, it is possible to reach a
        maximum number of inner iterations for a specific value for the
        nuisance parameters while the resultsof the function are still valid.
        This usually occurs when the optimization over the nuisance parameters
        selects paramater values that yield a log-likihood ratio close to
        infinity.

        Examples
        -------

        import statsmodels.api as sm
        import numpy as np

        # Test parameter is .05 in one regressor no intercept model
        data=sm.datasets.heart.load()
        y = np.log10(data.endog)
        x = data.exog
        cens = data.censors
        model = sm.emplike.emplikeAFT(y, x, cens)
        res=model.test_beta([0], [0])
        >>>res
        >>>(1.4657739632606308, 0.22601365256959183)

        #Test slope is 0 in  model with intercept

        data=sm.datasets.heart.load()
        y = np.log10(data.endog)
        x = data.exog
        cens = data.censors
        model = sm.emplike.emplikeAFT(y, sm.add_constant(x), cens)
        res=model.test_beta([0], [1])
        >>>res
        >>>(4.623487775078047, 0.031537049752572731)

         N/A censors N/A N/A self model censors N/A endog N/A N/A self model endog N/A exog N/A N/A self model exog N/A uncensored N/A N/A N/A censors 1 flatten N/A censored N/A N/A N/A censors 0 flatten N/A uncens_endog N/A endog N/A uncensored N/A uncens_exog N/A exog N/A N/A uncensored N/A N/A reg_model N/A N/A N/A OLS uncens_endog uncens_exog fit N/A N/A llr pval new_weights N/A N/A reg_model el_test b0_vals param_nums return_weights True N/A km N/A N/A N/A N/A N/A self model _make_km endog censors flatten N/A uncens_nobs N/A N/A self model uncens_nobs N/A F N/A N/A N/A N/A np asarray new_weights reshape uncens_nobs N/A params N/A N/A self params N/A survidx N/A N/A np where N/A censors 0 N/A survidx N/A N/A survidx N/A 0 N/A N/A np arange N/A len N/A survidx N/A 0 N/A numcensbelow N/A N/A np int_ N/A N/A np cumsum N/A 1 censors N/A N/A N/A len param_nums N/A len params N/A N/A llr N/A N/A self _EM_test N/A F F params params param_nums param_nums b0_vals b0_vals survidx survidx uncens_nobs uncens_nobs numcensbelow numcensbelow km km uncensored uncensored censored censored ftol ftol maxiter 25 N/A N/A llr N/A N/A chi2 sf llr N/A N/A self model nvar N/A N/A x0 N/A N/A np delete params param_nums N/A N/A N/A res N/A N/A optimize fmin N/A self _EM_test x0 N/A params param_nums b0_vals F survidx uncens_nobs numcensbelow km uncensored censored maxiter ftol full_output 1 disp 0 N/A llr N/A res N/A 1 N/A N/A llr N/A N/A chi2 sf llr N/A len param_nums N/A N/A N/A N/A N/A N/A np linalg linalg LinAlgError N/A N/A N/A N/A np inf 0 N/A ci_beta N/A N/A self param_num beta_high beta_low sig N/A 0.05 N/A N/A 
        Returns the confidence interval for a regression
        parameter in the AFT model.

        Parameters
        ---------

        param_num: int
            Parameter number of interest

        beta_high: float
            Upper bound for the confidence interval

        beta_low:
            Lower bound for the confidence interval

        sig: float, optional
            Significance level.  Default is .05

        Notes
        ----
        If the function returns f(a) and f(b) must have different signs,
        consider widening the search area by adjusting beta_low and
        beta_high.

        Also note that this process is computational intensive.  There
        are 4 levels of optimization/solving.  From outer to inner:

        1) Solving so that llr-critical value = 0
        2) maximizing over nuisance parameters
        3) Using  EM at each value of nuisamce parameters
        4) Using the _modified_Newton optimizer at each iteration
           of the EM algorithm.

        Also, for very unlikely nuisance parameters, it is possible for
        the EM algorithm to not converge.  This is not an indicator
        that the solver did not find the correct solution.  It just means
        for a specific iteration of the nuisance parameters, the optimizer
        was unable to converge.

        If the user desires to verify the success of the optimization,
        it is recommended to test the limits using test_beta.

         N/A params N/A N/A self params N/A N/A self r0 N/A N/A chi2 ppf N/A 1 sig 1 N/A ll N/A N/A optimize brentq N/A self _ci_limits_beta beta_low N/A params N/A param_num param_num N/A ul N/A N/A optimize brentq N/A self _ci_limits_beta N/A params N/A param_num beta_high param_num N/A N/A ll ul N/A N/A