# Look at the two spurious continuous # probability distributions given on the web page, # namely the Apfelton and the Blumenkopf # distributions. # # We will just repeat the kind of questions that # we saw in the binomial distribution. # ############################################ # Using the table, find #For the Apfelton distribution # P(X < -0.47 ) = # P(X <= 2.38 ) = # P(X < 3.3765) = # P( X > 2.24 ) = # P( X > -1.39 ) = # P( -0.62 < X < 1.26 ) = # P( X < 0.34 or X>0.98 ) = ###################################### ###################################### # now do the same using the papfelton() function source("../apfelton.R") # P(X < -0.47 ) = papfelton( -0.47 ) # P(X <= 2.38 ) = papfelton( 2.38 ) # P(X < 3.3765) = papfelton( 3.3765 ) # P( X > 2.24 ) = 1 - papfelton( 2.24 ) # Is one approach papfelton( 2.24, lower.tail=FALSE ) # another way # P( X > -1.39 ) = 1 - papfelton( -1.39 ) # Is one approach papfelton( -1.39, lower.tail=FALSE ) # another way # P( -0.62 < X < 1.26 ) = papfelton(1.26) - papfelton(-0.62) # P( X < 0.34 or X>0.98 ) = papfelton(0.34) + (1-papfelton(0.98)) # is one way papfelton(0.34) + papfelton( 0.98, lower.tail=FALSE)# is another way ####################################### ## go back to the table and use it to solve: # # find the y value such that # P(X < y ) = 0.2345 y= # P(X < y ) = 0.7608 y= # P(X > y ) = 0.3512 y= # P(X > y ) = 0.9199 y= # P(X < y ) = 0.5981 y= ###################################### ###################################### # now do the same using the qapfelton() function # P(X < y ) = 0.2345 y= qapfelton( 0.2345 ) # P(X < y ) = 0.7608 y= qapfelton( 0.7608 ) # P(X > y ) = 0.3512 y= qapfelton( 1 - 0.3512 ) # is one way qapfelton( 0.3512, lower.tail=FALSE ) # is another way # P(X > y ) = 0.9199 y= qapfelton( 1 - 0.9199 ) # is one way qapfelton( 0.9199, lower.tail=FALSE ) # is another way # P(X < y ) = 0.5981 y= qapfelton( 0.5981 ) ################################################# #### Switch to the Blumenkopf distribution. #### Remember that the Blumenkopf is a #### symmetric distribution, so the are some #### more questions that we might ask ############################################ # Using the table, find #For the Blumenkopf distribution # P(X < -0.47 ) = # P(X <= 2.38 ) = # P(X < 3.3765) = # P( X > 2.24 ) = # P( X > -1.39 ) = # P( -0.62 < X < 1.26 ) = # P( X < 0.34 or X>0.98 ) = ###################################### ###################################### # now do the same using the pblumenkopf() function source("../blumenkopf.R") # P(X < -0.47 ) = pblumenkopf( -0.47 ) # P(X <= 2.38 ) = pblumenkopf( 2.38 ) # P(X < 3.3765) = pblumenkopf( 3.3765 ) # P( X > 2.24 ) = 1 - pblumenkopf( 2.24 ) # Is one approach pblumenkopf( 2.24, lower.tail=FALSE ) # another way # and, because it is symmetric we could do pblumenkopf( -2.24) # P( X > -1.39 ) = 1 - pblumenkopf( -1.39 ) # Is one approach pblumenkopf( -1.39, lower.tail=FALSE ) # another way # and, because it is symmetric we could do pblumenkopf( 1.39) # P( -0.62 < X < 1.26 ) = pblumenkopf(1.26) - pblumenkopf(-0.62) # P( X < 0.34 or X>0.98 ) = pblumenkopf(0.34) + (1-pblumenkopf(0.98)) # is one way pblumenkopf(0.34) + pblumenkopf( 0.98, lower.tail=FALSE)# is another way ####################################### ## go back to the table and use it to solve: # # find the y value such that # P(X < y ) = 0.2332 y= # P(X < y ) = 0.7614 y= # P(X > y ) = 0.3600 y= # P(X > y ) = 0.9182 y= # P(X < y ) = 0.5981 y= # because Blumenkopf is symmetric # P( X < -y or X > y) = 0.2538 y= # because Blumenkopf is symmetric # P( -y < X < y) = 0.4610 y= ###################################### ###################################### # now do the same using the qblumenkopf() function # P(X < y ) = 0.2332 y= qblumenkopf( 0.2332 ) # P(X < y ) = 0.7614 y= qblumenkopf( 0.7614 ) # P(X > y ) = 0.3600 y= qblumenkopf( 1 - 0.3600 ) # is one way qblumenkopf( 0.3600, lower.tail=FALSE ) # is another way # P(X > y ) = 0.9182 y= qblumenkopf( 1 - 0.9182 ) # is one way qblumenkopf( 0.9182, lower.tail=FALSE ) # is another way # P(X < y ) = 0.5981 y= qblumenkopf( 0.5981 ) # because Blumenkopf is symmetric # P( X < -y or X > y) = 0.2538 y= qblumenkopf(0.2538/2, lower.tail=FALSE) # because Blumenkopf is symmetric # P( -y < X < y) = 0.4610 y= qblumenkopf((1 - 0.4610)/2, lower.tail=FALSE) # but note that qblumenkopf( (1-0.4610)/2 ) # also works, sort of