Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- costFunc=function(par,dat){
- state=sapply(mySamp,stateofMC,windDat=windDat)
- sum=0
- for(i in 1:3){
- state_loc=which(state==i)
- sum = sum + colSums(abs(as.matrix(dat[state_loc,,drop=F]) %*%
- rbind(-par,1)[,i,drop=F]))
- }
- return(sum)
- }
- forecstCoef=optim(par=tranProb,costFunc,gr=NULL, dat=dat,
- method="Nelder-Mead")$par
- Error in as.matrix(dat[state_loc, , drop = F]) %*% rbind(-par, 1)[, i,
- :non-conformable arguments
- Called from: is.data.frame(x)enter code here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement