  In order to obtain robust cosmological constraints from Type Ia supernova (SN
Ia) data, we have applied Markov Chain Monte Carlo (MCMC) to SN Ia lightcurve
fitting. We develop a method for sampling the resultant probability density
distributions (pdf) of the SN Ia lightcuve parameters in the MCMC likelihood
analysis to constrain cosmological parameters, and validate it using simulated
data sets. Applying this method to the Joint Lightcurve Analysis (JLA) data set
of SNe Ia, we find that sampling the SN Ia lightcurve parameter pdf's leads to
cosmological parameters closer to that of a flat Universe with a cosmological
constant, compared to the usual practice of using only the best fit values of
the SN Ia lightcurve parameters. Our method will be useful in the use of SN Ia
data for precision cosmology.
