Skip to main content

Posts

Showing posts with the label bayesian

Bayesian thought the End of Christainity

Im currently reading The End of Christainity and was hoping Richard Carriers chapter on Neither Life nor the Universe seem Intelligently Designed would be better, its a great chapter mind you, and certainly worth it the price of the book in and of itself. But, more and more I find myself thinking in a Bayesian sense. Its worthwhile to ask yourself whether you can go from hypothesis A to conclusion c cleanly. Does ~A get there cleanly? And what do we observe. Even for seemingly basic premises and thought that havent so much as occurred to me ever such thoughts illuminate arguments Ive never heard or thought about. Why cant people in heaven or hell communicate with Earth? I mean you cant really get from the premise "there is an afterlife" to the conclusion therefore that afterlife will be completely barred from communicating with the living. But, necessarily thats a requirement if there is no afterlife. While one could conclude that there are a myriad of afterlives that could ...

Bayesian Approach to Analyse Oneway RM ANOVA

Last post I analysed the fake data set using frequentists approach.  This time, I will use the Bayesian method to analyse the same data set by using Kruschkes code (which you may be able to download from Kruschkes blog).  The result will cross-examine against the frequentists approach to see if they show consistently result (supposedly we should get the same conclusion, because the difference is quite big). First I loaded the data and did some pre-processes.  I modified Kruschkes code a bit, because my machine is operated by Linux.  Also remember to load rjags, so you can use BUGS and JAGS directly by calling it in R.  tab14 . 3 < - read . table ( " tab14.3.txt " , header = T ) # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - # Bayesian RM - ANOVA # - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - fileNameRoot = " ANOVAonewayJagsWithinSubj " # for constructing output filenames if ( . Platform $OS . type ! = " unix ...

Bayesian Approach to Analyse Oneway RM ANOVA II

After finishing the model specification, I went back to the R environment and stored data from the data frame, tab14.3 , into several independent vectors. # Load the data : y = tab14 . 3$Score x1 = tab14 . 3$Wk S = tab14 . 3$Subj x1names = unique ( tab14 . 3$Wk ) Snames = unique ( tab14 . 3$Subj ) Ntotal = length ( y ) Nx1Lvl = length ( unique ( x1 ) ) NSLvl = length ( unique ( S ) ) The above codes extract dependent variable (y) and independent variables (x1 and S) and store them into separate vectors.  The label for each level of the two independent variables were assigned to x1names and Snames , respectively. For the BUGS code, i and j1, I also created the variables, Ntotal, Nx1Lv1 and NSLv1.  Later, they were sent as a data list to BUGS.   ySDorig = sd ( y ) yMorig = mean ( y ) z = ( y - yMorig ) / ySDorig dataList = list ( y = z , x1 = x1 , S = S , Ntotal = Ntotal , Nx1Lvl = Nx1Lvl , NSLvl = NSLvl ) This step converted the predic...