probability

How to get probability of new data point from probability object (fitdist)?

你离开我真会死。 提交于 2019-12-12 02:49:22
问题 I have fitted several probability distribution to my dataset by using the Matlab fitdist function in the following way: pd = fitdist(myDataset,distname) From this function I got a probability distribution object pd . I now that I can calculate mean(pd) , std(pd) , median(pd) etc. But how can I calculate the probability of a new data point according to the fitted distribution? 回答1: You can evaluate the probability value thanks to the pdf() function. First of all you can create your probability

How to plot a function that calculates the PDF?

大城市里の小女人 提交于 2019-12-12 02:27:46
问题 So this is the PDF that my function calculates: fx = 0.3 if (0<=x<1) 0.1 if (1<=x<2) 0.25 if (2<=x<3) 0.15 if (3<=x<4) 0.2 if (4<=x<5) 0 otherwise And this is my coding for it: fx = function(x) { if ((0<=x) & (x<1)) 0.3 else if ((1<=x) & (x<2)) 0.1 else if ((2<=x) & (x<3)) 0.25 else if ((3<=x) & (x<4)) 0.15 else if ((4<=x) & (x<5)) 0.2 else 0 } Now how would I go about plotting y=fx? I've tried: x <- runif(n,0,5) y <- fx(x) plot(x, y, type='1', xlim=c(0,5), ylim=c(0,5)) But I get an error

Conditional Probability Table in SAS

假如想象 提交于 2019-12-12 02:21:28
问题 I am working in SAS trying to create a conditional probability table. The current structure of the table is: 5 columns x 10 rows --> the value in each cell is binary. Current Data Table col1 col2 col3 col4 col5 1 0 1 0 0 0 0 0 1 1 0 0 0 0 0 1 0 0 0 0 1 0 0 0 1 0 1 0 0 0 0 1 0 1 0 1 1 1 1 0 1 0 1 0 1 1 0 1 0 0 I would like to create a table with the conditional probability for every column vs every other column. Ideal Output --- col1 col2 col3 col4 col5 col1 1.0 0.3 1.0 0.3 0.7 col2 0.2 1.0 0

calibration of the posterior probabilities

梦想与她 提交于 2019-12-12 01:22:34
问题 currently i work on calibration of probability. i use the calibration approach, called rescaling algorithm - the source http://lem.cnrs.fr/Portals/2/actus/DP_201106.pdf (page 7). the algorithm i wrote is: rescaling_fun = function(x, y, z) { P_korg = z # yhat_test_prob$BAD P_k_C1 = sum(as.numeric(y) - 1)/length(y) # testset$BAD P_kt_C1 = sum(as.numeric(x) - 1)/length(x) # trainset$BAD P_k_C0 = sum(abs(as.numeric(y) - 2))/length(y) P_kt_C0 = sum(abs(as.numeric(x) - 2))/length(x) P_new <- ((P_k

outlier detection based on gaussian mixture model

主宰稳场 提交于 2019-12-11 19:35:24
问题 I have a set of data. I want to build a one class distribution from that data. Based on the learned distribution I want to get a probability value for each of the data instance. Based on this probability values (thresholding) I want to build a classifier to classify a particular data instance is comming from that distribution or not. In this case, lets say I have a data of 50x100000 where 50 is the dimension of each data instance, the number of instances are 100000. I am leaning a Gaussian

Approximating Normal Distribution by adding Random Numbers

喜欢而已 提交于 2019-12-11 16:11:52
问题 I would like to generate some random numbers which are normally distributed. It’s not mission critical, so a simple algorithm will suffice. I would then like to supply my own mean and standard deviation. From what I have been able to read, according to the Central Limit Theorem, I should be able to approximate normally distributed random numbers by adding random numbers together. For example: rand()+rand()+rand()+rand()+rand()+rand() where rand() results in an evenly distributed random number

Convert Class Probabilities of a multiclass model to scores in range 0-100

筅森魡賤 提交于 2019-12-11 15:54:30
问题 What I want to do is to generate a score of 0-100 based on the predictions of a three class classification model. For eg. The predict_proba of a 3 class logistic regression model gives me 3 probabilities x, y, z as shown below - 0 1 2 x y z Now, I want to generate a score of 0-100 based on these probabilities, where 0 is closer to class 0 and 100 is closer to class 2. 回答1: Try this: prob['P']=(prob['1']*1+prob['2']*2)/2 prob['0'] is multiplied by 0, so you don't need it. examples: prob['0']=0

Tossing 3 fair coins in R

半城伤御伤魂 提交于 2019-12-11 15:37:25
问题 X = # of heads showing when three coins are tossed. Find P(X=1) , and E(X) . Say, I want to solve this problem using sample() , and replicate() functions in R even though there is a function called rbinom() . My attempt: noOfCoinTosses = 3; noOfExperiments = 5; mySamples <-replicate(noOfExperiments, {mySamples <- sample(c("H", "T"), noOfCoinTosses, replace = T, prob=c(0.5, 0.5)) }) headCount = length(which(mySamples=="H")) probOfCoinToss <- headCount / noOfExperiments # 1.6 meanOfCoinToss = ?

The confidence level of each specific instance in WEKA?

六月ゝ 毕业季﹏ 提交于 2019-12-11 15:04:12
问题 I'm new to WEKA and machine learning in general. I have a test set with about 6500 instances. I have a model that has already been trained with a training set. Once I run the test set through the saved model, is there a way I can extract the confidence level of each specific instance? By confidence level, I mean a numerical value that expresses the probability that the classifier has classified a specific instance correctly. I want this confidence number for each instance in the file. Is

Do Until Loop InputBox infinitely loops

前提是你 提交于 2019-12-11 12:53:24
问题 I am creating a probability macro where user enters number of players in a card game. If I enter string (ex, Joe ), non-integer(ex, 15.67 ), or integer less than 0 (ex, -25 ), the InputBox should loop. However, integers greater than 0 should terminate the loop. (I have to force kill Excel to stop the InputBox regardless of user input.) I want the InputBox to close / Exit Sub once an integer greater than 0 is entered. What am I doing wrong here? Sub GenerateCards() Players = InputBox("How many