def PVI(ax,ay,az,lag):
	"""
	Routine to calculate the Partial Variance Increment between three time series, normalized
	Input:
		ax: series 1
		ay: series 2
		az: series 3
		lag: The number of points to shift each of the series ax, ay, and az
	Output:
		mag: normalized pvi
	"""
	ax = ax.copy()
	ay = ay.copy()
	az = az.copy()
# take the three factors of mag_field and find the derivatives
	dax=ax.shift(-lag)-ax
	day=ay.shift(-lag)-ay
	daz=az.shift(-lag)-az
# calc the magnitude of the derivatives of mag_field and return the pvi
	mag = dax.pow(2)+day.pow(2)+daz.pow(2)
	return (mag.div(mag.mean())).pow(.5)