[R-SIG-Finance] parma - parmafrontier - Why do I get an error in seq.default ?
alexios ghalalanos
alexios at 4dscape.com
Tue Aug 5 13:03:50 CEST 2014
Looking at your dataset it is clearly very highly correlated (cor>0.99
in some cases). When I suggested you use the function
'make.positive.definite', I expected that you would read the
documentation on that. It takes one more argument ('tol') which does
make a difference.
This works for me:
if( ! is.positive.definite( C )) C = make.positive.definite( C, tol=1e-2)
spec = parmaspec( S=C, risk='EV', riskType='minrisk',
targetType='equality', forecast=means,
asset.names=colnames(m,do.NULL=FALSE) )
f = parmafrontier( spec, solver='QP', miny=0, maxy=max(means))
Comments:
-miny and maxy define the range over which the frontier is calculated
and it is usually helpful to provide these.
- For simple EV problems, use QP not SOCP (the current SOCP solver is
still far from state of the art and might require tweaking of some
control parameters in some cases).
- Don't use base R function names like 'c' to define your own variables.
-Alexios
On 05/08/2014 11:31, u0055 at wolke7.net wrote:
> Dear R-SIGs,
>
> I'm using the parma package and
> it works well for me with small input data.
> For big input data I get this error message:
>
> Fehler in seq.default(minb, maxb, length.out = n.points) :
> 'from' cannot be NA, NaN or infinite
>
> I'm using this R code (here without the input data):
>
> require( corpcor )
> require( parma )
> m = matrix( ... )
> c = cov( m )
> if( ! is.positive.definite( c )) c = make.positive.definite( c )
> means = colMeans( m )
> spec = parmaspec( S=c, risk='EV', riskType='minrisk', target=min(means),
> targetType='equality', forecast=means,
> asset.names=colnames(m,do.NULL=FALSE) )
> parmafrontier( spec, solver='SOCP' )
>
> Please find the attached whole R program including the input data.
> How to get rid of the error ?
>
> Thanks in advance,
> Uwe
>
>
> _______________________________________________
> R-SIG-Finance at r-project.org mailing list
> https://stat.ethz.ch/mailman/listinfo/r-sig-finance
> -- Subscriber-posting only. If you want to post, subscribe first.
> -- Also note that this is not the r-help list where general R questions should go.
>
More information about the R-SIG-Finance
mailing list