Nothing
library(testthat)
library(DistributionalDDA)
test_that("Fisher Scoring ", {
set.seed(234)
fT = function(x) cbind(log(x),log(1-x))
myBasis=BayesSpaceBasis(fT,A=diag(2),S=diag(2),bayesSpace=B2Unif01)
X = rbeta(10000,2,3)
thetaHat = DistributionalDDA:::FisherScoringEstimation(X,basis=myBasis,g=fx(1/(x*(1-x))),verbose=cat)
expect_true(all(abs(thetaHat-c(2,3))<0.15))
erg2 = DistributionalDDA:::FisherScoringEstimation(X,basis=B2Unif01Basis7,verbose=cat)
erg2
f2 =coef2function(erg2,B2Unif01Basis7)
x=seq(0,1,by=0.001)
cc=mean(Exp(f2(x)))
f3 = function(x) f2(x)-log(cc)
fd = function(x) dbeta(x,2,3,log=TRUE)- f3(x)
plot(x,dbeta(x,2,3),type="l",col="green")
lines(x,Exp(f2)(x)/mean(Exp(f2)(x)),col="blue")
abline(h=2)
lines(x,fd(x)+0.5,col="orange")
})
Any scripts or data that you put into this service are public.
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.