class: center, middle, inverse, title-slide # Module 06 ## MPA 6010 ### Ani Ruhil ### (updated: 2018-11-18) ---  # Agenda - Covariance - Correlation - Simple linear regression - Multiple linear regression --- class: inverse, middle, center # Covariance --- ## Covariance The covariance of two variables `\(x\)` and `\(y\)` measures how the two are `linearly related` - Positive covariance = positive linear relationship - Negative covariance = negative linear relationship ### Population versus Sample Covariance (1) Population covariance: `\(\sigma_{xy} = \dfrac{1}{N}\sum^{N}_{i=1} \left(x_i - \bar{x} \right) \left(y_i - \bar{y} \right)\)` (2) Sample covariance: `\(s_{xy} = \dfrac{1}{n-1}\sum^{n}_{i=1} \left(x_i - \bar{x} \right) \left(y_i - \bar{y} \right)\)` **Note:** - The numerical magnitude of the covariance is not easy to interpret because it depends on the values of the variables - If two variables are `independent`, their covariance is `\(0\)` - Variables must be, if related, `linearly related` --- ## The hsb2 data  --- class: inverse, middle, center # Correlations --- ## The Correlation Coefficient `\(r\)` The correlation coefficient `\((r)\)` estimates the association between two continuous variables `\(x\)` and `\(y\)` `$$r = \dfrac{\sum \left( x - \bar{x} \right) \left(y - \bar{y} \right)}{\sqrt{ \sum \left( x - \bar{x} \right)^2} \sqrt{ \sum \left( y - \bar{y} \right)^2 }}$$` - `\(-1 \leq r \leq +1\)` - `\(r = +1\)` indicates `perfect positive linear relationship` - `\(r = -1\)` indicates `perfect negative linear relationship` - `\(r \approx 0\)` indicates `absence of a linear relationship` The Correlation Coefficient is based on the assumption of `bivariate normality` - `\(x\)` and `\(y\)` are each normally distributed - `\(x\)` and `\(y\)` are linearly related - The cloud of points has a circular or elliptical shape If these are violated we can try various transformations but if these fail we can then rely on a nonparametric approach ... more on this in the next course, if anyone is interested --- ## Some Correlations  ---  ---  --- ## Stylized Examples of Violations .pull-left[  ] .pull-right[  ] --- ## Beware Attenuation and Measurement Error .pull-left[  ] .pull-right[  ] --- ## Hypothesis Testing for Correlations Given that the `Sample Pearson Correlation Coefficient` `\((r)\)` is based on a sample, we know it is estimating the true correlation between `\(x\)` and `\(y\)` in the population ... denoted by `\(\rho\)` One then needs to conduct a statistical test that will tell us whether in the population `\(\rho=0\)` or `\(\rho \neq 0\)` `\(H_0\)`: `\(\rho=0\)`; `\(H_1\)`: `\(\rho \neq 0\)` The test statistic is: `\(t = \dfrac{r}{SE_r}\)`; where `\(SE_r = \sqrt{\dfrac{1-r^2}{n-2}}\)` Reject `\(H_0\)` if `\(P-value\)` of the calculated `\(t\)` is `\(\leq \alpha\)`; Do not reject `\(H_0\)` otherwise `Advanced material follows` We can also calculate asymptotic approximate confidence intervals for `\(\rho\)` as `\(z - 1.96\sigma_z < \zeta < z + 1.96\sigma_z\)` where `\(z=0.5ln\left( \dfrac{1+r}{1-r} \right)\)`; `\(\sigma_z = \sqrt{\dfrac{1}{n-3}}\)`; and `\(\zeta\)` is the population analogue of the `\(z\)` used to calculate confidence intervals. Because the `\(z\)` involves the natural logarithm we back-transform via taking the antilog of the lower and upper bounds of the confidence interval --- ### STAR Data: Are Reading Scores Correlated?  --- ### hsb2 Data: Are Subject Scores Correlated?  --- ## Spearman's Rank Correlation Measures strength and association between the `ranks` of two variables assumed to be (i) randomly sampled, and (ii) with linearly related ranks - Rank the scores of each variable separately, from low to high - Average the ranks in the presence of ties - Calculate `\(r_s=\dfrac{\sum \left(R - \bar{R} \right)\left( S - \bar{S}\right) }{\sum \left(R - \bar{R} \right)^2 \sum \left(S - \bar{S} \right)^2}\)` - `\(H_0\)`: `\(\rho_s = 0\)`; `\(H_A\)`: `\(\rho_s \neq 0\)` - Set `\(\alpha\)` - Reject `\(H_0\)` if `\(P-value \leq \alpha\)`; Do not reject `\(H_0\)` otherwise --- ### Example: County Health Rankings  --- class: inverse, middle, center # Regression Analysis --- ## Introduction to Regression Analysis Regression analysis seeks to both describe and predict relationships between one `dependent variable` and `one or more quantitative (continuous and/or discrete) and/or one or more categorical (nominal and/or ordinal) independent variables` It allows us to model complex relationships between the dependent variable and the independent variables. We can thus ask: How do `\(x_1, x_2, \ldots, x_k\)` influence `\(y\)`? It also enables us to make predictions about outcomes. If `\(x_i\)` assumes a particular value, what will be the value of `\(y_i\)` predicted from the linear regression? `Regression analysis does not in itself allow us to make causal claims` Conventionally the dependent variable is denoted as `\(y\)` and the independent variables are denoted as `\(x\)` **Note:** Dependent variable may be (a) quantitative or (b) categorical but `in this course we will only work with continuous variables` --- ## Simple Bivariate Linear Regression The simple linear1 regression describes an outcome `\((y)\)` as a `linear function` of an independent variable `\((x)\)` .footnote[[1] Linear means variables can be `\(x^2\)`, `\(1/x\)`, etc. but the slope must have a power of 1; `\(y = a + b^2(x)\)` is not linear.] `\(y = a + bx\)` is an example of a linear function. Recall that this is also the equation for a straight line where `\(a=\)` the intercept, and `\(b=\)` the slope of the line Given two sets of coordinates `\((x_1,y_1), (x_2,y_2)\)`, say `\((-1,-1)\)` and `\((5, 1)\)` respectively, we can calculate the slope of the straight line connecting these two points as `$$b = \dfrac{y_2 - y_1}{x_2 - x_1} = \dfrac{1 - (-1)}{5 - (-1)} = \dfrac{2}{6}=0.333$$` **Note:** The Slope tells us the change in `\(y\)` for a unit change in `\(x\)` ... i.e., how much does `\(y\)` change by when `\(x\)` increases by 1? Typically slopes are interpreted in terms of a unit increase in `\(x\)` | x | -1 | 0 | 1 | 2 | 3 | 4 | 5 | | --: | --: | --: | --: | --: | --: | --: | --: | | y | -1.000 | -0.667 | -0.333 | 0.000 | 0.333 | 0.667 | 1.000 | --- We can calculate the intercept `\((a)\)` by finding the value of `\(y\)` when `\(x=0\)` One set of coordinates we want are `\((0, y_0)\)`, and a second set picked arbitrarily could be `\((5,1)\)` `\(b = \dfrac{1 - y_0}{5 - 0}=\dfrac{1-y_0}{5}\)` We know the slope, `\(b = 0.333\)` since we just calculated it (see previous slide) `\(\therefore b = \dfrac{1-y_0}{5}\)`, i.e., `\(0.333 = \dfrac{1-y_0}{5}\)` `\(\therefore 0.333 \times 5 = 1 - y_0\)` and hence `\(y_0 = 1 - (0.333 \times 5) = 1 - 1.665 = -0.665\)` Now we can write the equation for the straight line `\(y = a + b(x)\)` as `\(y = -0.665 + 0.333(x)\)` When `\(x = 0\)`, `\(y = -0.665\)`, when `\(x = 1\)`, `\(y = -0.332\)`, when `\(x = 2\)`, `\(y = 0.001\)` and so on ... Given a value of `\(x\)` `you can predict the value of` `\(y\)` But no regression line is perfect and so you will have prediction errors --- ## The Residuals (Errors) Unless `\(x\)` and `\(y\)` are perfectly correlated all data points will not fall on the straight line We thus end up with some `errors` Let us distinguish between the - `population regression function` `\(y = a + b(x) + \epsilon\)` - `sample regression function` `\(y = a + b(x) + e\)` `\(\epsilon\)` is representing the population-level variation in `\(y\)` that remains unexplained by the model `\(e\)` is is representing the sample-level variation in `\(y\)` that remains unexplained by the model In theory, if we knew and could accurately measure everything that influences `\(y\)` we would have a perfect regression model and hence there would be no errors whatsoever But that is a mirage given the complexity of almost all phenomena in the real world. Plus our knowledge and measurement abilities are imperfect --- Technically, when you estimate a linear regression you denote that fact by writing the regression equation as follows: `\(\hat{y} = \hat{a} + \hat{b}(x)\)` without the `\(+ e\)` term `\(\hat{y}\)` is the predicted value of `\(y\)`, and we can then calculate the prediction error for each observed value of `\(y\)` by calculating `$$\hat{e_i} = y_i - \hat{y_i}$$` `$$\text{actual value of each } y - \text{ predicted value of each } y$$` Note that `\(\hat{e_i}\)` are also called the residuals because they are showing the residual variation in `\(y_i\)` that remains unexplained by the regression model If the residuals are large and many, then we have an ill-fitting regression model (i.e., our model captures the linear relationship between the dependent variable and the independent variables very poorly) --- ### An Example | `\(y\)` | `\(x\)` | `\(\hat{y} = -0.1 + 0.7(x)\)` | `\(\hat{e} = y - \hat{y}\)` | | --: | --: | --: | --: | | 1 | 1 | 0.6 | 0.4 | | 1 | 2 | 1.3 | -0.3 | | 2 | 3 | 2.0 | 0.0 | | 2 | 4 | 2.7 | -0.7 | | 4 | 5 | 3.4 | 0.6 | When `\(x = 1, \hat{y} = -0.1 + 0.7(1) = 0.6\)` When `\(x = 2, \hat{y} = -0.1 + 0.7(2) = 1.3\)` When `\(x = 3, \hat{y} = -0.1 + 0.7(3) = 2.0\)` When `\(x = 4, \hat{y} = -0.1 + 0.7(4) = 2.7\)` When `\(x = 5, \hat{y} = -0.1 + 0.7(5) = 3.4\)` --- ### The Regression Line  **Note:** The prediction `\((\hat{y} = 2)\)` is perfect when `\(x\)` is at its mean: i.e., `\(\bar{x} = 3\)` --- ## The Pizza Example Student population size `\((x)\)` and pizza sales `\((y)\)` ... both in 1,000 units | Observation No. | `\(x_{i}\)` | `\(y_{i}\)` | `\(x_{i}-\bar{x}\)` | `\(y_{i}-\bar{y}\)` | `\((x_{i}-\bar{x})(y_{i}-\bar{y})\)` | `\((x_{i}-\bar{x})^{2}\)`| | --: | --: | --: | --: | --: | --: | --: | --: | | 1 | 2 | 58 | -12 | -72 | 864 | 144| | 2 | 6 | 105 | -8 | -25 | 200 | 64| | 3 | 8 | 88 | -6 | -42 | 252 | 36| | 4 | 8 | 118 | -6 | -12 | 72 | 36| | 5 | 12 | 117 | -2 | -13 | 26 | 4| | 6 | 16 | 137 | 2 | 7 | 14 | 4| | 7 | 20 | 157 | 6 | 27 | 162 | 36| | 8 | 20 | 169 | 6 | 39 | 234 | 36| | 9 | 22 | 149 | 8 | 19 | 152 | 64| | 10 | 26 | 202 | 12 | 72 | 864 | 144| | | `\(\bar{x}=14\)` | `\(\bar{y}=130\)` | `\(0\)` | `\(0\)` | `\(2840\)` | `\(568\)`| --- `\(SS_{xy} = (x_{i}-\bar{x})(y_{i}-\bar{y})\)` `\(SS_{x} = (x_{i}-\bar{x})^{2}\)` Technically, `\(\hat{b} = \dfrac{SS_{xy}}{SS_{x}} = \dfrac{2840}{568} = 5\)` and hence `\(\hat{a} = \bar{y} - \hat{b}(\bar{x}) = 130 - 5(14) = 130 - 70 = 60\)` The regression equation thus is `\(\hat{y} = 60 + 5(x)\)` What is `\(\hat{y}\)` when `\(x=2\)` ? `\(60 + 5(2) = 70\)` What is `\(\hat{y}\)` when `\(x=6\)` ? `\(60 + 5(6) = 90\)` What is `\(\hat{y}\)` when `\(x=8\)` ? `\(60 + 5(8) = 140\)` What is `\(\hat{y}\)` when `\(x=0\)` ? ... `\(y = 60,000 \text{ dollars } \ldots\)` `interpreting the intercept is tricky` --- ### The predictions | Observation No.| Sales| Revenue| Predicted Revenues| Prediction Errors| | --: | --: | --: | --: | --: | | 1| 2.00| 58.00| 70.00| -12.00| | 2| 6.00| 105.00| 90.00| 15.00| | 3| 8.00| 88.00| 100.00| -12.00| | 4| 8.00| 118.00| 100.00| 18.00| | 5| 12.00| 117.00| 120.00| -3.00| | 6| 16.00| 137.00| 140.00| -3.00| | 7| 20.00| 157.00| 160.00| -3.00| | 8| 20.00| 169.00| 160.00| 9.00| | 9| 22.00| 149.00| 170.00| -21.00| | 10| 26.00| 202.00| 190.00| 12.00| --- ### The Pizza Regression Line and Data  --- ### Fitting the Regression Model in SPSS  --- ### Interpreting the Regression Output Correlation is 0.950 ... the two variables are very highly, positively correlated R-squared is 0.903 ... 90.3% of the variation in revenue is explained by this regression model (i.e., by the independent variable(s) included in this particular regression model) Average prediction error `(Standard error of the estimate)` is 13.829 ... That is, if we use this model to make predictions, average prediction error will be `\(\pm 13,829\)` dollars than the actual value of revenues (the dependent variable `\(y\)`) The slope `\(\left( \hat{b} \right)\)` is 5, and this is statistically significant (the p-value is 0.000) ... as population increases by 1 unit (which here means 1,000 persons) revenues increase by 5 (i.e., 5,000 dollars since everything is measured in 1,000 units) --- ### SPSS' Regression Line and Data Plot  --- class: inverse, middle, center # Population vs. Sample Regression Function --- ## Galton's Parent-Child Height Data These data are from Francis Galton's 1885 exploration of the relationship between the heights of children and the height of their parents. The variables are the height of the adult child and the midparent height, defined as the average of the height of the father and 1.08 times the height of the mother. The units are inches. The number of cases is 928, representing 928 children and their 205 parents.  --- ### The Population Regression Function  `\({child} = Intercept + slope(parent) = 23.942 + 0.646(parent)\)` `\({child_{parent = 60}} = 23.942 + 0.646(60) = 23.942 + 38.76 = 62.702\)` **Note:** Intercept (aka Constant) a mathematical necessity but estimate may not be readily interpretable or make intuitive sense in all contexts --- ### The Population Regression Function (continued)  `\(\text{R } = 0.459\)` is the correlation between child and parent heights `\(\text{R Square } = 0.210\)` indicates that we can predict 21% of the variation in a child's height with parent heights Standard Error of the Estimate `\(= 2.23855\)` indicates that on average, any predicted height based on this regression equation will have an error of `\(\pm 2.23855\)` inches. Note: The smaller this estimate, the more accurate is the regression equation --- ## OLS via Population Regression Function .pull-left[  ] .pull-right[ Every value of parents' average height `\((x_i)\)` has more than one value of children's heights `\((y_i)\)` For a given value of `\(x\)`, the regression line typically runs through the mean of the `\(y\)` values ... `(see the data-set after generating predicted values)` ] --- ### Four sample regressions .pull-left[ #### Sample 1 ``` Estimate Std. Error t value Pr(>|t|) (Intercept) 33.8416 12.7259 2.659 0.0114 * sample1$parent 0.5005 0.1848 2.708 0.0101 * --- Residual standard error: 1.876 on 38 degrees of freedom Multiple R-squared: 0.1618, Adjusted R-squared: 0.1398 F-statistic: 7.336 on 1 and 38 DF, p-value: 0.01008 ``` #### Sample 2 ``` Estimate Std. Error t value Pr(>|t|) (Intercept) 22.6125 13.8820 1.629 0.11160 sample2$parent 0.6655 0.2027 3.283 0.00221 ** --- Residual standard error: 2.434 on 38 degrees of freedom Multiple R-squared: 0.221, Adjusted R-squared: 0.2005 F-statistic: 10.78 on 1 and 38 DF, p-value: 0.002207 ``` ] .pull-right[ #### Sample 3 ``` Estimate Std. Error t value Pr(>|t|) (Intercept) 8.890 12.051 0.738 0.465 sample3$parent 0.867 0.176 4.928 1.66e-05 *** --- Residual standard error: 2.178 on 38 degrees of freedom Multiple R-squared: 0.3899, Adjusted R-squared: 0.3738 F-statistic: 24.28 on 1 and 38 DF, p-value: 1.664e-05 ``` #### Sample 4 ``` Estimate Std. Error t value Pr(>|t|) (Intercept) 23.2672 14.6289 1.59 0.12001 sample4$parent 0.6620 0.2142 3.09 0.00373 ** --- Residual standard error: 2.104 on 38 degrees of freedom Multiple R-squared: 0.2008, Adjusted R-squared: 0.1798 F-statistic: 9.55 on 1 and 38 DF, p-value: 0.003732 ``` ] --- ### Four sample regressions (continued) .pull-left[  ] .pull-right[ ### So ... Since we never know the population regression function, how do we know which regression line better fits the data? We don't. In fact we never do What we can do, however, is to have faith in the theory of sampling distributions because then, so long as certain assumptions are met, a sample regression line is likely to be `similar` to the population regression line (if not identical) ] --- class: inverse, middle, center # Confidence and Prediction Intervals --- ## Estimation and Prediction `\(\hat{y}_{i}\)` is a point estimate for `\(x_{i}\)` .. the predicted value for a single observation with a given value of `\(x\)` But point estimates of predicted values tell us nothing about their precision However, `Confidence intervals` and `Prediction intervals` do Confidence interval: Interval estimate of mean value of `\(y\)` for specific value of `\(x\)` Prediction interval: Interval estimate of predicted value of `\(y\)` for specific value of `\(x\)` .pull-left[ `\(x_{p} =\)` specific value of `\(x\)` `\(y_{p} =\)` specific value of `\(y\)` for `\(x = x_{p}\)` `\(E(y_{p}) =\)` expected value of `\(y\)` given `\(x_{p}\)` `\(\hat{y}_{p} = a + b(x_{p}) =\)` point estimate of `\(E(y_{p})\)` when `\(x=x_{p}\)` ] .pull-right[ For e.g., if `\(x_{p}=14\)`, `\(\hat{y}_{p} = 60 + 5(14)=130\)` For e.g., if `\(x_{p}=2\)`, `\(\hat{y}_{p} = 60 + 5(2)=70\)` For e.g., if `\(x_{p}=8\)`, `\(\hat{y}_{p} = 60 + 5(8)=100\)` For e.g., if `\(x_{p}=20\)`, `\(\hat{y}_{p} = 60 + 5(20)=160\)` For e.g., if `\(x_{p}=26\)`, `\(\hat{y}_{p} = 60 + 5(26)=190\)` ] --- ### Confidence Interval Estimation for `\(y\)` `\(E(y_{p}) = \hat{y}_{p}\)` Variance of `\(\hat{y}_{p} = s^{2}_{\hat{y}_{p}} = s^{2}\left[\dfrac{1}{n} + \dfrac{(x_{p} - \bar{x})^{2}}{\sum(x_{i} - \bar{x})^{2}}\right]\)` Standard Deviation of `\(\hat{y}_{p} = s_{\hat{y}_{p}}=s\sqrt{\left[\dfrac{1}{n} + \dfrac{(x_{p} - \bar{x})^{2}}{\sum(x_{i} - \bar{x})^{2}} \right]}\)` For Armand's Pizza data, with `\(x_{p}=8\)`, `$$s_{\hat{y}_{p}}=13.829\sqrt{\left[\dfrac{1}{10} + \dfrac{(8 - 14)^{2}}{568}\right]} = 5.67$$` --- `\(\hat{y}_{p} \pm t_{\alpha/2}s_{\hat{y}_{p}} = 110 \pm 2.306(5.67) = 110 \pm 13.07 = 96,930; 123,070\)` When `\(x_{p}=2\)`, `\(s_{\hat{y}_{p}}=13.829\sqrt{[\frac{1}{10} + \frac{(2 - 14)^{2}}{568}]} = 13.829\sqrt{0.3667}=8.42\)` When `\(x_{p}=8\)`, `\(s_{\hat{y}_{p}}=13.829\sqrt{[\frac{1}{10} + \frac{(8 - 14)^{2}}{568}]} = 13.829\sqrt{0.1669}=5.67\)` When `\(x_{p}=14\)`, `\(s_{\hat{y}_{p}}=13.829\sqrt{[\frac{1}{10} + \frac{(14 - 14)^{2}}{568}]} = 13.829\sqrt{0.1000}=4.39\)` When `\(x_{p}=20\)`, `\(s_{\hat{y}_{p}}=13.829\sqrt{[\frac{1}{10} + \frac{(20 - 14)^{2}}{568}]} = 13.829\sqrt{0.1669}=5.67\)` When `\(x_{p}=26\)`, `\(s_{\hat{y}_{p}}=13.829\sqrt{[\frac{1}{10} + \frac{(26 - 14)^{2}}{568}]} = 13.829\sqrt{0.3667}=8.42\)` --- ### Prediction Interval for `\(y\)` In Confidence Intervals, we could be wrong on two counts -- `\(a; b\)` But, if we want to predict `\(y\)` for some `\(x\)` value not in the sample, we could be wrong on three counts -- `\(a; b; \epsilon\)` So we adjust Variance as `\(s^{2}_{ind} = s^{2} + s^{2}_{\hat{y}_{p}}\)` `$$s^{2}_{ind} = s^{2} + s^{2}\left[\dfrac{1}{n} + \dfrac{(x_{p} - \bar{x})^{2}}{\sum(x_{i} - \bar{x})^{2}}\right] = s^{2} \left[1 + \dfrac{1}{n} + \dfrac{(x_{p} - \bar{x})^{2}}{\sum(x_{i} - \bar{x})^{2}}\right]$$` `$$s_{ind} = s\sqrt{\left[1 + \dfrac{1}{n} + \dfrac{(x_{p} - \bar{x})^{2}}{\sum(x_{i} - \bar{x})^{2}}\right]}$$` --- Prediction Interval: `\(\hat{y}_{p} \pm t_{\alpha/2}s_{ind}\)` `$$s_{x_{p}} = s\sqrt{\left[1 + \dfrac{1}{n} + \dfrac{(x_{p} - \bar{x})^{2}}{\sum(x_{i} - \bar{x})^{2}}\right]}$$` `$$s_{x_{p} = 10} = 13.829\sqrt{\left[1 + \dfrac{1}{10} + \dfrac{(10 - 14)^{2}}{568}\right]}$$` `$$= 13.829\sqrt{1.1282}=14.69$$` `$$\hat{y}_{p} \pm t_{\alpha/2}s_{ind}$$` `$$110 \pm 2.306(14.69) = 110 \pm 33.8751 = 76,125; 143,875$$` --- ### Confidence & Prediction Intervals for Galton's Data <img src="conf_pred.png" width="40%" style="display: block; margin: auto;" /> Note that the Confidence Intervals are `narrower` than the Prediction Intervals Note also that the Confidence Intervals are narrowest when `\(x \approx \bar{x}\)` and `\(y \approx \bar{y}\)` --- class: inverse, middle, center # Dummy Independent Variable --- ## Regression Models with Dummy Variables At times our regression models include categorical variables that are nominal or ordinal variables (for e.g., gender, whether the subject attended a training or not, income group, ethnicity, marital status, union membership, and so on) In the regression setting variables that assume `\(0\)` and `\(1\)` values are referred to as `dummy variables` For e.g., female `\(=1\)` if the individual is a female and female `\(=0\)` if the individual is a male. This is an example of a `binary variable` For e.g., we have a variable that indicates classroom type -- regular; regular with an aide, and; small. A variable such as this can be dissected into the following dummy variables - regular `\(=1\)` if the student was in a regular classroom; regular `\(=0\)` otherwise (i.e., if the student was in a small classroom or a regular+aide classroom) - aide `\(=1\)` if the student was in a regular classroom with an aide; aide `\(=0\)` otherwise - small `\(=1\)` if the student was in a small classroom; small `\(=0\)` otherwise --- ### A Binary Variable (female) The Model is: `\(math3 = a + b_1(female) + \epsilon\)` - when female student, female `\(= 1\)`, `\(\widehat{math3} = \hat{a} + \hat{b}_1(1) = = 617.751 - 0.446 = 617.305\)` - when male student, female `\(= 0\)`, `\(\widehat{math3} = \hat{a} + \hat{b}_1(0) = \hat{a} = 617.751\)` so in this particular model the intercept is the predicted value of math3 for male students Implication? Male students scored about 0.446 points more, on average, than female students  --- ### Plotting this regression model}  --- ### School Location We have four sites -- Rural, Suburban, Urban, and Inner-city The Model is: `\(math3 = a + b_1(Rural) + b_2(Urban) + b_3(Inner-city) + \epsilon\)` Rule-of-thumb: When the categorical variable has `\(m\)` categories, we `can only include `\(m-1\)` dummy variables created from it as independent variables` The excluded group is then the `reference group` absorbed by the Constant  ---  `\(\widehat{math3} = \hat{a} + \hat{b}_1(InnerCity) + \hat{b}_2(Suburban) + b_3(Urban) + e\)` - Student in Inner-city School: `\(\widehat{math3} = \hat{a} + \hat{b}_1 = 624.866 - 24.151(1) = 600.715\)` - Student in Suburban School: `\(\widehat{math3} = \hat{a} + \hat{b}_2 = 624.866 - 7.034(1) = 617.832\)` - Student in Urban School: `\(\widehat{math3} = \hat{a} + \hat{b}_3 = 624.866 - 4.882(1) = 619.984\)` - Student in Rural School: `\(\widehat{math3} = \hat{a} = 624.866\)` Check the mean of math3 for each school-type and compare the means against these estimates --- class: inverse, middle, center # The Multiple Regression Model --- ## A Model with Two Independent Variables: `\(x_1\)` and `\(x_2\)` Population Regression Function: `\(y = a + b_1(x_1) + b_2(x_2) + \epsilon\)` Sample Regression Function: `\(y = \hat{a} + \hat{b}_1(x_1) + \hat{b}_2(x_2) + \hat{e}\)` Note: `\(\hat{b}_1\)` and `\(\hat{b}_2\)` are the `partial regression coefficients` or `the partial slope coefficients` Why are they `partial`? They are partial in the sense that ... - `\(\hat{b}_1 =\)` the impact of a unit change in `\(x_1\)` on the mean of `\(y\)` `holding` `\(x_2\)` constant - `\(\hat{b}_2 =\)` the impact of a unit change in `\(x_2\)` on the mean of `\(y\)` `holding` `\(x_1\)` constant `\(R^2 = \dfrac{SSTR}{SST}\)`, with `\(0 \leq R^2 \leq 1\)` Note: `\(R^2\)` is for multiple regression; `\(r^2\)` is for bivariate regression --- ### State of the World's Children U5MR -- No. of deaths of children 0--5 years old, per 1,000 live births Births -- Annual no. of births (thousands) Income -- Per--capita gross national income AdultLR -- Percent adults literate MaleYouthLR -- Percent of males 15--24 literate FemaleYouthLR -- Percent of females 15--24 literate Mobiles -- No. of mobile phones per 100 Internet -- No. of internet users per 100 Population -- Total population (thousands) PopulationU5 -- Total population 0--5 years old Life –- Number of years newborn children expected to live Fertility -- No. of children who would be born per woman if she lived to the end of her childbearing years and bore children at each age in accordance with prevailing age-specific fertility rates Urban -- Percent of population living in urban areas --- | Statistic | N | Mean | Std. Dev. | Min | Max| | :-- | --: | --: | --: | --: | --: | | U5MR | 194 | 35.665 | 37.452 | 2 | 182| | Births | 183 | 754.959 | 2,458.266 | 1.479 | 25,642.210| | Income | 177 | 12,351.810 | 17,867.930 | 220 | 98,860| | AdultLR | 144 | 82.123 | 19.310 | 25.308 | 99.998| | MaleYouthLR | 142 | 90.684 | 12.860 | 37.567 | 100.000| | FemaleYouthLR | 142 | 87.654 | 18.325 | 21.797 | 100.000| | Mobiles | 191 | 98.913 | 42.961 | 5.470 | 198.618| | Internet | 189 | 40.350 | 29.197 | 0.800 | 96.000| | Population | 196 | 35,898.960 | 136,432.100 | 0 | 1,377,064| | PopulationU5 | 196 | 3,323.143 | 11,269.960 | 0 | 120,580| | Life | 183 | 69.934 | 9.052 | 45.338 | 83.418| | Fertility | 183 | 2.906 | 1.450 | 1.268 | 7.574| | Urban | 196 | 56.709 | 23.669 | 11.193 | 100.000| --- ## Fitting Regression Models to these Data U5MR is the dependent variable (aka the outcome of interest) - with 1 independent variable (say, Income) - with 2 independent variables (say, Income and Fertility) - with 1 continuous independent variable (Income) and 1 categorical variable (Urban\_Country) - with an interaction between these two independent variables (Income * Urban\_Country) Some cautions ... Regression models are built on several features - Your independent variables cannot be `very highly correlated` - The dependent variable should have equal variance for every value of the independent variable - Your sample size should be large (say, at least 30 observations for every independent variable you wish to use) --- ### SPSS Output `$$U5MR = Constant + b_{1}(Income) + b_2(AdultLR)$$`  `$$U5MR = 159.170 - 0.001(Income) - 1.407(AdultLR)$$` - Holding all else constant, as Income rises by 1, U5MR is predicted to fall by 0.001 - Holding all else constant, as Income rises by 1000, U5MR is predicted to fall by 1 - Income = 1000 and AdultLR = 40? Predicted U5MR will be: `\(159.170 - 0.001(1000) - 1.407(40) = 101.89\)` - Income = 10000 and AdultLR = 80? Predicted U5MR will be: `\(159.170 - 0.001(10000) - 1.407(80) = 36.61\)` - Holding all else constant, as AdultLR increases by 1, U5MR falls by 1.407 --- ### Hypotheses `\(H_0:\)` Income has no impact on child mortality, i.e., `\(H_0: b_1 = 0\)` `\(H_A:\)` Income has an impact on child mortality, i.e., `\(H_A: b_1 \neq 0\)` `\(H_0:\)` Adult Literacy has no impact on child mortality, i.e., `\(H_0: b_2 = 0\)` `\(H_A:\)` Adult Literacy has an impact on child mortality, i.e., `\(H_A: b_2 \neq 0\)` `\(H_0:\)` As Income increases child mortality stays the same or increases, i.e., `\(H_0: b_1 \geq 0\)` `\(H_A:\)` As Income increases child mortality decreases (i.e., `\(H_A: b_1 < 0\)` `\(H_0:\)` As Adult Literacy increases child mortality stays the same or increases, i.e., `\(H_0: b_2 \geq 0\)` `\(H_A:\)` As Adult Literacy increases child mortality decreases, i.e., `\(H_A: b_2 < 0\)` **Note:** Two-tailed when we don't know what to expect but one-tailed when we have very specific impacts we expect to see --- ### R-squared and more  Adjusted R Squared `\(= 0.604\)` indicates that we can explain about 60.4% of the variation in U5MR with Income and Adult Literacy Std. Error of the Estimate `\(= 24.51773\)` indicates that on average, predictions generated by this regression model would have an error of `\(\pm 24.51773\)` ... about 25 fewer/more deaths per 1000 live births than would actually occur How could we do better? ... by fitting more variables Let us keep Income but replace AdultLR with FemaleYouthLR + Fertility + Urban ---  Note that the Adjusted R Squared has gone up to 0.762 so now we are explaining about 76.2% of the variation in U5MR ... an improvement over the previous model Average prediction error has dropped to 18.99929 as well Income is no longer `statistically significant` Urban is not statistically significant but FemaleYouthLR & Fertility are statistically significant --- ### Trimmed version of the Previous Regression  --- ### Interpreting a Dummy Variable  U5MR = `\(57.124 - 0.573(FemaleYouthLR) + 15.119(Fertility) - 8.498(UrbanRural)\)` UrbanRural = 1 implies an urbanized country. So the finite difference between an urban and a rural country? Urban Country: `\(57.124 - 0.573(FemaleYouthLR) + 15.119(Fertility) - 8.498(1)\)` Rural Country: `\(57.124 - 0.573(FemaleYouthLR) + 15.119(Fertility) - 8.498(0)\)` `\(= 57.124 - 0.573(FemaleYouthLR) + 15.119(Fertility)\)` `Holding all else constant`, urban countries have 8.498 fewer deaths per 1000 live births than do rural countries. --- class: inverse, middle, center # Interaction Effects --- ## Interaction Effects? At times it may be that the effect of an independent variable is not constant across the values of the other independent variable. For example, maybe at low levels of education there is no difference in hourly wages of men and women. However, a gap is seen only for those with more than a high school degree This may be a suspicion, a hypothesis that we would like to test. if we wish to do so then we need to modify the regression model Interactions are not easy to deal with here but we will look at three common types of interactions - An interaction between two categorical variables - An interaction between one categorical variable and one continuous variable - An interaction between two continuous variables Interactions ought to be specified on the basis of theory (preferred). However, do not hesitate to test for them if initial exploratory analysis (descriptive) of the data suggests interesting patterns `Interactions best understood and described via suitable graphs` --- ### An Interaction Between Two Categorical Variables Let `\(y = a + b_1(x_1) + b_2(x_2) + b_3(x_3) + \epsilon\)` `\(\ldots\)` where `\(y\)` is a continuous variable (wage); `\(x_1\)` is a dummy variable (female) that assumes two values; `\(x_2\)` is a dummy variable (single) that assumes two values; and `\(x_3 = (x_1) \times (x_2)\)` `$$wage = a + b_1(female) + b_2(single) + b_3(single \times female) + \epsilon$$`  Single Female: `\(= 10.876 - 3.192 - 2.521 + 3.097 = 8.260\)` Married Female: `\(= 10.876 - 3.192 =\)` Single Male: `\(= 10.876 - 2.521 = 8.355\)` (Constant) `\(=?\)` Married Male ... so average hourly wage is 10.876 for Married Male --- ### One Categorical and One Continuous Variable `$$wage = a + b_1(female) + b_2(age) + b_3(female \times age) + \epsilon$$`  No main effect of Female (p-value = 0.384) Main effect of age (p-value = 0.000) Interaction effect of Female and age (p-value = 0.009) `... as age increases, the wage-gap worsens for females` ---  --- `$$wage = 5.282 + 1.231(female) + 0.131(age) - 0.095(female \times age)$$` Calculate Minimum `\((18)\)`, Median `\((35)\)`, Maximum `\((64)\)` of age Set age at Minimum and calculate predicted hourly wage for Men versus Women Set age at Median and calculate predicted hourly wage for Men versus Women Set age at Maximum and calculate predicted hourly wage for Men versus Women You could also calculate the first `\((28)\)` and third quartiles `\((44)\)` of age, `\(\pm 1\)` standard deviation `\((\pm 11.72657)\)` of age, `\(\pm 2\)` standard deviations `\((23.45315)\)` of age, and then generate predicted wage for Men versus Women | | age | age | age | age | age | | :-- | --: | --: | --: | --: | --: | | Sex | 18 | 28 | 35 | 44 | 64| | Female | 7.162694 | 7.523649 | 7.776317 | 8.101176 | 8.823084| | Male | 7.639764 | 8.949691 | 9.866640 | 11.045575 | 13.665429| | Difference | 0.4770696 | 1.4260426 | 2.0903237 | 2.9443994 | 4.8423453| Note the increasing wage-gap as age increases --- ### Two Continuous Variables `\(y = a + b_1(x_1) + b_2(x_2) + b_3(x_3) + \epsilon\)` where `\(x_3 = (x_1) \times (x_2)\)` Now if `\(b_3 >0\)`, the higher is `\(x_1\)`, the more the effect of `\(x_2\)` on `\(y\)` and likewise, the higher is `\(x_2\)`, the more the effect of `\(x_1\)` on `\(y\)` If `\(b_3 < 0\)` then effects are reversed (i.e., the higher is `\(x_i\)` the less the effect of `\(x_j\)` on `\(y\)`) Note also that `\(b_1\)` and `\(b_2\)` now reflect `conditional relationships`: `\(b_1\)` is the effect of `\(x_1\)` on `\(y\)` when `\(x_2 = 0\)`; `\(b_2\)` is the effect of `\(x_2\)` on `\(y\)` when `\(x_1 = 0\)` When interpreting our regression coefficients, we are forced to say that the effect of a unit change in one variable depends upon the value of the other variable As a rule, if you have an interaction effect in your model, you will want to include the `\(x_1\)` and `\(x_2\)` as well `even if they are not statistically significant` Calculating impacts of variables ... - Hold `\(x_i\)` at its mean and tweak `\(x_j\)` by `\(\pm 1\)`, `\(\pm 2\)` standard deviations, or - Hold `\(x_i\)` at its mean and change the other by discrete units (for e.g., for variable that ranges from `\(0\%\)` to `\(100\%\)` you tweak from MIN to MAX by `\(10\%\)`) `Do not tweak` `\(x_i\)` `or` `\(x_j\)` `to values that are not in the sample` ---  Calculate `Minimum, Median, Maximum` for **age** and for **exper**, respectively Now hold age at Minimum and tweak exper Now hold exper at Minimum and tweak age Repeat by setting each, in turn, at Median, then at Maximum With missing data, all descriptive statistics must be calculated for the `estimation sample` and not the full sample since if you have missing data, the descriptive statistics of the estimation sample can differ from those of the full sample --- `$$wage = -12.193 + 0.957(age) - 0.610(exper) - 0.004(age \times exper)$$` | | age | age | age | age | age | | :-- | --: | --: | --: | --: | --: | | exper | 18 | 28 | 35 | 44 | 64 | | 0 | 5.033918 | 14.604271 | 21.303518 | 29.916835 | 49.057541 | | 8 | -0.4178636 | 8.8359545 | 15.3136271 | 23.6420634 | 42.1496995 | | 15 | -5.188172 | 3.788678 | 10.072473 | 18.151638 | 36.105338 | | 26 | -12.684372 | -4.142757 | 1.836373 | 9.523827 | 26.607057 | | 55 | -32.447081 | -25.052904 | -19.876980 | -13.222221 | 1.566133 | ### What seems odd about this picture?? --- ### Feasible in-sample values - age = 18, exper = 0 - age = 28, exper = (Min = 5, Max = 15) - age = 35, exper = (Min = 11, Max = 21) - age = 44, exper = (Min = 22, Max = 29) - age = 64, exper = (Min = 40, Max = 65) Important to scan the data to avoid impossible predictions being generated. Better yet, generate predicted values' plots such as the one that follows. ---


{% load staticfiles i18n %}
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make a type specimen book.
{% blocktrans %}We have sent an e-mail to you for verification. Follow the link provided to finalize the signup process. Please contact us if you do not receive it within a few minutes.{% endblocktrans %}
{% trans "Login now" %}


| FILE |
DESCRIPTION |
TAGS |
| acyclic |
ACYCLIC Returns true iff the graph has no (directed) cycles. |
|
| allFamilies |
Return a cell array of the families of every node in the dag G. |
|
| ancestors |
Recursively find all ancestors of a a node, (parents, grandparents, ... etc) |
|
| ancestralGraph |
Construct the ancestral graph for the variables V in the dag G |
|
| bestFirstElimOrder |
Greedily search for an optimal elimination order. |
|
| children |
Return the indices of a node's children in sorted order |
|
| dfs_test |
Test depth first search |
|
| dfsearchPMTK |
DFS Perform a depth-first search of the graph starting from 'start' |
|
| dfsPMTK |
DFS Perform a depth-first search of the graph starting from 'start'. |
|
| dijkstraKay |
DIJK Shortest paths from nodes 's' to nodes 't' using Dijkstra algorithm. |
|
| graphLeaves |
Return the leaves in a directed graph, (nodes with no children) |
|
| graphRoots |
Return the roots in a directed graph, (nodes with no parents) |
|
| isTopoOrdered |
Return true iff the directed graph G is topologically ordered |
|
| isWeaklyConnected |
Check if a directed graph is (at least) weakly connected |
|
| maxCardinalitySearch |
Compute the perfect elimination order of a chordal graph |
|
| mcsCliques2Jtree |
input: clqs, a 1 x t cell array of nonempty cliques |
|
| minSpanTreeDemo |
Demo of minimum spanning tree |
|
| minSpanTreeKruskal |
Kruskal's algorithm for MST |
|
| minSpanTreePrim |
set absent edges to infinite weight |
|
| minSpanTreePrimTieBreak |
Find the minimum spanning tree using Prim's algorithm. |
|
| minWeightElimOrder |
Greedily find an elimination order which induces the lightest clique. |
|
| mk_all_dags |
MK_ALL_DAGS generate all DAGs on N variables |
|
| mkChain |
Make a 1D chain-structured graph of length T |
|
| mkChordal |
Eliminate nodes in specified order, and ensure uneliminated |
|
| mkGrid |
Create an M by N undirected grid as an adjacency matrix in column order |
|
| mkRndDag |
Make a random, directed, weakly connected, topologically ordered, acyclic graph |
|
| mkRootedTree |
Adjmat should be the adjacency matrix of an undirected tree |
|
| mkSymmetric |
Fill in 0 entries of a matrix with their "mirror image" |
|
| mkTreeDag |
Create a K-ary tree structured dag |
|
| moralizeGraph |
Ensure that for every child, all its parents are married (connected) |
|
| ndags |
Computes number of dags on N nodes using Robinson's 1973 recursion |
|
| nedges |
Return the number of edges in the graph G |
|
| neighbors |
NEIGHBORS Find the parents and children of a node in a graph. |
|
| parents |
Return the list of parents of node i |
|
| perfectElimOrder |
Compute the perfect elimination order of a chordal graph |
|
| pmtkGraphIsDag |
Returns true iff the graph has no directed cycles. |
|
| reachability_graph |
REACHABILITY_GRAPH C(i,j) = 1 iff there is a path from i to j in graph G |
|


EVENT HORIZON 1997 A film review by Timothy Voon Copyright 1997 Timothy Voon 8 :-( :-( :-( :-( :-( :-( :-( :-( for potentially the worst movie I've seen this year
Cast: Laurence Fishburne, Sam Neill, Kathleen Quinlan, Joely Richardson, Richard T. Jones, Jack Noseworthy, Jason Isaacs, Sean Pertwee Director: Paul Anderson Screenplay: Philip Eisner
This movie works on pure horror and special effects. Both of which score zilch when the mind is continually bombarded by wave upon wave of shocking graphic gore. Is there a story line? Yes and no. YES, it is the tale of an exploration ship known as the "Event Horizon", capable of travel through a self-generated Black Hole. After being missing for seven years, it reappears. Apparently the ship has been to Hell and back, and NO it shouldn't have made a re-appearance.
There seems to be no limit to the human imagination when it comes to horror. Sam Neil's face is mutilated to the point where Freddy Kruger could be mistaken for Ronald McDonald in comparison. The simple scarred face is no longer shocking enough. The eyes must also be gorged out for added effect. Why not go all the way and remove the nose and tongue as well. That way we would be spared the mumbo jumbo dialogue, and the putrid stench that this movie creates. Let me mention a few horrific moments of wasted movie time.
The "Silence of the Lambs" scene. This time the female gender is spared the skinning process. Instead we have an average sized Caucasian male who is skinned alive, before his carcass is poetically sprawled on the butchering table. The rest of him dangles on a hook above the body, giving "hung and dry" a new meaning.
The "Carrie" scene - a simple bucket of blood has become cliche. This time we have a torrential river of crimson red, which floods and submerges its characters. This is definitely what the blood bank needs.
Now for something not seen too often in Mainstream cinema. The "Body Mutilation Orgy Scene", which was unsuspectingly thrown at the audience. We have the naked, mutilated bodies of the missing crew running about the ship, ripping each other's insides out; and I don't just mean the eyes. I figured that this must have been the substitute sex scene, cause the actors get to take their clothes off.
I won't forget to mention the "Blow the boy from the inside out" scene. Where once again we watch a nice young man having his eyes and veins explode in a pressure lock. There we go with the eyes again. Fetish, fetish. fetish.
Now tell me, was I meant to enjoy the movie, or merely gag in the aisle where I was sitting. I'm not a great connoisseur of food, but I guess what is considered one man's vomit, is another man's creme de la creme. Believe me, this movie leaves a very bitter taste in the mouth.
Are the actors worth mentioning? No. After portraying such used and abused characters, whose bodies have no less been put through a meat grinder, anonymity would be the kindest option. As for the director Paul Anderson, enough with the exploding eyes and bloody torrents, we have no wish to view the best left unseen effects of playing "Mortal Kombat" - a much better movie if you ask me. If I wanted to scare myself, I could have stayed at home and played "Peek-a-Boo" with a one year-old child.
Timothy Voon e-mail<EMAIL_ADDRESS>The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews


|
UE4Bson
Unreal Engine 4 plugin for basic Bson support.
|
A parent class for different types of Bson values. More...
#include <BsonValue.h>
Public Member Functions | |
| double | AsNumber () const |
| FString | AsString () const |
| bool | AsBool () const |
| const TArray< TSharedPtr< FBsonValue > > & | AsArray () const |
| virtual const TSharedPtr< FBsonObject > & | AsObject () const |
| virtual bool | TryGetNumber (double &OutDouble) const |
| bool | TryGetNumber (int32 &OutNumber) const |
| bool | TryGetNumber (uint32 &OutNumber) const |
| bool | TryGetNumber (int64 &OutNumber) const |
| virtual bool | TryGetString (FString &OutString) const |
| virtual bool | TryGetBool (bool &OutBool) const |
| virtual bool | TryGetArray (const TArray< TSharedPtr< FBsonValue >> *&OutArray) const |
| virtual bool | TryGetObject (const TSharedPtr< FBsonObject > *&Object) const |
| bool | IsNull () const |
| void | AsArgumentType (double &Value) |
| void | AsArgumentType (FString &Value) |
| void | AsArgumentType (bool &Value) |
| void | AsArgumentType (TArray< TSharedPtr< FBsonValue >> &Value) |
| void | AsArgumentType (TSharedPtr< FBsonObject > &Value) |
| bool | operator== (const FBsonValue &Rhs) const |
Static Public Member Functions | |
| static bool | CompareEqual (const FBsonValue &Lhs, const FBsonValue &Rhs) |
Public Attributes | |
| EBson | Type |
Protected Member Functions | |
| virtual FString | GetType () const =0 |
| void | ErrorMessage (const FString &InType) const |
Static Protected Attributes | |
| static const TArray< TSharedPtr< FBsonValue > > | EMPTY_ARRAY |
| static const TSharedPtr< FBsonObject > | EMPTY_OBJECT |
A parent class for different types of Bson values.
A base class for easy usage and comparison of Bson values. Only it's derived classes should actually be used.
|
inline |
Get a field of the same type as the argument. Mind that this uses the AsType functions which will return specified values if conversion isn't possible.
| Value | a reference of the desired type to put the converted value into. |
| const TArray<TSharedPtr<FBsonValue> >& FBsonValue::AsArray | ( | ) | const |
Returns this value as a TArray, logging an error and returning an empty TArray if not possible.
| bool FBsonValue::AsBool | ( | ) | const |
Returns this value as a boolean, logging an error and returning false if not possible.
| double FBsonValue::AsNumber | ( | ) | const |
Returns this value as a double, logging an error and returning zero if not possible.
|
virtual |
Returns this value as an FBsonObject, throwing an error if this is not possible.
| FString FBsonValue::AsString | ( | ) | const |
Returns this value as a string, logging an error and returning an empty string if not possible.
|
static |
Checks whether to FBsonValues are equal.
| Lhs | first value to compare. |
| Rhs | second value to compare. |
|
inline |
|
inline |
Overloaded == operator that uses the CompareEqual() method for two FBsonValues.
|
inlinevirtual |
Tries to convert this value to a TArray of TSharedPtr<FBsonValue>, returning false if not possible.
| OutArray | a reference to write the converted TArray into. |
Reimplemented in FBsonValueArray.
|
inlinevirtual |
Tries to convert this value to an boolean, returning false if not possible.
| OutBool | a reference to write the converted boolean into. |
Reimplemented in FBsonValueBoolean, FBsonValueNumber, and FBsonValueString.
|
inlinevirtual |
Tries to convert this value to a double, returning false if not possible.
| OutDouble | a reference to write the converted number into. |
Reimplemented in FBsonValueBoolean, FBsonValueNumber, and FBsonValueString.
| bool FBsonValue::TryGetNumber | ( | int32 & | OutNumber | ) | const |
Tries to convert this value to an int32, returning false if not possible.
| OutNumber | a reference to write the converted number into. |
| bool FBsonValue::TryGetNumber | ( | uint32 & | OutNumber | ) | const |
Tries to convert this value to a uint32, returning false if not possible.
| OutNumber | a reference to write the converted number into. |
| bool FBsonValue::TryGetNumber | ( | int64 & | OutNumber | ) | const |
Tries to convert this value to an int64, returning false if not possible.
| OutNumber | a reference to write the converted number into. |
|
inlinevirtual |
Tries to convert this value to an FBsonObject, returning false if not possible.
| Object | a pointer to a reference to write the converted Object into. |
Reimplemented in FBsonValueObject.
|
inlinevirtual |
Tries to convert this value to an FString, returning false if not possible.
| OutString | a reference to write the converted FString into. |
Reimplemented in FBsonValueBoolean, FBsonValueNumber, and FBsonValueString.


The animation-fill-mode property specifies a style for the element when the animation is not playing (before it starts, after it ends, or both). CSS animations do not affect the element before the first keyframe is played or after the last keyframe is played. The animation-fill-mode property can override this behavior.
Excercise: Move animate: change the fill mode of the element.
Solution: Solution code


{% comment %}
You'll get a link to the sample immediately after signing up for the newsletter.
Success! Now check your email to confirm your subscription.
There was an error submitting your subscription. Please try again.


Sire and breed your CryptoKitties with friends.
Please login your Kitty-Account in
Metamask
...
Please wait a bit...
♂Approve Siring
Breed Kitties♀
Check Breeding
Breed
Breeding Approval:
Before breeding with your friends' kitties, one needs to approve siring first!
Approve Siring
Eth-Address of your friend ♀
Kitty-ID
Approve
Approve Siring
Thank you for a cute tip:


Trevor Ogg
About
Portfolio
Contact
Contact
Name
Email address
Message
Submit
Connect with me
Copyright ©2018 Trevor Ogg


Returns information about a button or buttons on a toolbar. Use GET.TOOL to get information about a button to use with functions that add, delete, or alter buttons.
Syntax
GET.TOOL(type_num, bar_id, position)
Type_num specifies what type of information you want GET.TOOL to return.
| Type_num | Returns |
| 1 | The button's ID number. Gaps are represented by zeros. |
| 2 | The reference of the macro assigned to the button. If no macro is assigned, GET.TOOL returns the #N/A error value. |
| 3 | If the button is down, returns TRUE. If the button is up, returns FALSE. |
| 4 | If the button is enabled, returns TRUE. If the button is disabled, returns FALSE. |
| 5 | A logical value indicating the type of the face on the button: |
| TRUE = bitmap | |
| FALSE = a default button face | |
| 6 | The help_text reference associated with the custom button. If the button is built-in, returns #N/A. |
| 7 | The balloon_text reference associated with the custom button. If the button is built-in, returns the #N/A error value. |
| 8 | The Help context string associated with the custom button. |
| 9 | The Tip_text associated with the custom button. |
Bar_id specifies the number or name of the toolbar for which you want information. For detailed information about bar_id, see ADD.TOOL.
Position specifies the position of the button on the toolbar. Position starts with 1 at the left side (if horizontal) or at the top (if vertical). A position can be occupied by a button or a gap.
Example
The following macro formula requests the help text associated with the third button in Toolbar2:
GET.TOOL(6, "Toolbar2", 3)
Related Functions
ADD.TOOL Adds one or more buttons to a toolbar
DELETE.TOOL Deletes a button from a toolbar
ENABLE.TOOL Enables or disables a button on a toolbar
GET.TOOLBAR Retrieves information about a toolbar
Return to index


This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured content or information.
This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured content or information.
This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured
content or information.
This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured
content or information.
This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured
content or information.
This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured
content or information.
This is a simple hero unit, a simple
umbotron-style component for calling extra attention to featured
content or information.


|
b2
|
#include <stddef.h>
#include <assert.h>
#include <float.h>
Go to the source code of this file.
Classes | |
| struct | b2Version |
Macros | |
| #define | b2DEBUG |
| #define | B2_NOT_USED(x) ((void)(x)) |
| #define | b2Assert(A) assert(A) |
| #define | b2_maxFloat FLT_MAX |
| #define | b2_epsilon FLT_EPSILON |
| #define | b2_pi 3.14159265359f |
| #define | b2_maxManifoldPoints 2 |
| #define | b2_maxPolygonVertices 8 |
| #define | b2_aabbExtension 0.1f |
| #define | b2_aabbMultiplier 2.0f |
| #define | b2_linearSlop 0.005f |
| #define | b2_angularSlop (2.0f / 180.0f * b2_pi) |
| #define | b2_polygonRadius (2.0f * b2_linearSlop) |
| #define | b2_maxSubSteps 8 |
| Maximum number of sub-steps per contact in continuous physics simulation. | |
| #define | b2_maxTOIContacts 32 |
| Maximum number of contacts to be handled to solve a TOI impact. | |
| #define | b2_velocityThreshold 1.0f |
| #define | b2_maxLinearCorrection 0.2f |
| #define | b2_maxAngularCorrection (8.0f / 180.0f * b2_pi) |
| #define | b2_maxTranslation 2.0f |
| #define | b2_maxTranslationSquared (b2_maxTranslation * b2_maxTranslation) |
| #define | b2_maxRotation (0.5f * b2_pi) |
| #define | b2_maxRotationSquared (b2_maxRotation * b2_maxRotation) |
| #define | b2_baumgarte 0.2f |
| #define | b2_toiBaugarte 0.75f |
| #define | b2_timeToSleep 0.5f |
| The time that a body must be still before it will go to sleep. | |
| #define | b2_linearSleepTolerance 0.01f |
| A body cannot sleep if its linear velocity is above this tolerance. | |
| #define | b2_angularSleepTolerance (2.0f / 180.0f * b2_pi) |
| A body cannot sleep if its angular velocity is above this tolerance. | |
Functions | |
| void * | b2Alloc (int32 size) |
| Implement this function to use your own memory allocator. | |
| void | b2Free (void *mem) |
| If you implement b2Alloc, you should also implement this function. | |
| void | b2Log (const char *string,...) |
| Logging function. | |
Variables | |
| b2Version | b2_version |
| Current version. | |
Global tuning constants based on meters-kilograms-seconds (MKS) units.
| #define b2_aabbExtension 0.1f |
This is used to fatten AABBs in the dynamic tree. This allows proxies to move by a small amount without triggering a tree adjustment. This is in meters.
| #define b2_aabbMultiplier 2.0f |
This is used to fatten AABBs in the dynamic tree. This is used to predict the future position based on the current displacement. This is a dimensionless multiplier.
| #define b2_angularSlop (2.0f / 180.0f * b2_pi) |
A small angle used as a collision and constraint tolerance. Usually it is chosen to be numerically significant, but visually insignificant.
| #define b2_baumgarte 0.2f |
This scale factor controls how fast overlap is resolved. Ideally this would be 1 so that overlap is removed in one time step. However using values close to 1 often lead to overshoot.
| #define b2_linearSlop 0.005f |
A small length used as a collision and constraint tolerance. Usually it is chosen to be numerically significant, but visually insignificant.
| #define b2_maxAngularCorrection (8.0f / 180.0f * b2_pi) |
The maximum angular position correction used when solving constraints. This helps to prevent overshoot.
| #define b2_maxLinearCorrection 0.2f |
The maximum linear position correction used when solving constraints. This helps to prevent overshoot.
| #define b2_maxManifoldPoints 2 |
The maximum number of contact points between two convex shapes. Do not change this value.
| #define b2_maxPolygonVertices 8 |
The maximum number of vertices on a convex polygon. You cannot increase this too much because b2BlockAllocator has a maximum object size.
| #define b2_maxRotation (0.5f * b2_pi) |
The maximum angular velocity of a body. This limit is very large and is used to prevent numerical problems. You shouldn't need to adjust this.
| #define b2_maxTranslation 2.0f |
The maximum linear velocity of a body. This limit is very large and is used to prevent numerical problems. You shouldn't need to adjust this.
| #define b2_polygonRadius (2.0f * b2_linearSlop) |
The radius of the polygon/edge shape skin. This should not be modified. Making this smaller means polygons will have an insufficient buffer for continuous collision. Making it larger may create artifacts for vertex collision.
| #define b2_velocityThreshold 1.0f |
A velocity threshold for elastic collisions. Any collision with a relative linear velocity below this threshold will be treated as inelastic.


Frozen Solid.
Uranus, the seventh planet from the sun, may initially look like a bland, blue-green ball. But there's a lot to love about the icy giant, from its 13 rings to its 27 known moons to the fact that it may even rain diamonds from its hazy atmosphere.
Uranus was the first of three planets in our solar system discovered thanks to the invention of the telescope. In March 1781 British astronomer Sir William Herschel spotted the glinting object in the sky, initially mistaking it for a comet. When it was accepted as a planet years later, Herschel lobbied to call the discovery Georgium Sidus after King George III. Instead, it got its official name from the Greek god of the sky, Uranus, who was both son and husband to Gaea, the goddess of Earth.
The planet Uranus was so hard to find in part because it is a whopping 1.8 billion miles away. But it is actually the third-largest planet in our solar system, and is roughly four times wider than Earth.
 Uranus owes its vibrant blue-green hues not from unusual oceans but from an upper atmosphere flush with methane, which absorbs the sun's red light and scatters blue light back to our eyes.ns someone standing on Mercury would see the sun start to rise, then briefly set, then rise again all within the same day.


In Ruby, a method is a series of statements that perform a specific tasks. A method must start with lower case letters, it can include a _(underscore) or !(exclamation point). All methods start with the keyword, "def" followed by the method name. The next line will include the block of code that will perform the task. Lastly, the method must be completed with the keyword "end"
In Javascript, a function is similar to a Ruby method. A function is piecce of program wrapped in a value. Such values can be applied in order to run the wrapped program. You can call a function by putting () after an expression that produces a function value. All functions start with the word "function
As you can see function and methods are pretty simiar. The major difference has to do with synax! Good luck on your journey to mastering JS.


Top Rated Items of the past 30 days
See the best recent additions to the site!
{% extends "main.html" %} {% block title %} - Awards {% endblock %} {% block scripts %} {% endblock %} {% block content %}
Browse every item submitted for this month's contest theme.
This month's theme is: {{contest.theme}}
No contest is currently running right now. Check the front page for new contest announcements in the future!
If you're new to contests, check out the contest rules.


Coach Usage
Training an Agent
Single-threaded Algorithms
This is the most common case. Just choose a preset using the -p
flag and press enter.
Example:
python coach.py -p CartPole_DQN
Multi-threaded Algorithms
Multi-threaded algorithms are very common this days.
They typically achieve the best results, and scale gracefully with the number of threads.
In Coach, running such algorithms is done by selecting a suitable preset, and choosing the number of threads to run using the -n
flag.
Example:
python coach.py -p CartPole_A3C -n 8
Evaluating an Agent
There are several options for evaluating an agent during the training:
-
For multi-threaded runs, an evaluation agent will constantly run in the background and evaluate the model during the training.
-
For single-threaded runs, it is possible to define an evaluation period through the preset. This will run several episodes of evaluation once in a while.
Additionally, it is possible to save checkpoints of the agents networks and then run only in evaluation mode.
Saving checkpoints can be done by specifying the number of seconds between storing checkpoints using the -s
flag.
The checkpoints will be saved into the experiment directory.
Loading a model for evaluation can be done by specifying the -crd
flag with the experiment directory, and the --evaluate
flag to disable training.
Example:
python coach.py -p CartPole_DQN -s 60
python coach.py -p CartPole_DQN --evaluate -crd CHECKPOINT_RESTORE_DIR
Playing with the Environment as a Human
Interacting with the environment as a human can be useful for understanding its difficulties and for collecting data for imitation learning.
In Coach, this can be easily done by selecting a preset that defines the environment to use, and specifying the --play
flag.
When the environment is loaded, the available keyboard buttons will be printed to the screen.
Pressing the escape key when finished will end the simulation and store the replay buffer in the experiment dir.
Example:
python coach.py -p Breakout_DQN --play
Learning Through Imitation Learning
Learning through imitation of human behavior is a nice way to speedup the learning. In Coach, this can be done in two steps -
-
Create a dataset of demonstrations by playing with the environment as a human. After this step, a pickle of the replay buffer containing your game play will be stored in the experiment directory. The path to this replay buffer will be printed to the screen. To do so, you should select an environment type and level through the command line, and specify the
--play
flag.Example:
python coach.py -et Doom -lvl Basic --play
-
Next, use an imitation learning preset and set the replay buffer path accordingly. The path can be set either from the command line or from the preset itself.
Example:
python coach.py -p Doom_Basic_BC -cp='agent.load_memory_from_file_path=\"<experiment dir>/replay_buffer.p\"'
Visualizations
Rendering the Environment
Rendering the environment can be done by using the -r
flag.
When working with multi-threaded algorithms, the rendered image will be representing the game play of the evaluation worker.
When working with single-threaded algorithms, the rendered image will be representing the single worker which can be either training or evaluating.
Keep in mind that rendering the environment in single-threaded algorithms may slow the training to some extent.
When playing with the environment using the --play
flag, the environment will be rendered automatically without the need for specifying the -r
flag.
Example:
python coach.py -p Breakout_DQN -r
Dumping GIFs
Coach allows storing GIFs of the agent game play.
To dump GIF files, use the -dg
flag.
The files are dumped after every evaluation episode, and are saved into the experiment directory, under a gifs sub-directory.
Example:
python coach.py -p Breakout_A3C -n 4 -dg
Switching between deep learning frameworks
Coach uses TensorFlow as its main backend framework, but it also supports neon for some of the algorithms.
By default, TensorFlow will be used. It is possible to switch to neon using the -f
flag.
Example:
python coach.py -p Doom_Basic_DQN -f neon
Additional Flags
There are several convenient flags which are important to know about.
Here we will list most of the flags, but these can be updated from time to time.
The most up to date description can be found by using the -h
flag.
| Flag | Type | Description |
|---|---|---|
-p PRESET , `--preset PRESET |
string | Name of a preset to run (as configured in presets.py) |
-l , --list |
flag | List all available presets |
-e EXPERIMENT_NAME , --experiment_name EXPERIMENT_NAME |
string | Experiment name to be used to store the results. |
-r , --render |
flag | Render environment |
-f FRAMEWORK , --framework FRAMEWORK |
string | Neural network framework. Available values: tensorflow, neon |
-n NUM_WORKERS , --num_workers NUM_WORKERS |
int | Number of workers for multi-process based agents, e.g. A3C |
--play |
flag | Play as a human by controlling the game with the keyboard. This option will save a replay buffer with the game play. |
--evaluate |
flag | Run evaluation only. This is a convenient way to disable training in order to evaluate an existing checkpoint. |
-v , --verbose |
flag | Don't suppress TensorFlow debug prints. |
-s SAVE_MODEL_SEC , --save_model_sec SAVE_MODEL_SEC |
int | Time in seconds between saving checkpoints of the model. |
-crd CHECKPOINT_RESTORE_DIR , --checkpoint_restore_dir CHECKPOINT_RESTORE_DIR |
string | Path to a folder containing a checkpoint to restore the model from. |
-dg , --dump_gifs |
flag | Enable the gif saving functionality. |
-at AGENT_TYPE , --agent_type AGENT_TYPE |
string | Choose an agent type class to override on top of the selected preset. If no preset is defined, a preset can be set from the command-line by combining settings which are set by using --agent_type , --experiment_type , --environemnt_type |
-et ENVIRONMENT_TYPE , --environment_type ENVIRONMENT_TYPE |
string | Choose an environment type class to override on top of the selected preset. If no preset is defined, a preset can be set from the command-line by combining settings which are set by using --agent_type , --experiment_type , --environemnt_type |
-ept EXPLORATION_POLICY_TYPE , --exploration_policy_type EXPLORATION_POLICY_TYPE |
string | Choose an exploration policy type class to override on top of the selected preset.If no preset is defined, a preset can be set from the command-line by combining settings which are set by using --agent_type , --experiment_type , --environemnt_type |
-lvl LEVEL , --level LEVEL |
string | Choose the level that will be played in the environment that was selected. This value will override the level parameter in the environment class. |
-cp CUSTOM_PARAMETER , --custom_parameter CUSTOM_PARAMETER |
string | Semicolon separated parameters used to override specific parameters on top of the selected preset (or on top of the command-line assembled one). Whenever a parameter value is a string, it should be inputted as '\"string\"' . For ex.: "visualization.render=False; num_training_iterations=500; optimizer='rmsprop'" |


Software applications are built in layers. There is common functionality that is sometimes needed across layers - logging, performance tracing etc.
How do you implement these common features?
You will learn?
- What Is Aspect Oriented Programming?
- What are the important concepts behind Aspect-Oriented Programming?
- What are the situations where AOP is used?
- Why is AOP needed?
- What are the best Java frameworks to implement AOP?
What Is Aspect Oriented Programming?
In order to understand what Aspect Oriented Programming (AOP) is all about, let’s first talk about layered architecture, and something called cross-cutting concerns.
What is a Layered Architecture
Whenever we design and develop a large software application, we make use of a layered architecture. For instance, in a web application, it is quite common to see an architecture similar to the following:
Here, we see that the application is organized into a Web layer, a Business layer, and a Data layer.
Understanding Cross Cutting Concerns
In a layered architecture, there are specific parts that are common to all these different layers. Such parts include:
- Logging
- Security
- Performance
- Auditing
All these features are applicable across layers, hence it makes sense to implement them in a common way.
Let’s say you want to implement logic to find out how much time each method takes to execute, in each of the three layers (Web, Business and Data) above.
That’s where AOP steps in.
An Example Of AOP
Let’s now look at a simple example where we apply AOP.
@Component
class HiByeService {
public void sayHi(String name) {
System.out.println("Hi " + name);
}
public void sayBye() {
System.out.println("Bye");
}
public String returnSomething() {
return "Hi Bye";
}
}
The `class` ` ` ` ` `HiByeService` ` ` has a few methods such as ` ` `sayHi()` ` `, ` ` `sayBye()` ` ` and ` ` `returnSomething()`
defined within it.
We want to do a few computations by taking up each of these methods, by turn at the following stages:
- Do something before the method begins execution
- Do something after the method completes execution
- Track how much time the method takes during its execution
Here we take `HiByeService`
as a specific example to work with. The same could be done across several classes that make up such an application.
Let’s take each of these computations and look at them in some detail.
Doing Stuff Before Execution
Have a look at the following AOP code:
@Aspect
@Component
class MyAspect {
@Before("execution(* HiByeService.*(..))")
public void before(JoinPoint joinPoint) {
System.out.print("Before ");
System.out.print(joinPoint.getSignature().getName());
System.out.println(Arrays.toString(joinPoint.getArgs()));
}
We first define an aspect with the annotation `@Aspect` ` ` for the ` ` `class` ` ` ` ` `MyAspect` ` `. Within it is another annotation, ` ` `@Before` ` ` that describes the method ` ` `before()` ` `. The idea of this aspect is that whatever logic lies in the ` ` `before()` ` ` body, is executed before any method of ` ` `HiByeService` ` ` is run. Note that in the ` ` `@Before`
annotation, a package name could also be mentioned instead of a class name. This aspect would then be executed before any method in the entire package.
Doing Stuff After Execution
Similar to this, it is also possible to define an aspect to execute after every method within `HiByeService`
is run:
@AfterReturning(pointcut = "execution(* HiByeService.*(..))"
, returning = "result")
public void after(JoinPoint joinPoint, Object result) {
System.out.print("After ");
System.out.print(joinPoint.getSignature().getName());
System.out.println(" result is " + result);
}
}
For this, you need to define a method with an `@AfterReturning` ` ` annotation, defined above for the ` ` `after()` ` ` method. This method here takes an extra argument to store the result of execution of the method of ` ` `HiByeService`
.
Doing Stuff Around Execution
An additional thing you can do is define an aspect around the execution of a method:
@Around(value = "execution(* HiByeService.*(..))")
public void around(ProceedingJoinPoint joinPoint)
throws Throwable {
long startTime = new Date().getTime();
Object result = joinPoint.proceed();
long endTime = new Date().getTime();
System.out.print("Execution Time - "
+ (endTime - startTime));
}
Over here, we have made use of an annotation called `@Around` ` ` to decorate the ` ` `around()`
method.
In this method body, we intercept the call to the method in `HiByeService`
in the following manner:
- We make note of the start time of execution
- Allow the method to run its course
- Finally, we make note of the end time of execution
We then output the computed execution time of that method.
 We have used annotations to decorate our computations within the aspect.
In our examples above, we have restricted ourselves to a single class. However, we could easily extend it to more classes or packages by varying the regular expression we use in the annotations.
For example, we could choose to intercept classes pertaining to the web layer, or classes across all three layers of the example web application.
Terms We Use In AOP
Let’s now look at some important terms we use when talking about AOP.
- Point Cut : It refers to the regular expression that defines what methods need to be intercepted by this aspect. It essentially says where the logic within an aspect method is applicable.
- Advice : This is nothing but the logic within the aspect method. It describes what we do when the Point Cut expression is matched.
- Aspect: The combination of the Point Cut and the Advice
- Join Point: This refers to the situation where a method’s execution has been intercepted, and the aspect is in execution
- Weaving: The entire process of taking a method, intercepting its execution and applying an aspect to its execution. This is the functionality provided by the AOP framework. Examples of AOP frameworks are SpringAOP and AspectJ.
AOP In Summary
In this article, we looked at Aspect Oriented Programming (AOP). We talked about cross-cutting concerns, and described the situations where AOP can be used. In particular, we saw examples of how we can define a point cut, and define the logic of an aspect. We focused on how we can specify aspects to run before, after or around the execution of a method. We then examined the important terms that describe AOP concepts.


Developed by Alberto Abruzzo. Thanks to the guys of YouTube MP3 Downloader for their amazing API.
Downloading...
{{downloadProgress | limitTo:4}}%
There was an error, retry to download or share again the song
Problems with file?


| Methods' Details |
nextEffect
- Description
- Trigger the next effect of the slideshow.
This method triggers the next effect on the currently
displayed slide. If there is currently no slideshow running,
this method does nothing. If there are no more effects on the
current slide, a possible slide transition effect is issued
and the next slide is displayed.
- Returns
- true, if the next effect was successfully
triggered. This method returns false, if there is no show
running, the last effect on the last slide was already
triggered, or the implementation failed to trigger the next
effect.
|
|
previousEffect
| boolean |
| previousEffect(); |
- Description
- Undo the last effect in the main sequence of the slideshow.
The current slide is displayed as if the last user-triggered effect
has never been triggered. If there is no previous effect on the
current slide then slideEnded(true) is called at the registered
XSlideShowListener objects, which can then trigger a change to the
previous slide. Note that this command is executed asynchronously.
Multiple calls to update() may be necessary to complete its execution.
If there is currently no slideshow running, this method does
nothing.
- Returns
- true, if the previous effect was successfully
triggered. This method returns false, if there is no show
running, the first effect on the first slide was not yet
triggered, or the implementation failed to trigger the previous
effect.
|
|
startShapeActivity
| boolean |
| startShapeActivity( |
[in] ::com::sun::star::drawing::XShape |
xShape ); |
- Description
- Start a shape-intrinsic animation or activity.
This method starts an animation or activity intrinsic to the
given shape. Shape-intrinsic activities are things like video
playback for multimedia shapes, sounds, GIF animations and
drawing layer animations (flipping between shapes in a group,
or scroll text).
- Parameter xShape
- The shape to start the activity for
|
|
stopShapeActivity
| boolean |
| stopShapeActivity( |
[in] ::com::sun::star::drawing::XShape |
xShape ); |
- Description
- Stop a shape-intrinsic animation or activity.
This method stops an animation or activity intrinsic to the
given shape. Shape-intrinsic activities are things like video
playback for multimedia shapes, sounds, GIF animations and
drawing layer animations (flipping between shapes in a group,
or scroll text).
- Parameter xShape
- The shape to stop the activity for
|
|
displaySlide
- Description
- Jump to the given slide.
This method ends all effects on the current slide, displays a
possible slide transition, followed by the given slide. If the
current slide is equal to the requested slide here, this
method does nothing (this especially means, that any currently
active effects will remain running).
- Parameter xPage
- The slide to display.
- Parameter xDrawPages
- For future use.
- Parameter xAnimationNode
- The animation node determine the animations to display.
- Parameter aProperties
- Sequence of property values, which influence the way the
slide is displayed. Currently, the
following values are recognized:
- name: Prefetch, value: ::com::sun::star::drawing::XDrawPage. When given,
this slide is prepared in the background to be displayed next. The next
call to displaySlide() with the given slide may be faster if there was
enough time for prefatching. If the next call to displaySlide() uses
a different slide, this will still work but will not have any performance
improvements
- name: SkipAllMainSequenceEffects, value: boolean.
When true then all main sequence effects on the new slide
are triggered. This is typically used when going back one
effect leads to the previous slide. On that slide all
effects have to be shown in order to continue the backward
travelling.
When false, the default, then no main sequence effect is
triggered.
- name: SkipSlideTransition, value: boolean.
When true then the slide transition animation, if there
is any, is not displayed. This is typically used when going
back one effect leads to the previous slide. Typically used
together with SkipAllMainSequenceEffects also being true.
When false, the default, then the slide transition
effect, if it exists, is played.
|
|
pause
| boolean |
| pause( |
[in] boolean |
bPauseShow ); |
- Description
- Change the pause state of the slide show.
This method either pauses the slide show (all currently
running effects are stopped), or starts a previously stopped
show again (all paused effects start again).
- Parameter bPauseShow
- When true, the show is paused. When false, and the show
was paused, it starts running at the paused position again.
- Returns
- true, if the requested action was successfully
performed.
|
|
getCurrentSlide
- Description
- Query the currently displayed slide.
- Returns
- the instance of the current slide. If there's no
slideshow running at the moment, this method returns an
empty reference.
|
|
registerUserPaintPolygons
- Description
- Register drawn polygons in presentation mode
- Parameter xDocFactory
|
|
setProperty
- Description
- Change a property of the slideshow.
- Parameter aShowProperty
- Property values, which influence the way the slides are
shown. Note that this might possibly be a subset of what is
supported on show(). Currently, the following values
are recognized:
- name: AutomaticAdvancement, value: double. When given, effects
and slides are advanced automatically. The double value specifies
the timeout between the end of one effect until the start of the
next one. Negative values are truncated to zero here. When given,
but with empty value, automatic advancement is disabled again.
- name: UserPaintColor, value: long. When given, the slide show
will display a small stylus as the mouse cursor. When pressing the
left mouse key, the user can paint a thin line in the given color.
A changed property is effective immediately.
|
|
addView
- Description
- Add a view to the slide show.
This method adds a view to the slide show. After successful
completion of this method, the slide show will be visible on
the added view, scaled according to the view's output area.
- Parameter xView
- The view to add
- Returns
- true, if the view has been successfully
added. Otherwise, false is returned (e.g. if the view is
already added).
|
|
removeView
- Description
- Remove view from the slide show.
This method removes the given view from the slide show. After
successful completion of this method, the slide show will
cease to display on this view.
- Parameter xView
- View to remove
- Returns
- true, if the view was successfully removed, false
otherwise (e.g. if the view was not added in the first place).
|
|
update
| boolean |
| update( |
[out] double |
nNextTimeout ); |
- Description
- Update the animations.
This method updates all currently active slide animations. The
XSlideShow implementations do not render animations
automatically, but must be called from their clients. This
allows for various update mechanisms to be employed, ranging
from a dedicated rendering thread, over timer-based updates,
to rendering in an idle function. Either way, the client of
this interface decide about the details.
- Parameter nNextTimeout
- Via this value, the implementation can return a timeout value,
denoting the maximal time span that must not be exceeded from
the return of this method to the next update call. Otherwise,
the animations might show visible jerks.
- Returns
- true, if further update calls are required. If
false is returned, no further update calls are necessary,
until anyone of the other interface methods is called (most
notably, the next/previousSlide(), nextEffect() and show()
methods will nearly always make further update() calls
necessary).
|
|
addSlideShowListener
- Description
- Add a slide show listener.
This method adds a listener to the slide show, which will get
notified when a registerend shape is clicked upon, or a new
slide is about to be displayed. Note that the listeners will
not be notified, when the slide change is directly
requested by one of the nextSlide(), previousSlide() or
displaySlide() methods.
- Parameter xListener
- Listener to add.
|
|
removeSlideShowListener
- Description
- Revoke a previously registered slide show listener.
- Parameter xListener
- Listener interface to revoke from being called.
|
|
addShapeEventListener
- Description
- Add a shape event listener.
This method adds a listener to the slide show, which will get
notified when a mouse click is performed on the given
shape. This can be used by clients of the slide show to
trigger external actions, such as jumps to different slides.
- Parameter xListener
- Listener to add.
- Parameter xShape
- Shape to register a listener for.
|
|
removeShapeEventListener
- Description
- Revoke a previously registered shape event listener.
- Parameter xListener
- Listener interface to revoke from being called.
- Parameter xShape
- Shape for which the listener should be revoked.
|
|
setShapeCursor
| void |
| setShapeCursor( |
[in] ::com::sun::star::drawing::XShape |
xShape, |
| [in] short |
nPointerShape ); |
- Description
- Set a special mouse cursor for a shape.
This method requests the slide show to display a special
cursor, whenever the mouse is hovering over the given shape.
- Parameter xShape
- Shape to display a special mouse cursor.
- Parameter nPointerShape
- Type of mouse cursor to display. Must be one of the
::com::sun::star::awt::SystemPointer values.
|
|
Copyright © 2013, The Apache Software Foundation, Licensed under the Apache License, Version 2.0. Apache, the Apache feather logo, Apache OpenOffice and OpenOffice.org are trademarks of The Apache Software Foundation. Other names may be trademarks of their respective owners.


{% extends "page.html" %} {% block content %}
Welcome, {{user.username}}! This is your profile. Make yourself at home.
Log out


Ducts Unlimited Boilerplate
This is the boilerplate for Ducts Unlimited.Hopefully this boilerplate is simple enough, yet effective enough, to impress the customer.
Feel free to request a change in color scheme, layout size, or anything else. Let us know at<EMAIL_ADDRESS>or<EMAIL_ADDRESS>Maintaining a link to Page Two
How far behind the other group do you think we are?
Serving the Front Range since 2000


My talk on building apps with just Rack is at 3:40! Ever wondered how small a web app can be? Join me in 160 and find out #railsconf ✨ 4/25/2017, 3:17:56 PM Favs: 6 Retweets: 0 link


I took my first computer science class in Java in 2011 and found an immediate calling for myself. Since then I have taken academic courses covering C, C++, x86 assembly, taught myself Objective-C, and enrolled in a web development bootcamp, Epicodus, to build my skills in HTML, CSS, JavaScript, jQuery, and PHP.
Having this unique perspective (an academic background mixed with the practicality of code school) helps me see how each part of an application fits into the big picture.
I am currently interested in transitioning from freelancing to working on a team. I am eager to work closely with others, write great code, and make new connections.


|
Excimontec
v1.0-beta.3
An open-source KMC simulation software package for modeling organic semiconductor materials and devices, such as OPVs, OLEDs, and more
|
This namespace provides useful constants and utility functions. More...
Functions | |
| std::vector< std::pair< double, double > > | calculateProbabilityHist (const std::vector< double > &data, int num_bins) |
| Calculates the probability histogram for the input data vector using the input number of bins. More... | |
| std::vector< std::pair< double, double > > | calculateProbabilityHist (const std::vector< double > &data, double bin_size) |
| Calculates the probability histogram for the input data vector using the input bin size. More... | |
| std::vector< std::pair< double, double > > | calculateProbabilityHist (const std::vector< double > &data, const double bin_size, const int num_bins) |
| Calculates the probability histogram for the input data vector using the input bin size and input number of bins. More... | |
| void | createExponentialDOSVector (std::vector< double > &data, const double mode, const double urbach_energy, std::mt19937 &gen) |
| Creates a vector of doubles that has a custom asymmetric distribution with an exponential tail. More... | |
| void | createGaussianDOSVector (std::vector< double > &data, const double mean, const double stdev, std::mt19937 &gen) |
| Creates a vector of doubles that has a Gaussian distribution. More... | |
| bool | importBooleanParam (const std::string &input, bool &error_status) |
| Extracts a boolean value from a string containing "true" or "false". More... | |
| double | integrateData (const std::vector< std::pair< double, double >> &data) |
| Numerically integrates a vector of x-y data using the trapezoid rule. More... | |
| double | interpolateData (const std::vector< std::pair< double, double >> &data, const double x_val) |
| Linearly interpolates an x-y data set to determine the interpolated y-value corresponding to an input x-value. More... | |
| std::vector< double > | MPI_calculateVectorAvg (const std::vector< double > &input_vector) |
| Uses MPI to calculate the element-wise average vector from separate vectors coming from different processors. More... | |
| std::vector< double > | MPI_calculateVectorSum (const std::vector< double > &input_vector) |
| Uses MPI to calculate the element-wise sum vector from separate vectors coming from different processors. More... | |
| std::vector< int > | MPI_calculateVectorSum (const std::vector< int > &input_vector) |
| Uses MPI to calculate the element-wise sum vector from separate vectors coming from different processors. More... | |
| std::vector< double > | MPI_gatherVectors (const std::vector< double > &input_vector) |
| Uses MPI to gather vectors from separate processors to build one big vector containing all of the data. More... | |
| std::string | removeWhitespace (const std::string &str) |
| Removes leading and trailing spaces surrounding a string. More... | |
| template<typename T > | |
| double | array_avg (const T data[], const int array_size) |
| This template function calculates and returns the average value in double format when given an array of numerical datatypes. More... | |
| template<typename T > | |
| double | array_stdev (const T data[], const int array_size) |
| This template function calculates and returns the standard deviation in double format when given an array of numerical datatypes. More... | |
| template<typename base_type > | |
| base_type | intpow (const base_type base, const int exponent) |
| This template function calculates and returns the results of an integer power operation on a base numerical datatype. More... | |
| template<typename T > | |
| void | outputVectorToFile (std::vector< T > &vec, std::string filename) |
| This template function outputs the input data vector to a file with the specified filename. More... | |
| template<typename T > | |
| void | outputVectorToFile (std::vector< std::pair< T, T >> &vec, std::string filename) |
| This template function outputs the input data pair vector to a file with the specified filename. More... | |
| template<typename T > | |
| void | removeDuplicates (std::vector< T > &vec) |
| This template function efficienctly removes the duplicate entries from an input vector. More... | |
| template<typename T , typename A > | |
| double | vector_avg (const std::vector< T, A > &data) |
| This template function calculates and returns the average value in double format when given a vector of numerical datatypes. More... | |
| template<typename T , typename A > | |
| double | vector_stdev (const std::vector< T, A > &data) |
| This template function calculates and returns the standard deviation in double format when given a vector of numerical datatypes. More... | |
This namespace provides useful constants and utility functions.
| double Utils::array_avg | ( | const T | data[], |
| const int | array_size | ||
| ) |
This template function calculates and returns the average value in double format when given an array of numerical datatypes.
| data | is the array of numerical data. |
| array_size | is the size of the input data array. |
| double Utils::array_stdev | ( | const T | data[], |
| const int | array_size | ||
| ) |
This template function calculates and returns the standard deviation in double format when given an array of numerical datatypes.
| data | is the array of numerical data. |
| array_size | is the size of the input data array. |
| std::vector< std::pair< double, double > > Utils::calculateProbabilityHist | ( | const std::vector< double > & | data, |
| int | num_bins | ||
| ) |
Calculates the probability histogram for the input data vector using the input number of bins.
Linearly spaced bins are automatically created from the minimum value to the maximum value of the data set. The function outputs bin-centered x values and probability y values in a x-y pair vector.
| data | is the input data vector. |
| num_bins | is the desired number of bins. |
| std::vector< std::pair< double, double > > Utils::calculateProbabilityHist | ( | const std::vector< double > & | data, |
| double | bin_size | ||
| ) |
Calculates the probability histogram for the input data vector using the input bin size.
Linearly spaced bins are automatically created from the minimum value to the maximum value of the data set. with the specified bin spacing. The function outputs bin-centered x values and probability y values in a x-y pair vector.
| data | is the input data vector. |
| bin_size | is the desired bin size. |
| std::vector< std::pair< double, double > > Utils::calculateProbabilityHist | ( | const std::vector< double > & | data, |
| const double | bin_size, | ||
| const int | num_bins | ||
| ) |
Calculates the probability histogram for the input data vector using the input bin size and input number of bins.
Linearly spaced bins are automatically created starting from the minimum value of the data set. The function outputs bin-centered x values and probability y values in a x-y pair vector.
| data | is the input data vector. |
| num_bins | is the number of bins that will be created. |
| bin_size | is the input bin size. |
| void Utils::createExponentialDOSVector | ( | std::vector< double > & | data, |
| const double | mode, | ||
| const double | urbach_energy, | ||
| std::mt19937 & | gen | ||
| ) |
Creates a vector of doubles that has a custom asymmetric distribution with an exponential tail.
The created distribution is Gaussian in the positive direction relative to the mode and exponential in the negative direction. On the Gaussian side, the standard deviation is calculated relative to the urbach energy chosen for the exponential side, so that the distribution function is continuous.
| data | is the data vector where the random numbers will be placed, which must be preallocated to the desired size. |
| mode | is the value of the peak of the distribution. |
| urbach_energy | is the parameter that detemines the shape of the exponential tail side of the distribution. |
| gen | is a Mersenne twister random number generator used to randomly draw numbers from the distribution. |
| void Utils::createGaussianDOSVector | ( | std::vector< double > & | data, |
| const double | mean, | ||
| const double | stdev, | ||
| std::mt19937 & | gen | ||
| ) |
Creates a vector of doubles that has a Gaussian distribution.
| data | is the data vector where the numbers will be placed, which must be preallocated to the desired size. |
| mean | is the position of the peak and center of the distribution. |
| stdev | is the standard deviation of the distribution, which defines the width of the peak. |
| gen | is a Mersenne twister random number generator used to randomly draw numbers from the distribution. |
| bool Utils::importBooleanParam | ( | const std::string & | input, |
| bool & | error_status | ||
| ) |
Extracts a boolean value from a string containing "true" or "false".
| input | is the input string. |
| error_status | is an input boolean that is used to indicate an error with the import process. |
| double Utils::integrateData | ( | const std::vector< std::pair< double, double >> & | data | ) |
Numerically integrates a vector of x-y data using the trapezoid rule.
| data | is the data vector containing x-y data pairs. |
| double Utils::interpolateData | ( | const std::vector< std::pair< double, double >> & | data, |
| const double | x_val | ||
| ) |
Linearly interpolates an x-y data set to determine the interpolated y-value corresponding to an input x-value.
| data | is the data vector containing x-y data pairs. |
| x_val | is the x-value that will be interpolated to. |
| base_type Utils::intpow | ( | const base_type | base, |
| const int | exponent | ||
| ) |
This template function calculates and returns the results of an integer power operation on a base numerical datatype.
| base | is the base of the integer power operation and can be any numerical type. |
| exponent | is the integer exponent for the integer power operation. |
| std::vector< double > Utils::MPI_calculateVectorAvg | ( | const std::vector< double > & | input_vector | ) |
Uses MPI to calculate the element-wise average vector from separate vectors coming from different processors.
Each processor calls this function and sends an input vector. Upon function return, processor 0 receives the average vector and all of the other processors receive an empty vector.
| input_vector | is the input data from the processor calling the function. |
| std::vector< double > Utils::MPI_calculateVectorSum | ( | const std::vector< double > & | input_vector | ) |
Uses MPI to calculate the element-wise sum vector from separate vectors coming from different processors.
Each processor calls this function and sends an input vector. Upon function return, processor 0 receives the sum vector and all of the other processors receive an empty vector.
| input_vector | is the input data from the processor calling the function. |
| std::vector< int > Utils::MPI_calculateVectorSum | ( | const std::vector< int > & | input_vector | ) |
Uses MPI to calculate the element-wise sum vector from separate vectors coming from different processors.
Each processor calls this function and sends an input vector. Upon function return, processor 0 receives the sum vector and all of the other processors receive an empty vector.
| input_vector | is the input data from the processor calling the function. |
| std::vector< double > Utils::MPI_gatherVectors | ( | const std::vector< double > & | input_vector | ) |
Uses MPI to gather vectors from separate processors to build one big vector containing all of the data.
Each processor calls this function and sends an input vector. Upon function return, processor 0 receives the large data vector and all of the othe rprocessors receive an empty vector.
| input_vector | is the input data from the processor calling the function. |
| void Utils::outputVectorToFile | ( | std::vector< T > & | vec, |
| std::string | filename | ||
| ) |
This template function outputs the input data vector to a file with the specified filename.
| vec | is the input data vector. |
| filename | is the input file name. |
| void Utils::outputVectorToFile | ( | std::vector< std::pair< T, T >> & | vec, |
| std::string | filename | ||
| ) |
This template function outputs the input data pair vector to a file with the specified filename.
| vec | is the input data pair vector. |
| filename | is the input file name. |
| void Utils::removeDuplicates | ( | std::vector< T > & | vec | ) |
This template function efficienctly removes the duplicate entries from an input vector.
This algorithm allow efficient removal of duplicate vector objects when > or < comparison operators do not exist.
| vec | is the input vector to be operated on. |
| std::string Utils::removeWhitespace | ( | const std::string & | str | ) |
Removes leading and trailing spaces surrounding a string.
| str | is the input string |
| double Utils::vector_avg | ( | const std::vector< T, A > & | data | ) |
This template function calculates and returns the average value in double format when given a vector of numerical datatypes.
| data | is the vector of numerical data. |
| double Utils::vector_stdev | ( | const std::vector< T, A > & | data | ) |
This template function calculates and returns the standard deviation in double format when given a vector of numerical datatypes.
| data | is the vector of numerical data. |


Rfast: A Collection of Efficient and Extremely Fast R Functions
A collection of fast (utility) functions for data analysis. Column- and row- wise means, medians, variances, minimums, maximums, many t, F and G-square tests, many regressions (normal, logistic, Poisson), are some of the many fast functions. Reference: Tsagris M, Papadakis M. (2018). Taking R to its limits: 70+ tips. PeerJ Preprints 6:e26605v1 <doi:10.7287/peerj.preprints.26605v1>.
| Version: |
1.9.2 |
| Depends: |
R (≥ 3.5.0), Rcpp (≥ 0.12.3), RcppZiggurat |
| LinkingTo: |
Rcpp (≥ 0.12.3), RcppArmadillo |
| Published: |
2018-11-09 |
| Author: |
Manos Papadakis, Michail Tsagris, Marios Dimitriadis, Stefanos Fafalios, Ioannis Tsamardinos, Matteo Fasiolo, Giorgos Borboudakis, John Burkardt, Changliang Zou, Kleanthi Lakiotaki and Christina Chatzipantsiou. |
| Maintainer: |
Manos Papadakis <rfastofficial at gmail.com> |
| License: |
GPL-2 | GPL-3 [expanded from: GPL (≥ 2.0)] |
| NeedsCompilation: |
yes |
| SystemRequirements: |
C++11 |
| Materials: |
NEWS |
| CRAN checks: |
Rfast results |
Downloads:
Reverse dependencies:
Linking:
Please use the canonical form
https://CRAN.R-project.org/package=Rfast
to link to this page.


Home
Sign Up
About Us
Contact
Cole.W
Web UI
Tharshan.K
Web UI
Alex.Martinez
React I
Alex.Miller
React II
Edwin.C
Back-End
Cody.H
Back-End
Katrina.R
Product Lead


{% extends '_base.html' %} {% block title %} {{ job_detail.Job_title }} {% endblock %} {% block content %}
{{ job_detail.Job_location }}
Date posted- {{ job_detail.Date_posted }}
{{ job_detail.Description|linebreaks }}
{{ job_detail.Add_skills|linebreaks }}
Job Details
Employment Type{{ job_detail.Employee_type }}
This Job post is verified
{% else %}This Job post is not verified
{% endif %}


THE ABYSS: THE DIRECTOR'S CUT A film review by Michael John Legeros Copyright 1994 Michael John Legeros
Still making rounds around town is the director's cut of THE ABYSS, a definite must-see for action fans and a perfect warm-up to the July release of TRUE LIES.
The story presses a team of oil-drilling divers (led by Ed Harris) into the service of the Navy, who requests their aid to locate and disarm a missing nuclear sub. Along for the ride is one ex-wife (Mary Elizabeth Mastrantonio), some less-than-playful SEALS (led by Michael Biehn), and a handful of luminescent, underwater aliens.
Director James Cameron's undersea adventure received a soggy reception in 1989, despite grossing somewhere between $50 to $80 million in the States. Critics couldn't accept the aliens and with good reason. The truncated film--cut by 27 minutes per the studio's request--gave zero explanation for their existence.
Aliens, that is. Not critics.
Now, with the footage restored, THE ABYSS is finally fathomable. The ending is still way-too-literal, but Cameron was young when he made this movie. (Remember the awful editing in TERMINATOR 2? The man is still learning. Let's talk after TRUE LIES.)
If nothing else, THE ABYSS is a bonafide technical masterpiece. The actors spent months underwater and did all of their own diving. Their efforts helped to win the Oscar for Best Visual Effects. (The film was also nominated for best cinematography and best sound.)
Brave THE ABYSS.
It's *that* deep.
Grade: A-
.
The review above was posted to the
rec.arts.movies.reviews newsgroup (de.rec.film.kritiken for German reviews).
The Internet Movie Database accepts no responsibility for the contents of the
review and has no editorial control. Unless stated otherwise, the copyright
belongs to the author.
Please direct comments/criticisms of the review to relevant newsgroups.
Broken URLs inthe reviews are the responsibility of the author.
The formatting of the review is likely to differ from the original due
to ASCII to HTML conversion.
Related links: index of all rec.arts.movies.reviews reviews