fork download
  1. library(SuppDists)
  2. jdist<-list(gamma=-0.7, delta=0.8, xi=26, lambda=1.4, type="SU")
  3. xvals<-seq(10,60,by=1)
  4. yvals<-dJohnson(xvals,jdist)
  5. print(jdist)
  6. #plot(xvals,yvals,col="blue",type="l")
  7.  
  8. #this is some trial observation - say we see an observation of "40" and give it a weighting of one-third
  9. observation<-40
  10. observationweight<-1/3
  11.  
  12. #your code here - modifies jdist for example
  13. observationnumber<-100/observationweight
  14. randomobservations<-rJohnson(observationnumber, jdist)
  15. jdist<-JohnsonFit(randomobservations)
  16. #
  17.  
  18. xvals<-seq(10,60,by=1)
  19. yvals<-dJohnson(xvals,jdist)
  20. print(jdist)
  21. #lines(xvals,yvals,col="red")
Success #stdin #stdout 0.35s 24104KB
stdin
Standard input is empty
stdout
$gamma
[1] -0.7

$delta
[1] 0.8

$xi
[1] 26

$lambda
[1] 1.4

$type
[1] "SU"

$gamma
[1] -0.6026688

$delta
[1] 0.7284803

$xi
[1] 26.19920

$lambda
[1] 1.146913

$type
[1] "SU"