A computer-implemented method for estimating in situ stress field of a geological environment, the method comprising: - providing: ▪ a geomechanical model of the geological environment, ▪ measurements of a first geological attribute each performed at a respective first position of the geological environment, ▪ constraints on a second geological attribute related to a yield criterion and each assigned to a respective second position of the geological environment, wherein one or more of the constraints are that the yield criterion be not reached and/or one or more of the constraints are that the yield criterion be reached, and ▪ a geomechanical simulator configured to take as input the geomechanical model and a set of one or more boundary conditions defined on the geomechanical model, and to output data from which are derivable: ∘values of the first geological attribute each at a respective first position of the measurements, ∘ values of the second geological attribute each at a respective second position of the constraints, and ∘ a stress field distributed on the geological environment; - determining the stress field derivable from the data outputted by the geomechanical simulator taking as input the geomechanical model and an optimal set of one or more boundary conditions, the optimal set optimizing a program rewarding for each respective one of candidate sets of one or more boundary conditions: ▪ consistency between the measurements and the values of the first geological attribute, and ▪ respect of the constraints by the values of the second geological attribute. - providing: ▪ a geomechanical model of the geological environment, ▪ measurements of a first geological attribute each performed at a respective first position of the geological environment, ▪ constraints on a second geological attribute related to a yield criterion and each assigned to a respective second position of the geological environment, wherein one or more of the constraints are that the yield criterion be not reached and/or one or more of the constraints are that the yield criterion be reached, and ▪ a geomechanical simulator configured to take as input the geomechanical model and a set of one or more boundary conditions defined on the geomechanical model, and to output data from which are derivable: ∘values of the first geological attribute each at a respective first position of the measurements, ∘ values of the second geological attribute each at a respective second position of the constraints, and ∘ a stress field distributed on the geological environment; ▪ a geomechanical model of the geological environment, ▪ measurements of a first geological attribute each performed at a respective first position of the geological environment, ▪ constraints on a second geological attribute related to a yield criterion and each assigned to a respective second position of the geological environment, wherein one or more of the constraints are that the yield criterion be not reached and/or one or more of the constraints are that the yield criterion be reached, and ▪ a geomechanical simulator configured to take as input the geomechanical model and a set of one or more boundary conditions defined on the geomechanical model, and to output data from which are derivable: ∘values of the first geological attribute each at a respective first position of the measurements, ∘ values of the second geological attribute each at a respective second position of the constraints, and ∘ a stress field distributed on the geological environment; ∘values of the first geological attribute each at a respective first position of the measurements, ∘ values of the second geological attribute each at a respective second position of the constraints, and ∘ a stress field distributed on the geological environment; - determining the stress field derivable from the data outputted by the geomechanical simulator taking as input the geomechanical model and an optimal set of one or more boundary conditions, the optimal set optimizing a program rewarding for each respective one of candidate sets of one or more boundary conditions: ▪ consistency between the measurements and the values of the first geological attribute, and ▪ respect of the constraints by the values of the second geological attribute. ▪ consistency between the measurements and the values of the first geological attribute, and ▪ respect of the constraints by the values of the second geological attribute.