PHP
  Home arrow PHP arrow Page 2 - Implementing Bayesian Inference Using ...
Administration  
AJAX  
Apache  
BrainDump  
DHTML  
Flash  
Java  
JavaScript  
Multimedia  
MySQL  
Oracle  
Perl  
PHP  
Practices  
Python  
Reviews  
Security  
Style-Sheets  
Web Services  
XML  
Zend  
Zope  
Forums Sitemap 
IBM® developerWorks 
Sun Developer Network 
E-Commerce Hosting 
Linux Web Hosting 
Managed Hosting 
Small Business Hosting 
Mobile Linux 
App Generation ROI 
VPS Hosting 
Weekly Newsletter

 
Developer Updates  
Free Website Content 
 RSS  Articles
 RSS  Forums
 RSS  All Feeds
Write For Us Get Paid 
Request Media Kit
Contact Us 
Site Map 
Privacy Policy 
Support 
 USERNAME
 
 PASSWORD
 
 
  >>> SIGN UP!  
  Lost Password? 
PHP

Implementing Bayesian Inference Using PHP: Part 2
By: developerWorks
  • Search For More Articles!
  • Disclaimer
  • Author Terms
  • Rating: 5 stars5 stars5 stars5 stars5 stars / 2
    2005-01-12

    Table of Contents:
  • Implementing Bayesian Inference Using PHP: Part 2
  • Defining simple surveys
  • What is parameter estimation?
  • Computing the MLE
  • Graphing the likelihood distribution
  • Algebraic cleverness
  • Bayes estimators
  • Beta distribution sampling model
  • Beta distribution source code
  • Conclusions

  • Rate this Article: Poor Best 
      ADD THIS ARTICLE TO:
      Del.ici.ous Digg
      Blink Simpy
      Google Spurl
      Y! MyWeb Furl
    Email Me Similar Content When Posted
    Add Developer Shed Article Feed To Your Site
    Email Article To Friend
    Print Version Of Article
    PDF Version Of Article
     
     
    ADVERTISEMENT


    Implementing Bayesian Inference Using PHP: Part 2 - Defining simple surveys


    (Page 2 of 10 )

    Surveys come in many forms. You can present questions and solicit answers in a large variety of ways. I won't be concerned with understanding how to analyze every possible type of survey; instead, I will try to be a bit more strategic by starting with the simplest possible types of surveys.

    The first type of survey to examine is one in which all the survey questions require a boolean response (yes/no, agree/disagree, male/female, and so forth). Think of this as a multiple-choice survey where all questions only offer two mutually-exclusive response options, probably the simplest type of survey you can imagine constructing.

    When participants take a Web survey, you need to store their answers in a form suitable for later analysis. For analysis purposes, the best way to store survey answers is in a database table dedicated to responses from a particular survey. The survey table should have columns devoted to recording the boolean-valued response for each question (denoted q1 to q3 in the following table):

    Table 1. Storing survey answers so they're suitable for later analysis

    participantq1q2q3
    1000
    2001
    3110
    add more rows here

    Opinion poll surveys with binary response options are ideally collected in this format. Surveys with binary data collected in this format are referred to as binary surveys.

    A survey that is constructed for the purposes of classifying participants differs from the above in that it requires at least one extra classification field (denoted c1 below) to record, for example, the employment status of the participant (coded as 0 = unemployed and 1 = employed).

    Table 2. Extra field allows participants to be classified

    participantq1q2q3c1
    10001
    20011
    31100
    add more rows here

    Note that records used for medical diagnostic testing are likely to have a similar format.

    Surveys with binary data collected in this format are referred to as binary classification surveys.

    When the adjective "simple" is used to describe a binary survey, this means that the survey consists of only one binary response per participant -- which most people would refer to as a poll. It can also be viewed as the limiting case of a survey.

    When the adjective "simple" is used to describe a binary classification survey, this means that the survey consists of only two binary responses per participant, one being a response to the test question q1 and one being a response to the classification question c1.

    You will find the parameter estimation concepts that I discuss in this article to be useful for analyzing simple binary surveys. In my next article, I focus on concepts and code useful for analyzing simple binary classification surveys and multivariate binary classification surveys.

    The range of binary surveys as defined here represent a distinct and interesting class of surveys to study. A cornucopia of literature and palette of analytic techniques is available to analyze binary data. Binary surveys are also interesting because responses coded as 0s and 1s are written in the native language of hardware-based computing. Fields as diverse as statistics, computer science, physics, medical diagnosis, data compression, and electrical engineering can be treated in a unified manner within the mathematics of binary data analysis and modeling.

    More PHP Articles
    More By developerWorks


       · Who uses Bayesian inference these days? It is computationally harder,and it also...
       · what do they use then? i remember that this, was the first things i learned in my...
     

       

    PHP ARTICLES

    - Working With Different Namespaces in PHP 5
    - User Management Explained: Overview
    - Using Namespaces in PHP 5
    - Database Security: Guarding Against SQL Inje...
    - Building a Modular Exception Class in PHP 5
    - Database and Password Security for Web Appli...
    - Handling MySQL Data Set Failures in PHP 5
    - Building Site Registration for Web Applicati...
    - Intercepting Customized Exceptions in PHP 5
    - Securing Your Web Application Against Attacks
    - Sub Classing Exceptions in PHP 5
    - Authentication for Web Application Security
    - Building a Content Management System with Co...
    - Filters and Login Systems for Web Applicatio...
    - Working with the Email Class in Code Igniter





    © 2003-2008 by Developer Shed. All rights reserved. DS Cluster 3 hosted by Hostway
    Stay green...Green IT