On Fri, 1 Sep 2017, Artur T. wrote:
> Dear all,
>
> I am just experimenting with libsvm. Overall it works fine. However,
> see below an example where calling the svm() function fails. I try to
> provide an alternative epsilon value for an e-SV regression from the
> matrix epsval but obtain the error:
>
> <output>
> Data types not conformable for operation
> Error executing script: halting
>> series yhat2 = svm(L, parms)
> </output>
>
> <hansl>
> set verbose off
> open sw_ch14.gdt
> series infl = 400 * log(PUNEW/PUNEW(-1))
> ntrain = 130
> test1 = ntrain + 1
> list L = infl LHUR(-1 to -3) infl(-1 to -3)
> smpl L --no-missing
>
> # works
> bundle parms = defbundle("n_train", ntrain, "quiet", 1)
> parms.kernel_type=2
> parms.svm_type=3
> parms.search=1
> series yhat1 = svm(L, parms)
>
> # doesn't work
> matrix epsval = {0.5,1} # matrix of possible eps. values
> bundle parms = defbundle("n_train", ntrain, "quiet", 1)
> parms.kernel_type=2
> parms.svm_type=3
> parms.search=1
> parms.epsilon=epsval[1] # error: doesnt recognize epsval[] as
> scalar
> series yhat2 = svm(L, parms)
> </hansl>
Workaround:
scalar parms.epsilon=epsval[1]
However, in git we'll now accept a 1x1 matrix in that sort of context.
Thanks for the fix, Allin.
Artur