bayesian

Error during modelCompile() [OpenBUGS]

爱⌒轻易说出口 提交于 2019-12-13 04:45:12
问题 I am trying to do Bayesian NHST between two groups. Each group consists of many variables, and in order to avoid multiple hypothesis corrections I opted for Bayesian method. However my code in OpenBUGS is giving the following error: "Error in handleRes(res) : Internal "trap" error in OpenBUGS, or non-existent module or procedure called." I am using BRugs R-package with modelCheck(...) - model is syntactically correct and with modelData(...) - data loaded are appearing but when tried to

how to plot joint distribtuion of 2 random variable having 1000 data

ⅰ亾dé卋堺 提交于 2019-12-13 04:07:20
问题 here is the code i wrote to generate probability distribtuion of two random variable. now i would like to plot JPD. clear all; clc; x1 = randn(1000,1); x2 = 10*randn(1000,1); [count_1, b] = hist(x1, 25); %25 bins pd1 = count_1 / length(x1) / (b(2) - b(1)); % probability distribution function of x1 [count_2, bn] = hist(x2, 25); %25 bins pd2 = count_2 / length(x2) / (bn(2) - bn(1)); % probabitlity distribtuion function of x2 %subplot(2,2,1), plot(x,s1) %subplot(2,2,2),plot(x,s2) %subplot(2,2,1)

Bayesian interval of 5 fitted values

落花浮王杯 提交于 2019-12-12 22:04:00
问题 I conducted a Bayesian analysis by running Winbugs from R and derived the fitted values and their Bayesian intervals. Here is the related Winbugs output where mu[i] is the i-th fitted value. node mean 2.5% 97.5% mu[1] 0.7699 0.6661 0.94 mu[2] 0.8293 0.4727 1.022 mu[3] 0.7768 0.4252 0.9707 mu[4] 0.6369 0.4199 0.8254 mu[5] 0.7704 0.5054 1.023 What I want to do is to find the Bayesian interval for the mean of these 5 fitted values. Any idea how? 回答1: The answer of Chris Jackson is correct,

Calculating Mutual Information For Selecting a Training Set in Java

别等时光非礼了梦想. 提交于 2019-12-12 14:34:14
问题 Scenario I am attempting to implement supervised learning over a data set within a Java GUI application. The user will be given a list of items or 'reports' to inspect and will label them based on a set of available labels. Once the supervised learning is complete, the labelled instances will then be given to a learning algorithm. This will attempt to order the rest of the items on how likely it is the user will want to view them. To get the most from the user's time I want to pre-select the

RJAGS output Node inconsistent with parents

你说的曾经没有我的故事 提交于 2019-12-12 03:31:22
问题 Hi everyone I'm new in JAGS and currently doing a bayesian inference using mcmc through RJAGS. I've been trying my best to debug my code until I'm stuck with this error "Error in node e1[3] Node inconsistent with parents". e1<-c(1,1,0,1,1,0,0,1,0,0,1,0,1,1,1,1,1,0,0,1,1,0,1,1,1,1,0,0,1,1,0,0,0,0,0,1,1,1,1,1,0,0,0,1,1,0,1,1,0,0,1,1,1,1,0,1) e2<-c(1,1,0,1,1,1,0,1,0,1,1,1,0,1,1,1,1,0,1,1,1,1,0,0,1,1,1,1,1,1,1,1,0,1,1,0,1,1,0,1,1,0,0,1,1,1,0,1,1,0,1,1,1,1,1) c1<-c(2412,3485,881,1515,1824,1603,865

BayesServer: InvalidNetworkException: Node [Knowledge] has a null distribution

时光毁灭记忆、已成空白 提交于 2019-12-11 18:14:24
问题 I am trying to build a Dynamic Bayesian Network using the BayesServer library in C# for my Unity3D game. I have the following method which implements the network // numberOfDistractors and levelId will be used later for added complexity in modeling void InitializeNetworkForLevel(int numberOfDistractors, int levelId) { beliefNet = new BayesServer.Network(); // add a knowledge node which is a latent variable (parameter to be learned from observed values KTrue = new State("KTrue"); KFalse = new

How to effectively solve a compound cost function optimisation problem?

一笑奈何 提交于 2019-12-11 15:45:58
问题 I want to solve the following optimization problem with Python: I have a black box function f with multiple variables as input. The execution of the black box function is quite time consuming, therefore I would like to avoid a brute force approach. I would like to find the optimum input parameters for that black box function f . In the following, for simplicity I just write the dependency for one dimension x . An optimum parameter x is defined as: the cost function cost(x) is maximized with

BayesFactor Package R: Two different Output

谁说胖子不能爱 提交于 2019-12-11 06:03:10
问题 I'm using the BayesFactor package but I get two different output for the same data using two very similar codes . I'm wondering which one is correct? if(!require(BayesFactor)){install.packages('BayesFactor')} require(BayesFactor) ################################################## exp(ttest.tstat(t= 2 , n1=40, n2=40, nullInterval =c(0, Inf), rscale = sqrt(2)/2, complement = FALSE, simple = FALSE)$bf) ### !CHECK THIS OUTPUT! ### exp(ttest.tstat(t= 2 , n1=40, n2=40, nullInterval =c(0, Inf),

Nltk naive bayesian classifier memory issue

偶尔善良 提交于 2019-12-11 05:47:21
问题 my first post here! I have problems using the nltk NaiveBayesClassifier. I have a training set of 7000 items. Each training item has a description of 2 or 3 worlds and a code. I would like to use the code as label of the class and each world of the description as features. An example: "My name is Obama", 001 ... Training set = {[feature['My']=True,feature['name']=True,feature['is']=True,feature[Obama]=True], 001} Unfortunately, using this approach, the training procedure NaiveBayesClassifier

MATLAB - Classification output

烈酒焚心 提交于 2019-12-11 03:52:02
问题 My programme uses K-means clustering of a set amount of clusters from the user. For this k=4 but I would like to run the clustered information through matlabs naive bayes classifier afterwards. Is there a way to split the clusters up and feed them into different naive classifiers in matlab? Naive Bayes: class = classify(test,training, target_class, 'diaglinear'); K-means: %% generate sample data K = 4; numObservarations = 5000; dimensions = 42; %% cluster opts = statset('MaxIter', 500,