Method for determining electrical parameters used to program a resistive random access memory in an insulating state and in a conducting state, said memory comprising first and second electrodes (3, 4) separated by a layer made of an electrically insulating material, and passing from the insulating state to the conducting state by formation of a conducting filament between the first and second electrodes (3, 4), method comprising the following steps: - providing a set of parameters including a target retention time (t ret) of the insulating and conducting states, a maximum resistance value (R ON-f) in the conducting state and a minimum resistance value (R OFF-f) in the insulating state; - simulating retention curves of the conducting state corresponding to different dimensions of the filament, each retention curve of the conducting state representing the increase of the resistance in the conducting state (R ON) as a function of a retaining time (t); - determining the retention curve of the conducting state reaching the maximum resistance value (R ON-f) in the conducting state after a retention time (t) equal to the target retention time (t ret); - determining an initial resistance value (R ON-i) in the conducting state from said retention curve of the conducting state; - determining the programming parameter (I SET) of the conducting state from the initial resistance value (R ON-i) in the conducting state; - simulating retention curves of the insulating state corresponding to different dimensions of the filament, each retention curve of the insulating state representing the decrease of the resistance in the insulating state (R OFF) as a function of the retention time (t); - determining the retention curve of the insulating state reaching the minimum resistance value (R OFF-f) in the insulating state after a retention time (t) equal to the target retention time (t ret); - determining an initial resistance value (R OFF-i) in the insulating state from said retention curve of the insulating state; - determining the programming parameter (V RST) of the insulating state from the initial resistance value (R OFF-i) in the insulating state. - providing a set of parameters including a target retention time (t ret) of the insulating and conducting states, a maximum resistance value (R ON-f) in the conducting state and a minimum resistance value (R OFF-f) in the insulating state; - simulating retention curves of the conducting state corresponding to different dimensions of the filament, each retention curve of the conducting state representing the increase of the resistance in the conducting state (R ON) as a function of a retaining time (t); - determining the retention curve of the conducting state reaching the maximum resistance value (R ON-f) in the conducting state after a retention time (t) equal to the target retention time (t ret); - determining an initial resistance value (R ON-i) in the conducting state from said retention curve of the conducting state; - determining the programming parameter (I SET) of the conducting state from the initial resistance value (R ON-i) in the conducting state; - simulating retention curves of the insulating state corresponding to different dimensions of the filament, each retention curve of the insulating state representing the decrease of the resistance in the insulating state (R OFF) as a function of the retention time (t); - determining the retention curve of the insulating state reaching the minimum resistance value (R OFF-f) in the insulating state after a retention time (t) equal to the target retention time (t ret); - determining an initial resistance value (R OFF-i) in the insulating state from said retention curve of the insulating state; - determining the programming parameter (V RST) of the insulating state from the initial resistance value (R OFF-i) in the insulating state.