I am experiencing some problems in fitting a trimodal distribution (which should be thought as a sum of three Gaussian distributions) using the nls function for nonlinear fittings.
As a test, just consider the very simple code:
which I use to get the empirical density (as I would from real experimental data) and test it against a Gaussian ansatz.
Well, either R always crashes for a segmentation fault and I have to restart it manually or I get this output:
Error in match.call(definition, call, expand.dots) :
'.Primitiv�i�d�������������...' is not a function
Am I missing the obvious or is there some bug in my R build?