<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Sabyasachi D Choudhury on Medium]]></title>
        <description><![CDATA[Stories by Sabyasachi D Choudhury on Medium]]></description>
        <link>https://medium.com/@sunnychoudhuri?source=rss-54153b8d0798------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/0*EYwfSaTtm9C5kt_t.jpg</url>
            <title>Stories by Sabyasachi D Choudhury on Medium</title>
            <link>https://medium.com/@sunnychoudhuri?source=rss-54153b8d0798------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Tue, 01 Dec 2026 15:52:35 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@sunnychoudhuri/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[CLUSTER ANALYSIS]]></title>
            <link>https://sunnychoudhuri.medium.com/cluster-analysis-e307af16e609?source=rss-54153b8d0798------2</link>
            <guid isPermaLink="false">https://medium.com/p/e307af16e609</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[towards-data-science]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Sabyasachi D Choudhury]]></dc:creator>
            <pubDate>Fri, 09 Apr 2021 21:53:16 GMT</pubDate>
            <atom:updated>2021-04-09T21:53:16.939Z</atom:updated>
            <content:encoded><![CDATA[<p>Cluster analysis groups individuals or objects into clusters objects in the same cluster are more similar to one another than they are to objects in other clusters. The attempt is to maximize the homogeneity of objects within the clusters while also maximizing the heterogeneity between the clusters. Like factor analysis, cluster analysis is also an inter-dependence technique.</p><p><strong>A Simple Example</strong></p><p>Suppose, you have done a pilot marketing of a candy on a randomly selected sample of consumers. Each of the consumers was given a candy and was asked whether they liked it and whether they will buy it. Now the respondents were grouped into following four clusters:</p><p>Now the group ―NOT LIKED, WILL BUY‖ group is a bit unusual. But people can buy for others. From a strategy point of view, the group ―LIKED, WILL NOT BUY‖ is important, because they are potential customers. A possible change in the pricing policy may change the purchasing decision.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/590/0*GRL9tPdlJkPKXIeO.png" /></figure><p>What Exactly Are We Looking for?</p><p>From the example, it is very clear that we must have some objective on the basis of which we want to create clusters. The following questions need to be answered:</p><p> What kind of similarity are we looking for? Is it pattern or proximity?</p><p> How do we form the groups?</p><p> How many groups should we form?</p><p> What‘s the interpretation of each cluster?</p><p> What‘s the strategy related to each of these clusters?</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/624/0*MwlwDSW2lKFLZAwx.png" /></figure><p><strong>Problems with Cluster Analysis</strong></p><p>1. Cluster analysis does not have a theoretical statistical basis. So no inference can be made from the sample to the population. It‘s only an exploratory technique. Nothing guarantees unique solutions.</p><p>2. Cluster analysis will always create clusters, regardless of actual existence of any structure in the data. Just because clusters can be found doesn‘t validate their existence.</p><p>3. The Cluster solution cannot be generalized because it is totally dependent upon the variables used as the basis for similarity measure. This criticism can be made against any statistical technique. With cluster variate completely specified by the researcher, the addition of spurious variables or the deletion of relevant variables can have substantial impact on the resulting solution. As a result, the researcher must be especially cognizant of the variables used in the analysis, ensuring that they have a strong conceptual support.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/981/0*iYvaLxeFPpqeu7Mb.png" /></figure><p>In data mining, hierarchical clustering is a method of cluster analysis which seeks to build a hierarchy of clusters. Strategies for hierarchical clustering generally fall into two types:</p><p><strong>Agglomerative: </strong>This is a “bottom up” approach: each observation starts in its own cluster, and pairs of clusters are merged as one moves up the hierarchy.</p><p><strong>Divisive: </strong>This is a “top down” approach: all observations start in one cluster, and splits are performed recursively as one moves down the hierarchy.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/572/0*C9-sCbu_mPrC5jxT.png" /></figure><p><strong>Metric and linkage</strong></p><p>In order to decide which clusters should be combined (for agglomerative), or where a cluster should be split (for divisive), a measure of dissimilarity between sets of observations is required. In most methods of hierarchical clustering, this is achieved by use of an appropriate metric (a measure of distance between pairs of observations), and a linkage criterion which specifies the dissimilarity of sets as a function of the pairwise distances of observations in the sets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/465/0*wUoiCkR86OJ297vd.png" /></figure><p>Generally the distance metric is the Euclidean distance. As for linkages, there are single linkage (the shortest distance between two clusters), complete linkage (the longest distance), and average linkage (the average of all the distances between the two clusters).</p><p><strong>Ward’s Minimum Variance Cluster Analysis</strong></p><p>1. Ward’s minimum variance criterion minimizes the total within-cluster variance.</p><p>2. At each step the pair of clusters with minimum cluster distance are merged.</p><p>3. To implement this method, at each step find the pair of clusters that leads to mini-mum increase in total within-cluster variance after merging.</p><p><strong>Related Statistics</strong></p><p><strong>Semi Partial R Squared:</strong> The semi-partial R-squared (SPR) measures the loss of homogeneity due to merging two clusters to form a new cluster at a given step. If the value is small, then it suggests that the cluster solution obtained at a given step is formed by merging two very homogeneous clusters.</p><p><strong>R Square: </strong>R-Square (RS) measures the heterogeneity of the cluster solution formed at a given step. A large value represents that the clusters obtained at a given step are quite different (i.e. heterogeneous) from each other, whereas a small value would signify that the clusters formed at a given step are not very different from each other.</p><p><strong>Dendrogram:</strong> It‘s a chart showing which two clusters are merging at which distance.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/650/0*e7vUMwIEcMTMpIWS.png" /></figure><p><strong>Icicle:</strong> It‘s a chart showing which case is being merged into the a cluster at which level.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/536/0*r7oA1PIS345OEU96.png" /></figure><p><strong>K Means Clustering</strong></p><p>In data mining, k-means clustering is a method of clus-ter analysis which aims to partition n observations into k clusters in which each observation belongs to the cluster with the nearest mean. A key limitation of k-means is its cluster model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/594/0*rUqWgzSBBGopGZVQ.png" /></figure><p>The concept is based on spherical clusters that are separable in a way so that the mean value converges towards the cluster center. The clusters are expected to be of similar size, so that the assignment to the nearest cluster center is the correct assignment. Researchers generally use Hierarchical Methods to find out the optimal number of clusters and then use K Means method to determine the actual clusters.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e307af16e609" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Exploratory Factor Analysis]]></title>
            <link>https://medium.com/analytics-vidhya/exploratory-factor-analysis-9b7fbb7c5a25?source=rss-54153b8d0798------2</link>
            <guid isPermaLink="false">https://medium.com/p/9b7fbb7c5a25</guid>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[towards-data-science]]></category>
            <dc:creator><![CDATA[Sabyasachi D Choudhury]]></dc:creator>
            <pubDate>Thu, 08 Apr 2021 18:19:10 GMT</pubDate>
            <atom:updated>2021-04-09T15:58:43.226Z</atom:updated>
            <content:encoded><![CDATA[<p>Suppose, we are interested in consumers evaluation of a brand of coffee. We take a random sample of consumers whom were given a cup of coffee. They were not told which brand of coffee they were given. After they had drunk the coffee, they were asked to rate it on 14 semantic — differential scales. The 14 at-tributes which were investigated are shown below:</p><p>1. Pleasant Flavor — Unpleasant Flavor</p><p>2. Stagnant, muggy taste — Sparkling, Refreshing Taste</p><p>3. Mellow taste — Bitter taste</p><p>4. Cheap taste — Expensive taste</p><p>5. Comforting, harmonious — Irritating, discordant</p><p>6. Smooth, friendly taste — Rough, hostile taste</p><p>7. Dead, lifeless, dull taste — alive, lively, peppy taste</p><p>8. Tastes artificial — Tastes like real coffee</p><p>9. Deep distinct flavor — Shal-low indistinct flavor</p><p>10. Tastes warmed over — Tastes just brewed</p><p>11. Hearty, full — bodies, full flavor — Warm, thin empty flavor</p><p>12. Pure, clear taste — Muddy, swampy taste</p><p>13. Raw taste — Stale taste</p><p>14. Overall preference: Excel-lent quality — Very poor quality</p><p>A factor analysis of the ratings given by consumers indicated that four factors could summarize the 14 attributes. These factors were: comforting quality, heartiness, genuineness and freshness.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/715/0*spATFEf4hjlzD782.png" /></figure><p>Here we are only exploring the factors, but we cannot confirm whether these are the only factors, hence the name Exploratory Factor Analysis</p><p><strong>Principal Component Analysis</strong></p><p>Principal component analysis was developed by Pearson and adapted for factor analysis by Ho telling. A goal for the user of PCA is to summarize the interrelationships among a set of original variables in terms of a smaller set of uncorrelated principal components that are linear combinations of the original variables.</p><p><strong>Estimating The Initial Communalities</strong></p><p>PCA assumes that there is as much variance to be analyzed as the number of observed variables and that all of the variance in an item can be explained by the extracted factors. Communality means the variance that the items and factors share in common.</p><p><strong>Eigenvalues and Eigen Vectors</strong></p><p>PCA has been described as Eigen analysis or seeking of the solution to the characteristic equation of the correlation matrix. An Eigen value represents the amount of variance in all of the items that can explained by a given principal component or factor. An Eigen vector of a correlation matrix is a column of weights.</p><p><strong>Is Factor Analysis Feasible?</strong></p><p>1.<strong> Correlation Matrix Check:</strong> Is it a combination of high and low correlations?</p><p>2.<strong>KMO MSA Check:</strong> The Kaiser — Meyer — Olkin Measure of Sampling Adequacy tests whether the partial correlations among variables are small.</p><p>3. <strong>Bartlett‘s Test of Sphericity: </strong>It tests whether the correlation matrix is an identity matrix, which could indicate that the factor model is inappropriate.</p><p><strong>Factor Loadings</strong></p><p>To obtain a principal component, each of the weights of a Eigen vector is multiplied by the square root of the principal component‘s associated Eigen value. These newly generated weights are called factor loadings and represent the correlation of each item with the given principal component.</p><p><strong>Deciding The Number of Factors</strong></p><p><strong>A Priori Criterion: </strong>Number of Factors to extract is pre-decided</p><p><strong>Eigen Value Criterion:</strong></p><p><strong>Min Eigen Criterion:</strong> We decide the floor of Eigen value. If the floor is 0.6 and there are 3 Eigen values above that mark, then we are looking for 3 factors</p><p><strong>Proportional and Cumulative Variance: </strong>We consider how much information is explained by an individual factor and on aggregate by the selected factors.</p><p><strong>Scree Plot: </strong>This is basically graphical presentation of proportional variance</p><p>So, PCA explains the entire variance and EFA explains a part of it. In EFA we are basically trying to explain the common variance among the variables.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*n6dxU3olTToz7eCH.png" /></figure><p>Factor Analysis is an Interdependence technique. In interdependence techniques the variables are not classified as dependent or independent; rather, the whole set of interdependence relationships is examined.</p><p><strong>Problems of Factor Loadings and Solutions</strong></p><p>Initially, the weights are distributed across all the variables. So it is not possible to under-stand the underlying factor of one or more variables. To remove this problem , we ap-ply rotation to the axes.</p><p>We mainly deal with two types of rotation:</p><ol><li><strong> Orthogonal Rotation: Varimax</strong></li></ol><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/0*mPjN_CSY0nyESmEq.png" /></figure><p><strong>2. Oblique Rotation: Promax</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/423/0*cE0gOMRadotZfP0O.png" /></figure><p>The problem with oblique rotation is that it makes the factors correlated. Varimax rotation is used in principal component analysis so that the axes are rotated to a position in which the sum of the variances of the loadings is the maximum possible.</p><h3>References</h3><h3>Academic Literature</h3><ul><li>[Vogt, 2012] Vogt, M. (2012). Nonparametric regression for locally stationary time series. <em>The Annals of Statistics</em>, <em>40</em>(5), 2601–2633.</li><li>Gujarati, D. N. , Basic Econometrics, 5th Edition, Tata McGraw-Hill</li><li>Field, A. , Discovering Statistics Using SPSS, 2nd Edition, Sage Publications</li><li>Hair, J. , Anderson, R. , Babin, B. Multivariate Data Analysis, 7th Edition, Prentice Hall</li><li>Malhotra, N. K. , Dash, S. , Marketing Research: An Applied Orientation, 5th Edition, Pearson Education</li><li>Rud, O. P. , Data Mining Cookbook: Modeling Data for Marketing, Risk, and Customer Relationship Management, John Wiley &amp; Sons, 2000</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=9b7fbb7c5a25" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/exploratory-factor-analysis-9b7fbb7c5a25">Exploratory Factor Analysis</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Time Series Analysis]]></title>
            <link>https://medium.com/analytics-vidhya/time-series-analysis-d32cc707f871?source=rss-54153b8d0798------2</link>
            <guid isPermaLink="false">https://medium.com/p/d32cc707f871</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[time-series-analysis]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Sabyasachi D Choudhury]]></dc:creator>
            <pubDate>Tue, 30 Mar 2021 20:18:43 GMT</pubDate>
            <atom:updated>2021-04-01T15:59:48.549Z</atom:updated>
            <content:encoded><![CDATA[<h3>A Formal Definition</h3><p>A time series is a sequence of data points, measured typically at successive times, spaced at uniform time intervals. Now the period or the uniform time interval can be as large as a century if you collect geological data, can be as small as a second if you collect biological data, and can be a quarter if you consider economic data. The important issue is that the time interval must be uniform.</p><p>Time series analysis comprises methods for analyzing time series data in order to ex-tract meaningful statistics and other characteristics of the data.</p><p>Time series forecasting is the use of a model to forecast future events based on known past events: to predict data points before they are measured.</p><p><strong>Assumptions of Time Series Analysis</strong></p><p>Pattern of past will continue into the future.</p><p>Discrete time series data should be equally spaced over time. There should be no missing values in the training data set( or should be handled using appropriate missing value treatment in the data preparation process).</p><p>Time Series Analysis cannot be used to predict effect of random events( Example- Terrorist Attacks or acts of god such as Tsunami, disaster, etc.).</p><p><strong>What is a Trend Component?</strong></p><p>The trend is the long term pattern of a time series. A trend can be positive or negative depending on whether the time series exhibits an increasing long term pattern or a de-creasing long term pattern. If a time series does not show an increasing or decreasing pattern then the series is stationary in the mean. For example, population increases over a period of time, price increases over a period of years, production of goods of the country increases over a period of years. These are the examples of upward trend. The sales of a commodity may decrease over a period of time because of better products coming to the market. This is an example of declining trend or downward trend.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S-65DbhBXfw4vIOH.png" /><figcaption>Sales vs Time Period</figcaption></figure><p><strong>What is a Cyclical Component?</strong></p><p>Any pattern showing an up and down movement around a given trend is identified as a cyclical pattern. The duration of a cycle depends on the type of business or industry being analyzed. A business cycle showing these oscillatory movements has to pass through four phases-prosperity, recession, depression and recovery.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*8JSO7wbkywUaaH8c.png" /><figcaption>Sales vs Time Period</figcaption></figure><p><strong>What is a Seasonal Component?</strong></p><p>Seasonality occurs when the time series exhibits regular fluctuations during the same month (or months) every year, or during the same quarter every year. This continues to repeat year after year. The major factors that are responsible for the repetitive pattern of seasonal variations are weather conditions and customs of people. More woolen clothes are sold in winter than in the season of summer .Regardless of the trend, we can observe that in each year more ice creams are sold in summer and very little in Winter season. The sales in the departmental stores are more during festive seasons that in the normal days.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*4lt7RZqf7CmWqKqw.png" /><figcaption>Sales vs Time Period</figcaption></figure><p><strong>What is a Random Component?</strong></p><p>This component is unpredictable. Every time series has some unpredictable component that makes it a random variable. These variations are fluctuations in time series that are short in duration, erratic in nature and follow no regularity in the occurrence pattern. These variations are also referred to as residual variations since by definition they represent what is left out in a time series after trend ,cyclical and seasonal variations. Irregular fluctuations results due to the occurrence of unforeseen events like floods, earthquakes, wars, famines, etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kB9EzORwH91-xihq.png" /><figcaption>Sales vs Time Period</figcaption></figure><p>Since economic cycles are very hard to predict, most time series pattern are de-scribed in terms of trend and seasonality. The irregular or the random events can be smoothed out by using Simple, Weighted, or Exponential Moving Averages.</p><p><strong>Understanding Different Types of Moving Averages: Which One is Faster?</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*s-2C2pHkvyUyppvt.png" /><figcaption>Blue- 50 day Weighted Moving Average, Purple-50 days Exponential moving average, Red- 50 days simple moving average</figcaption></figure><p><strong>Understanding Moving Averages of Different Periods: Find out the Trends</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Ul6y4MjDsPY1HERK.png" /><figcaption>Blue- 10 Week Simple Moving Average, Red- 50 Weeks simple moving average</figcaption></figure><p><strong>Now How Do We Make Predictions?</strong></p><p>The overall idea is that we extract a trend part, adjust the trend for seasonal compo-nent, and make forecast. Now there can be two variations:</p><p>Y = T + C + S + e, Or Y = T * C * S * e</p><p>Where T = Trend Component</p><p>C = Cyclical Component</p><p>S = Seasonal Component</p><p>and e is the random part</p><p>These two variations are respectively known as Additive and Multiplicative Models.</p><p><strong>Various Trends</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*OPcGm0gzDRISwp1o.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*bYQePMwqN3gGzVxY.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/0*EbRKdWl3ewl38JoI.png" /></figure><h3>References</h3><h3>Academic Literature</h3><ul><li>[Boshnakov, 2011] G. Boshnakov. <a href="http://www.maths.manchester.ac.uk/~goran/research-reports/psrr03-2009.pdf"><em>On First and Second Order Stationarity of Random Coefficient Models</em></a>. Linear Algebra Appl. 434, 415–423. 2011.</li><li>[Breitung, 2002] Breitung, J. (2002). <a href="https://pdfs.semanticscholar.org/e31b/c65824cc156d43d25b6ece0e9613b398233d.pdf"><em>Nonparametric tests for unit roots and cointegration.</em></a> Journal of econometrics, 108(2), 343–363.</li><li>[Dahlhaus, 2012] Dahlhaus, R. (2012). Locally stationary processes. In <em>Handbook of statistics</em> (Vol. 30, pp. 351–413). Elsevier.</li><li>[Nason, 2006] <a href="https://research-information.bristol.ac.uk/en/persons/guy-p-nason(c22adede-c5fc-4692-9b91-24afa15868b6).html">Nason, GP</a> 2006, <a href="https://research-information.bristol.ac.uk/en/publications/stationary-and-nonstationary-time-series(c0005c54-b407-414e-944c-92fca5df2a2b).html">Stationary and non-stationary time series</a>. in H Mader &amp; SC Coles (eds), <em>Statistics in Volcanology.</em> The Geological Society, pp. 129–142.</li><li>[Vogt, 2012] Vogt, M. (2012). Nonparametric regression for locally stationary time series. <em>The Annals of Statistics</em>, <em>40</em>(5), 2601–2633.</li><li>Gujarati, D. N. , Basic Econometrics, 5th Edition, Tata McGraw-Hill</li><li>Field, A. , Discovering Statistics Using SPSS, 2nd Edition, Sage Publications</li><li>Hair, J. , Anderson, R. , Babin, B. Multivariate Data Analysis, 7th Edition, Prentice Hall</li><li>Malhotra, N. K. , Dash, S. , Marketing Research: An Applied Orientation, 5th Edition, Pearson Education</li><li>Rud, O. P. , Data Mining Cookbook: Modeling Data for Marketing, Risk, and Customer Relationship Management, John Wiley &amp; Sons, 2000</li></ul><h3>Online References</h3><ul><li><a href="https://stats.stackexchange.com/questions/185200/roots-of-characteristic-equation-reciprocal-to-roots-of-its-inverse">Roots of characteristic equation reciprocal to roots of its inverse</a></li><li><a href="https://www.mathworks.com/help/econ/stationary-stochastic-process.html">Stochastic Process Characteristics</a></li><li><a href="https://www.mathworks.com/help/econ/trend-stationary-vs-difference-stationary.html">Trend-Stationary vs. Difference-Stationary Processes</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=d32cc707f871" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/time-series-analysis-d32cc707f871">Time Series Analysis</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[DEEP LEARNING FOR MINIATURIZED SLOT ANTENNA DESIGN USING METAMATERIAL INSPIRED TECHNIQUES]]></title>
            <link>https://medium.com/analytics-vidhya/deep-learning-for-miniaturized-slot-antenna-design-using-metamaterial-inspired-techniques-dde25df5074d?source=rss-54153b8d0798------2</link>
            <guid isPermaLink="false">https://medium.com/p/dde25df5074d</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[physics]]></category>
            <category><![CDATA[electromagnetic]]></category>
            <category><![CDATA[metamaterials]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Sabyasachi D Choudhury]]></dc:creator>
            <pubDate>Thu, 25 Mar 2021 00:05:46 GMT</pubDate>
            <atom:updated>2021-03-25T15:47:53.358Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>Necessity of antenna miniaturization in wireless communication</strong></p><p>In almost all areas of electrical engineering the research interest has been shifted toward miniaturization. Electromagnetism and antennas in particular, are no exception. With the rapid development in wireless systems all over the world, miniaturized antennas have become an active area of research for many antenna engineers. In past several years, a large emphasis has been placed towards miniaturized antenna design. There are many reasons for using small antennas, most of which are physical constraints. For example, high speed aircraft or warships are easy to be damaged due to mechanical strength i.e. wind age for using large antennas. There is a rising interest in making antennas small enough to ultimately fit on a single chip with the rest of the receiving front-end for local area networks. Due to limited space availability for antenna placement in the mobile platforms more antennas can be closely packed that generates the risk of mutual and parasitic coupling between them. Small antennas are required in many applications i.e. invisible military ground vehicles, concealed electrical devices of police or security forces, obstacle clearance on road vehicles or trains, and radio tracking of small animals etc. It is also used in a very recent application like personal communications and handheld devices such as smart phones, tablets, and computers RFID and sensing systems, including printed circuit board design etc.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/216/0*uZ9rBROadelLzsuW" /></figure><p><strong>Effect of miniaturization on Antenna Performances</strong></p><p>It is well established that the miniaturizing of an antenna affects its radiation characteristics. Reducing an antenna’s size influence its bandwidth, gain, efficiency, and matching with the feed. This follows directly from the fact that an antenna is a device used to transform a guided wave into a radiated wave, or vice-versa. This transformation process is related to the wavelength, and the antenna size is more significant than the antenna technology in determining how well and for which frequencies this transformation is satisfactory. Many authors have studied the relationship between the electrical dimension of an antenna and its radiation performances for several years. Antenna size and its performance are strongly related to each other. The first fundamental results showing the link between antenna size and its maximum bandwidth and gain were presented in the late 1940s. Wheeler used the radiation power factor, defined as the quotient between the antenna resistance and the antenna reactance, to quantify the radiation of an antenna. Using a simple equivalent lumped circuit, Wheeler deduced that this quotient was equivalent to the bandwidth multiplied by the efficiency, in those cases where the antenna was matched by a simple circuit. This early paper was a first attempt to confirm mathematically the product of efficiency and bandwidth is directly related to the volume occupied by an antenna. Indeed, as the size of an antenna decreases, its reactance increases, but its radiation resistance decreases. The work of Wheeler was generalized by Chu, who derived the equivalent lumped-circuit element from an expansion in partial fractions of the spherical-wave impedance functions around the antenna. Thus, the relationship between the minimum quality factor, Q, of an omnidirectional antenna and its volume was formally established. These results suggest that antenna miniaturization affects gain, bandwidth, and efficiency of the antenna. In addition, due to an increase in antenna Q with a reduction in their electrical size, the antennas become more difficult to match with the feed.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/501/0*Z3XldvcXSr3xEgaH.png" /></figure><p><strong>Literature Review</strong></p><p>The simplest way to construct a miniaturized antenna is by loading different lumped elements. The idea is that an antenna smaller than a half-wavelength has strong reactive input impedance, which is to be compensated by the loading. The loading can be performed by adding capacitor, coil, top loading etc. The effect of this loading is to either reduce the efficiency of the antenna or to increase the quality factor of the antenna and to thus reduce its bandwidth. A meandered antenna is another simple form of miniaturized antennas where a half wavelength dipole was made compact by meandering the wire. A similar approach had been applied to design a meander type slot antenna. The meandered antennas are very difficult to match with a 50 W line. This difficulty is due to the fact that the radiation of almost in-phase electric currents flowing in opposite directions on closely spaced wires tends to cancel each other in the far-field region. This leads to a very low radiation resistance. In a two-strip meandered line was used to increase the bandwidth of the miniaturized antenna.</p><p>The development of metamaterials opened a new possibility for antenna designers to create a novel structure with unconventional properties or enhanced performance. Metamaterials are artificially fabricated structures or media that exhibit unusual properties not found in naturally occurring materials .It can be synthesized by embedding specific inclusions of periodic structures in the host media .Some of these materials exhibit either negative permittivity or negative permeability. If both permittivity and permeability of such materials are negative at the same frequency, then the composite possesses an effective negative index of refraction for isotropic medium and is referred to as a left handed metamaterial. In 1968, first theoretical studies was done by Veselago. After a long gap of his work, there has been a renewed interest in this area with the initiation of the first metamaterial by pendry <em>et al </em>. Pendry proposed an artificial material consisting of the so-called Slit-Ring Resonators(SRR) which exhibit a band of negative permeability values in spite of being made of nonmagnetic materials, and wires which provide the negative permittivity. Next, Smith <em>et al. </em>demonstrated the realization of the first left-handed material which was consisting of an array of SRRs and wires.</p><h3>Where Deep Learning Meets Metamaterials</h3><p>Breakthroughs in the field of nanophotonics — how light behaves on the nanometer scale — have paved the way for the invention of “metamaterials,” man-made materials that have enormous applications, from remote nanoscale sensing to energy harvesting and medical diagnostics. But their impact on daily life has been hindered by a complicated manufacturing process with large margins of error.</p><p>Now a new interdisciplinary Tel Aviv University study published in Light: Science and Applications demonstrates a way of streamlining the process of designing and characterizing basic nanophotonic, metamaterial elements. The study was led by Dr. Haim Suchowski of TAU’s School of Physics and Astronomy and Prof. Lior Wolf of TAU’s Blavatnik School of Computer Science and conducted by research scientist Dr. Michael Mrejen and TAU graduate students Itzik Malkiel, Achiya Nagler and Uri Arieli.</p><p>“The process of designing metamaterials consists of carving nanoscale elements with a precise electromagnetic response,” Dr. Mrejen says. “But because of the complexity of the physics involved, the design, fabrication and characterization processes of these elements require a huge amount of trial and error, dramatically limiting their applications.”</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/564/0*Q11HqK0BEN1LdR_e.jpg" /></figure><h3>Deep Learning a key to precision manufacturing</h3><p>“Our new approach depends almost entirely on Deep Learning, a computer network inspired by the layered and hierarchical architecture of the human brain,” Prof. Wolf explains. “It’s one of the most advanced forms of machine learning, responsible for major advances in technology, including speech recognition, translation and image processing. We thought it would be the right approach for designing nanophotonic, metamaterial elements.”</p><p>The scientists fed a Deep Learning network with 15,000 artificial experiments to teach the network the complex relationship between the shapes of the nanoelements and their electromagnetic responses. “We demonstrated that a ‘trained’ Deep Learning network can predict, in a split second, the geometry of a fabricated nanostructure,” Dr. Suchowski says.</p><p>The researchers also demonstrated that their approach successfully produces the novel design of nanoelements that can interact with specific chemicals and proteins.</p><h3>Broadly applicable results</h3><p>“These results are broadly applicable to so many fields, including spectroscopy and targeted therapy, i.e., the efficient and quick design of nanoparticles capable of targeting malicious proteins,” says Dr. Suchowski. “For the first time, a novel Deep Neural Network, trained with thousands of synthetic experiments, was not only able to determine the dimensions of nanosized objects but was also capable of allowing the rapid design and characterization of metasurface-based optical elements for targeted chemicals and biomolecules.</p><p>“Our solution also works the other way around. Once a shape is fabricated, it usually takes expensive equipment and time to determine the precise shape that has actually been fabricated. Our computer-based solution does that in a split second based on a simple transmission measurement.”</p><p>The researchers, who have also written a patent on their new method, are currently expanding their Deep Learning algorithms to include the chemical characterization of nanoparticles.</p><p>This article has been republished from <a href="https://www.aftau.org/news-page-computers--technology?&amp;storyid4702=2412&amp;ncs4702=3">materials </a>provided by <a href="https://www.aftau.org/home">AFTAU</a>. Note: material may have been edited for length and content. For further information, please contact the cited source.</p><h3>References</h3><h3>Academic Literature</h3><p>1. K. Fujimoto, A. Henderson, K. Hirasawa, J.R. James, Small Antennas. New York: John Wiley<br>and Sons, Research Studies Press, 1987.<br>2. R.C. Hansen, Electrically Small Superdirective and Superconducting Antennas. Hoboken,<br>New Jersey: Wiley, 2006.<br>3. R. A. Burberry, “Electrically small antennas: A review,” IEEE Colloquium on Electrically<br>Small Antennas. London, U.K.: IEEE, Oct 1990, pp.1–5.<br>4. H. A Wheeler, “Fundamental limitations of small antennas,” Proceedings of the IRE, vol. 35,<br>pp. 1479–1484, Dec. 1947.<br>5. L. J. Chu, “Physical limitation on Omni-Directional antennas,” Journal of Applied Physics,<br>vol. 19, , pp. 1163–1175, Dec. 1948.<br>6. A. K. Skrivervik, J.-F. Zürcher, O. Staub, J. R.Mosig, “PCS antenna design: The challenge of<br>miniaturization,” IEEE Antennas and Propagat. Magazine, vol. 43, no. 4, pp.12–26, Aug. 2001.<br>7. J. Rashed and C. T. Tai, “A new class of Resonant antennas,” IEEE Trans. Antennas<br>Propagat., vol. 39, pp. 1428–1430, Sep. 1991.<br>8. J. M. Kim, J. G. Yook, W. Y. Song, Y. J. Yoon, J. Y. Park, and H. K. Park, “Compact<br>meander-type slot antennas,” in Proc. Antennas Propagat. Soc. Int. Symp., AP-S. Dig., vol. 2,<br>Boston, MA, July 2001, pp. 724–727.</p><p>9. K. Noguchi, N. Yasui, M. Mizusawa, S. Betsudan, and T. Katagi, “Increasing the bandwidth<br>of a two-strip meander-line antenna mounted on a conducting box,” in Proc. Antennas Propagat.<br>Soc. Int. Symp., AP-S. Dig., vol. 4, 2001, pp. 112–115.</p><p>10. N. Engheta and R. W. Ziolkowski, Eds., Metamaterials: Physics and Engineering<br>Explorations. Hoboken-Piscataway, NJ: Wiley-IEEE Press, 2006.<br>11. B. A. Munk, Metamaterials: Critique and Alternatives. New York: Wiley, 2009.<br>12. Veselago, V. G., “The electrodynamics of substances with simultaneously negative values of<br>e and μ ,” Soviet Physics USP., vol. 10, no. 4, 509–514, Jan.–Feb. 1968.<br>13. J. B. Pendry, A. J. Holden , W. J. Stewart,and I. Youngs, “Extremely Low Frequency<br>Plasmons in Metallic Mesostructures,” Phys. Rev. Lett., vol.76, no. 25 ,pp. 4773–4776, June<br>1996.<br>14. Pendry, J. B., A. J. Holden, D. J. Robbins, and W. J. Stewart, “Magnetism from conductors<br>and enhanced nonlinear phenomena,” IEEE Trans. Microwave Theory Tech., vol. 47, №11,<br>pp.2075–2084, Nov. 1999.<br>15. Smith, D. R., W. J. Padilla, D. C. Vier, S. C. Nemat-Nasser, and S. Schultz, “Composite<br>medium with simultaneously negative permeability and permittivity,” Phys. Rev. Lett., vol. 84,<br>no. 18, pp.4184–4187, May 2000.<br>16. A. Alu, F. Bilotti, N. Engheta, and L. Vegni, “Sub-wavelength, compact, resonant patch<br>antennas loaded with metamaterials,” IEEE Trans. Antennas Propag., vol. 55, no. 1, pp. 13–25,<br>2007.<br>17. K. Buell, H. Mosallaei, and K. Sarabandi, “A substrate for small patch antennas providing<br>tunable miniaturization factors,” IEEE Trans. Microw. Theory Tech., vol. 54, no. 1, pp. 135–146,<br>2006.<br>18. H. Mosallaei and K. Sarabandi, “Design and modelling of patch antenna printed on magneto-<br>dielectric embedded-circuit metasubstrate,” IEEE Trans. Antennas Propagat., vol. 55, no. 1, pp.<br>45–52, 2007.</p><p>19. Malkiel, I., Mrejen, M., Nagler, A., Arieli, U., Wolf, L., &amp; Suchowski, H. (2018). Plasmonic nanostructure design and characterization via Deep Learning. Light: Science &amp; Applications, 7(1), 60. <a href="https://doi.org/10.1038/s41377-018-0060-7">https://doi.org/10.1038/s41377-018-0060-7</a></p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dde25df5074d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/deep-learning-for-miniaturized-slot-antenna-design-using-metamaterial-inspired-techniques-dde25df5074d">DEEP LEARNING FOR MINIATURIZED SLOT ANTENNA DESIGN USING METAMATERIAL INSPIRED TECHNIQUES</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LOGISTIC REGRESSION]]></title>
            <link>https://medium.com/analytics-vidhya/logistic-regression-27c81e562999?source=rss-54153b8d0798------2</link>
            <guid isPermaLink="false">https://medium.com/p/27c81e562999</guid>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[mathematics]]></category>
            <category><![CDATA[statistics]]></category>
            <dc:creator><![CDATA[Sabyasachi D Choudhury]]></dc:creator>
            <pubDate>Fri, 12 Mar 2021 11:59:43 GMT</pubDate>
            <atom:updated>2021-03-16T17:00:54.969Z</atom:updated>
            <content:encoded><![CDATA[<p>In a nutshell, logistic regression is multiple regression but with an outcome variable that is a categorical dichotomy and predictor variables that continuous or categorical. In plain English, this simply means that we can predict which of two categories a person is likely to belong to given certain other information.</p><p><strong>Example: Will the Customer Leave the Network?</strong></p><p>This example is related to the Telecom Industry. The market is saturated. So acquiring new customers is a tough job. A study for the European market shows that acquiring a new customer is five time costlier than retaining an existing customer. In such a situation, companies need to take proactive measures to maintain the existing customer base. Using logistic regression, we can predict which customer is going to leave the network. Based on the findings, company can give some lucrative offers to the customer. All these are a part of Churn Analysis.</p><p><strong>Example: Will the Customer Leave the Network?</strong></p><p>This example is related to the Telecom Industry. The market is saturated. So acquiring new customers is a tough job. A study for the European market shows that acquiring a new customer is five time costlier than retaining an existing customer. In such a situation, companies need to take proactive measures to maintain the existing customer base. Using logistic regression, we can predict which customer is going to leave the network. Based on the findings, company can give some lucrative offers to the customer. All these are a part of Churn Analysis.</p><p><strong>Example: Will the Borrower Default?</strong></p><p>Non — Performing Assets are big problems for the banks. So the banks as lenders try to assess the capacity of the borrowers to honor their commitments of interest payments and principal repayments. Using a Logistic Regression model, the managers can get an idea of a prospective customer defaulting on payment. All these are a part of Credit Scoring.</p><p><strong>Example: Will the Lead become a Customer?</strong></p><p>This is a key question in Sales Practices. Conventional salesman runs after, literally, everybody everywhere. This leads to a wastage of precious resources, like time and money. Using logistic regression, we can narrow down our search by finding those leads who have a higher probability of becoming a customer.</p><p><strong>Example: Will the Employee Leave the Company?</strong></p><p>Employee retention is a key strategy for HR managers. This is important for the sustainable growth of the company. But in some industries, like Information Technology, employee attrition rate is very high. Using Logistic regression we can build some models which will predict the probability of an employee leaving the organization within a given span of time, say one year. This technique can be applied on the existing employees. Also, it can be applied in the recruitment process. So, we are basically talking about the probability of occurrence or non — occurrence of something.</p><p><strong>The Principles Behind Logistic Regression</strong></p><p>In simple linear regression, we saw that the outcome variable Y is predicted from the equation of a straight line: Yi = b0 + b1 X1 + εi in which b0 is the intercept and b1 is the slope of the straight line, X1 is the value of the predictor variable and εi is the residual term. In multiple regression, in which there are several predictors, a similar equation is derived in which each predictor has its own coefficient.</p><p>In logistic regression, instead of predicting the value of a variable Y from predictor variables, we calculate the probability of Y = Yes given known values of the predictors. The logistic regression equation bears many similarities to the linear regression equation. In its simplest form, when there is only one predictor variable, the logistic regression equation from which the probability of Y is predicted is given by:</p><p>P(Y = Yes) = 1/ [1+ exp{ — (b0 + b1 X1 + εi )}]</p><p>One of the assumptions of linear regression is that the relationship between variables is linear. When the outcome variable is dichotomous, this assumption is usually violated. The logistic regression equation described above expresses the multiple linear regression equation in logarithmic terms and thus overcomes the problem of violating the assumption of linearity. On the hand, the resulting value from the equation is a probability value that varies between 0 and 1. A value close to 0 means that Y is very unlikely to have occurred, and a value close to 1 means that Y is very likely to have occurred.</p><p><strong>Why Can’t We Use Linear Regression?</strong></p><p>One of the assumptions of linear regression is that the relationship between variables is linear. When the outcome variable is dichotomous, this assumption is usually violated. The logistic regression equation described above expresses the multiple linear regression equation in logarithmic terms and thus overcomes the problem of violating the assumption of linearity. On the hand, the resulting value from the equation is a probability value that varies between 0 and 1. A value close to 0 means that Y is very unlikely to have occurred, and a value close to 1 means that Y is very likely to have occurred. Look at the data points in the following charts. The first one is for Linear Regression and the second one for Logistic Regression.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/515/0*bbXuUcn9ndKGeDkS.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/545/0*gI8LuB1tu0zUU4TU.png" /></figure><p><strong>How Do We Get Equation?</strong></p><p>In case of linear regression, we used ordinary least square method to generate the model. In Logistic Regression, we use a technique called Maximum Likelihood Estimation to estimates the parameters. This method estimates coefficients in such a way that makes the observed values highly probable, i.e. the probability of getting the observed values becomes very high.</p><p><strong>Comparison: Discriminant Analysis and Logistic Regression</strong></p><p>Discriminant Analysis deals with the issue of which group an observation is likely to belong to. On the other hand, logistic regression commonly deals with the issue of how likely an observation is to belong to each group, i.e. it estimates the probability of an observation belonging to a particular group.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/446/0*AEEoknj0lripSLKs.png" /></figure><p>Discriminant Analysis is more of a classification technique like Cluster analysis.</p><p><strong>Comparison: Linear Probability Model and Logistic Regression</strong></p><p>The simplest binary choice model is the linear probability model, where as the name implies, the probability of the event occurring is assumed to be a linear function of a set of explanatory variables as follows:</p><p>P(Y = Yes) = b0 + b1 X1 + εi</p><p>whereas the equation of logistic regression is as follows:</p><p>P(Y = Yes) = 1/ [1+ exp{ — (b0 + b1 X1 + εi )}]</p><p>You may find a great resemblance of Linear regression with the Linear Probability Mod-el. From expectation theory, it can be shown that, if you have two outcomes like yes or no, and we regress those values on an independent variable X, we get a LPM. In this case, we code yes and no as 1 and 0 respectively.</p><p><strong>Why Can’t We Use Linear Probability Model?</strong></p><p>The reason is the as why we cannot use the linear regression for a dichotomous out-come variable discussed in the last slide. Moreover, you may find some negative probabilities and some probabilities greater than 1! And the error term will make you crazy. So we have to again study Logistic Regression. NO CHOICE!</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/666/0*ju85jGm0LjhsiDdl.png" /></figure><p><strong>Time for Mathematics</strong></p><p>If we code yes as 1 and no as 0, the logistic regression equation can be written as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/403/0*BCsXiBWmr_5zxApi.png" /></figure><p>Now if we divide probability of yes by the probability of no, then we get a new measure called ODDS. Odds shouldn‘t be confused with probability. Odds is simply the ratio of probability of success to probability of failure. Like we may say, what‘s the odds of India winning against Pakistan. Then we are basically comparing the probability of India winning to probability of Pakistan winning.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/830/0*ta-t1MQb5v8sqves.png" /></figure><p>If we take natural logarithm on the both sides, we have:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/567/0*IMrnqLBqmwfj6btx.png" /></figure><p>This is why Logistic regression is also known as Binary Logit Model.</p><p><strong>Change In Odds</strong></p><p>If we change X by one unit then the change in Odds is given by:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/312/0*61ZXYKBfiCMR0YoP.png" /></figure><p>Now if we divide the 2nd relation by the 1st one, we get eβ. So if we change X by 1 unit, then odds changes by a multiple of eβ. So the expression (eβ- 1)* 100% gives the percentage change. Remember this kind of understanding is valid only when X is continuous. When X is categorical, we refer to Odds Ratio.</p><p><strong>Odds Ratio</strong></p><p>Suppose we are comparing the odds for a Poor Vision Person getting hit by a car to the odds for a Good Vision Person getting hit by a car.</p><p>Suppose, the accident is encoded as 1.</p><p>Let P(Y =1| Poor Vision) = 0.8</p><p>&amp; P(Y =1| Good Vision) = 0.4</p><p>So, P(Y = 0| Poor Vision) = 1–0.8 = 0.2</p><p>&amp; P(Y =0| Good Vision) = 1–0.4 = 0.6</p><p>So, Odds( Poor Vision getting hit by a car) = 0.8 / 0.2 = 4</p><p>&amp; Odds( Good Vision getting hit by a car) = 0.4 / 0.6 = 0.67</p><p>So, Odds Ratio = 4/ 0.67 = 6</p><p>The Odds ratio implies as we move from a good vision person to a poor vision person, the odds of getting hit by a car becomes 6 times.</p><p><strong>Developing The Model: Model Convergence</strong></p><p>In order to estimate the logistic regression model, the likelihood maximization algorithm must converge. The term infinite parameters refers to the situation when the</p><p>likelihood equation does not have a finite solution (or in other words, the maximum likelihood estimate does not exist). The existence of maximum likelihood estimates for the logistic model depends on the configurations of the sample points in the observation space. There are three mutually exclusive and exhaustive categories: complete separation, quasi-complete separation, and overlap.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/655/0*Ra08Y_uOlYFikmUE.png" /></figure><p>Complete Separation: No Estimate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/0*3yB5JDEU5vmvtYwJ.png" /></figure><p>Quasi Separation: No Estimate</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/652/0*Z9vGN0_AL8i83Bi_.png" /></figure><p>Quasi Separation: Has Estimates</p><p><strong>Assessing the Model</strong></p><p>We saw in multiple regression that if we want to assess whether a model fits the data, we can compare the observed and the predicted values of the outcome by using R2 . Likewise, in logistic regression, we can use the observed and predicted values to assess the fit of the model. The measure we use is the log — likelihood.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/778/0*x_bcAkjtPulB2MaU.png" /></figure><p>The log-likelihood is therefore based on summing the probabilities associated with the predicted and actual outcomes. The log — likelihood statistic is analogous to the residual sum of squares in multiple regression in the sense that it is an indicator of how much unexplained information is there after the model has been fitted. It‘s possible to calculate a log-likelihood for different models and to compare these models by looking at the difference between their log-likelihoods. One use of this is to compare the state of a logistic regression against some kind of baseline model. The baseline model that‘s usually used is the model when only the constant is included. If we then add one or more predictors to the model, we can compute the improvement of the model as follows:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/444/0*-ffAVZ4N6OgFRiSB.png" /></figure><p>Now, what we should do with the rest of the variables which are not in the equation. For that we have a statistic called Residual Chi — Square Statistic. This statistic tells us that the coefficients for the variables not in the model are significantly different from zero, in other words, that the addition of one or more of these variables to the model will significantly affect its predictive power.</p><p><strong>Testing of Individual Estimated Parameters</strong></p><p>The testing of individual estimated parameters or coefficients for significance is similar to that in multiple regression. In this case, the significance of the estimated coefficients is based on Wald‘s statistic. The statistic is a test of significance of the logistic regression coefficient based on the asymptotic normality property of maximum likelihood estimates and is estimated as:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/264/0*NiVPDBARJY8gXiA3.png" /></figure><p>The Wald statistic is chi-square distributed with 1 degrees of freedom if the variable is metric and the number of categories minus 1 if the variable is non-metric.</p><p><strong>The Hosmer-Lemeshow Goodness-of-Fit Test</strong></p><p>The Hosmer and Lemeshow goodness of fit (GOF) test is a way to assess whether there is evidence for lack of fit in a logistic regression model. Simply put, the test compares the expected and observed number of events in bins defined by the predicted probability of the outcome. The null hypothesis is that the data are generated by the model developed by the researcher.</p><p>Hosmer Lemeshow test statistic:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/325/0*X1mxhkjsvtY-pzaS.png" /></figure><p>where Oi is the observed frequency of the i-th bin, Ni is the total frequency of the i-th bin. Пi is the average estimated probability of the i-th bin.</p><p><strong>Statistics Related to Log-likelihood</strong></p><p><strong>AIC (Akaike Information Criterion)</strong> <strong>=</strong> -2log L + 2(k + s), k is the total number of response level minus 1 and s is the number of explanatory variables.</p><p><strong>SC (Schwarz Criterion) =</strong> -2log L + (k + s)Σj fj , fj is the frequency of the j th observation.</p><p><strong>Cox and Snell</strong> (1989, pp. 208–209) propose the following generalization of the coefficient of determination to a more general linear model:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/336/0*YVuvUqvKcAp5RRi2.png" /></figure><p>where n is the sample size and L(0) is the intercept only model,</p><p>So,</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/223/0*d_mTnBFo7TJsZp6Z.png" /></figure><p>All these statistics have similar interpretation as the R2 in Linear Regression. So, in this part we are trying to assess how much information is reflected through the model.</p><p><strong>Understanding the Relation between the Observed and Predicted Outcomes</strong></p><p>It is very important to understand the relation between the observed and predicted outcome. The performance of the model can be benchmarked against this relation.</p><p><strong>Simple Concepts</strong></p><p>Let us consider the following table.</p><p>In this table, we are working with unique observations. The model was developed for Y = Yes. So it should show high probability for the observation where the real outcome has been Yes and a low probability for the observation where the real outcome has been No.</p><p>Consider the observations 1 and 2. Here the real outcomes are Yes and No respectively, and the probability of the Yes event is greater than the probability of the No event. Such pairs of observations are called <strong>Concordant Pairs.</strong> This is in contrast to the observations 1 and 4. Here we get the probability of the No is greater than the probability of Yes. But the data was modeled for P(Y = Yes). Such a pair is called a<strong> Discordant Pair. </strong>Now consider the pair 1 and 3. The probability values are equal here, although we have opposite outcomes. This type of pair is called a<strong> Tied Pair. </strong>For a good model, we would expect the number of concordant pairs to be fairly high.</p><p><strong>Related Measures</strong></p><p>Let nc , nd and t be the number of concordant pairs, discordant pairs and unique observations in the dataset of N observations. Then (t — nc — nd ) is the number of tied pairs.</p><p>Then we have the following statistics:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/606/0*Rs6gQ5sxM4RiiZUQ.png" /></figure><p>In ideal case, all the yes events should have very high probability and the no events with very low probability as shown in the below chart.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/649/0*5f1YiQxUGjhBlv9F.png" /></figure><p>But the reality is somehow like the right chart. We have some yes events with very low probability and some no events with very high probability.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/648/0*KzBzblHDIFMJIhNM.png" /></figure><p><strong>What Should be the Cut-point Probability Level?</strong></p><p>It is a very subjective issue to decide on the cut-point probability level, i.e. the probability level above which the predicted outcome is an Event i.e., Yes. A Classification Table can help the researcher in deciding the cutoff level.</p><p>A Classification table has several key concepts.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*ySBzuTlRYZfaBUl6.png" /></figure><p><strong>Other Measures Related to Classification Table</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*QEaTpcAF8BxTO-hg.png" /></figure><p><strong>Receiver Operating Characteristic Curves</strong></p><p>Receiver operating characteristic (ROC) curves are useful for assessing the accuracy of predictions. In a ROC curve the Sensitivity is plotted in function of 100-Specificity for different cut-off points of a parameter. Each point on the ROC curve represents a sensitivity/specificity pair corresponding to a particular decision threshold. The area under the ROC curve (AUC) is a measure of how well a parameter can distinguish be-tween two groups. In our case the parameter is the probability of the event.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/508/0*wajzxxnWkmJPPUYe.png" /></figure><p>ROC curve shows sensitivity on the Y axis and 100 mi-nus Specificity on the X axis. If predicting events (not non-events) is our purpose, then on Y axis we have Proportion of Correct Prediction out of Total Occurrence and on the X axis we have proportion of Incorrect Prediction out of Total Non-Occurrence for different cut-points.</p><p>If the ROC curve turns out to be the red straight line, then it implies that the model is segregating cases randomly.</p><h3>References</h3><h3>Academic Literature</h3><ul><li>[Boshnakov, 2011] G. Boshnakov. <a href="http://www.maths.manchester.ac.uk/~goran/research-reports/psrr03-2009.pdf"><em>On First and Second Order Stationarity of Random Coefficient Models</em></a>. Linear Algebra Appl. 434, 415–423. 2011.</li><li>[Breitung, 2002] Breitung, J. (2002). <a href="https://pdfs.semanticscholar.org/e31b/c65824cc156d43d25b6ece0e9613b398233d.pdf"><em>Nonparametric tests for unit roots and cointegration.</em></a> Journal of econometrics, 108(2), 343–363.</li><li>[Dahlhaus, 2012] Dahlhaus, R. (2012). Locally stationary processes. In <em>Handbook of statistics</em> (Vol. 30, pp. 351–413). Elsevier.</li><li>[Nason, 2006] <a href="https://research-information.bristol.ac.uk/en/persons/guy-p-nason(c22adede-c5fc-4692-9b91-24afa15868b6).html">Nason, GP</a> 2006, <a href="https://research-information.bristol.ac.uk/en/publications/stationary-and-nonstationary-time-series(c0005c54-b407-414e-944c-92fca5df2a2b).html">Stationary and non-stationary time series</a>. in H Mader &amp; SC Coles (eds), <em>Statistics in Volcanology.</em> The Geological Society, pp. 129–142.</li><li>[Vogt, 2012] Vogt, M. (2012). Nonparametric regression for locally stationary time series. <em>The Annals of Statistics</em>, <em>40</em>(5), 2601–2633.</li><li>Gujarati, D. N. , Basic Econometrics, 5th Edition, Tata McGraw-Hill</li><li>Field, A. , Discovering Statistics Using SPSS, 2nd Edition, Sage Publications</li><li>Hair, J. , Anderson, R. , Babin, B. Multivariate Data Analysis, 7th Edition, Prentice Hall</li><li>Malhotra, N. K. , Dash, S. , Marketing Research: An Applied Orientation, 5th Edition, Pearson Education</li><li>Rud, O. P. , Data Mining Cookbook: Modeling Data for Marketing, Risk, and Customer Relationship Management, John Wiley &amp; Sons, 2000</li></ul><h3>Online References</h3><ul><li><a href="https://stats.stackexchange.com/questions/185200/roots-of-characteristic-equation-reciprocal-to-roots-of-its-inverse">Roots of characteristic equation reciprocal to roots of its inverse</a></li><li><a href="https://www.mathworks.com/help/econ/stationary-stochastic-process.html">Stochastic Process Characteristics</a></li><li><a href="https://www.mathworks.com/help/econ/trend-stationary-vs-difference-stationary.html">Trend-Stationary vs. Difference-Stationary Processes</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=27c81e562999" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/logistic-regression-27c81e562999">LOGISTIC REGRESSION</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[LINEAR REGRESSION]]></title>
            <link>https://medium.com/analytics-vidhya/linear-regression-b0d533614f5c?source=rss-54153b8d0798------2</link>
            <guid isPermaLink="false">https://medium.com/p/b0d533614f5c</guid>
            <category><![CDATA[machine-learning]]></category>
            <category><![CDATA[analytics]]></category>
            <category><![CDATA[ai]]></category>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[data-science]]></category>
            <dc:creator><![CDATA[Sabyasachi D Choudhury]]></dc:creator>
            <pubDate>Thu, 11 Mar 2021 18:27:03 GMT</pubDate>
            <atom:updated>2021-03-16T17:00:29.719Z</atom:updated>
            <content:encoded><![CDATA[<p>In regression analysis we fit a predictive model to our data and use that model to predict values of the dependent variable from one or more independent variables.</p><p>Simple regression seeks to predict an outcome variable from a single predictor variable whereas multiple regression seeks to predict an outcome from several predictors. We can predict any data using the following general equation:</p><p>(Outcome)i = (Model)i + (Error)i</p><p>The model that we fit here is a linear model. Linear model just means a model based on a straight line. One can imagine it as trying to summarize a data set with a straight line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/625/0*7NGWYBeK4MqPGZbS.png" /></figure><p>Some Important Features of a Straight Line</p><p>A straight line can be defined by two things:</p><p>1)The slope or gradient of the line (b1)</p><p>2)The point at which the line crosses the vertical axis of the graph, also known as the intercept of the line (b0). So our general equation becomes: Yi = (b0 + b1Xi) + εi</p><p>Here Yi is the outcome that we want to predict and Xi is the i-th score on the predictor variable. The intercept b0 and the slope b1 are the parameters in the model and are known as regression coefficients. There is a residual term εi which represents the difference between the score predicted by the line and the i-th score in reality of the de-pendent variable. This term is the proof of the fact that our model will not fit perfectly the data collected. With regression we strive to find the line that best describes the data.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/607/0*zelRTu1nN_ehBOxw.png" /></figure><p>Same intercept, but different slope</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/622/0*dkwsePTJmXpTxpO6.png" /></figure><p>Same slope, but different intercept</p><p><strong>Difference between Correlation and Regression</strong></p><p>Correlation analysis is concern with knowing whether there is a relationship between variables and how strong the relationship is. Regression analysis is concern with finding a formula that represents the relationship between variables so as to find an approximate value of one variable from the value of the other(s).</p><p>Assumptions of Simple Linear Regression</p><p>1. An unilinear between an independent and dependent variable can be represented by a linear regression.</p><p>2. The independent variable must be non-stochastic in nature, i.e. the variable doesn‘t have any distribution associated with it.</p><p>3. The model must be linear in parameters.</p><p>4. The independent variable should not be correlated with the error term.</p><p>5. The error terms must be independent of each other, i.e. occurrence of one error term should not influence the occurrence of other error terms.</p><p><strong>The Method of Least Square</strong></p><p>The method of least squares is a way of finding the line that best fits the data. Of all the possible lines that could be drawn, the line of best fit is the one which results in the least amount of difference between the observed data points and the line.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/555/0*tx4T3l-eNlV4HPz4.png" /></figure><p>The figure shows that when any line is fitted to a set of data, there will be small differences between the line and the actual data. We are interested in the vertical differences between the line and the actual data because we are using the line to predict the values of Y from the values of X. Some of these differences are positive (they are above the line, indicating that the model underestimates their value) and some are negative (they are below the line, indicating that the model overestimates their value).</p><p><strong>Understanding The Goodness of Fit</strong></p><p>The goodness of fit of a statistical mod-el describes how well it fits a set of observations. Measures of goodness of fit typically summarize the discrepancy between observed values and the values expected under the model in question.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/647/0*fIJqKtkBVYJ5rOVJ.png" /></figure><p>In linear regression, the fit is expressed through R2, apart from R2, there is another measure of goodness of fit known as Adjusted R Square. The R2 value for a regression can be made arbitrarily high simply by including more and more predictors in the model. Adjusted R2 takes into account the number of independent variables in the model.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/448/0*nYE89OcfdEhqD-Wv.png" /></figure><p><strong>From Sample to Population</strong></p><p>Like other statistical methods, using regression we are trying to discover a relationship between the dependent and independent variable(s) from a sample and try to draw inference on the population. So there comes the tests of significance in linear regression.</p><p>The Equation of the estimated line is:</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/199/0*R0JT2LEHlFAdZyAX.png" /></figure><p>Here alpha and beta are the estimated value of the intercept and the slope respectively. The tests of significance are related to these two estimates.</p><p><strong>Test of Significance of The Estimated Parameters</strong></p><p><strong>Global Test</strong></p><p><strong>H0:</strong> All the parameters are equal to zero simultaneously</p><p><strong>H1:</strong>At least one is non — zero</p><p>This test is conducted by using a F statistic similar to that we saw in ANOVA.</p><p><strong>Local Test</strong></p><p>For each individual parameters,</p><p><strong>H0:</strong> The parameter value is zero</p><p><strong>H1:</strong> The value is non — zero</p><p>This test is conducted by using a t statistic similar to a one sample t test.</p><p>For Simple Linear Regression there is no difference between the Global and Local tests as there is only one independent variable.</p><p><strong>Multiple Linear Regression</strong></p><p>The Multiple Linear Regression (MLR) is basically an extension of Simple Linear Regression. Single linear regression has single explanatory variable whereas multiple regression considers more than one independent variables to explain the dependent variable. So from a realistic point of view, MLR is more attractive than the simple linear regression. For example,</p><p>(Salary)i = a + b1(Education)i + b2(Experience)i + b3(Productivity)i + b4 (Work Experience)i + (e)i</p><p><strong>Assumptions</strong></p><p>1. The relationship between the dependent and the independent variables is linear. Scatter plots should be checked as an exploratory step in regression to identify possible departures from linearity.</p><p>2. The errors are uncorrelated with the independent variables. This assumption is checked in residuals analysis with scatter plots of the residuals against individual predictors.</p><p>3. The expected value of residuals is zero. This is not a problem because the least squares method of estimating regression equations guarantees that the mean is zero.</p><p>4. The variance of residual is constant. An example of violation is a pattern of residuals whose scatter (variance) increases over time. Another aspect of this assumption is that the error variance should not change systematically with the size of the predicted values. For example, the variance of errors should not be greater when the predicted value is large than when the predicted value is small.</p><p>5. The residuals are random or uncorrelated in time.</p><p>6. The error term is normally distributed. This assumption must be satisfied for conventional tests of significance of coefficients and other statistics of the regression equation to be valid.</p><p><strong>Concept of Multicollinearity</strong></p><p>The predictors in a regression model are often called the ―independent variables‖, but this term does not imply that the predictors are themselves independent statistically from one another. In fact, for natural systems, the predictors can be highly inter-correlated. ―Multicollinearity is a term reserved to describe the case when the inter-correlation of predictor variables is high. It has been noted that the variance of the estimated regression coefficients depends on the inter-correlation of predictors.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/552/0*QmwQsTKxJgsi8d1B.png" /></figure><p>How-ever, multicollinearity does not invalidate the regression model in the sense that the predictive value of the equation may still be good as long as the pre-diction are based on combinations of predictors within the same multivariate space used to calibrate the equation. But there are sever-al negative effects of multicollinearity. First, the variance of the regression coefficients can be inflated so much that the individual coefficients are not statistically significant — even though the overall regression equation is strong and the predictive ability good. Second, the relative magnitudes and even the signs of the coefficients may defy interpretation. Third, the values of the individual regression coefficients may change radically with the removal or addition of a predictor variable in the equation. In fact, the sign of the coefficient might even switch.</p><p><strong>Signs of Multicollinearity</strong></p><p>1. High correlation between pairs of predictor variables</p><p>2. Regression coefficients whose signs or magnitudes do not make good physical sense</p><p>3. Statistically non-significant regression coefficients on important predictors</p><p>4. Extreme sensitivity of sign or magnitude of regression coefficients to insertion or deletion of a predictor variable</p><p><strong>What is VIF?</strong></p><p>The Variance Inflation Factor (VIF) is a statistic that can be used to identify multicollinearity in a matrix of predictor variables. ―Variance Inflation‖ refers here to the mentioned effect of multicollinearity on the variance of estimated regression coefficients. Multicollinearity depends not just on the bivariate correlations between pairs of predictors, but on the multivariate predictability of any one predictor from the other predictors. Accordingly, the VIF is based on the multiple coefficient of determination in regression of each predictor in multivariate linear regression on all the other predictors:</p><p>VIFi = 1/(1 — Ri2)</p><p>where Ri2 is the multiple coefficient of determination in a regression of the i-th predictor on all other predictors, and VIFi is the variance inflation factor associated with the i-th predictor. Note that if the i-th predictor is independent of the other predictors, the variance inflation factor is one, while if the i-th predictor can be almost perfectly predicted from the other predictors, the variance inflation factor approaches infinity. In that case the variance of the estimated regression coefficients is unbounded. Multicollinearity is said to be a problem when the variance inflation factors of one or more predictors becomes large. How large it appears to be is a subjective judgment. Some re-searchers use a VIF of 5 and others use a VIF of 10 as a critical threshold. The VIF is closely related to a statistic call the tolerance, which is 1/VIF.</p><p><strong>Analysis of The Residuals</strong></p><p>Analysis of residuals consists of examining graphs and statistics of the regression residuals to check that model assumptions are satisfied. Some frequently used residuals tests are listed below. All these are to check whether the error terms are identically independently distributed.</p><ol><li><strong> Time series plot of residuals: </strong>The time series plot of residuals can indicate such problems as non-constant variance of residuals, and trend or autocorrelation in residuals.</li><li><strong>Scatter plot of residuals against predicted values:</strong> The residuals are assumed to be uncorrelated with the predicted values. Violation is indicated by some noticeable pattern of dependence in the scatter plots.</li><li><strong>Scatter plots of residuals against individual predictors:</strong> The residuals are assumed to be uncorrelated with the individual predictors. Violation of these assumptions would be indicated by some noticeable pattern of dependence in the scatter plots, and might suggest transformation of the predictors.</li><li><strong>Histogram of residuals:</strong> The residuals are assumed to be normally distributed. Accordingly, the histogram of residuals should resemble a normal probability density function curve.</li><li><strong>Lag-1 scatter plot of residuals: </strong>This plot also deals with the assumption of independence of residuals. The residuals at time t should be independent of the residuals at time t-1. The scatter plot should therefore resemble a formless cluster of points.</li></ol><p><strong>The Idea of Autocorrelation</strong></p><p>Autocorrelation is a mathematical representation of the degree of similarity between a given time series and a lagged version of itself over successive time intervals. It is the same as calculating the correlation between two different time series, except that the same time series is used twice — once in its original form and once lagged one or more time periods.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/523/0*RNr7cp0Nz3veU1Xp.png" /></figure><p>Autocorrelation is calculated to detect patterns in the data. In the chart, the first series is random, whereas the second one shows patterns.</p><p><strong>Durbin-Watson (D-W) Statistic</strong></p><p>The Durbin-Watson (D-W) statistic tests for autocorrelation of residuals, specifically lag-1 autocorrelation. The D-W statistic tests the null hypothesis of no first-order autocorrelation against the alternative hypothesis of positive first-order autocorrelation. The alter-native hypothesis might also be negative first-order autocorrelation. Assume the residuals follow a first-order autoregressive process</p><p>et = pet-1+ nt</p><p>where nt is random and p is the first-order autocorrelation coefficient of the residuals. If the test is for positive autocorrelation of residuals, the hypotheses for the D-W test can be written as H0: p = 0 against H1: p &gt; 0</p><p>The D-W statistic is given by d = Σ(ei — ei-1)2 / Σei2</p><p>It can be shown that if the residuals follow a first-order autoregressive process, d is related to the first-order autocorrelation coefficient, p, as d = 2 (1 — p).</p><p>The above equation implies that</p><p> d = 2 if no autocorrelation (p = 0)</p><p> d = 0 if 1st order autocorrelation is 1</p><p> d = 4 if 1st order autocorrelation is -1</p><h3>References</h3><h3>Academic Literature</h3><ul><li>[Boshnakov, 2011] G. Boshnakov. <a href="http://www.maths.manchester.ac.uk/~goran/research-reports/psrr03-2009.pdf"><em>On First and Second Order Stationarity of Random Coefficient Models</em></a>. Linear Algebra Appl. 434, 415–423. 2011.</li><li>[Breitung, 2002] Breitung, J. (2002). <a href="https://pdfs.semanticscholar.org/e31b/c65824cc156d43d25b6ece0e9613b398233d.pdf"><em>Nonparametric tests for unit roots and cointegration.</em></a> Journal of econometrics, 108(2), 343–363.</li><li>[Dahlhaus, 2012] Dahlhaus, R. (2012). Locally stationary processes. In <em>Handbook of statistics</em> (Vol. 30, pp. 351–413). Elsevier.</li><li>[Nason, 2006] <a href="https://research-information.bristol.ac.uk/en/persons/guy-p-nason(c22adede-c5fc-4692-9b91-24afa15868b6).html">Nason, GP</a> 2006, <a href="https://research-information.bristol.ac.uk/en/publications/stationary-and-nonstationary-time-series(c0005c54-b407-414e-944c-92fca5df2a2b).html">Stationary and non-stationary time series</a>. in H Mader &amp; SC Coles (eds), <em>Statistics in Volcanology.</em> The Geological Society, pp. 129–142.</li><li>[Vogt, 2012] Vogt, M. (2012). Nonparametric regression for locally stationary time series. <em>The Annals of Statistics</em>, <em>40</em>(5), 2601–2633.</li><li>Gujarati, D. N. , Basic Econometrics, 5th Edition, Tata McGraw-Hill</li><li>Field, A. , Discovering Statistics Using SPSS, 2nd Edition, Sage Publications</li><li>Hair, J. , Anderson, R. , Babin, B. Multivariate Data Analysis, 7th Edition, Prentice Hall</li><li>Malhotra, N. K. , Dash, S. , Marketing Research: An Applied Orientation, 5th Edition, Pearson Education</li><li>Rud, O. P. , Data Mining Cookbook: Modeling Data for Marketing, Risk, and Customer Relationship Management, John Wiley &amp; Sons, 2000</li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b0d533614f5c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/linear-regression-b0d533614f5c">LINEAR REGRESSION</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[APPROACHES FOR TIME SERIES ANALYSIS]]></title>
            <link>https://medium.com/analytics-vidhya/approaches-for-time-series-analysis-db27fe252c70?source=rss-54153b8d0798------2</link>
            <guid isPermaLink="false">https://medium.com/p/db27fe252c70</guid>
            <category><![CDATA[statistics]]></category>
            <category><![CDATA[towards-data-science]]></category>
            <category><![CDATA[data-science]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[machine-learning]]></category>
            <dc:creator><![CDATA[Sabyasachi D Choudhury]]></dc:creator>
            <pubDate>Wed, 10 Mar 2021 02:01:43 GMT</pubDate>
            <atom:updated>2021-03-25T15:49:21.894Z</atom:updated>
            <content:encoded><![CDATA[<p><strong>STEPAR (Stepwise Auto-regression)</strong></p><p>Here we fit a time trend model to the series and takes the difference between each value and the estimated trend. This process is called DETRENDING. Then, the remaining variation is fit using an autoregressive model. We will learn about the Autoregressive Model in the coming segments.</p><p><strong>EXPONENTIAL</strong></p><p>Exponential smoothing forecasts are forecasts for an integrated moving-average process; however, the weighting parameter is specified by the user rather than estimated from the data. As a general rule, smaller smoothing weights are appropriate for series with a slowly changing trend, while larger weights are appropriate for volatile series with a rapidly changing trend</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/836/0*ZC15eunNoZIAg43G.png" /></figure><p><strong>WINTERS METHOD</strong></p><p>The WINTERS method uses updating equations similar to exponential smoothing to fit parameters for the model.</p><p><strong>xt=(a+bt)s(t)+ ϵt</strong></p><p>where a and b are trend parameters and the function s(t) selecting the seasonal parameter.</p><p><strong>Stochastic Processes</strong></p><p>A random or stochastic process is a collection of random variables ordered in time. An example of the continuous stochastic process is an electrocardiogram and an example of the discrete stochastic process is GDP.</p><p><strong>In what sense can we regard GDP as a stochastic process?</strong></p><p>Consider for instance the GDP of $2872.8 billion for 1970–I. In theory, the GDP figure for the first quarter of 1970 could have been any number, depending on the economic and political climate then prevailing. The figure of 2872.8 is a particular realization of all such possibilities. You can think of the value of $2872.8 billion as the mean value of all possible values of GDP for the first quarter of 1970. Just as we use sample data to draw inferences about a population, in time series we use the realization to draw inferences about the underlying stochastic process.</p><p><strong>Stationary Stochastic Processes</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/0*iXlHngK2K4lbmsQG.png" /></figure><p>A stochastic process is said to be stationary if its mean and variance are constant over time and the value of the covariance be-tween the two time periods depends only on the distance or gap or lag between the two time periods and not the actual time at which the covariance is computed. Such a time series will tend to return to its mean (called mean reversion) and fluctuations around this mean (measured by its variance) will have a broadly constant amplitude. If a time series is not stationary in the sense just defined, it is called a non-stationary time series.</p><p><strong>Why are stationary time series so important?</strong></p><p>If the time series is non-stationary, then each set of time set data will have its own characteristics. So we cannot generalize the behavior of one set to other sets.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/0*BYer0zXwdLQcTcFM.png" /></figure><p>Non- Stationary Process: Variance is Changing</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/646/0*Ljc7MGytt7jEKtdi.png" /></figure><p>Non- Stationary Process: Mean is Changing</p><p>This is a type of Non-Stationary Process. The term random walk is often compared with a drunkard‘s walk. Leaving a bar, the drunkard moves a random distance ut at time t, and, continuing to walk indefinitely, will eventually drift farther and farther away from the bar. The same is said about stock prices. Today‘s stock price is equal to yesterday‘s stock price plus a random shock. There are two types of Random Walk:</p><p>Random Walk Without Drift (No Constant Term): Where ut is a white noise error term with mean = 0 and variance = σ2</p><p>Random Walk With Drift (With Drift Parameter): Where δ is the drift parameter</p><p><strong>Random Walk Without Drift</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*Zy7UpczAGzDt5aUo.png" /></figure><p><strong>Random Walk With Drift (δ = 0.06)</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*qTdbRJHAuIvF20l4.png" /></figure><p><strong>Unit Root Problem</strong></p><p>A stochastic process expressed by <strong>Yt= ρY(t-1)+ut,</strong> where<strong> 0≤ρ≤1,</strong> is called a unit root stochastic process. If ρ is in fact 1, we face what is known as the unit root problem, that is, the process is non-stationary; we already know that in this case the variance of Yt is not stationary. The name unit root is due to the fact that ρ=1. Thus the terms non-stationarity, random walk, and unit root can be treated as synonymous. If, however, if<strong> |ρ|≤1,</strong> that is if the absolute value of ρ is less than one, then it can be shown that the time series Yt is stationary. In practice, then, it is important to find out if a time series possesses a unit root.</p><p><strong>Unit Root Process (ρ = 1): Non-stationary</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*x-IDute37MhSWgWc.png" /></figure><p><strong>Unit Root Process (-1&lt; ρ &lt;1): Stationary</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*eM5orkBN7WqFkEJ7.png" /></figure><p>Putting Them All Together</p><p>The distinction between stationary and non-stationary stochastic processes (or time series) has a crucial bearing on whether the trend (the slow long-run evolution of the time series under consideration) observed in the constructed time series is deterministic or stochastic. Broadly speaking, if the trend in a time series is completely predictable and not variable, we call it a deterministic trend, whereas if it is not predictable, we call it a stochastic trend. To make the definition more formal, consider the following model of the time series Yt :</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/369/0*iVj76NNw5mMbtf3V.png" /></figure><p><strong>Case 1: Pure Random Walk</strong></p><p>If <strong>β1=0, β2=0 and β3=1</strong>, we get, <strong>Yt= Y(t-1)+ ut</strong> which is nothing but a RWM without drift and is therefore non-stationary. Again, <strong>ΔYt= (Yt — Y(t-1) )= ut</strong> which is stationary. Hence, a RWM without drift is a difference stationary process.</p><p><strong>Case 2: Random Walk With Drift</strong></p><p>If <strong>β1≠0, β2=0 and β3=1</strong>, we get,<strong> Yt= β1+Y(t-1)+ ut</strong> which is a RWM with drift and is therefore non-stationary. Again,<strong> ΔYt= (Yt — Y(t-1) )= β1+ ut</strong> which means that Yt will exhibit a positive<strong> (β1&gt;0)</strong>or negative <strong>(β1&lt;0) </strong>trend. Such a trend is called a Stochastic Trend. Again this is a difference stationary process as <strong>ΔYt</strong> is stationary.</p><p><strong>Case 3: Deterministic Trend</strong></p><p>If <strong>β1≠0, β2≠0 and β3=0, </strong>we get,<strong> Yt=β1+ β2 t+ ut </strong>which is called a Trend Stationary Process. Although the mean of the process <strong>β1+ β2 </strong>t is not constant, its variance is. Once the values of β1 and β2 are known, the mean can be forecasted perfectly. Therefore, if we subtract the mean from Yt, the resulting series will be stationary, hence the name trend stationary. This procedure of removing the (deterministic) trend is called detrending.</p><p><strong>Case 4: Random Walk With Drift and Deterministic Trend</strong></p><p>If <strong>β1≠0, β2≠0 and β3=1,</strong> we get, <strong>Yt=β1+ β2 t+Yt-1+ ut </strong>we have a random walk with drift and a deterministic trend. <strong>ΔYt= (Yt — Y(t-1) )=β1+ β2 t+ ut,</strong> which implies that Yt is nonstationary.</p><p><strong>Case 5: Deterministic Trend with Stationary Component</strong></p><p>If <strong>β1≠0, β2≠0 and β3&lt;1, </strong>we get, <strong>Yt=β1+ β2 t+β3 Yt-1+ ut</strong> which is stationary around a deterministic trend.</p><p><strong>Deterministic Versus Stochastic Trend</strong></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/687/0*jSrYhj3nlAfomHp8.png" /></figure><p><strong>How Do We Test Whether The Time Series Is Stationary?</strong></p><p>By now, all of us probably have a good idea about the nature of stationary stochastic processes and their importance. There are broadly three ways to find out whether the Time Series under consideration is stationary or not. The first way is to plot the time series and look into the chart. In the last few topics, we have seen how a non- stationary series looks like. For example, if the chart is showing an upward trend, it‘s suggesting that the mean of the data is changing. This may suggest that the data is non-stationary. Such an intuitive feel is the starting point of more formal tests of stationarity. The other methods of checking stationarity is Autocorrelation Function or Correlogram and Unit Root Test.</p><p><strong>What is Autocorrelation Function or Correlogram?</strong></p><p>Autocorrelation refers to the correlation of a time series with its own past and future values. The first-order autocorrelation coefficient is the simple correlation coefficient of the first<strong> N — 1 </strong>observations <strong>x1, x2, x3, …, x(N-1)</strong>and the next <strong>N — 1 </strong>observations, <strong>x2, x3, x4, …, xN.</strong> Similarly, we can define higher order autocorrelation coefficients. So for different order or lag, we will get different autocorrelation coefficients. As a result, we can define the autocorrelation coefficients as a function of lag. This function is known as Autocorrelation Function and its graphical presentation is known as Correlogram.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/636/0*Jnj9-lmnPW46UhaQ.png" /></figure><p>A rule of thumb is to compute ACF up to one-third to one-quarter the length of the time series. The statistical significance of any au-tocorrelation coefficient can be judged by its standard error. Bartlett has shown that if a time series is purely random, that is, it exhibits white noise, the sample autocorrelation coefficients follows a normal distribution with mean = 0 and variance = 1/ Sample Size.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/505/0*BglnEBpyp9d_gCSs.png" /></figure><p><strong>The Unit Root Test</strong></p><p>As we learnt from the unit root stochastic process</p><p><strong>Yt= ρY(t-1)+ut, </strong>where <strong>-1≤ρ≤1</strong>.Also we learnt that in the case of unit root, ρ=1.For theoretical reasons, we convert the equation as follows:</p><p><strong>Yt — Y(t-1)=(ρ-1) Y(t-1)+ ut. Or, ΔYt=δY(t-1)+ ut</strong></p><p>Where<strong> δ=(ρ-1) and Δ </strong>is the first difference operator.</p><p>Here, we are going to test the null hypothesis that δ=0, that is, ρ=1 which means that the time series under consideration is non — stationary.</p><p>Now the problem is that under null hypothesis, the t value of the estimated coefficient of Yt−1does not follow the t distribution even in large samples. Dickey and Fuller have shown that, under the null hypothesis, the estimated t value of the coefficient of Yt−1 follows the τ (Tau) Statistic. In honor of the discoverer, this test is known as Dickey — Fuller (DF) Test. In conducting DF test, we assumed that the error terms ut are uncorrelated. But in case the ut are correlated, Dickey and Fuller have developed a test, known as the Augmented Dickey–Fuller (ADF) test.</p><p><strong>Problems of Unit Root Tests</strong></p><p>Apart from ADF, there are other unit root tests. There are limitations to these tests including ADF. Most tests of the Dickey Fuller type tend to accept the null of unit root more frequently than is warranted. That is, these tests may find a unit root even when none exists.</p><p><strong>How Do We Transform A Non- Stationary Time Series?</strong></p><p><strong>Difference-Stationary Process (DSP):</strong> If a time series has a unit root, the first differences of such time series are stationary.</p><p><strong>Trend-Stationary Process (TSP):</strong> A Trend Stationary Process is stationary around the trend. Hence, the simplest way to make such a time series stationary is to regress it on time and the residuals from this regression will then be stationary.</p><p>It should be pointed out that, if a time series is DSP but we treat it as TSP, this is called Under-Differencing. On the other hand, if a time series is TSP but we treat it as DSP, this is called Over-Differencing. The consequences of these types of specification errors can be serious.</p><p><strong>Integrated Stochastic Process</strong></p><p>If a time series has to be differenced once to make it stationary, we such time series Integrated of Order 1. Similarly, if a time series has to be differenced twice (i.e., take the first difference of the first differences) to make it stationary, we call such a time se-ries integrated of order 2. For example, pure random walk is non-stationary, but its first difference is stationary. So we call random walk without drift integrated of order 1. In general, if a (non-stationary) time series has to be differenced d times to make it stationary, that time series is said to be integrated of order d and is denoted as Yt∼I(d). If a time series is stationary at the beginning, then it is said to be integrated of order zero. Most economic time series are generally I(1); that is, they generally become stationary only after taking their first differences.</p><p><strong>Now How Do We Forecast?</strong></p><p>Before forecasting we need to model the time series. If a time series is stationary, we can model it in a variety of ways.</p><p><strong>Autoregressive (AR) Process</strong></p><p>Let Yt represents GDP at time t. If we model Yt as: <strong>( Yt — δ) = a1(Yt-1 -δ) + ut</strong> where δ is the mean of Y and ut is an uncorrelated random error term with zero mean and constant variance σ2 , then we say Yt follows a first order autoregressive, or AR(1) stochastic process. Here the value of Y at time t de-pends on its value in the previous time period and a random term; the Y values are ex-pressed as deviations from their mean value. Here the value of Y at time t de-pends on its value in the previous time period and a random term; the Y values are ex-pressed as deviations from their mean value. In general, we can have an AR(p) as follows:</p><p><strong>( Yt — δ) = a1(Yt-1 -δ) + a2(Yt-2 -δ) +…+ap(Yt-p -δ) + ut</strong></p><p><strong>Moving Average (MA) Process</strong></p><p>Suppose we model Y as: <strong>Yt = μ + bout + b1ut-1</strong></p><p>where μ is a constant and u, as before, is the white noise stochastic error term. Here Y at time t is equal to a constant plus a moving average of the current and past error terms. Thus, in the present case, we say that Y follows a first-order moving average, or an MA(1) process. More generally, a MA(q) process is expressed as:</p><p><strong>Yt = μ + bout + b1ut-1 + b2ut-2 +…+bqut-q</strong></p><p>In short, a moving average process is simply a linear combination of white noise error terms.</p><p><strong>Autoregressive Moving Average (ARMA) Process</strong></p><p>Of course, it is quite likely that Y has characteristics of both AR and MA and is therefore ARMA. Thus, Yt follows an ARMA(1, 1)process if it can be written as:</p><p><strong>θ + a1Yt-1 + bout + b1ut-1</strong></p><p>where θ represents a constant term. Again this expression can be generalized for an ARMA(p, q) process.</p><p><strong>Autoregressive Integrated Moving Average (ARIMA) Process</strong></p><p>Now in the last segment we learnt about the Integrated Stochastic Process of order d, which implies we have to difference a time series d times to make it stationary. So, given a time series, we first have to difference it d and then apply an ARMA(p, q) to mod-el it. Then we say the original time series is ARIMA(p, d, q). Thus, an ARIMA(2, 1, 2) time series has to be differenced once(d=1)before it becomes stationary and the (first-differenced) stationary time series can be modeled as an ARMA(2, 2) process, that is, it has two AR and two MA terms. Of course, if d=0 (i.e., a series is stationary to begin with), ARIMA(p, d=0,q)= ARMA(p, q). Note that an ARIMA(p, 0, 0) process means a purely AR(p)stationary process; an ARIMA(0, 0,q) means a purely MA(q) stationary process. Given the values of p, d, and q, one can tell what process is being modeled.</p><p><strong>The Box–Jenkins Methodology</strong></p><p>The objective of B–J [Box–Jenkins] is to identify and estimate a statistical model which can be interpreted as having generated the sample data. If this estimated model is then to be used for forecasting we must assume that the features of this mod-el are constant through time, and particularly over future time periods. Thus we must have either a stationary time series or a time series that is stationary after one or more differencing.</p><p><strong>What actually are we looking for?</strong></p><p>The most important question while modeling a time series is how does one know whether it follows a purely AR process (and if so, what is the value of p) or a purely MA process (and if so, what is the value of q) or an ARMA process (and if so, what are the values of p and q) or an ARIMA process, in which case we must know the values of p, d, and q. The BJ methodology comes in handy in answering the preceding question. The method consists of four steps:</p><p><strong>Identification:</strong> Find out the appropriate values of p, d, and q</p><p><strong>Estimation: </strong>Having identified the appropriate p and q values, the next stage is to estimate the parameters of the autoregressive and moving average terms included in the model.</p><p><strong>Diagnostic Checking: </strong>Having chosen a particular ARIMA model, and having estimated its parameters, we next see whether the chosen model fits the data reason-ably well.</p><p><strong>Forecasting</strong></p><p><strong>So, How Do We Find p, d and q?</strong></p><p>The chief tools in identification are the autocorrelation function (ACF),the partial auto-correlation function (PACF),and the resulting correlograms, which are simply the plots of ACFs and PACFs against the lag length.</p><p><strong>Identifying d</strong></p><p>If the series has positive autocorrelations out to a high number of lags, then it probably needs a higher order of differencing</p><p>If the lag-1 autocorrelation is zero or negative, or the autocorrelations are all small and pattern less, then the series does not need a higher order of differencing. If the lag-1 autocorrelation is -0.5 or more negative, the series may be over differenced</p><p>The optimal order of differencing is often the order of differencing at which the standard deviation is lowest</p><p><strong>Identifying AR(p)</strong></p><p>ACF decays exponentially or with dampened sine wave pattern or both and PACF has significant spikes through lags p.</p><p><strong>Identifying MA(q)</strong></p><p>The PACF decays exponentially and the ACF has significant spikes through lags q.</p><p><strong>How Do We Estimate The Parameters?</strong></p><p>Estimating the parameters for the Box–Jenkins models is a quite complicated non-linear estimation problem. For this reason, the parameter estimation should be left to a high quality software program that fits Box–Jenkins models. The main approaches to fitting Box–Jenkins models are non-linear least squares and maximum likelihood estimation. Maximum likelihood estimation is generally the preferred technique.</p><p><strong>How Good Is The Model?</strong></p><p>One simple diagnostic is to obtain residuals from the model developed and obtain the ACF and PACF of these residuals, say, up to lag 25. The correlograms of both auto-correlation and partial autocorrelation give the impression that the residuals estimated from model are purely random.</p><h3>References</h3><h3>Academic Literature</h3><ul><li>[Boshnakov, 2011] G. Boshnakov. <a href="http://www.maths.manchester.ac.uk/~goran/research-reports/psrr03-2009.pdf"><em>On First and Second Order Stationarity of Random Coefficient Models</em></a>. Linear Algebra Appl. 434, 415–423. 2011.</li><li>[Breitung, 2002] Breitung, J. (2002). <a href="https://pdfs.semanticscholar.org/e31b/c65824cc156d43d25b6ece0e9613b398233d.pdf"><em>Nonparametric tests for unit roots and cointegration.</em></a> Journal of econometrics, 108(2), 343–363.</li><li>[Dahlhaus, 2012] Dahlhaus, R. (2012). Locally stationary processes. In <em>Handbook of statistics</em> (Vol. 30, pp. 351–413). Elsevier.</li><li>[Nason, 2006] <a href="https://research-information.bristol.ac.uk/en/persons/guy-p-nason(c22adede-c5fc-4692-9b91-24afa15868b6).html">Nason, GP</a> 2006, <a href="https://research-information.bristol.ac.uk/en/publications/stationary-and-nonstationary-time-series(c0005c54-b407-414e-944c-92fca5df2a2b).html">Stationary and non-stationary time series</a>. in H Mader &amp; SC Coles (eds), <em>Statistics in Volcanology.</em> The Geological Society, pp. 129–142.</li><li>[Vogt, 2012] Vogt, M. (2012). Nonparametric regression for locally stationary time series. <em>The Annals of Statistics</em>, <em>40</em>(5), 2601–2633.</li><li>Gujarati, D. N. , Basic Econometrics, 5th Edition, Tata McGraw-Hill</li><li>Field, A. , Discovering Statistics Using SPSS, 2nd Edition, Sage Publications</li><li>Hair, J. , Anderson, R. , Babin, B. Multivariate Data Analysis, 7th Edition, Prentice Hall</li><li>Malhotra, N. K. , Dash, S. , Marketing Research: An Applied Orientation, 5th Edition, Pearson Education</li><li>Rud, O. P. , Data Mining Cookbook: Modeling Data for Marketing, Risk, and Customer Relationship Management, John Wiley &amp; Sons, 2000</li></ul><h3>Online References</h3><ul><li><a href="https://stats.stackexchange.com/questions/185200/roots-of-characteristic-equation-reciprocal-to-roots-of-its-inverse">Roots of characteristic equation reciprocal to roots of its inverse</a></li><li><a href="https://www.mathworks.com/help/econ/stationary-stochastic-process.html">Stochastic Process Characteristics</a></li><li><a href="https://www.mathworks.com/help/econ/trend-stationary-vs-difference-stationary.html">Trend-Stationary vs. Difference-Stationary Processes</a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=db27fe252c70" width="1" height="1" alt=""><hr><p><a href="https://medium.com/analytics-vidhya/approaches-for-time-series-analysis-db27fe252c70">APPROACHES FOR TIME SERIES ANALYSIS</a> was originally published in <a href="https://medium.com/analytics-vidhya">Analytics Vidhya</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>