We consider a problem of prediction based on opinions elicited from heterogeneous rational agents with private information. Making an accurate prediction with a minimal cost requires a joint design of the incentive mechanism and the prediction algorithm. To elicit heterogeneous agents' private information and incentivize agents with different capabilities to act in the principal's best interest, we design an optimal joint incentive mechanism and prediction algorithm called COPE (COst and Prediction Elicitation), the analysis of which offers several valuable engineering insights. First, when the costs incurred by the agents are linear in the exerted effort, COPE corresponds to a 'crowd-contending' mechanism, where the principal only employs the agent with the highest capability. Second, when the costs are quadratic, COPE corresponds to a 'crowdsourcing' mechanism that employs multiple agents with different capabilities at the same time. Numerical simulations show that COPE improves the principal's profit (The improvement is 5%-30% in our simulations), comparing to those mechanisms that assume all agents have equal capabilities. Funding: This work is supported by the General Research Funds (Project Number CUHK 14206315 and CUHK 14219016) established under the University Grant Committee of the Hong Kong Special Administrative Region, China. Nihar B. Shah's research was funded in part by the Microsoft Research PhD fellowship. Supplemental Material: The online appendix is available at https://doi.org/10.1287/opre.2017.1681. Keywords: information system x games decisions x estimation x asymmetric network information x pricing, 1. Introduction Prediction markets, which aggregate information elicited from people with private beliefs, have served as a reliable tool for estimating the outcome of specific future events (see Berg and [...]