cdf

PDF and CDF plot for central limit theorem using Matlab

寵の児 提交于 2019-12-17 21:22:59
问题 I am struggling to plot the PDF and CDF graphs of where Sn=X1+X2+X3+....+Xn using central limit theorem where n = 1; 2; 3; 4; 5; 10; 20; 40 I am taking Xi to be a uniform continuous random variable for values between (0,3). Here is what i have done so far - close all %different sizes of input X %N=[1 5 10 50]; N = [1 2 3 4 5 10 20 40]; %interval (1,6) for random variables a=0; b=3; %to store sum of differnet sizes of input for i=1:length(N) %generates uniform random numbers in the interval X

Weibull cumulative distribution function starting from “fitdistr” command

对着背影说爱祢 提交于 2019-12-12 09:14:43
问题 I've used fitdistr function from R MASS package to adjust a Weibull 2 parameters probability density function (pdf). This is my code: require(MASS) h = c(31.194, 31.424, 31.253, 25.349, 24.535, 25.562, 29.486, 25.680, 26.079, 30.556, 30.552, 30.412, 29.344, 26.072, 28.777, 30.204, 29.677, 29.853, 29.718, 27.860, 28.919, 30.226, 25.937, 30.594, 30.614, 29.106, 15.208, 30.993, 32.075, 31.097, 32.073, 29.600, 29.031, 31.033, 30.412, 30.839, 31.121, 24.802, 29.181, 30.136, 25.464, 28.302, 26.018,

Function to transform empirical distribution to a uniform distribution in Matlab?

坚强是说给别人听的谎言 提交于 2019-12-12 06:01:02
问题 I know the procedure of transforming one distribution to another by the use of CDF. However, I would like to know if there is existing function in Matlab which can perform this task? My another related question is that I computed CDF of my empirical using ecdf() function in Matlab for a distribution with 10,000 values. However, the output that I get from it contains only 9967 values. How can I get total 10,000 values for my CDF? Thanks. 回答1: As you say, all you need is the CDF. The CDF of a

How can I plot two cumulative distributions curve as line type in same plot

纵饮孤独 提交于 2019-12-12 04:42:41
问题 I want to plot cumulative distributions curve for Weibull distribution over empirical cumulative distribution curve. I have tried with this several times but it does not serve the way I want. Here is the command: x<-(SIZEDIST$AVG.µm.) x plot(x,pweibull(x,shape=1.120662,scale=18.496778),type="l",col=4) plot(ecdf(x),add=TRUE) 回答1: Use lines instead of plot plot(x,pweibull(x,shape=1.120662,scale=18.496778),type="l",col=4) lines(ecdf(x),col='red') 回答2: Like this? set.seed(1) # for reproducibility

R: area under curve of ogive?

♀尐吖头ヾ 提交于 2019-12-12 03:38:31
问题 I have an algorithm that uses an x,y plot of sorted y data to produce an ogive. I then derive the area under the curve to derive %'s. I'd like to do something similar using kernel density estimation. I like how the upper/lower bounds are smoothed out using kernel densities (i.e. the min and max will extend slightly beyond my hard coded input). Either way... I was wondering if there is a way to treat an ogive as a type of cumulative distribution function and/or use kernel density estimation to

How to get cumulative distribution function correctly for my data in python?

喜你入骨 提交于 2019-12-11 19:24:47
问题 Hello everyone i have a list of values for which i need to get cumulative distribution function i have saved this list in a variable name yvalues [0.0, 1.0, 2.0, 3.0, 4.0, 5.0, 6.0, 7.0, 8.0, 9.0, 10.0, 11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0, 21.0, 22.0, 23.0, 24.0, 25.0, 26.0, 27.0, 28.0, 29.0, 30.0, 31.0, 32.0, 33.0, 34.0, 35.0, 36.0, 37.0, 38.0, 39.0, 40.0, 41.0, 42.0, 43.0, 44.0, 45.0, 46.0, 47.0, 48.0, 49.0, 50.0, 51.0, 52.0, 53.0, 54.0, 55.0, 56.0, 57.0, 58.0, 59.0,

Performance bottleneck because of high “erf” function use

自作多情 提交于 2019-12-10 10:48:23
问题 I'm using large matrices (100x100 to 3000x3000) to do some claculations (a lot of sums and matrix-vector multiplications), I'm using the Eigen Library for my vectors and matrices. My code is simple C-like code (only functions, no classes) and is going to be compiled as a DLL to be used on Excel. I identified a bottleneck in the following code : // Q(z) matrix function Eigen::MatrixXd qzMatrix(const Eigen::MatrixXd& xjk, const float& riskFreeRate, const float& volatility, const float&

How to random sample lognormal data in Python using the inverse CDF and specify target percentiles?

泄露秘密 提交于 2019-12-07 17:50:42
问题 I'm trying to generate random samples from a lognormal distribution in Python, the application is for simulating network traffic. I'd like to generate samples such that: The modal sample result is 320 (~10^2.5) 80% of the samples lie within the range 100 to 1000 (10^2 to 10^3) My strategy is to use the inverse CDF (or Smirnov transform I believe): Use the PDF for a normal distribution centred around 2.5 to calculate the PDF for 10^x where x ~ N(2.5,sigma). Calculate the CDF for the above

ggplot: adjusting alpha/fill two factors cdf

拥有回忆 提交于 2019-12-07 07:33:42
问题 I'm having some issues getting my ggplot alpha to be sufficiently dark for my plot. Example code: ggplot(mtcars, aes(x=mpg, color=factor(gear), alpha=factor(carb))) + stat_ecdf() As you can see, whenever carb == 1 , it's very difficult to see the plot elements. In my real world data set, the factor for color has four levels and the alpha factor has two levels. I was hoping to have the alpha a slightly lighter shade of the color, but more visible than how it's occurring in that example). 回答1:

Performance bottleneck because of high “erf” function use

蹲街弑〆低调 提交于 2019-12-06 09:17:27
I'm using large matrices (100x100 to 3000x3000) to do some claculations (a lot of sums and matrix-vector multiplications), I'm using the Eigen Library for my vectors and matrices. My code is simple C-like code (only functions, no classes) and is going to be compiled as a DLL to be used on Excel. I identified a bottleneck in the following code : // Q(z) matrix function Eigen::MatrixXd qzMatrix(const Eigen::MatrixXd& xjk, const float& riskFreeRate, const float& volatility, const float& rebalancingPeriod) { int j, k, r = xjk.rows(), c = xjk.cols(); Eigen::MatrixXd matrix(r, c); double mu =