Bookmark and Share

Notice: On April 23, 2014, Statalist moved from an email list to a forum, based at statalist.org.


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

st: RE: assign infinite values to vector element


From   Nick Cox <[email protected]>
To   "'[email protected]'" <[email protected]>
Subject   st: RE: assign infinite values to vector element
Date   Tue, 15 Mar 2011 18:20:40 +0000

Numeric missing . counts as arbitrarily large and is what is assigned by Stata when your answer is indeterminate (e.g. if you divide by zero). You can assign it too, but otherwise neither Stata nor Mata has a notion of infinity as a value you can assign, so far as I know. 

If you wish to work with either of these as an argument to something else, i.e. some action may depend on whether your infinity has positive or negative sign, then I think you need some work-around of your own, e.g. store a value as missing and separately store its sign as +1 or -1. 

Nick 
[email protected] 

Alex Nobel

In Mata, I would like to assign a positive infinite of negative infinite value
to a vector element, something like (in R for example):

c[i,j] = Inf or c[i,j]= -Inf

Is this possible in Mata?


*
*   For searches and help try:
*   http://www.stata.com/help.cgi?search
*   http://www.stata.com/support/statalist/faq
*   http://www.ats.ucla.edu/stat/stata/


© Copyright 1996–2018 StataCorp LLC   |   Terms of use   |   Privacy   |   Contact us   |   Site index