def METHOD_NAME(wavelet_coefs,scaling_coefs):
	yi = wavelet_coefs
	ti = scaling_coefs
	# print len(yi), len(ti)
	d = yi.shape[0]
	t_max = np.sqrt(2*np.log(d))
	t_min = 0
	def SkellamObjective(t):
			t1 = np.sum(np.sign(np.abs(yi)-t)*ti)
			t2 = np.sum(np.minimum(yi**2,np.ones(yi.shape)*t**2))
			t3 = -t*np.sum(np.abs(yi)==t)
			# print t1,t2,t3
			return np.sum([t1,t2,t3])
	def SS(t):
		t1 = np.sum(np.sign(np.abs(yi)-t)*ti)
		t2 = np.sum(np.minimum(yi**2,np.ones(yi.shape)*t**2))
		t3 = -t*np.sum(np.abs(yi)==t)
		# print t1,t2,t3
		return np.sum([t1,t2,t3])
	trsh = minimize_scalar(SkellamObjective,bounds=[t_min,t_max]).x
	# print "threshold", trsh
	def soft_threshold(y):
		a = np.absolute(y) - trsh
		sgn = np.sign(y)
		if a <= 0:
			return 0
		else:
			return sgn*a
	# sigma_x = np.std(yi)
	# def adjusted_threshold(y,t):
	# 	if np.abs(y) >= (np.sqrt(2)*t)/sigma_x:
	# 		return -np.sign(y)*(np.sqrt(2)*t)/sigma_x
	# 	else:
	# 		return -y
	# thresholded = np.zeros(yi.shape)
	# for i in range(yi.shape[0]):
	# 	thresholded[i] = adjusted_threshold(y=yi[i],t=ti[i])
	# soft threshold:
	thresholded = np.vectorize(soft_threshold)(yi)
	return thresholded