normal-distribution

Java Guassian Distribution-Bell Curve [duplicate]

只谈情不闲聊 提交于 2019-12-23 15:24:31
问题 This question already has answers here : Draw Gaussian curve in Java (2 answers) Closed 3 years ago . I have calculated mean and SD of a set of values. Now I need to draw a bell curve using those value to show the normal distribution in JAVA Swing. How do i proceed with this situation. List : 204 297 348 528 681 684 785 957 1044 1140 1378 1545 1818 Total count : 13 Average value (Mean): 877.615384615385 Standard deviation (SD) : 477.272626245539 If i can get the x and y cordinates I can do it

Drawing overlayed sideways plots in R

◇◆丶佛笑我妖孽 提交于 2019-12-23 12:34:25
问题 I have the following code, in R. x = c(rep(2,10),rep(4,10)) y1 = c(5.1,3,4.2,4.1,4.8,4.0,5,4.15,3,4.5) y2 = c(9.1,8,9.2,8.2,7,9.5,8.8,9.3,10,10.4) y = c(y1,y2) plot(x,y,pch=16,cex=0.9,xlim=c(0,6),ylim=c(0,13)) This code produces a plot with two bands of dots. I've overlayed normal curves sideways on those bands using powerpoint. How can I do this in R (drawing the sideways normal curves), using the actual means and sd values? NOTE : I repeat, the normal curves are not part of the plot. The

Boost BCP doesn't output any files?

守給你的承諾、 提交于 2019-12-23 09:44:24
问题 I'm trying to use the Boost Copy (BCP) utility to pull the normal_distribution class out of Boost. However, when I do bcp normal_distribution ./my_normal_distribution_dir , nothing appears in the my_normal_distribution_dir directory. Here's some more detailed background on the environment that I'm doing this in: On Mac OS 10.7, I downloaded the Boost 1.50 and untared source files. In the top-level Boost directory, I did ./bootstrap.sh . Then, I did ./bjam ./tools/bcp , which produced a bcp

circularly symmetric Gaussian variables using matlab

荒凉一梦 提交于 2019-12-23 04:43:11
问题 any one can help me, i want to generate a matrix with elements being zero mean and unit variance independent and identically distributed (i.i.d.) circularly symmetric Gaussian variables using Matlab any one know the code for this and how to do it 回答1: It is easy to generate a matrix with elements being zero mean and unit variance by using this command in matlab: normrnd(mu, sigma) mu is the mean sigma is the standard deviation. More detail please help normrnd in MATLAB. 来源: https:/

Javascript equivalent for Inverse normal function ? eg Excel's NORMSINV() or NORMINV()?

China☆狼群 提交于 2019-12-21 21:08:59
问题 I'm trying to convert something from my excel spreadsheets into Javascript and came along the NORMSINV() macro in my spreadsheets. The NormSInv() is nicely documented at http://office.microsoft.com/en-us/excel-help/normsinv-HP005209195.aspx. Basically it's of the form Z = NormSInv(probability) where if you give it the probability (say 0.90), it gives you the Z value for a standard normal distribution (Z= 1.33). I could encode the entire transformation table as per http://en.wikipedia.org/wiki

Alternative for scipy.stats.norm.pdf?

安稳与你 提交于 2019-12-21 12:39:03
问题 Does anyone know of an alternative for scipy.stats.norm.pdf()? I'm hosting my python site on Google App Engine and Google doesn't support SciPy. I've tried this function, but that didn't return the same results as scipy: def normpdf(x, mu, sigma): u = (x-mu)/abs(sigma) y = (1/(sqrt(2*pi)*abs(sigma)))*exp(-u*u/2) return y For example: print scipy.stats.norm.pdf(20, 20, 10) print normpdf(20, 20, 10) print scipy.stats.norm.pdf(15, 20, 10) print normpdf(15, 20, 10) print scipy.stats.norm.pdf(10,

Can't add a probability-curve on the histogram

会有一股神秘感。 提交于 2019-12-21 05:50:14
问题 I'm trying do display multiple histograms with one plot with the lattice-package. That's my code so far: histogram(~ X1 + X2 + X3 + X4 + X5 + X6 + X7 + X8 + X9 + X10, data=mydata, type = "density",layout=c(5,2), panel=function(x, ...) { panel.histogram(x, ...) panel.mathdensity(dmath=dnorm, col="black", args=list(mean=mean(x), sd=sd(x)), ...) }) The problem is, that it won't plot the probability-curve. It doesn't give me an error back, so the code looks good, I think. I also tried it with

R - Plotting two bivariate normals in 3d and their contours respectively

核能气质少年 提交于 2019-12-20 10:10:47
问题 I have been playing around with the MASS package and can plot the two bivariate normal simply using image and par(new=TRUE) for example: # lets first simulate a bivariate normal sample library(MASS) bivn <- mvrnorm(1000, mu = c(0, 0), Sigma = matrix(c(1, .5, .5, 1), 2)) bivn2 <- mvrnorm(1000, mu = c(0, 0), Sigma = matrix(c(1.5, 1.5, 1.5, 1.5), 2)) # now we do a kernel density estimate bivn.kde <- kde2d(bivn[,1], bivn[,2], n = 50) bivn.kde2 <- kde2d(bivn2[,1], bivn[,2], n = 50) # fancy

Understanding and implementing numerical integration with a quantile function in R

旧城冷巷雨未停 提交于 2019-12-20 04:58:14
问题 I need to calculate this integral below, using R: The q_theta(x) function I managed to do in R with quantile regression (package: quantreg ). matrix=structure(c(0.01, 0.02, 0.03, 0.04, 0.05, 0.06, 0.07, 0.08, 0.09, 0.1, 0.11, 0.12, 0.13, 0.14, 0.15, 0.16, 0.17, 0.18, 0.19, 0.2, 0.21, 0.22, 0.23, 0.24, 0.25, 0.26, 0.27, 0.28, 0.29, 0.3, 0.31, 0.32, 0.33, 0.34, 0.35, 0.36, 0.37, 0.38, 0.39, 0.4, 0.41, 0.42, 0.43, 0.44, 0.45, 0.46, 0.47, 0.48, 0.49, 0.5, 0.51, 0.52, 0.53, 0.54, 0.55, 0.56, 0.57,

How to generate normal random numbers using boost multiprecision?

瘦欲@ 提交于 2019-12-20 04:55:20
问题 I'm trying to generate random numbers from normal distribution using boost's multiprecision. I can generate random numbers from uniform distributions, but when I tried to generate from standard normal, it reports an error. Here is the code: (follows from Examples from boost, change mpz_int to cpp_int, and mpf_float_50 to cpp_dec_float_50) #include <boost/multiprecision/cpp_int.hpp> #include <boost/multiprecision/cpp_dec_float.hpp> #include <boost/multiprecision/random.hpp> #include <boost