Tutor profile: Adrian M.
Subject: R Programming
What is a logistic regression and why is it used?
In simple terms, a logistic regression is a method of calculating the LOG ODDS (similar to the probability) of some event happening. This can then be transformed into probabilities which are then used for CLASSIFICATION. Within R, there are libraries and functions that easily perform the calculations of log(odds) for each data point being classified. After giving each data point a probability, R will then round these points based on a given cut-off value, which will then CLASSIFY the data point. From here, we would test our predictions against a testing set of actual outcome variables, and see the ACCURACY of our model. Once we are satisfied with the model, we can then use it on any new data to classify and make decisions! Do you understand? If you want me to explain anything again, do NOT hesitate! I am here to assist you, so that is the number one priority!
Why and how do we normalize data?
First, I will explain WHY we normalize data. The word itself gives a little insight as to why we do so. Sometimes we want to compare certain statistics, such as average or variance, of data that is in different types. If we are comparing for example the number of units sold of some product and the total number of sales, we could see the units sold figure as small as 100s of units, compared to total sales figures in the millions! Clearly, we cannot compare these two figures accurately if this is the case, so that is why we normalize! By normalizing, we put all different kinds of data into the SAME NORMAL terms, which make it much easier and more accurate when comparing them! When in doubt, think of this as the old saying of "You can't compare apples to oranges". Now, HOW we normalize is the same formula, no matter what type of data you use! You simply take each data point, subtract it by the overall average of that variable, and then divide by the standard deviation of the variable, and viola! Each data point is now in NORMALIZED terms, and can be easily compared to any other variable! Do you understand? If you need further explanation, let me know and I can break it down into smaller, more understandable chunks to really pinpoint where we are getting tripped up!
So how would one arrive at a price for a bond or a stock?
Well, to price these two instruments is the same process, it just uses different terms and values. What I mean by this, is for BOTH pricing methods, we are simply taking all of the expected future income from the investment, and discounting (a fancy way of saying putting future money into today's value) these payments to arrive at a price. For bonds, you take all of the coupon payments, which are fixed interest payments, and the "face value" of the bond, which is almost always $1000, and discount to today's value to arrive at a price. For stocks, you would do the exact same process, except the coupon payments are now dividend payments, and you would consider the expected future price. Did you get that? If you need some more explanation, let me know!
needs and Adrian will reply soon.