# linfun function problem

I'm trying to run this code, but I'm having some problem with the linfun function, and I don't know how to fix it.
The error is: "Error in linfun(a = x.T, d = -sum(x.T * w)) :
unused arguments (a = x.T, d = -sum(x.T * w))"

Does someone know how to correct it? Thank you already

The code is:
###################

for (i in 1:100) {
zeta <- rnorm(n)
gamma.b <- colMeans(gamma * zeta)
d=2
sum(gamma.bw)+sum(w(Gram %*% w)), val=eta.l)

# define optimization; min

``````co <- cop(f=obj, max=F, lb=lbcon(rep(0,p)),
lc=lincon(A=t(rep(1, p)), val=sum(w), name="eq"), qc=qcon)
result <- solvecop(co, solver="cccp", quiet=T)
ub[i] <- -validate(co, result, quiet=T)\$obj.fun
# define optimization; max
co <- cop(f=obj, max=T, lb=lbcon(rep(0,p)),
lc=lincon(A=t(rep(1, p)), val=sum(w), name="eq"), qc=qcon)
result <- solvecop(co, solver="cccp", quiet=T)
lb[i] <- -validate(co, result, quiet=T)\$obj.fun
``````

}
sc0[l] <- sum(x.T * w.hat) + ybar
sc0.l[l] <- sc0[l] + quantile(lb, alpha)
sc0.u[l] <- sc0[l] + quantile(ub, 1-alpha)

# 3rd approach: conditional mean and variance

u.T.mean <- sum(c(1, x.new[index]) * ufit\$coeff)
u.T.sig <- sqrt(exp(sum(c(1,x.new[index])u2fit\$coeff)))
sc0.ll.3[l] <- sc0.l[l] + u.T.mean + u.T.sig
quantile(res.st, alpha)
sc0.uu.3[l] <- sc0.u[l] + u.T.mean + u.T.sig*quantile(res.st, 1-alpha)

# 4th approach: quantile reg

sc0.ll.4[l] <- sc0.l[l] + sum(qfit\$coefficients[,1]*c(1, x.new[index]))
sc0.uu.4[l] <- sc0.u[l] + sum(qfit\$coefficients[,2]*c(1, x.new[index]))
}

##############

This topic was automatically closed 21 days after the last reply. New replies are no longer allowed.

If you have a query related to it or one of the replies, start a new topic and refer back with a link.