A method of controlling a wellbore, comprising: determining pressure and/or gas-fluid mass ratio of a gas mass to overall fluid mass of the wellbore from a time series of wellbore measurement, wherein the wellbore measurement comprises at least pressure measurements and/or flow rate measurements, comprising using a processor to: a) build an approximate model of the wellbore; b) sample a plurality of wellbore parameter values for a current time interval from an approximate posterior probability distribution that represents a probability distribution of the wellbore parameter conditional on the wellbore measurement for the current time interval and the approximate model, wherein the wellbore parameter comprises at least gas slip velocity and/or gas kick rate; c) determine an estimate of the wellbore parameter at the current time interval by determining a maximum a posteriori estimation for the wellbore parameter, derived from the distribution of the plurality of sampled wellbore parameter values; d) determine an estimate of the pressure and/or gas-fluid mass ratio of the wellbore at the current time interval by simulating the evolution of an estimate of the pressure and/or gas-fluid mass ratio of a wellbore for the previous time interval to the current time interval, given the estimate of the wellbore parameter; e) repeat b) to d) for the next time interval; and f) provide the estimated pressure and/or gas-fluid mass ratio of the wellbore to a control unit for use in controlling the pressure profile of the wellbore. determining pressure and/or gas-fluid mass ratio of a gas mass to overall fluid mass of the wellbore from a time series of wellbore measurement, wherein the wellbore measurement comprises at least pressure measurements and/or flow rate measurements, comprising using a processor to: a) build an approximate model of the wellbore; b) sample a plurality of wellbore parameter values for a current time interval from an approximate posterior probability distribution that represents a probability distribution of the wellbore parameter conditional on the wellbore measurement for the current time interval and the approximate model, wherein the wellbore parameter comprises at least gas slip velocity and/or gas kick rate; c) determine an estimate of the wellbore parameter at the current time interval by determining a maximum a posteriori estimation for the wellbore parameter, derived from the distribution of the plurality of sampled wellbore parameter values; d) determine an estimate of the pressure and/or gas-fluid mass ratio of the wellbore at the current time interval by simulating the evolution of an estimate of the pressure and/or gas-fluid mass ratio of a wellbore for the previous time interval to the current time interval, given the estimate of the wellbore parameter; e) repeat b) to d) for the next time interval; and f) provide the estimated pressure and/or gas-fluid mass ratio of the wellbore to a control unit for use in controlling the pressure profile of the wellbore. a) build an approximate model of the wellbore; b) sample a plurality of wellbore parameter values for a current time interval from an approximate posterior probability distribution that represents a probability distribution of the wellbore parameter conditional on the wellbore measurement for the current time interval and the approximate model, wherein the wellbore parameter comprises at least gas slip velocity and/or gas kick rate; c) determine an estimate of the wellbore parameter at the current time interval by determining a maximum a posteriori estimation for the wellbore parameter, derived from the distribution of the plurality of sampled wellbore parameter values; d) determine an estimate of the pressure and/or gas-fluid mass ratio of the wellbore at the current time interval by simulating the evolution of an estimate of the pressure and/or gas-fluid mass ratio of a wellbore for the previous time interval to the current time interval, given the estimate of the wellbore parameter; e) repeat b) to d) for the next time interval; and f) provide the estimated pressure and/or gas-fluid mass ratio of the wellbore to a control unit for use in controlling the pressure profile of the wellbore.