Re: [R] Fwd: Matrix Constraints in R Optim

2016-06-21 Thread Priyank Dwivedi
Thank you Jeff. It seems to definitely solve it but the "total_error" is very high. Around 399. I also tried with the method = "L-BFGS-B". Still the error is around 399. How can we reduce it? Priyank On 21 June 2016 at 12:18, Jeff Newmiller wrote: > The size of this

Re: [R] Fwd: Matrix Constraints in R Optim

2016-06-21 Thread Jeff Newmiller
Not my problem. You are the one applying constraints. -- Sent from my phone. Please excuse my brevity. On June 21, 2016 1:13:35 PM PDT, Priyank Dwivedi wrote: >Thank you Jeff. >It seems to definitely solve it but the "total_error" is very high. >Around 399. >I also tried

Re: [R] Fwd: Matrix Constraints in R Optim

2016-06-21 Thread Jeff Newmiller
The size of this request is a bit big for this list. I think you need the constrOptim function to achieve this constraint. See reproducible example below (no contributed packages needed): #- my.data.matrix.inj <- structure(c(284.6624, 284.6743, 284.6771, 284.6746, 284.6664, 284.6516,

Re: [R] Fwd: Matrix Constraints in R Optim

2016-06-20 Thread Priyank Dwivedi
All, Here are the dput files of the input data to the code. Thanks for any advice. I am adding the entire code below too just in case. file <- file.path("Learning R","CRM_R_Ver4.xlsx") file my.data <- readWorksheetFromFile(file,sheet=1,startRow=1) str(my.data) # DATA FRAME my.data.matrix.inj

Re: [R] Fwd: Matrix Constraints in R Optim

2016-06-17 Thread Jeff Newmiller
Always reply-to-all to keep the mailing list informed... I don't do private consulting online. You look like you have plain text worked out, but we still cannot run your code. Read the Posting Guide and [1]. You cannot attach Excel files here (and many R users can't or won't do that anyway)

Re: [R] Fwd: Matrix Constraints in R Optim

2016-06-17 Thread Jeff Newmiller
Your code is corrupt because you failed to send your email in plain text format. You also don't appear to have all data needed to reproduce the problem. Use the dput function to generate R code form of a sample of your data. -- Sent from my phone. Please excuse my brevity. On June 17, 2016

[R] Fwd: Matrix Constraints in R Optim

2016-06-17 Thread Priyank Dwivedi
By mistake, I sent it earlier to the wrong address. -- Forwarded message -- From: Priyank Dwivedi Date: 17 June 2016 at 14:50 Subject: Matrix Constraints in R Optim To: r-help-ow...@r-project.org Hi, Below is the code snippet I wrote in R: The basic idea