Automatic dimensionality selection from the scree plot via the use of profile likelihood