ruby-on-rails gems to determine probability curve - ruby-on-rails

Is there a gem which enables you provide 3 to 4 values of known probability and generate en equation showing lognormal curve of best fit? The curve to be used for determining different values of (y) given the value of (x)
thanks Pierre

I didn't appreciate how hard this would be. A third party is providing javascript to go to solve this problem. Thanks - Pierre

Related

Maximum a Poseriori Derivation

can anyone please tell me how the author came to equation 2 from equation 1. I've applied Bayes rules but I'm not able to come to equation 2 directly. Thanks so much in advance.
These two are equal by definition of Bayes theorem :)

Autocorrelation interpretation

Hi I am trying to understand how to interpret autocorrelation:
By looking at the graph how can we say the auto-correlation with the previous period (t + 1 in relation to t). TIA.
The following section from the Forecasting Principles and Practice book may help you to understand the interpretation of the Auto-correlation plots.
Thanks.
[1] https://otexts.com/fpp2/autocorrelation.html

Comparison of two normal distribution

I have two normally distributed samples. I want to know how close or similar it is. I tried few methods to find the similarity, like z-score and bhattacharyya distance.
Bhattacharyya distance didn't work for me. It gives the same distance if the standard deviation of two samples is same. It doesn't change with change in mean.
I want to know whether any method is available that take the samples or its mean and standard deviation to find the similarity or similarity rank something like this.
I am not from mathematics background, so please ignore the terminology mistakes and let me know if any clarification is required.
I assume you're not looking for a relationship between the two samples, where a correlation coefficient would be appropriate?
I've been investigating a similar question for my current data and am looking at the Mahalanobis distance and the Earthmovers distance.
I found this post from a different forum which gave me a few ideas

Data based estimation of missing values

I have problem at hand where I feel there should be an rather elegant solution to it, but at this point I have problems finding the right search terms or getting the first step towards the right direction.
Basics:
I have a high dimensional data space with D = 19 and have about 100 points in the space (100 measurements). With PCA and dimensionality estimation algorithms, I already confirmed that the latent space on which the points lie on is relatively low dimensional (max 5 dimensions or so). Therefore, I think in general it is not impossible what I am asking.
The problem:
Now, based on uncomplete measurements of a new point, I would like to estimate the missing values. The problem is that I do not know which values will be missing. Basically all combinations of missing values are (somewhat) similarly likely. -> I could have 1 missing value, 19 missing values or something in between. In a perfect world, the algorithm I am looking for not only gives an estimate of the missing values, but also some error measure.
To further illustrate, I attach you one image with the raw data. The x-axis shows the 19 individual measured parameters and the y axis gives the values of those parameters. You can see that the measurements are highly correlated. So even if I specify only one measurement/dimension I should be able to give a somewhat reliable estimation of the rest.
Does anyone of you have any pointers for me? Any thoughts or advice would be really helpful!
Thanks,
Thomas
The Right Way (TM) to handle missing data is to average (i.e., integrate) over the missing variables, given the values of any known variables. A Bayesian belief network is a formalization of this idea. If you can say more about what the variables are, I can say more about how to go about building a suitable belief network.

Where can I get a Delphi/Pascal implementation of Excel-style polynomial regression curve fitting?

I have a set of X-Y values (i.e. a scatter plot) and I want a Pascal routine to generate the coefficients of a Nth order polynomial that fits those points, in the same way that Excel does.
I used David J Taylor's Polyfit example (curvefit.zip), which implements a least squares curve fitting algorithm (also known as linear regression) David's site is here, but keep reading, because my version is better. (See below).
The origin of the algorithms David is using is a book on scientific math for Pascal programmers, Allen Miller's Curve Fitting routine from the book "Pascal Programs For Scientists And Engineers", typed and submitted to MTPUG in Oct. 1982 by Juergen Loewner,
and corrected and adaptated for Turbo Pascal by Jeff Weiss.
You can grab curvefit.zip directly from bitbucket here. (You can clone the sourcecode with Mercurial/TortoiseHG, or download a ZIP from bitbucket)
hg clone https://bitbucket.org/wpostma/curvefit curvefit
It runs in any delphi version 5 and up, Unicode or not, even Delphi 10 Berlin. It has a little chart in the demo, added by me. I also added a way to force the result through the origin, a common technique where you want a best fit on all values, other than the constant term, which should be forced, either to zero, or to some experimentally derived average. A forced "blank subtraction" which is set equal to the average of a series of analytical "zero samples", is common in certain types of analytical chemistry when used with certain types of instrumentation, and in other scientific cases, where it can be more useful than a best-fit, because you may wish to minimize error around the origin more than minimize error across the area of the curve that is farthest from the origin.
I should also clarify that for purposes of linear regression, a "curve" may also be a line, which is the case I needed for analytical chemistry purposes, and that equation for any straight line (y=mx+b) is also called the "calibration curve". A first order curve fit is a line (y = mx +b), a second order curve fit (shown in the picture) is a parabola (y= nX^2 + mX + b). As you might guess, this algorithm scales from first order up to any level you might wish. I haven't tested it above 8 terms though.
Here's a screenshot:
Bitbucket project link:
https://bitbucket.org/wpostma/curvefit/overview
Try TPMath http://tpmath.sourceforge.net/ - I've been using this for years for fitting a hill regression and can recommend it.
Check the functions in Turbo Power's SysTools library, now is open source, it includes math functions in the unit StStat.
Even though you've already awarded an answer, for completeness, I thought I'd add this:
We use SDL Components' Math pack and have been very happy with it.
http://www.lohninger.com/delfcomp.html
It's well thought out, and does exactly what we need.
He's got a variety of other interesting tools on his site.
XlXtrFun is the best curve fitting I know and use, but it is for Excel:
http://www.xlxtrfun.com/XlXtrFun/XlXtrFun.htm

Resources