original_docstring: 
  		Refinement by weighted Deming regression.
  
  		Fits a line minimizing errors in x and y, implementation according to: 
  			'Performance of Deming regression analysis in case of misspecified 
  			analytical error ratio in method comparison studies'
  			Kristian Linnet, in Clinical Chemistry, 1998
  
  		x -- vector of x values
  		y -- vector of y values
  		weights -- vector of weights (1 per point)		
  		
docstring: Refinement by weighted Deming regression.
  Fits a line minimizing errors in x and y, implementation according to:
  'Performance of Deming regression analysis in case of misspecified
  analytical error ratio in method comparison studies'
  Kristian Linnet, in Clinical Chemistry, 1998
  
  
docstring_tokens: Refinement by weighted Deming regression . Fits a line minimizing errors in x and y implementation according to : ' Performance of Deming regression analysis in case of misspecified analytical error ratio in method comparison studies ' Kristian Linnet in Clinical Chemistry 1998
code: def __refine_hyp(self, x, y, weights):
  		'''
  		Refinement by weighted Deming regression.
  
  		Fits a line minimizing errors in x and y, implementation according to: 
  			'Performance of Deming regression analysis in case of misspecified 
  			analytical error ratio in method comparison studies'
  			Kristian Linnet, in Clinical Chemistry, 1998
  
  		x -- vector of x values
  		y -- vector of y values
  		weights -- vector of weights (1 per point)		
  		'''
  
  		ws = weights.sum()
  		xm = (x * weights).sum() / ws
  		ym = (y * weights).sum() / ws
  
  		u = (x - xm)**2
  		u = (u * weights).sum()
  
  		q = (y - ym)**2
  		q = (q * weights).sum()
  
  		p = torch.mul(x - xm, y - ym)
  		p = (p * weights).sum()
  
  		slope = (q - u + torch.sqrt((u - q)**2 + 4*p*p)) / (2*p)
  		intercept = ym - slope * xm
  
  		return slope, intercept
code_tokens: def __refine_hyp ( self , x , y , weights ) : ws = weights . sum ( ) xm = ( x * weights ) . sum ( ) / ws ym = ( y * weights ) . sum ( ) / ws u = ( x - xm ) ** 2 u = ( u * weights ) . sum ( ) q = ( y - ym ) ** 2 q = ( q * weights ) . sum ( ) p = torch . mul ( x - xm , y - ym ) p = ( p * weights ) . sum ( ) slope = ( q - u + torch . sqrt ( ( u - q ) ** 2 + 4 * p * p ) ) / ( 2 * p ) intercept = ym - slope * xm return slope , intercept
short_docstring: Refinement by weighted Deming regression.
short_docstring_tokens: Refinement by weighted Deming regression .
comment: '''
  		Refinement by weighted Deming regression.
  
  		Fits a line minimizing errors in x and y, implementation according to: 
  			'Performance of Deming regression analysis in case of misspecified 
  			analytical error ratio in method comparison studies'
  			Kristian Linnet, in Clinical Chemistry, 1998
  
  		x -- vector of x values
  		y -- vector of y values
  		weights -- vector of weights (1 per point)		
  		'''