statsmodels.emplike.descriptive.DescStatMV.mv_mean_contour¶
-
DescStatMV.
mv_mean_contour
(mu1_low, mu1_upp, mu2_low, mu2_upp, step1, step2, levs=[0.2, 0.1, 0.05, 0.01, 0.001], var1_name=None, var2_name=None, plot_dta=False)[source]¶ Creates a confidence region plot for the mean of bivariate data
Parameters: m1_low : float
Minimum value of the mean for variable 1
m1_upp : float
Maximum value of the mean for variable 1
mu2_low : float
Minimum value of the mean for variable 2
mu2_upp : float
Maximum value of the mean for variable 2
step1 : float
Increment of evaluations for variable 1
step2 : float
Increment of evaluations for variable 2
levs : list
Levels to be drawn on the contour plot. Default = [.2, .1 .05, .01, .001]
plot_dta : bool
If True, makes a scatter plot of the data on top of the contour plot. Defaultis False.
var1_name : str
Name of variable 1 to be plotted on the x-axis
var2_name : str
Name of variable 2 to be plotted on the y-axis
Notes
The smaller the step size, the more accurate the intervals will be
If the function returns optimization failed, consider narrowing the boundaries of the plot
Examples
>>> two_rvs = np.random.standard_normal((20,2)) >>> el_analysis = sm.empllike.DescStat(two_rvs) >>> contourp = el_analysis.mv_mean_contour(-2, 2, -2, 2, .1, .1) >>> contourp.show()