Re: [R] optim and singularity

2010-12-31 Thread emorway
Thanks Berend, setting lower=c(0,0.01) seems to have solved the problem. I have a dataset with 200+ cropped fields with associated data and wanted to generate each plot in a way that minimized the visual residuals between the green squares and blue circles. I have inserted a resulting plot so yo

Re: [R] optim and singularity

2010-12-31 Thread Berend Hasselman
The error occurs in the x <- solve(A,RHS) statement. In a certain iteration ylim_2 passed by optim to your function is c(0,0) That give a zero column of matrix A ==> exactly singular. If I set lower=c(0,0.01) in the call of optim and use the na.approx then the result is ylim_2=c(0, 4.63) with th

Re: [R] optim and singularity

2010-12-30 Thread emorway
Hi Tom, I followed you suggestion and found the following: class(temp.dat$WTD) #[1] "numeric" temp.dat$WTD<-na.approx(temp.dat$WTD,as.numeric(as.Date(temp.dat$Meas_Date,"%m/%d/%Y"))) class(temp.dat$WTD) #[1] "numeric" Have I misunderstood you? If not, then my original confusion still stands..

Re: [R] optim and singularity

2010-12-30 Thread Tom Purucker
check on: class(temp.dat$WTD) before and after the na.approx statement, you have changed it from numeric to character Best, Tom On Thu, Dec 30, 2010 at 3:16 PM, emorway wrote: > > Hello, > > I was unable to find clues to my problem in ?optim.  Using the data and code > below, I get an error ("sy

[R] optim and singularity

2010-12-30 Thread emorway
Hello, I was unable to find clues to my problem in ?optim. Using the data and code below, I get an error ("system is exactly singular") when a particular line of code is left in, but have found that 'optim' works when I comment it out. The line of code in question is after the closeAllConnectio