@@ -56,8 +56,13 @@ def plot_psychometric_function(result: Result, # noqa: C901, this function is t
5656 x = np .linspace (x_data .min (), x_data .max (), num = 1000 )
5757 x_low = np .linspace (x [0 ] - extrapolate_stimulus * (x [- 1 ] - x [0 ]), x [0 ], num = 100 )
5858 x_high = np .linspace (x [- 1 ], x [- 1 ] + extrapolate_stimulus * (x [- 1 ] - x [0 ]), num = 100 )
59- y = sigmoid (np .r_ [x_low , x , x_high ], params ['threshold' ], params ['width' ])
60- y = (1 - params ['gamma' ] - params ['lambda' ]) * y + params ['gamma' ]
59+ y = sigmoid (
60+ np .r_ [x_low , x , x_high ],
61+ threshold = params ['threshold' ],
62+ width = params ['width' ],
63+ gamma = params ['gamma' ],
64+ lambd = params ['lambda' ],
65+ )
6166 ax .plot (x , y [len (x_low ):- len (x_high )], c = line_color , lw = line_width , clip_on = False )
6267 ax .plot (x_low , y [:len (x_low )], '--' , c = line_color , lw = line_width , clip_on = False )
6368 ax .plot (x_high , y [- len (x_high ):], '--' , c = line_color , lw = line_width , clip_on = False )
@@ -110,8 +115,13 @@ def _plot_residuals(x_values: np.ndarray,
110115 data = result .data
111116 sigmoid = result .configuration .make_sigmoid ()
112117
113- std_model = params ['gamma' ] + (1 - params ['lambda' ] - params ['gamma' ]) * sigmoid (
114- data [:, 0 ], params ['threshold' ], params ['width' ])
118+ std_model = sigmoid (
119+ data [:, 0 ],
120+ threshold = params ['threshold' ],
121+ width = params ['width' ],
122+ gamma = params ['gamma' ],
123+ lambd = params ['lambda' ],
124+ )
115125 deviance = data [:, 1 ] / data [:, 2 ] - std_model
116126 std_model = np .sqrt (std_model * (1 - std_model ))
117127 deviance = deviance / std_model
@@ -349,8 +359,13 @@ def plot_prior(result: Result,
349359 for param_value , color in zip (x_percentiles , colors ):
350360 this_sigmoid_params = dict (sigmoid_params )
351361 this_sigmoid_params [param ] = param_value
352- y = sigmoid (sigmoid_x , this_sigmoid_params ['threshold' ], this_sigmoid_params ['width' ])
353- y = (1 - estimate ['gamma' ] - this_sigmoid_params ['lambda' ]) * y + estimate ['gamma' ]
362+ y = sigmoid (
363+ sigmoid_x ,
364+ threshold = this_sigmoid_params ['threshold' ],
365+ width = this_sigmoid_params ['width' ],
366+ gamma = estimate ['gamma' ],
367+ lambd = this_sigmoid_params ['lambda' ],
368+ )
354369 plt .plot (sigmoid_x , y , linewidth = line_width , color = color )
355370
356371 plt .scatter (data [:, 0 ], np .zeros (data [:, 0 ].shape ), s = marker_size * .75 , c = 'k' , clip_on = False )
@@ -457,7 +472,7 @@ def plot_bias_analysis(data: np.ndarray, compare_data: np.ndarray,
457472
458473 fig = plt .figure (constrained_layout = True , figsize = (5 , 15 ))
459474 gs = fig .add_gridspec (6 , 1 )
460-
475+
461476 ax1 = fig .add_subplot (gs [0 :2 , 0 ])
462477 plot_psychometric_function (result_combined , ax = ax1 , estimate_type = estimate_type )
463478 plot_psychometric_function (result_data , ax = ax1 , line_color = [1 , 0 , 0 ], data_color = [1 , 0 , 0 ],
@@ -469,25 +484,25 @@ def plot_bias_analysis(data: np.ndarray, compare_data: np.ndarray,
469484 ax3 = fig .add_subplot (gs [3 , 0 ])
470485 ax4 = fig .add_subplot (gs [4 , 0 ])
471486 ax5 = fig .add_subplot (gs [5 , 0 ])
472-
487+
473488 axesmarginals = [ax2 , ax3 , ax4 , ax5 ]
474-
489+
475490 for param , ax in zip (['threshold' , 'width' , 'lambda' , 'gamma' ], axesmarginals ):
476491
477- plot_marginal (result_combined , param , ax = ax , plot_prior = False ,
492+ plot_marginal (result_combined , param , ax = ax , plot_prior = False ,
478493 line_color = [0 , 0 , 0 ], estimate_type = estimate_type ,
479494 plot_ci = False )
480-
495+
481496 plot_marginal (result_data , param , ax = ax , plot_prior = False ,
482- line_color = [1 , 0 , 0 ], estimate_type = estimate_type ,
497+ line_color = [1 , 0 , 0 ], estimate_type = estimate_type ,
483498 plot_ci = False )
484-
485-
499+
500+
486501 plot_marginal (result_compare_data , param , ax = ax , plot_prior = False ,
487502 line_color = [0 , 0 , 1 ], estimate_type = estimate_type ,
488503 plot_ci = False )
489-
504+
490505 for ax in axesmarginals :
491506 ax .autoscale ()
492-
507+
493508
0 commit comments