instruction
stringlengths
9
38.7k
First of all, I had a look here and in a couple of other questions: I couldn't find what I am looking for. So my question is purely theoretical (although I have an example by my hands). Suppose I have some data $(x_i,y_i)$ for $i=1,..,n$. Suppose I fit the following models with IID $\epsilon_i \sim N(0, \sigma^2)$ for...
I have N objects and the mean of one attribute A1 is namely, M1 and the standard deviation of the attribute A1 is namely, S1. This N objects is divided into K-clusters. If for cluster Ki, i have a mean of attribute A1 of N1, what technique should i use to check if N1(cluster mean) is significantly different from M1?
In a factory, there are many machines which packaging many type of products. Due to technical problem, all of them damage the product A during the process except three machines with fewer damaged products. Here is the detail table: Machine number -----probability getting Product A -----% cause damage on Product A ...
I have done a regression analysis and have plotted the residuals vs. the predicted values. I would like to know what kind of error model would be suitable for the picture I add. I am a novice in the field and therefore I would love suggestions, references, etc. I am modelling weight of people using a linear function of...
I know that if a statistic is both sufficient and complete then it must also be minimal sufficient. But on the other hand, could I say a minimal sufficient statistic must also be a complete statistic?
A drug trial is conducted identically in two different groups that are essentially similar at baseline. Can I obtain a joint mean and a joint SE? For example, Group A has placebo group of n=224 mean of 37.6 SE of 3.3 Group B has n=236 mean of 30.9 SE of 3.0 What is their combined mean and SE and how do you do it?
We have two identically distributed, independent, uniform variables on interval $[0,1]$ : $X_{1}$, $X_{2}$. And $Y_{1}=\max(X_{1},X_{2})$, $Y_{2}=\min(X_{1},X_{2})$. I want to find distribution $f(y_{1}|y_{2})$ and $f(y_{2}|y_{1})$. So I tried to approach it like this: firstly try to calculate distribution of $f(y_{1},...
Let's say I have a data set where the goal is to forecast the future customer base of a cell phone carrier. The data is set up in monthly snapshots, where I have information for each customer at the beginning of each month, along with the exact date the customer left the carrier (if it occurred). I also have covariates...
I am trying to find $E_\alpha[\beta^TD_\alpha X^TXD_\alpha\beta]$ where $D_{\alpha} = $diag$ (\alpha_i)$. $\beta$ is p by 1, $X^tX$ is p by p, and $D_\alpha$ is p by p. Note, the expectation is over $\alpha$, not $\beta$! I would like to better understand the results of a paper that finds the above expectation in ter...
My question is similar to this one about whether or not tidy data vary by context. My initial reading of Hadley's article on the concept (here) led me to believe that all data can be reduced to a tidy data format (i.e., the quote about happy and unhappy families), and that the format is consistent regardless of the spe...
In every example I see(spam, negative vs positive tweet , weather study...) there is always the assumption that the input features (or variables) are independent. In order for me to be able to understand whether naive Bayes can be applied to my problem, I need to truly understand what dependent variables means. I know ...
This is a simple question. Suppose $V_1$ and $V_2$ are distributed independently and uniformly on the unit interval. I want to find the expected difference $V_2 - V_1$ conditional on $V_2 > V_1$. I know the answer is $\int_0^1\int_0^{v_2}2(v_2-v_1)dv_1dv_2 = 1/3$. I have also verified it by computation. Why is there a ...
Say that I have a set of training examples with binary 0-1 labels, and corresponding regression labels ranging from 0 to 1. Normally, to compute AUC I've used the ROCR package in R, which also allows me to compute the optimal cutoff point. In addition to these labels and predictions, I also have a weight column which...
The size of training data is critical for deep learning. For image classification, I saw people making arbitrary training images to improve the accuracy. Is it possible to generate arbitrary training data for document classification problems? For images, people can rotate, shift the images. So how can I manipulate the...
I'm not too sure how to interpret the coefficients of a variable that has more than 2 levels. Please note that my model contains explanatory variables that are numeric, binary, and with multiple category Given that my response variable $$0 = \text{no late debt payment} , 1 = \text{has late debt payment}$$ and one of m...
I recently got to know about projected gradient descent and have a question. My understanding is that when you have constrained optimization problem, you use the duality to solve an easier dual problem, which also gives an answer to the original problem. Is the projected gradient descent just another method for solving...
I'm trying to demonstrate there is a bias in judging of academic talks. There was a competition of talks where there were 147 talks given in 23 sections. In each section, there was a judge that determined the best talk from the group. I have a list of the winners of each section, and believe there was a bias to talks g...
I need to find a design that would deal with nine factors with two levels, and four factors with three levels. To be precise, I need an orthogonal array balanced on the second order (i.e., all pairwise combinations of factors are present in the array the same number of times), but it seems to me it is easier to find th...
I'm following tutorial in xgboost docs: https://xgboost.readthedocs.io/en/latest/model.html I'm stuck on this step: I don't understand how the first term (loss) was transformed, they seem to not be equal (sympy says so too). I'm thinking there may be some magic with constant term involved?
I have a data which is a series of standard errors(SE) of n elements. I need to get the a measure of collective noise in the data which takes in account of individual standard errors(SE) of all the elements. The way I feel I can do that is as following. I can get variance (VAR) of each element by multiplying SE by squa...
There are several posts on here about this question. The gist of them, as far as I understand, is that you cannot compare RMSE or MAE of two models where one is log transformed on the dependent variable since they are on different scales. So you can compare thousands of dollars to thousands of dollars but not log(thous...
I've been reading Shalev-Shwartz & Ben-David's book, "Understanding Machine Learning", which presents the PAC theory in its Part I. While the theory of PAC learnability does appear very elegant and remarkable to me, I'm not so sure about its implications on practical machine learning problems. What is the primary uti...
Training after 15 epochs on the CIFAR-10 dataset seems to make the validation loss no longer decrease, sticking around 1.4 (with 60% validation accuracy). I've shuffled the training set, divided it by 255, and imported as float32. I've tried numerous architectures, both with and without dropout in the Conv2D layers and...
To construct the half-normal probability plot, plot the absolute values in a certain statistical diagnostic (residual, leverage, Cook distance and others) versus $z_i$ where: $\displaystyle z_{i} = \Phi^{-1} \left(\frac{k + n - \frac{1}{8}}{2n +\frac{1}{2}}\right)$ $\therefore$ Applied Linear Statistical Models, (Kut...
A requirement for many statistical and machine learning prediction models is the independence of observations. However, when using oversampling we reintroduce the same observations in the dataset. How can this be legitimate given the independence requirement?
I've been working a little with weka and so far I haven't made my own database to apply a classifier but I've tried to look at the already existing files and from what I've seen there is absolutely no problem with using a mix of categorical and numeric variables and then applying a classifier but I got so confused beca...
The pictures show the same response-covariate association. The response represent a large count variable (number of sperm). When I fit a normal linear regression the beta coefficient is significantly different from 0, whereas when I fit a negative binomial model the association is not significant any more. It seems tha...
Exposure and offset are two techniques often used in Poisson regressions by actuaries to predict claim frequency . From my understanding, offset and exposure are the same things, so I don't understand why there are two terms to describe the same thing. Is it correct or there are special cases (other than Poisson regres...
I have N individuals with M features. I call the mean of the N individuals on each M feature a "Grand Mean" For example, on feature F1, I call it "Grand Mean of F1". Now, If I have K clusters INSIDE the N individuals, I can compute the mean of Feature 1 (F1). I do not know what statistical test to use to check if "ther...
I don't understand why we have to consider covariance. Is there any problem if I just intuitively understand Var(Y) as variance vector of Y?
I've been working on the generation of music. Particularly, given a target sound I would like this sound to be modified depending on an input signal. Say, I play the piano and I want to generate a drum sequence based on the targeted one. Both sounds are in a time-frequency representation (STFT). I'm reading here that d...
Offset is commonly used in Poisson regression to take into account different exposure (different time periods for instance): offset = log of exposure Question: what's the typical use case of offset in logistic regression? I assume we can't do exposure (proportional effect) in classification problems since E(y|x) can't ...
I have found a web page telling that for lmer: If your random effects are nested, or you have only one random effect, and if your data are balanced (i.e., similar sample sizes in each factor group) set REML to FALSE, because you can use maximum likelihood. If your random effects are crossed, don't set the REML argumen...
I made an SVM regression model in R using e1071 package for forecasting daily electricity demand. My dataset consists of daily weather and energy consumption data from 1/01/14 till 31/12/16. I trained and tested my model. How will I start forecasting from 1/01/17 for next the 30 days
Does anyone know of a metric that quantifies the bias-variance tradeoff of a given fitted model? I'm not talking about measuring the MSE in cross validation, I'm interested in a single generic or model-specific metric (or statistical test) that measures the degree of bias and/or variance of a fitted model.
After starting with the official binary classification example of Keras (see here), I'm implementing a multiclass classifier with Tensorflow as backend. In this example, there are two classes (dog/cat), I've now 50 classes, and the data is stored the same way in folders. When training, the loss won't go down and the a...
So here are the basic facts: My population is a city. The sample is 500. I am calculating how many minutes it takes by foot to walk to their nearest shop. The participants are split into two groups: car users n= 210 and public transport users n=290. I want to see if the means differ between the groups. Which test shoul...
I am running up against a very tough inverse problem that I suspect might be solvable using machine learning. Here is the problem. Overview I am studying an object $X$ which, internally, is composed of two functions $f_1(x)$ and $f_2(x)$, $x \in [0,1]$. I want to know what $f_1$ and $f_2$ are, but I can't measure the...
I have two matrices of samples $A, shape(A) = n \times k$ and $B, shape(A) = m \times k$. We can assume, that each row in $A$ and each row in $B$ is sampled from a Bernoulli distribution - the values are Boolean. (But each row may have different parameter for the distribution.) In other words, I have $k$ samples and f...
Are there any known techniques or methods to extract and identify decays from a time-series of data? By "extract and identify" I mean finding similar features as those in the blue boxes in the figure.
The following is an assignment so please do not provide complete answers. I just need an hint since I spent hours coming up with nothing. The problem is the following. Given a stationary VARX process $$ Y(t) = \mu + \sum_{p=1}^P \mathbf{A}_pY(t-p) + \mathbf{B}U(t) + \epsilon(t) $$ with $Y(t) \in \mathbb{R}^n$ with $t=1...
In this bioinformatics paper: paper link is used the following DNN (Deep Neural Network): where some input nodes were added (concatenated) to the first hidden layer. Does anybody know the name of this technique? I would like to know more but I can not find any information about it.
I have conducted Spearman's Rho tests with two ordinal variables (one with 4 possible answers and the other with 6). I have obtained a statistically significant correlation between the two. My question is, how can I graphically (or some other way) determine which answer of each correlate together - as a scatterplot wou...
I am running a regression on real GDP growth as the dependent variable. I am trying to include an initial year for GDP as an independent variable to control for the initial state of development in a time series regression focusing on one country. How should I implement in this in STATA? i.e. What should the new Initial...
So my sample is 500 and split in two groups. The data is the distance in minutes to the nearest supermarket. There were 500 respondents in total and broken down into two groups (male and female). I want to compare is for significant difference. Group 1 = n= 210 Group 2 = n= 290 I have checked and it looks like the dat...
There has been a lot of discussion on interaction terms on this site but I'm looking at a specific situation: I have 3 groups and a continuous independent variable X;Group1, Group2 are represented by indicators G1 and G2 and Group 3 is the baseline group. The regression Y = m + b1X + b2(X*G1) + b3(X*G2) shows the in...
Suppose that we have a network which performs poorly on the training set, something like ~40% accuracy. Does it make any sense at all to add a regularisation term in such case? Isn't it only needed when overfitting occurs?
This question is related to text analytics. I have text files which contain customer feedback for a chain of retail stores. My objective is to extract 5 main topics or entities from that data and score each store based on those entities and customer feedback corresponding to that store. Can someone tell me how i can d...
I am wondering why in most of the literature when they measure the relationship between GDP and a certain phenomenon (For example Judicial Independence). Initial GDP is put as a first independent variable. Do anyone knows the justification for that? example: GDP (over period 1990 to 2008) = initial GDP (1990) + Judic...
I am just curious about how Random forest calculates the (Out-of-bag) OOB error rate. In my course note, it says that RF will predict each observation using only trees in which that observation does not appear. It makes sense but what if a observation appears in all the tree, how can we calculate OOB error rate for thi...
I am somewhat new to statistics and for my degree, I am required to take a statistics course. We have recently started to look into sampling distributions, point estimators, statistical intervals, and the central limit theorem (CLT). One thing that I cannot seem to understand is how we can determine normality - or the ...
One assumption of the Poisson regression is that the target variable follows a Poisson distribution. Do that also mean that each individual prediction given by a Poisson regression follows a Poisson distribution of parameter lambda = the predicted value y_hat ?
I ran a mixed effect model in R by using lme() to analyze the following data (an excerpt is shown in the following): name day daily_amount lag_raised_amount inv_count length <chr> <dbl> <dbl> <dbl> <dbl> <dbl> 1 abcde 2 232 1901 20 58 2 abcde 3 ...
I know the definition of sublinear and superlinear convergence but I have some data which seems to be neither sublinear nor superlinear (unless I am mistaken). Sublinear convergence: $e_{k+1}/e_{k}=\mu$, $\mu_k \rightarrow 1$ as $k \rightarrow \infty$ Superlinear convergence: $e_{k+1}/e_{k}=\mu$, $\mu_k \rightarrow 0$...
Let's say we are using multinomial naive bayes to perform a classification task based on ONE categorical feature. As an example, the categorical feature could be a "Store-ID" and each training example is a recorded transaction. Now say that we have 5000 unique values for the Store_ID, out of which 2000 are such that ...
In this answer the author shows using ANOVA to compare two models and use the likelihood ratio test to decide keep the rank variable. The likelihood ratio test is highly significant and we would conclude that the variable rank should remain in the model. My question is has ANOVA be used for feature selection in large...
I'm searching for a computationally efficient algorithm to calculate the sliding mean deviation from sample $x_a$ to sample $x_b$ belonging to a large set $x_0, x_1 ... x_n$ with the condition that $a$ and $b$ are incremented by 1 at every iteration and the window size $a-b$ is constant: $$\frac{1}{a-b+1} \sum_{i = a}^...
According to this post, The choice between a t-test and a z-test, therefore, depends on whether or not σ is known prior to collecting the data. In classical t-test example, one sample t-test can be used in quality control. We can get a sample of product and compare sample mean to design value. But, I do not understa...
I'm a geology student and I'm currently doing my thesis at a mining company. I've been asked to search the chemical variables (basically chemical elements) that negatively impact the most on the metallurgical process. I've got a small database (100 representative samples of the mine with their chemical analysis and met...
I am unaware of how to generate a sample data set for reproduction that has the same characteristics as my actual data that would deliver similar results when running a log(response_variable) model vs. a regular non transformed equivalent. My goal here is therefore to provide some detail about my response variable and ...
I want to find out from a given data set the influence of following type of variable on outcome. 1. Continuous variable 2. Discrete variable E.g. I am selling watches and watch has set of discrete variable like type, style, ageclass,brand which may influence what purchaser is looking... There is another set of continuo...
In my firm I am developing a model using a probit model. I noticed that when benchmarking with a logit specification, the logit slightly improves the model goodness-of-fit. Talking with a colleague he argued that, this is purely luck because the probit and logit are very similar. He also said that I can apply a monoto...
As part of a survey I had to conduct Kruskal-Wallis H test. The aim of my study is to understand whether the current waste management practices in households have any effect on people's interests in selecting a centralized waste treatment programme. Current management practices (independent variable) are divided into ...
I'm new to statistics and I have just come across the term "statistical confidence". I'm not too sure what it is or how it works but I would like to understand it first. I've tried to search for explanations online but they are all quite technical for me to understand. I would like to have a more intuitive explanation ...
I am working on a question for a course. How can I calculate the probability of a daily return of -20.5% in S&P500 (i,e s&p500 dropping 20.5% or more in one day, this day can be tomorrow or in next 50 years) The following are given: Annual Volatility= 20% Stock returns follow lognormal distributin I am using python re...
In the textbooks and in code examples, the Kalman filter equations usually have the prediction step first followed by the measurement updates. Specifically, inside the loop that iterates over the measurements, prediction is first and then the measurement update step. My question is the following: Is it correct to swap...
I have three types of food (Fish, Beef, Pasta) and for each food I have the average of the pH level. For each food and pH level, I have three repeated measures showing the amount of aluminum. I want to check whether the amount of aluminum in food depends on the pH of food by adjusting for the effect of the type of food...
For an SVM classifier, how can I get the confidence of each prediction ? I thought of adding a "unknown" class, but I don't quite see how to do it ( what values ?) While theory is highly appreciated, I would be glad if you can give me hint(s) on how to do it in scikit-learn.
In the introductory part of a Russian document I was translating, there was a simplified description of a control chart-based quality management system. The description contained this sentence in Russian: Контрольные границы определяют предел ожидаемых изменений процесса, когда действуют наиболее типичные для этого п...
In machine learning, cross-entropy is often used while training a neural network. During my training of my neural network, I track the accuracy and the cross entropy. The accuracy is pretty low, so I know that my network isn't performing well. But what can I say about my model knowing the cross-entropy?
I have only 1 month of day to day survival rate data on a plant subject. I want to be able to use this data to predict the survival rate for all the future months. Is there any way that I can do that in r using existing function? Basically, I have something like surv(time, death)~1. I have no other variables that I wan...
So in SPSS I did a mann-whitney u test. There is significant difference between the median ranks - p score below 0.5 But, it also provided a Z score along with a W and U score. What is the z score for and what can i do with it?
I have edited to better reflect what my question is. I would like to better understand chance and how to calculate probability. I am presented with three options, A, B, and C, and a prize is arbitrarily assigned to one of them. If I guess the correct option, I get a prize. I have a 33% chance of getting a prize if I gu...
Many statistical papers or articles present very nice draws of graphical models. Example: this on LDA from wikipedia https://upload.wikimedia.org/wikipedia/commons/thumb/d/d3/Latent_Dirichlet_allocation.svg/250px-Latent_Dirichlet_allocation.svg.png or this, pg 7, directly from the paper: http://ai2-s2-pdfs.s3.amazonaws...
This is a repost from stackflow forum. My purpose is to discover key relationship between variables. I have several categorical variables such as "nationality, office locations, job title" etc. In total I have 14 categorical which created about 100 dummy variables and 6 continuous variables. My dependent variable i...
I am analysing business cycle effects on health behaviour (smoking, alcohol abuse etc. and want to see whether the size of the recession or the fact there is a recession is more important. Hence I am using gdp growth and recession in my regression. $cigarettes smoket_{it} = β_1 * employment_{it} + β_2 * earnings_{it} +...
I want to compute the derivative of: $\frac{\partial y^T C^{-1}(\theta)y}{\partial \theta_{k}}$, (Note that C is a covariance matrix that depends on a set of parameters $\theta$) for which I used the chain rule: $ \frac{\partial y^T C^{-1}(\theta)y}{\partial \theta_{k}}= \frac{\partial y^T C^{-1}(\theta)y}{\partial C(\...
Policy and value iteration algorithms can be used to solve Markov decision process problems. I have a hard time understanding to necessary conditions for convergence. If the optimal policy does not change during two steps (i.e. during iterations i and i+1), can it be concluded that the algorithms have converged? If not...
I have two classes A and B. 98% of the data belongs to class A and 2% of it belongs to class B. Size of the entire dataset is about 2000. I am interested in correctly classifying all the data points that belong to class B. I want to perform classification on the aforementioned dataset but I am not sure whether the clas...
Suppose you want to predict the outcome of some real valued function $f$. The details of the function are unknowable and it also has a stochastic component. You identify some variables $\theta$ which you think could help to predict $f$. You suspect that $f$ is non linear in $\theta$ so you decide to implement a neural ...
Perhaps I'm missing a simple conceptual point here. But do the error statistics (RMSE, MAE) not tell which is the best forecast by presenting the lowest figures between the forecast and the actual figures? Why then do we need to compare two forecasts directly, given we've already established which is one is superior vi...
I'm checking my ability to predict a binary outcome using SVM. While the model fits very well, when resampling the model performance drops (but not so much when using logistic regression) which makes me think that SVM overfits this model, but as I understand this should not happen unless cost is set to very low. I'm us...
I am reviewing some notes from an old statistics course in preparation for a big upcoming exam I have. I have an old book by John E. Freund, Mathematical Statistics (5th Edition) that has a number of problems in it that I'm using to prepare. One of them, 3.67 (pg. 123) asks "Find the joint probability density functio...
I am using the lrm function in the rms package in R to fit a logistic regression model. The function outputs various useful stats, including Brier score. Is it possible to output the confidence interval for these statistics, especially the Brier score? If not then what are the other ways of doing this? EDIT: The calcu...
I'm building an image recognition system that classifies cars from 10 different models. The input data is a folder with 100 images for each model. I am having difficulties because the model stagnates at 16% accuracy when tries to predict the test set. My question is: are there any major pitfalls in my script that are ...
I'd like to automatically determine whether a form which is filled in by hand and then scanned or photographed is "valid". To be considered valid, the form has to satisfy the following two criteria: Two given checkboxes have been checked. There is a signature. One approach to solve this would be to use an optical ima...
I am studying method of moments and GMM in the context of econometrics. Can someone explain on intuitive level, what does it mean to match moments? And how does this differ from the classical linear regression model, for example? Some terms and commonly used clauses I would appreciate gaining clarity are: Orthogonalli...
I did a mann-whitney u test. There is a significant difference - p value below 0.05 It also provided a Z score along with a W and U score. What is the z score for and what can I do with it?
I have a collection of data for a multiplayer game (2000 games, 10 players each). I would like to create clusters from this data, each containing the ids of 3 players that had played against each other. For example, assume player A played against player B, B played against C, and C played against A. I'm trying to figur...
This is the google trends result obtained for "Naive Bayes" phrase from Jan 2004-April 2017 (link). According to this figure, the search ratio for "Naive Bayes" in April 2017 is about %25 higher than the maximum in the whole time period. Does this imply that this simple and old method is gaining more attention? Why? A...
I generated 3000 observations (3000) and carrying out multiple linear regression. Prior to regression i randomized my observations five times and then selected 30 % of the observations for testing and 70 % for training. I discovered that when i choose a different set of 30% of my observations i get slightly different ...
Is it reasonable to use an information criterion such as AIC in which the maximized likelihood function is replaced by the maximized posterior function? I know there are other criteria designed specifically for a bayesian setting, but I'm still curious about this adaptation of AIC.
I am trying to deal with data imbalance within a small dataset. Just found an article talking about SMOTE and MSMOTE here It seems that MSMOTE can overcome the shortages of SMOTE, so I really want to try it. MSMOTE paper is published in 2009, however I could not find any library related to MSMOTE in R or python. Do you...
[I deleted my previous question, which was wrong] Define: $\boldsymbol\theta=[\theta_1,~ \theta_2]^T.$ With both $\theta_1, \theta_2$ scalars. The FIM is given by: $\mathbf{J}_{\theta\theta}=\begin{bmatrix}{J}_{\theta_1\theta_1}&{J}_{\theta_1\theta_2}\\{J}_{\theta_1\theta_2}&{J}_{\theta_2\theta_2}\end{bmatrix}.$ I know...
I am trying to fit penalized model for binary outcome with few events and correlated covariates. Probit and logistic regression models are among the most widely used models for binary outcome. I am wondering why penalized logistic regression has been developed and codes written but not penalized probit regression?
We are developing a cache for virtual reality images for painting recognition. To simulate our approach and make tests, we submit queries according to the visit distribution of a museum. Unfortunately, there is not a lot of documentation about this, except this work, where Figure 3 is the "distribution of the stay time...
If I want to use naive bayes with laplace smoothing and therefore add 1 to probabilities with the value of 0, what does this mean for probabilities which have the actual value of 1?
I'm doing a kalman filter and I need to sum two covariance matrices (Q1 and Q2) regarding two uncertainties I need to join. I'm tracking the position of an object from a referencial with a changing position and orientation. As the position of the moving referential also has an uncertainty, it also has a covariance matr...
In his post, one of our colleagues asked if it is possible to find the shape parameters of a $Beta(\alpha,~\beta)$ distribution given knowledge about its $\mu~(mean)$ and $variance$. However, my question is how in R I can find shape parameters of a $Beta(\alpha,~\beta)$ distribution given only its quantiles (say, lower...
In my application (spaced-repetition system for quizzes), I have an unknown half-life (in units of time), $h>0$. This half-life governs a Bernoulli trial $X$, such that $P(X=1) = 2^{-t / h}$, for some known, deterministic time $t>0$ (same units as $h$, this corresponds to when the Bernoulli test was conducted). I’d lik...