I am trying to implement [lognormal.inv()][1] in MS excel using lognormal.inv function of java script jstat library for my two values lower bound and upper bound. For the same values I am getting different results in excel and jstat output. Is the jstat function I am taking is the correct one ?

Excel formula - =LOGNORM.INV(0.56,(LN(400000)+LN(2500000))/2, (LN(400000)-LN(2500000))/3.29) Result - 10,87,729

Java script implementation using jStat

function logInvJstat( probability , lowerBound, upperBound){


let bound_array = [lowerBound,upperBound]

let bound_array_log = jStat.log(bound_array)

let round_bound = jStat.map( bound_array_log, function( x ) {
    return Math.round(x);
});

deviation = (round_bound[1]-round_bound[2])/3.29
console.log(round_bound)
let mean = jStat.mean(round_bound)
let std = jStat.stdev(round_bound)
console.log(mean)
console.log(std)
console.log(jStat.lognormal.inv(probability , mean, std ))
}

logInvJstat(.56,400000,2500000);

The result from above function for the same values as 1398581.708. Why this is not matching with excel result 10,87,729 ?

0 Answers