Displaying 2 results from an estimated 2 matches for "lden".
Did you mean:
len
2007 Mar 05
1
error message when using outer function
...te help in understanding the differences
between these two sets of code.
The code in post.a1 is from Gelman, Carlin, Stern, and Rubin's Bayesian Data
Analysis solutions, problem 3.5. I was trying to modify this code in
post.a2 when I ran into this error.
post.a1 <- function(mu,sd,y){
ldens <- 0
for (i in 1:length(y)) ldens <- ldens + log(dnorm(y[i],mu,sd))
ldens}
y <- c(10,10,12,11,9)
mugrid <- c(10,11)
sdgrid <- c(1,1.2)
logdens1 <- outer (mugrid, sdgrid, post.a1, y)
#*** no error messages ***
post.a2 <- function(mu,sd,y)
{
ldens <- sum(log(dnorm(y,m...
2010 Sep 12
3
create a '3D line plot'
Esteemed useRs and developeRs,
I need to create a '3D line plot' (proper name?) of which an excellent
example can be viewed here:
http://cococubed.asu.edu/images/87a/images/unknown_pleasures.jpg
I have some experience using the rgl package to create 3D PCA plots, but
have no idea where to start for an image like this.
I'd really appreciate suggestions & help on how might