def LSTD_values(T, R, fMap, discountFactor, **kwargs):
 (statMatrix, statResidual) = trueFeatureStats(T, R, fMap, discountFactor, **kwargs)
 weights = lstsq(statMatrix, statResidual)[0]
 return dot(weights, fMap)

def LSTD_values ( T , R , fMap , discountFactor , ** kwargs ) : ( statMatrix , statResidual ) = trueFeatureStats ( T , R , fMap , discountFactor , ** kwargs ) weights = lstsq ( statMatrix , statResidual ) [ 0 ] return dot ( weights , fMap )
least-squares temporal difference algorithm .