Fitting with numerical function

Dear colleagues,
can somebody tell, how to fit data with a function defined numerically?
Situation seems to be quite common, when the function is given by numeric calculations or MC-simulations (for the same bins as experimental data) and no analytic form is available.
Extra question is how to take into account finite accuracy of given function in this fitting procedure with chi-squared estimation? That is both experimental datapoints and function points have error bars.
Thanks in advance

Have you solved your problems? I am facing the same problem as you.
Looking forward to your reply.

It is not a good idea to “resurrect” a 7 years old posts. You better create a new one.
Anyway I guess @moneta can give you some hints.

I have created a new one about my question, but it haven’t been replyed.
Topic is : How to integral my pdf in ROOFIT