# mean of Exp(1) distribution
E(Exp())
# second moment of N(1,4)
E(Norm(mean=1, sd=2), fun = function(x){x^2})
# conditional distribution of a linear model
D1 <- LMCondDistribution(theta = 1)
E(D1, cond = 1)
E(Norm(mean=1))
E(D1, function(x){x^2}, cond = 1)
E(Norm(mean=1), fun = function(x){x^2})
E(D1, function(x, cond){cond*x^2}, cond = 2, withCond = TRUE)
E(Norm(mean=2), function(x){2*x^2})
Run the code above in your browser using DataLab