[R-sig-dyn-mod] ConstrOptim Function Error stating ui%*%theta:matrix/vector complex arguments...

Daniel Reed reeddc at umich.edu
Thu Sep 26 22:59:26 CEST 2013


Hi Munjal:

Could you post all of the code (i.e., including definitions of all functions and data structures)?

Cheers,
Daniel

_______________________________
Daniel C. Reed, PhD.
Postdoctoral Fellow,
Dept. of Earth & Environmental Sciences,
University of Michigan,
Ann Arbor, MI, USA.
email: reeddc at umich.edu
web: www.danielreed.org



On Sep 26, 2013, at 4:50 PM, Munjal  Patel <munjalpatel85 at gmail.com> wrote:

> Hello All,
> I am stuck in the following problem.
> 
> Cexpt=c(0,25,50,100,150,300,250,125,40)
> t=c(0,0.2,0.4,0.6,1,4,8,12,24)
> theta0= vector of 6 parms (My initial parameter)
> 
> A=Constraint matrix (hopefully 6*6)
> B= Constraint vector of length 6)
> Cfit=function(t,theta){
>           J(t)=function(theta,t)
>           Cfit=function(J(t),constant)
>         return(Cfit)   }
> 
> loss=function(theta,t,Cexpt) { sum(Cexpt- Cfit(t,theta))^2}
> 
> Final=constrOptim(theta0,loss,t,Cexpt,NULL,A,B)
> 
> When i try to fit it gives me error
> 
> ERROR IN UI%*% THETA : MATRIX/VECTOR/COMPLEX ARGUEMENTS REQUIRED OR
> SOMETHING...
> 
> thank you all.
> 
> M
> J
> 
> 
> -- 
> Munjal Patel
> PhD Student
> Division of Pharmaceutical Sciences
> Long Island University
> Brooklyn,NY
> Cell: 201 707 3301
> 
> 	[[alternative HTML version deleted]]
> 
> _______________________________________________
> R-sig-dynamic-models mailing list
> R-sig-dynamic-models at r-project.org
> https://stat.ethz.ch/mailman/listinfo/r-sig-dynamic-models



More information about the R-sig-dynamic-models mailing list