search for: a_g

Displaying 3 results from an estimated 3 matches for "a_g".

Did you mean: a_
2012 Dec 18
1
multi dimensional optim problem
...optim to solve a neural network problem. I would like to optimize coefficients that are currently stored in a matrix Y=270 x 1 X= 27- x 14 b1= 10x14 b2= 11x1 V= 10 x 14 set of prior variances. I have the following function: posterior.mode1=function(y,X,b_0,b2,V) { log.like=function(b1) { a_g=compute(b1) z_g=tanh(a_g); z_g=cbind(1,z_g) p=softmax(z_g%*%b2); a=sum(y*log(p)+(1-y)*log(1-p)); return(a); } compute=function(b1) { a_g=NULL; for(i in 1:nrow(b1)){ a_g=cbind(a_g,X%*%b1[i,]) } return(a_g); } log.posterior=function(b1) { -log.l...
2010 Sep 24
1
Solving equations involving gamma functions
Hi, I want to find a value of n1. I used the following code but I am getting the error - Error in as.vector(x, mode) : cannot coerce type 'closure' to vector of type 'any' n=10 a_g<-(1/(n*(n-1)))*((pi/3)*(n+1)+(2*sqrt(3)*(n-2))-4*n+6) a_s<-function(n1) { t1=(n1-1)/2; (t1*(gamma(t1)/gamma(n1/2))^2)/2-1-a_g } xm<-solve(a_s) Can anyone help me out. Thanks in advance for your help. Shant [[alternative HTML version deleted]]
2005 Dec 01
1
Simulate Correlated data from complex sample
...#39;m using aren't turning up results that I can use. I may be missing something very simple and transparent. Any thoughts are much appreciated, Harold Ver 2.2 Windows XP N <- 5000 # Number of students J <- 50 # Number of schools N_j <- N/J # Number of students in each school a_g <- c(0,.5,1) # This is the growth vector # Step 1 -- create psi for base grade rps <- rep(N_j, J) v_gk <- rep(rnorm(J, 0, sqrt(.01) ), rps) v_gik <- rnorm(N, 0, sqrt(.99)) # Organize into a dataframe data <- data.frame(schid = rep(1:J, rps), stuid = 1:N, cbind(v_gk, v_gik), psi =...