I am currently working with a dataframe containing financial information post IPO of traditional IPO firms as well as firms that went public through a SPAC merger, both in the years 2020 to 2022. I am trying to model the likelihood of a firm becoming public using the SPAC merger route, from a few key financial post IPO variables (independent variables). I want to employ a logistic regression model with the dependent variable P(SPAC)i, which is binary and equals 1 for SPAC firms and 0 for IPO firms. The main specification is:
P(SPAC)i = 1⁄(1+ e∧(α + β1Xi + β2Xi + β3Xi + ... + ∑βj Year fixed effectsi,j + ∑βl Industry fixed effects i,l + u i))
Where individual firms are indexed by i.
I don't know how to include year and industry fixed effect into my logit regression. Could anybody give me a hand on this?
I am new to Boolean algebra, I want to know when is Boolean algebra used. I am getting confused with it. Please, anyone can clear it so I can understand? Is Boolean algebra using to simplify mathematical calculation during execution of user program or already used in designed circuit board of computer?
Boolean algebra is used for elementary digital circuits composed of logical gates (AND, OR, NOT, XOR, ...). But it also is applied in many other fields.
Examples include philosophy, literature/search retrieval, software engineering, software verification, logic synthesis, automatic test pattern generation, artificial intelligence, logic in general, discrete mathematics, combinatorics, discrete optimization, constraint programming, game theory, information theory, coding theory ... to name a few.
An overview of Boolean algebra applications is listed in Wikipedia.
The short answer is: both.
Boolean algebra is a science, derived from the name of George Boole, a mathematician, logician and philosopher, who laid the foundation of two-valued logic.
Algebra is the study of mathematical symbols and the rules of manipulating those symbols via formulas.
Therefore, Boolean Algebra is the field of study that focuses on mathematical symbols and the rules of manipulating those symbols via formulas on the domain of 2-valued logical expressions whose foundations were laid down by George Boole.
The most atomic principle of Boolean Algebra is that a statement may be true or false and nothing else. True is represented by 1 and false is represented by 0. Let's see a few expressions
A and B = A * B
that is, A and B is true if and only if both values are true, that is, 1 * 1 = 1, but 1 * 0 <> 1, 0 * 1 <> 1 and 0 * 0 <> 1.
A or B = A + B - A * B
Since we are in the domain of two values, A or B has to be either 0 or 1. So, we exclude A * B from the result of their addition to cover the case when both A and B is true, which would now be evaluated to 1 + 1 - 1 = 1.
These logical formulas and many others are covered in electronic circuits via logical gates, but this field of study is used by you at every day of your life as well, but you do not necessarily realize it.
Whenever you assume that a statement is fully true or fully false, you are in line with Boolean algebra. When you draw a conclusion, you are operating with the logical operator called implication.
Basically, more often than not, when you use logic, you partially or fully apply Boolean standards (hopefully).
So, Boolean Algebra is the field if study that operates with statements. And since science and everyday life is all about thoughts/statements, Boolean Algebra is everywhere, you cannot escape it.
The more interesting question is: if Boolean Algebra is so prevalent, then what is the context of non-Boolean logic?
And the answer is simple. Whenever we operate with the probability of the unknown or partial truths.
If you toss a coin, you know for sure that it will be either a head or a tail, but, before tossing the coin you do not know which one, so you compute the probability, which is 0.5 for each case.
If you throw a dice, then you know that it will either be a six or something else. You do not know in advance whether it will be a six or something else, but you know that there is a 1/6 probability that it will be a six.
Probability is a value between 0 and 1. You can convert the raw probability value that is between 0 and 1 to the more popular % value by multiplying its value with 100. So, the probability of a heads as a result of a coin toss would be (0.5 * 100) % = 50%.
So, probability calculation deals with the unkown, even if the statements would eventually become boolean statements, before some events they cannot be fully evaluated, but they can be predicted to some extend. So, this is the field of probability calculation.
Statistics is the field that assumes that the frequency of events in a larg input pattern that's known from the past can predict the future. It's a case of applied probabilities. This is also a non-boolean approach to statements.
Fuzzy logic (no, this is not a joke, there is actually a field of study that goes by this name) deals with partial truths. If you are during the process of eating your lunch, then it is not true that you ate your lunch, neither that you did not eat your lunch, because you have eaten a part of it and you have completed it to a certain extent. So, Fuzzy logic is also a multi-valued field of study, which deals with partial truths.
Conclusion
Boolean algebra is used everywhere, including the areas you have been wondering about and much more. So, Boolean algebra is used both in the circuits and mathematical computations. The very bits that comprise any information (except for the esotheric qbits, but in order not to confuse you I will not delve into that area here) are statements on their own. A 0 means lack of current and a 1 means the presence of current. So, if we have a number represented on 8 bits (for the sake of simplicity), that's a set of 8 statements that ultimately results in the representation of a number.
For example, a 15 is represented (on 8 bits) as
00001111
because
15
= 0 * 1^7 + 0 * 1^6 + 0 * 1^5 + 0 * 1^4 + 1* 1^3 + 1 * 1^2 + 1 * 1^1 + 1 * 1^1
= 0 * 128 + 0 * 64 + 0 * 32 + 0 * 16 + 1 * 8 + 1 * 4 + 1 * 2 + 1 * 1
So even the numbers you see in front of you on the computer are evaluated with Boolean algebra.
I'm using a 1D CNN on temporal data. Let's say that I have two features A and B. The ratio between A and B (i.e. A/B) is important - let's call this feature C. I'm wondering if I need to explicitly calculate and include feature C, or can the CNN theoretically infer feature C from the given features A and B?
I understand that in deep learning, it's best to exclude highly-correlated features (such as feature C), but I don't understand why.
The short answer is NO. Using the standard DNN layers will not automatically capture this A/B relationship, because standard layers like Conv/Dense will only perform the matrix multiplication operations.
To simplify the discussion, let us assume that your input feature is two-dimensional, where the first dimension is A and the second is B. Applying a Conv layer to this feature simply learns a weight matrix w and bias b
y = w * [f_A, f_B] + b = w_A * f_A + w_B * f_B + b
As you can see, there is no way for this representation to mimic or even approximate the ratio operation between A and B.
You don't have to use the feature C in the same way as feature A and B. Instead, it may be a better idea to keep feature C as an individual input, because its dynamic range may be very different from those of A and B. This means that you can have a multiple-input network, where each input has its own feature extraction layers and the resulting features from both inputs can be concatenated together to predict your target.
I have four channels in my application: A, B, C, D. Some application users are only interested in documents contained in both channels A and B only. Also can be expressed as: A ∩ B. Others may be interested in a different combination like: A ∩ B ∩ D.
UPDATE
I don't think the following will work anyway
What has been suggested so far is that I can create a new channel (like A_B and A_B_D) for each combination and then tag the documents that meet the intersection criteria accordingly. But you can see how this could easily get out of hand since with just 4 channels, you end up with 15 combinations (11 extra channels).
Is there a way to do this with channels or perhaps some other feature I have missed in Couchbase?
The assignment of channels to a document is done via the sync function. So a document is not "contained" in a channel, but it may have attributes from which the channels to which it is routed can be derived. Only in the simplest default case, the document's channel attribute will route it to the channel having that value of that attribute.
So what you intend can be achieved by putting statements like
if (doc.areas.includes("A") && doc.areas.includes("B") {
channel("AB");
}
into the sync function. (I renamed the channels attribute to areas to make clear to the reader of the program that these are not the actual channels, but that channels are only derived from combinations of them.)
I was reading this SO question and I got intrigued by what are Boolean Networks, I've looked it up in Wikipedia but the explanation is too vague IMO. Can anyone explain me what Boolean Networks are? And if possible with some examples too?
Boolean networks represent a class of networks where the nodes have states and the edges represent transitions between states. In the simplest case, these states are either 1 or 0 – i.e. boolean.
Transitions may be simple activations or inactivations. For example, consider nodes a and b with an edge from a to b.
f
a ------> b
Here, f is a transition function. In the case of activation, f may be defined as:
f(x) = x
i.e. b's value is 1 if and only if a's value is 1. Conversely, an inactivation (or repression) might look like this:
f(x) = NOT x
More complex networks use more involved boolean functions. E.g. consider:
a b
\ /
\ /
\ /
v
c
Here, we've got edges from a to c and from b to c. c might be defined in terms of a and b as follows.
f(a, b) = a AND NOT b
Thus, c is activated only if a is active and b is inactive, at the same time.
Such networks can be used to model all kinds of relations. One that I know of is in systems biology where they are used to model (huge) interaction networks of chemicals in living cells. These networks effectively model how certain aspects of the cells work and they can be used to find deficiencies, points of attack for drugs and similarities between unrelated components that point to functional equivalence. This is fundamentally important in understanding how life works.