instruction
stringlengths
9
38.7k
I want to use PCA to reduce SIFT (128 dims) and VLAD vectors (128*k dims, let's say k={64, 128, 256}) dimensions as described in this paper. SIFT descriptors can have integer values (by default in VLFeat) or float numbers (by default in OpenCV). In both cases, SIFT vecotrs have always positive values, while VLAD vector...
I am going through R's function indeptCoxph() in the spBayesSurv package which fits a bayesian Cox model. I am confused by some of the input parameters to this functions. (I also had some questions about the R code which I have posted separately on Stack Overflow: Stuck with package example code in R - simulating data ...
In the very beginning of a video made by Andrew Ng (Associate professor at Standford), it is said that "the learning curves can help to diagnose whether a model is suffering from a bias, a variance problem or a bit of both" My question is concerning the addition of the "bit of both" to the sentence above: How can an al...
I have created couple of graphs in R d5 <- scan('d500.txt') p1 <- acf(d5,lag.max = 36 ,type = c("covariance"),plot = TRUE) Then the next one is correlation p1 <- acf(d5,lag.max = 36 ,type = c("correlation"),plot = TRUE) And pacf p1 <- pacf(d5,lag.max = 36 ,plot = TRUE) If I take a one difference operation d51 <- ...
Let $X$ be a non-negative random variable with continuous density $f(\cdot)$, finite mean $\mu > 0$, and finite variance $\sigma^2$. I am interested in providing an upper bound for $\int_{a}^{\infty}x f(x)dx$, for $a > \mu$. Here is a very crude approach: $\sigma^2 + \mu^2 = \int_{0}^{\infty}x^2 f(x) dx$. Thus \begin{a...
I want to apply a Zero Truncated Poisson regression in R. It works so far with the following Code: require(VGAM) m1 <- vglm(howoften ~ TTCALL, family = pospoisson(), data = data) summary(m1) Call: vglm(formula = howoften ~ TTCALL, family = pospoisson(), data = data) Coefficients: Estimate Std. Error ...
Welch Two Sample t-test data: sample1 and sample2 t = 2.658, df = 95.421, p-value = 0.009217 alternative hypothesis: true difference in means is not equal to 0 95 percent confidence interval: 0.01615943 0.11150922 sample estimates: mean of x mean of y 0.5585566 0.4947222 I have this result for a T test using t.test...
I am wondering what is a suitable measure to separate the blue, green and red points? I tried 'cosine' but some of the red gets confused with green. My goal is to make two generative models; one for blue points and one for green points. EDIT As suggested by the first comment, the same plot is drawn in polar coordinat...
Say I have an observational dataset over 20 years with blood-pressure measured each year for 1000 men. Each year a decision is made whether to start antihypertensive drug A, drug B or continue without medication. This decision is based on the blood-pressure, but the exact bloodpressure threshold is left at the discret...
The dendrogram was obtained using SPSS, the Nearest Neighbor method alongside the Squared Euclidian Distance. It groups together glass fragments from 3 different origins but I have difficulties with the number of clusters, can anyone help? Thank you in advance!
GOAL Graph represantation of "similarity" between key phrases based on documents that mention it in their text, in form of simple graph. I'm working on vectors, of different length, each value in it as a pair {keyWord,strength}. Every document has such a vector created. Therefore it's not a problem to put it into a 2 ...
Say we want to do OLS on $m$ samples $(x_i,y_i)$, where $(x_1,y_1), \ldots, (x_{m-1},y_{m-1})$ have the relationship $y_i = \beta \cdot x_i$, but $(x_m,y_m)$ does not. Specifically, $(x_m,y_m)$ is an outlier where $||y_m - \beta \cdot x_i|| = c$. Can we quantify the effect that this outlier will have on our estimation ...
While most books and papers on Probability Graphical Models (PGMs) describe a nice representational method for Bayesian Networks BNs (and/or Dynamic Bayesian Networks DBNs), where a Joint Probability Distribution/Table (JPD)/(JPT) computation is factored into individual Conditional Probability Distributions/Tables (CPD...
I want know the formulas for the information highlighted in the confusion matrix in the picture below:
Suppose I want to determine the effect of an intervention on a health score. I do not have the means to design an experiment to randomly assign people to the control and treatment groups. The way I recruit people to apply for the intervention is by mailing advertisements to their homes, or going to hospitals and giving...
Suppose I have a random response Y and a fixed predictor X. My model is \begin{align*} Y &= \frac{aX}{b + aX} \end{align*} where $X, Y, a, b > 0$. I have a sample $Y_1, ..., Y_n$ and n is very large. In my problem domain most people fit a nonlinear least squares model on \begin{align*} Y &= \frac{\beta X}{1 + \bet...
Imagine if I have a game that dynamically increases or decreases the difficulty between levels each day and players can choose when they want to play/quit. Additionally, the players always get to see the changes in the difficulty level for the last 365 days so they might be able to guess that there is a local minima/ma...
In this paper by Thomas Minka the author gives the following example : Suppose you, a Bostonian, have entered the New Hampshire lottery along with 999 people from New Hampshire. The prize will be awarded to exactly one of the 1000 people. By sheer luck, you obtain a computer printout listing 998 participants; each name...
Here's my situation: The equation for a simple linear regression model (below) was calculated and the summary output for the model was produced (below). The task is to calculate all equations by hand; however, for the sake of other users, I incorporated the data in R format too. Linear Regression Model: ...
Equation 5.30 of The Elements of Statistical Learning states that the penalized log-likelihood for a nonparametric logistic regression is: \begin{align} l(f;\lambda) &= \sum_{i=1}^{N}\big[y_i\log p(x_i) +(1-y_i)\log(1-p(x_i))\big] - \frac12\lambda \int{f''(t)}^2dt \\ &= \sum_{i=1}^{N}\big[y_if(x_i) - \log(1+e^{f(x_i)}...
I am trying to implement one-vs-all logistic regression by myself on a small dataset that I have already divided into 8 folds (I do not want to use nnet::multinom). I have 14 classes and as many as about 90 features. I have create 14 different logistic regression models for each of the classes. The probabilities I am g...
When using the glm function in the stats package with ordinal variables data$X1 <- ordered(data$X1) data$X2 <- ordered(data$X2) data$X3 <- ordered(data$X3) data$X4 <- ordered(data$X4) data$X5 <- ordered(data$X5) data$X6 <- ordered(data$X6) glm(Y ~ X1 + X2 + X3 + X4 + X5 + X6, data = data) Coefficients: E...
I am using SPSS for analysis of my data using general linear model for univariate ANOVA with 3 independent factors (2 levels each), one random ordinal factor (4 levels), and 1 covariate. I saved the residuals and tested for normality with Shapiro-Wilk and Anderson-Darling tests, but the residuals are non-normal. I read...
I have been thinking about this for about 2 hours now and I don't see my error. In Time Series Analysis by Hamilton it is stated that the MLE of a normal distribution can be obtained by regarding the observed sample of size $n$ as a signle draw from the joint distribution. This intuitively clear since the ML estimation...
I am reading through the Hamilton book on Time Series Analysis. There are numerous references to estimation of models using both exact log-likelihood estimation and conditional estimation. From what I've gathered so far exact likelihood estimation has to be done with any number of numerical optimization techniques. Ho...
I program and do test-driven development. After I made a change in my code I run my tests. Sometimes they succeed and sometimes they fail. Before I run a test I write down a number from 0.01 to 0.99 for my credence that the test will succeed. I want to know whether I'm improving in predicting whether my test will succ...
In a cosmological simulation, we are calculating a physical quantity at different times from 3 different viewing angles; that is at any particular snapshot or epoch, we have three output numbers for the physical quantity. From each run, we have one time array including its error (called x and xerr) and one physical qua...
I am writing some code that uses a Least-Squares estimator. Of course, as mentioned HERE, the covariance matrix can be obtained from $\sigma^2(X'X)^{-1}$. The problem I have, is that I have no idea how to get the constant factor. As the number of measurements goes up, the covariance seems to converge to the correct v...
Let's say I have a random variable B transformed from a standard normal distribution. When the value is larger than 1, it is set to be 0. Is there an analytical way to get the expectation of random variable B?
Let the model $$y_t=\beta_0+\beta_1t+z_t\qquad t=1,2,\dots$$ $$z_t=\epsilon_t+\theta\epsilon_{t-1}$$ where $\epsilon_t$ is White noise with zero mean and variance $\sigma^2$ and $\beta_0,\beta_1,\theta$ constants. a) Is $y_t$ stationary? b) Is $(1-B)y_t$ stationary? (where $B$ is a lag operator) This model can ...
I have a set of data associated with ~60 individuals. For each individual, I have sequence data for a number of different genes. I have performed clustering analysis (using affinity propagation) for each gene, based on the number of pairwise differences between sequences. This means that for each gene, I have a number...
Given a neural network as following \begin{align*} &J = CE(y,\hat{y})=-\sum_i y_i log(\hat{y}_i)\\ &\hat{y} = softmax(z_2)\\ &z_2 = hW_2+b_2\\ &h = sigmoid(z_1)\\ &z_1 = xW_1+b_1 \end{align*} and $$\frac{\partial J}{\partial z_2}=\hat{y}-y=\delta_1$$ where $W_1 \in \mathbb{R}^{D_x \times H}$, $b_1 ...
My personal experience with ML is strictly tied to Coursera ML class. Most of their classes are really good, but I never figured out how to apply it to my data. My question is; I have a lot of user event data that basically says, this user clicked on A,B,C and views page X,Y,Z. My data is nested with users and all thei...
I use R to run neural network model, but The Rsquared is too low. I have tried different learning rate, threshold and neurons but still the R-square is below 50%. Is there anything I can do to improve this condition? My code: formula.bpn<-Y~X1+X2+X3+X4+X5+X6 bpn<-neuralnet(formula = formula.bpn, data = data, hidden = ...
Summary: Given a non-Euclidean distance matrix in which some entries represent replicate observations of an entity, is it (statistically) valid to calculate the arithmetic mean of pairwise distances across replicates? Details: From a matrix of sample by species incidence, I have used a non-Euclidean distance metric (an...
I am trying to build and train a neural network to recognize letters of the alphabet and numbers based upon their design using a seven segment display where each segment of the display is one input into the neural network ( I am using the basic prop simulator). I am just a bit unsure about of how to represent the inpu...
I tried replicating the stochastic vol example in the pymc3 documentation, but using a larger dataset. NUTS was taking too long, so I tried ADVI. from pandas_datareader import data import pymc3 as pm import pandas as pd returns = data.get_data_yahoo('SPY', start='2008-5-1', end='2016-12-1')['Adj Close'].pct_change()...
Here is an interesting question I came across: Suppose you want to design a multiple choice test with $M$ questions. Each question has $4$ alternatives, out of which only one alternative is correct. How large will you take $M$ such that you can distinguish between a good student and a bad student? This is the questio...
In the output for Choice-based conjoint, there are some significant and some insignificant output utilities. When calculating attribute importance (using the difference formula), should I exclude insignificant variables? Or should the calculation include all variables regardless of statistical significance?
Is the Kaiser rule (choosing only PCs with eigenvalues >1) a suitable method to select the best principal components? What are its pros and cons?
I'm learning about variational inference and tried to follow the example for a Gaussian Mixture as described here. I could follow the bound for $\phi_k$ which is the difference of two Beta log likelihoods. But I cannot follow the example for the bound for $\mu_k$ which is the difference of two multivariate Normals. The...
Example data: df <- data.frame(Proportion = c(0.1,0.15,0.22,0.20,0.29,0.37,0.41,0.36, 0.47,0.67), Age = c("15-20", "20-25", "25-30", "30-35", "35-40", "40-45", "45-50", "50-55", "55-60", "60-65")) plot(df$Proportion, ylab = "Proportion") From the plot the Proportion seems ...
I have two pictures of a mole, but second picture is slightly different from the first because mole has changed its form a bit. Both images have different perspective, so I am willing to compute a homography to transform the second image's perspective to the first one's perspective. I know it could be done when images ...
The following estimators can be used for the german-tank-like problems. If we collect a sample of size $k$ with sample mean $\bar{x}$ and highest number $m$, then we can estimate the population size with either $\hat{x}_{1}$ or $\hat{x}_{2}$: $$\hat{x}_{1} = m + \frac{m}{k} - 1$$ $$\hat{x}_{2} = 2 \bar{x}$$ After compu...
In the tutorial, it is said that: Let v range over the tags. Define U(k, v) to be the score of the best sequence of tags from 1 to k, where tag k is required to be v. This is a maximization over k −1 tags because tag number k is fixed to have value v It is very confusing that why should the Kth tag be fixed?...
Let's say that T1, T2, T3 are random variables, $T_1$ and $T_2$ are independent and $T_3=T_1+T_2$. Are $T_3$ and $T_2$ independent? Intuitively, i'd say no. However I cannot find a proof of it.
I am not sure about plotting a biplot for LDA. Suppose I have a 3 feature data set with 3 classes. Then, I perform LDA to reduce the dimensionality to 2. How can I create a biplot for the LDA? My understanding of biplot (I may be completely wrong) is simply a projection of the original features in the hyperplane (or li...
I'm trying to give an upper bound for the VC dimension of the hypotheses class $H$ of NN with binary output, $L$ layers (feedforward, fully connected), each layer except the output layer contains $d$ nodes, and sign is the activation function. The idea is first to find the number of parameters $N$ of the network, and ...
Say I have two logistic models, the null model ($\omega_0$) and a model with one covariate ($\omega_1$). That is \begin{align} \omega_0: \quad \text{logit}(p_i) &= \beta_0 \\ \omega_1: \quad \text{logit}(p_i) &= \beta_0 + \beta_1 x_i \end{align} where $p_i = P(Y_i = 1)$ for some $Y_i \sim \text{Bernoulli}(p_i)$. Sho...
Preface I've looked at How should we convert sports results data to perform a valid logistical regression? and How to simulate head to head competition based on winning percentages? but I didn't get it to a 100%. Question We have 5 rows about head to head competition between elderly people playing bridge. We have compe...
This is a minor side-project I have been playing with and I wanted to see if anyone might have suggestions. Problem. I used a dataset of loans with payment and borrower credit history (https://www.lendingclub.com/info/download-data.action), where each loan is a 36,60 month term. I am not so concerned with defaults vs....
I have a historical dataset which tells who bought our products. This dataset contains ID, Age Gender Salary. I have another set of data which contains the four fields above. How should I use R to calculate the probability of purchase of each customer in the second dataset or whether they would buy our products (T/...
I'm looking at an example in my lecture notes where $X_1, X_2,...,X_n$ are iid $N(\mu,\sigma^2)$, where $\sigma^2$ is known. $\bar{X}$ is an unbiased estimator of $\mu$. The pivot for the confidence interval is given as $\frac{\bar{X} -\mu}{\frac{\sigma}{\sqrt{n}}}$ and the notes state that this pivot does not depend o...
I reproduced a trivial game found in an Udacity course to experiment Markov Decision Process. I was really surprised to see I found different results. After some research, I saw the discount value I used is very important. When I choose a discount of 0.5, I got different results but with a discount of 0.999, the result...
I am trying to figure out how to do learning using probabilistic programming languages. For this I am following different paths to get a hold on the way of thinking. I understand modelling using neural networks, and understand how learning in this context works. Now I am trying to figure out the analog in Bayesian reas...
I am doing some work on aggregation bias and MAUP. I have ols linear regressions on the same spatial data at 20 or so levels of aggregation-by-neighborhood-mean, from very fine to very coarse. I have been looking at all regression stats across those levels, but I am interested in whether the AICs are truly comparable,...
Let me explain my question. Consider, for example, a Weibull mortality curve with covariates included: $$\mu_{x}=\bigg(\frac{a}{b}\bigg)\bigg(\frac{x}{b}\bigg)^{a-1}\text{exp}(\beta Z)\quad\quad a,b,x>0$$ where $\beta$ is a $(1\times n)$ matrix and $Z$ is an $(n\times 1)$ matrix. We can derive the cumulative hazard fun...
Is the Kaiser rule (choosing only PCs with eigenvalues >1, see e.g. here on Wikipedia) a reasonable method to select the number of principal components to retain? What are its pros and cons?
Let the model $$y_t=y_ {t-1}-0.25y_{t-2}+\epsilon_t$$ where $\epsilon_t$ is White Noise with mean zero and variance $\sigma^2$. a) Find the forecasts $y_t(1)$ and $y_t(2)$. b) Find $Cov(y_t(2),y_t)$. Express the result in function of $Var(y_t)=\gamma(0)$. This is an $AR(2)$ process with zero mean. In this notatio...
Say for 4 companies' close prices time-series with 500 observations each, I first estimate the Vector Autoregression of lagged order p, VAR(p). I achieved this by using Ordinary Linear Squares (OLS) with the following steps: 1) Form the dependent matrix Y with dimensions (row,columns): {4 x (500-p)}, where the oldest p...
I have seen a question that claims transformation changes a distribution into a normal distribution. Is this a correct assertion?
I am trying to solve a statistics problem with very little statistics theory. I can determine a solution to my problem by writing a simulation program, but I really need to have the proper formula instead. I have a Gaussian Normal distribution with Mean x and Variance v. I have defined a second function that is simpl...
Bound for distribution of sum of RVs with fixed marginals has been discussed, for example in Best-possible bounds for the distribution of a sum — a problem of Kolmogorov. Is there similar paper discussing bounds for distribution of X/Y with fixed marginals of X and Y?
The insulin-sensitivity check index (QUICKI) has an excellent linear correlation with the glucose clamp index of insulin sensitivity (SI_Clamp) that is better than that of many other surrogate indexes. However, correlation between a surrogate and reference standard may improve as variability between subjects in a coho...
Assume that $X_1$ and $X_2$ are two i.i.d. random variables with pdf $f$. Also, assume that $a$ and $b$ are two fixed real numbers such that $a>b$. If $g$ is a strictly increasing function, do I have: $$ E[g(a+X_1)] > E[g(b+X_2)], $$ where the expectations are with respect to the distribution of $X_1$ and $X_2$? To me,...
I am implementing a variance-covariance matrix myself and I'm having some trouble understanding what is meant by the expectation this equation: $ Cov(X, X) = E[(X - E(x))(X - E(x))']$ From what I understand, the expectation of a matrix of variables is the expectation of the columns of the matrix: $ X = \left( \begin{ar...
I have been trying to estimate parameters of a poisson regression. I am using Newton Raphson method. This method requires that the inverse of Hessian be computed to obtain, updates to beta vector. The text book that I am using defines the Hessian as $$-\sum x'_{i}xe^{x'_i\beta}$$ This doesn't seem to be a $p \times p$...
I have a dataset from an experiment in which a sample of participants repeatedly done a variation of visual search task (for each participant there is about 400 trials) in two conditions. The predictions for this experiments suggest a comparison between two non-linear models that have the same number of parameters and ...
I'm following the procedure in this post (Adjusting daily time series data for the seasonal component) on R 3.2.3 (linux). The de-seasoning process in the above post works fine. But with my data, a weather time series with 32,000+ observations, the same process leaves behind a noticeable seasonal trend, as shown below...
In a credit risk model, the probability of defaulting 18 months in the future is estimated as a function of a set of characteristics $x$. We index individuals with $i$ and periods with $t$. An outcome variable $y^i_t$ is constructed so that: $y^i_t = 1$ if $Default^i_{t+18m} = 1$ $y^i_t = 0$ if $Default^i_{t+18m} = 0$ ...
I always read that every maximum likelihood estimator has to be a function of any sufficient statistic. The idea is that, if we are dealing with a random variable $X$ with mass or density function $f(x\mid\theta)$, and $T$ is a sufficient statistic for $\theta$, then by the factorization theorem $f(\vec{x}\mid\theta)=g...
I've been reviewing the results of an interesting chemistry experiment a colleague of mine was conducting, and she sought some help analyzing the results. Would you be able to help, please? The experiment settings A set of 1,200 known chemical substances denoted $s_1, s_2, s_3, ..., s_{1200}$. 10 of which are have a s...
I have a colleague that wants to fit a nonlinear model to the independent variables X (X is an n x k matrix) and the dependent variables Y (Y is an n x 1 matrix). The difficulty is that each row of Y could be from one of two different "types" of data, T1 and T2. There are two different functional relationships between...
Folks I've read in many places that the margin of error doesn't depend on the population size, and yet several online calculators a) ask for the population size and b) give different results depending on what's entered. Here are some examples: http://www.snapsurveys.com/support/calculators/margin-error-calculator/ http...
Let's say I have a series of some values. When I transform the series now by simple shrinkage, for instance, multiplying the original value by 0.5 and adding 0.5 constant . Then, are both series correlated perfectly with 1 as coefficient?
I performed a simple ANOVA in R and then generated the following TukeyHSD() comparisons of means: I have a pretty good idea (I think) of what all this means except the 'p adj'. If I'm correct: The difference in test scores between say Juniors and Freshmen is 4.86, with Juniors averaging 4.86 points higher. The 95% c...
Let $\overline{X} = \frac{1}{n} \sum_{i=1}^n X_i$, and $S^2 = \frac{1}{n-1} \sum_{i=1}^n (X_i - \overline{X})^2$. It is well known that if the $X_i$ are IID normals, say $X_i \sim N(\mu, \sigma)$, then $\frac{\overline{X} - \mu}{S / \sqrt{n}}$ is $t$-distributed with $n-1$ degrees of freedom. In turn, as $n$ goes to in...
According to the definition of T distribution, the numerator (stand normal distribution) should be independent of the denominator ( chi square distribution). If the population of the sample is normal distribution, we could prove the sample mean distribution and sample standard derivation distribution are independent. O...
I have a series of questions with binary choices, which are coded as 1 and 0. I created a percentage by adding up the "1" responses and dividing by the total number of questions. For example, for one respondent, if they gave a "1" response for 6 out of 10 questions, their rate would be 60%. The design of the study is ...
I have some data taken at multiple time points from a set of individuals, but without tracking the individuals. For example, at each of six time points, the heights of all individuals are recorded -- but there is no information on which height came from which individual. (This is similar to the R builtin data-set Loblo...
If you perform, say 10 fold cv with logistic regression and then average the coefficient vectors from each turn, does that average roughly equal the coefficient vector you would get by fitting a logistic regression to the whole dataset? Here is an example using a sklearn logistic regression that performs a random searc...
What would be the distribution of the following equation: $$y = \frac{a}{(a+d)^2}$$ where $a, d$ $\sim$ $\Gamma(M,c)$. Additionally, $a$ and $d$ are independent random variables.
I'm trying to simulating time-series of count data given an underlying population model in order to get a better feel for the processes shaping the data. As I am modelling the actual time-series of counts following eq (1) and (2) (substitute m for t), the aim of the below simData() is to generate count data given the u...
When applying the Diebold-Mariano test to test for predictive accuracy we need to specify a loss differential. For instance the loss differential $d$ in terms of the mean absolute error (MAE) is $d = abs(e_1) - abs(e_2)$ where $e_1$, $e_2$ are the errors of two competing forecasts and are nobs-by-1 matrices. When we wa...
I'm working on a paper with a senior colleague who provided data. To make it general, we are studying whether something (measured by X) affects an outcome (measured by Y). Since unobserved factors may affect both X and Y, I argue that we can consistently estimate the effect of X on Y with an instrumental variable W for...
My research is archaeological and I am looking at distribution of Roman lamps across time. Most of my lamps are coded into 50-year brackets within a single categorical variable (0-50 CE =1, 50-100 CE =2, 100-150 CE =3, 150-200 CE =4 and so forth). I, however, have a number of lamps that cannot be neatly dated/categori...
I have used a questionnaire to collect data from 200 people. This questionnaire was obtained from a published research paper in which researchers had used it in a specific population. It involves 34 items that are nominal multiple choice questions with one possible answer. For example: Which factor do you consider? X ...
This is something that has been bugging me for a while, and I couldn't find any satisfactory answers online, so here goes: After reviewing a set of lectures on convex optimization, Newton's method seems to be a far superior algorithm than gradient descent to find globally optimal solutions, because Newton's method can ...
Let the process $\{y_t\}$ $$y_t=0.6y_{t-1}-0.08y_{t-2}+\epsilon_t-0.5\epsilon_{t-1}$$ where $\epsilon_t$ is White Noise with zero mean and variance $\sigma^2$. Is possible to find the $AR(\infty)$ representation? First I write the process using lag operators $$y_t(1-0.6B+0.08B^2)=\epsilon_t(1-0.5B)$$ If a pro...
This problem was taken from a free online Computational Neuroscience class {1}. Suppose we are diagnosing a very rare illness, which happens only once in 100 million people on average. Luckily, we have a test for this illness but it is not perfectly accurate. If somebody has the disease, it will report positive 99% of...
I'm trying to asses how accurate FiveThirtyEight's NBA predictions were for the Pistons. They give a percentage chance for a team to win for every game. I wanted to test that against the actual outcome and see how accurate they've been overall for the Pistons. This is probably a really basic question, but it's been a w...
Recently I have found that in the applied econometrics literature, when dealing with feature selection problems, it is not uncommon to perform LASSO followed by an OLS regression using the selected variables. I was wondering how can we qualify the validness of such a procedure. Will it cause troubles such as omitted v...
I'm trying to reproduce the Diebold&Mariano test available in Stata13 and I think there is an error in the suggested implementation. At the bottom of the file you have: // apply cross to get the covariances and scale by T gamma = cross(X,X) :/ strtoreal(st_local("T")) The problem is that "T" is a constant equal ...
A coin that lands on heads with probability $p$ is flipped until either $n$ consecutive heads appear or $n$ consecutive tails appear. What is the expected number of coin tosses? I get $$\mathbb{E}[C_n]=\mathbb{E}[\mathbb{E}[C_n|H]]=\mathbb{E}[C_n|H=1]\mathbb{P}(H=1)+\mathbb{E}[C_n|H=0](1-\mathbb{P}(H=1))$$ Where $C_...
I am working with an insurance dataset with around 77 predictors which are all categorical with multiple categories each represented by a number for example one such variable can have 20 levels few of them are given below: " 1 High Income, expensive child 2 Very Important Provincials 3 High status seniors 4 Affluent se...
I have question on the methods of performing meta analysis. I have data that consists of multiple Randomized Control Trials (RCT) with different dose levels and observational studies with different dose level as well. The responses are brain pressure measured as continuous random variable. So my understanding is that...
When I trained ANN model, sometime training set has high R-square but testing set has low R-square. How to explain this situation? Is there any over-fitting problem? (Show in figure)
In this question, I do not understand how to create the random values from this density function. The plot histogram part of the question is not problematic. Would someone please give me a hint as to how to generate the random values?
Is the Kaiser rule (choosing only PCs with eigenvalues >1) a suitable method to select the best principal components?
As the title asks: is there a fast (e.g., polynomial) algorithm to compute a 2-means clustering for a cloud of 2D points?