I'm trying to solve the following nonlinear system of equations with $sigma^2_2$ and $\mu_2$ unknown :
And here is the code I used in R with the rootSolve library :
library(rootSolve)
mu_1 <- -2.931476
sigmasq_1 <- (1.084857)^2
mu_Z <- -6.717234
sigmasq_Z <- 0.104320
model <- function(x) c(F1 = log(((exp(2*mu_1+sigmasq_1)*(exp(sigmasq_1)-1))+(exp(2*x[1]+x[2])*(exp(x[2])-1)))/
((exp(mu_1+sigmasq_1/2)+exp(x[1]+x[2]/2))^2)+1)-sigmasq_Z,
F2 = log(exp(mu_1+sigmasq_1/2)+exp(x[1]+x[2]/2))-sigmasq_Z/2-mu_Z)
(ss <- multiroot(f = model, start = c(1.5, 0)))
However this gives absurd result and the following warning :
Warning messages: 1: In stode(y, times, func, parms = parms, ...) : error during factorisation of matrix (dgefa); singular matrix 2: In stode(y, times, func, parms = parms, ...) : steady-state not reached