[R] geoR : Passing arguments to "optim" when using "likfit"

From: Mzabalazo Ngwenya <mzabalazo_ngwenya_at_yahoo.com>
Date: Thu, 26 Jun 2008 04:03:38 -0700 (PDT)


Hi everyone !
 
I'm am trying to fit a kriging model to a set of data. When I just run the "likfit" command I can obtain the results. However when I try to pass additional arguements to the optimization function "optim" I get errors. That is I want to obtain the hessian matrix so matrix (hessian=TRUE).  
Heres a little example( 1-D). Can anyone shed some light?  Where am I going wrong ?  



 
 
> obs.points <-matrix(c(0.1,0,0.3666667,0,0.6333334,0,0.9000001,0),byrow=TRUE,nrow=4)
> MM1.fx <-MM1(obs.points[,1])
> MM1.fx

[1] 0.1111111 0.5789475 1.7272732 9.0000100 # Creating geoR object
> MM1.data <-as.geodata(cbind(obs.points,MM1.fx))
> MM1.data

$coords
[1,] 0.1000000 0
[2,] 0.3666667 0
[3,] 0.6333334 0
[4,] 0.9000001 0

$data
[1] 0.1111111 0.5789475 1.7272732 9.0000100 attr(,"class")
[1] "geodata"

# Starting values for MLE
> sta.vals =expand.grid(seq(1,20),seq(1,20))
# Maximum likelihood estimation of covariance parameters
#### HERE IS THE PROBLEM ################

> MM1.fit <-likfit(MM1.data,ini.cov.pars=sta.vals,fix.nugget=TRUE,cov.model="gaussian",optim(hessian=TRUE))

 

      
	[[alternative HTML version deleted]]


______________________________________________

R-help_at_r-project.org mailing list
https://stat.ethz.ch/mailman/listinfo/r-help PLEASE do read the posting guide http://www.R-project.org/posting-guide.html and provide commented, minimal, self-contained, reproducible code. Received on Thu 26 Jun 2008 - 11:49:59 GMT

Archive maintained by Robert King, hosted by the discipline of statistics at the University of Newcastle, Australia.
Archive generated by hypermail 2.2.0, at Thu 26 Jun 2008 - 12:31:15 GMT.

Mailing list information is available at https://stat.ethz.ch/mailman/listinfo/r-help. Please read the posting guide before posting to the list.

list of date sections of archive