https://learninghub.kx.com/forums/topic/fundamentals-capstone-4-7
In 4.7 exercise I don't understand how to implement the code for it. maybe I don't understand what the question is asking. can you please explain this?
https://learninghub.kx.com/forums/topic/fundamentals-capstone-4-7
In 4.7 exercise I don't understand how to implement the code for it. maybe I don't understand what the question is asking. can you please explain this?
Hi @kal8na
Let me break down question 4.7 for you:
Let me know if you require further assistance.
Thanks,
Megan
just to borrow the thread as I’m stuck on this as well: so I managed to complete the task with script:
edgeCor:edge
qtynumTrds!(1;cor[timeSeries[
edge];timeSeries[qty]];cor[timeSeries[
edge];timeSeries[`numTrds]])
the output is a dictionary with type 99h and values of 1 0.8059053 0.7830214
however it failed the section testing with 4.7 error: “edgeCor Has Correct Format”
I didn’t implement it with iterators but I don’t think that is the reason it failed the test. not sure why it says incorrect format–do I need to output values in percentage terms (there is no way in Q to output a numeric in % without converting it into string first?)
any ideas please? thanks!
using a different approach and now it passed the section testing:
corKey:edge
qty`numTrds
correlations:cor[timeSeries[edge]] each timeSeries[corKey]
edgeCor:corKey!correlations
the results visually identical, though the earlier approach failed with 4.7 format testing:
edgeCor:edge
qtynumTrds! (1;cor[timeSeries[
edge];timeSeries[qty]];cor[timeSeries[
edge];timeSeries[`numTrds]])
would be good to understand why (cannot see how the testing function 4.7 written so cannot debug…) Thanks.
P.S. apologies borrowing the thread, let me know if should create a separate discussion for this.
Hi,
Don't worry about jumping on the thread, it's good to have it on one thread to help others!
I ran your two solutions and then ran
type each edgeCor
on each.
And while the output dictionary looked the same for both outputs, using the input of "1" in your first attempt defaulted the types to:
edge | -7
qty | -9
numTrds| -9
when the correct types should be (and are in your second attempt)
edge | -9
qty | -9
numTrds| -9
Hope this helps!
Laura
I see, should be 1.0 in the manual construction, thanks a lot!