Aptech Systems, Inc. Worldwide Headquarters
Mailing Address:
PO Box 250
Black Diamond, WA 98010 USAStreet Address:
30741 Third Avenue #160
Black Diamond, WA 98010 USAPhone: 360.886.7100
FAX: 360.886.8922Ready to Get Started?
For Pricing and Distribution
Industry Solutions
Products
Resources
Support
Training & Events
Want more guidance while learning about the full functionality of GAUSS and its capabilities? Get in touch for in-person training or browse additional references below.
Tutorials
Step-by-step, informative lessons for those who want to dive into GAUSS and achieve their goals, fast.
Have a Specific Question?
Get a real answer from a real person
- Need Support?
Q&A: Register and Login
Support Plans
Premier Support and Platinum Premier Support are annually renewable membership programs that provide you with important benefits including technical support, product maintenance, and substantial cost-saving features for your GAUSS System or the GAUSS Engine.
User Forums
Join our community to see why our users are considered some of the most active and helpful in the industry!
Where to Buy
Available across the globe, you can have access to GAUSS no matter where you are.
Recent Tags
applications character vectors CMLMT covariance matrix dates dlibrary dllcall ECDF Editor error handling errors floating network GAUSS Engine Geometric mean graphics GUI hardware histogram hotkeys if statements installation Java API linux localization Matlab convert matlab translation matrices matrix initialization matrix manipulation Maxlik MaxLikMT Memory output pgraph graph PQG graphics RAM random numbers RedHat 6.1 simulation string functions strings threading threads loops Time Series writing dataRecent Questions
Features
Resources
Command “indnv” cannot find index of a value
I find that when b is large in indnv(a, b), it returns a missing value, even if I know a is in vector b.
Here is an example that is not working for me:
z = 1000;
b = seqa(-1/z,1/z,z+2);
a = { 0.049, 0.999 };
c = indnv(a,b);
print c;
. .
Help!
3 Answers
The problem here is not the size of b, but rounding errors inherent in floating point arithmetic. If you print all the digits in b you will see the difference.
format /rd 16,16; print b;
You will see that that second to last element of b is:
0.9990000000000008
and if you print 0.999, it will be:
0.9990000000000000
This is not a problem particular to GAUSS, it is a limitation of the double precision values that computers use. You can avoid this problem by making your original sequence from -1 to 1000 and the dividing by 1000 like this:
z = 1000;
b = seqa(-1, 1, z+2)./z;
a = { 0.049, 0.999 };
c = indnv(a, b);
print c;
You should see:
51.0000000000000000 1001.0000000000000000
I think this should work for you, because it does not require you to know any more information at the time of the creation of b.
When you say that b is large, do you mean that b has many elements, or that the individual values in b are large?
Do these examples work for you?
Example 1: Many elements in b
b = rndn(1e7, 1);
idx = { 9, 41, 10009, 9999746 };
a = b[idx];
out = indnv(a,b);
print out;
9.0000000 41.000000 10009.000 9999746.0
Example 2: Large values in b
Continuing with the data from above:
b = b.*1e90; a = b[idx]; out2 = indnv(a, b); print out2;
9.0000000 41.000000 10009.000 9999746.0
Both of these work for me using GAUSS version 13. Let me know if these work for you and/or a more specific description of your problem.
I mean b has many elements. I wonder why the following does not work:
z=1000; b=seqa(-1/z,1/z,z+2); a=0.999; indnv(0.999,b);

