Principal curve analysis