1. A method of performing context inference, comprising: collecting ambient light at a spectrometer sensor integrated in a portable device; characterizing the collected light to obtain optical information; comparing the optical information to optical data predetermined to match one or more contexts; inferring at least one characteristic of a specific context based on the comparison; and determining a probability that the portable device is in the specific context.