instruction
stringlengths
9
38.7k
I am working in biostatistics and often have the following conversation with medics: we are talking about some very interesting, but also very rare, disease/disorder (or side effect of a drug) until the point comes, where somebody says "the prevalence of this disease/side effect is only 5 per 1 Million people". I alway...
LSTM state consists of two vectors, one is short-term $h_t$ and the other is long-term $c_t$. Together with the input vector $x_{t+1}$ they form the total input to the following cell on each step. This seems logical and, apparently, works very well in practice. What I don't understand is why the cell output is just $h...
The probability density function is well characterized: it has to be measurable, and must integrate up to 1, and it must be non-negative over its support. In this case, the parameter vector is seen as fixed, and housed within a family of parametric distributions, like Exp($\theta$) or Weibull or... For estimation and s...
I am wondering if there is in use a notation for a standardized random variable? If $X$ is a random variable following some parametric distribution with mean $\mu$ and variance $\sigma^{2}$, then if there is a notation for the standardized random variable $\sigma^{-1}(X-\mu)$?
$$ y = \beta_{0} + \beta_{1}x + \varepsilon, $$ where $\varepsilon\sim N(0,\sigma e). $ How do I calculate epsilon in this context? I know and understand all of the other variables however I cannot seem to figure out epsilon.
My question is very basic: I understand linear regression and how to use it. I would like to know what to use in statistics when I don’t have a dependent and independent variable. For example, I understand how we could use height to predictic weight but I only have one variable. Take for instance if I have four people ...
How are we supposed to judge whether​ $R$ and $R_1$ are related and if they are, then how?
Imagine I have 100 marbles in a bag. Each marble is uniquely labeled. I want to draw 9 marbles out of that bag all at once. I call this a selection. Once I have draw 9 marbles, I put them back. I make 50 such selections (in other words I draw 9 marbles and put them back 50 times). I need to know the probability of sele...
As I read through the site most answers suggest that cross validation should be done in machine learning algorithms. However as I was reading through the book "Understanding Machine Learning" I saw there is an exercise that sometimes it's better not to use cross validation. I'm really confused. When training algorithm ...
Not able to figure out the difference between hard and soft voting in context to ensemble based methods In my view they are doing the same thing. In hard voting, the voting_classifier counts the number of each class_instance and then assigns to a test_instance a class that was voted by majority of the classifiers. In ...
I read logistic regression formula i.e. $ \log\frac{P(C_1|X)}{P(C_2|X)}=w^Tx+w_o$ but this equation is true if we have $P(X|C_1)$ and $P(X|C_2)$ sampled from two Gaussian with the same covariance matrices ($\sum_1=\sum_2$); furthermore, we can derive the sigmoid transformation $P(C_1|X) = \frac{1}{1+ \exp{(-(w^Tx+w_o)...
In other words, I have a binary classification problem with million samples and around 1000 features. I am trying to understand wheather I should subsample the dataset and add a feature selection step (and approximately how many features I should retain)
I know that if a P value is less than 0.05 we can reject the null hypothesis and state that the finding may be statistically significant however I remember reading something about if the 95% confidence interval includes 0 that its not a significant finding or something like that (i tried to find what i was reading but ...
I was thinking about the meaning of location-scale family. My understanding is that for every $X$ member of a location scale family with parameters $a$ location and $b$ scale, then the distribution of $Z =(X-a)/b$ does not depend of any parameters and it's the same for every $X$ belonging to that family. So my question...
I did a little Google Search on machine learning and got this: Machine learning is the ability of a system to learn without being explicitly programmed. So I decided to attempt to do this on java. PS: I will include the code at the end as it is quite long. I created a very basic program that let's you input the "Name...
Curve fitting, using conventional measures of error, such as LSE (Least Squares Estimation), cannot include the complexity of the formula because the complexity of the formula must be measured in bits and is therefore incommensurable. However, if one can measure the total error in units of bits, it can be added to the...
As a beginner user I have a lot of experience in ETL (extract, transform, load) process. I work with large datasets on daily basis. Data collecting is very time consuming and requires a lot of resources. The problem arises when we have data but we don't know how to analyze and make it useful. I have a list of numbers (...
I read this abstract (unfortunately, I have no access to the full text): https://doi.org/10.1136/bmj.318.7177.193b. How is it possible for 95% confidence intervals of sensitivity and specificity to exceed 100%? Does it depend by the computing method? Eventually, may a specific computing method be used? (I use R)
I am reading an awesome introductory HMC paper by Prof. Michael Betancourt, but getting stuck in understanding how do we go about the choice of the distribution of the momentum. Summary The basic idea of HMC is to introduce a momentum variable $p$ in conjunction with the target variable $q$. They jointly form a phase ...
A response scale has the categories (strongly agree, midly agree, midly disagree, strongly disagree, do not know). A two-part model uses a logistic regression model for the probability of a DK (don't know) response and a separate ordinal model per the ordered categories conditional on response in one of those categoeri...
I am doing some work regarding my master's thesis in networks security. I have decided to work with Game Theory, calculating the Nash Equilibrium for a two player zero sum game. However, I have also read that Markov Chain Model can be used to calculate Nash Equilibrium and this is confusing me. What is the relation bet...
I am planning a trial in which I have two groups: A and B. The plan is to have 40 subjects in each group, a total of 80 subjects. There is also a need for stratification by site, where 4 sites are planned. Theoretically, the ideal is to have 20 subjects in each site, and with block randomization, I get a 1:1 ratio, wit...
I am currently trying to use classification analysis for some EEG data. As such data is of very high dimensionality, I am looking at using PCA for dimensionality reduction to prevent overfitting of the classification models. My data structure is approximately 50 (rows, observations) times 38000 (columns, variables). I ...
I'm working on developing a physics lab about radioactive decay, and in analyzing sample data I've taken, I ran into a statistics issue that surprised me. It is well known that the number of decays per unit time by a radioactive source is Poisson distributed. The way the lab works is that students count the number of d...
If you regress randomly generated independent variables on a randomly generated dependent variable, is the expected R squared value simply a function of n (the # observations) and k (the # of independent variables)? If so, why is this? In some old regression course notes I was re-reading, I see that the expected R-...
I have 10 (many more available) independent variables (IV) and one dependent variable (DV). I do not have specific hypotheses to test but am using an exploratory approach to find the IVs that can explain the DV. I am running a vector auto-regressive (VAR) model. When I run the DV on each IV separately, only one of the ...
I am trying to grapple with the following problem. I have an application that develops empirical distributions. In essence, I end up with a histogram of equally spaced $x$ values, with both a $max$ and a $min$, and the probability for each bucket. What I need to do is 'compress' it for storage (there may be 1,000 t...
How confident can you be that a test is reliable (and measures what it is supposed to) if the number of sample units (in a random sample) above 1% or below 1% is small? There might be many sample units around the mean or median but as you approach the tails of the distribution <1% there are fewer and fewer sample units...
I am pretty new to bayesian statistics and PyMC3. I am doing a hierarchical model where the output variable I am trying to predict is a percentage with a maximum of 100%. My problem is that my posterior distribution includes values greater than 100% which is impossible in my situation. I configured my Y values as be...
There is an interesting exercise which shows k-fold cross validation fails in some cases. The exercise is as follows: Consider a case in that the label is chosen at random according to $P[y =1]= P[y =0]=1/2$. Consider a learning algorithm that outputs the constant predictor $h(x)=1$ if the parity of the labels on the ...
I've created a market simulation with a few different types of agents that trade with each other based on simple rules that sample from parametrized random distributions. I can choose reasonable values for the parameters by hand, but there are too many (a few dozen) and their interactions too complex to easily make the...
Premise In Taylor's original Principles of Scientific Management, the optimal weight of a single shovel load was calculated (roughly 21 pounds). This had some interesting implications: short of this optimal load, you are simply wasting energy; conversely, exceeding the optimal load results in rapid fatigue. Essentially...
I have a dataset with different types of user events, and I'd like to set a metric of user activity. I don't have any labeled data of the actual perceived activity level of users. The data consists of around 10 different types of events (count of events normalized by usage time). For example: +---------+--------+------...
I would like to simulate the p-value of Pearson's chi-squared tests through a Monte Carlo method. Please correct me if I am wrong: imagine the Yates' correction for continuity may be useful for my data (as I read on https://en.wikipedia.org/wiki/Yates%27s_correction_for_continuity), does the simulation make it useless?...
I would like to have a degree of uncertainty of my predictions for each prediction I will perform in my new data. Is the procedure I have in mind reasonable? Suppose I am modelling a binary classification data. I have fit a model on a training data and run it on my test data. Now for each prediction on my unseen new d...
Firstly, I'm not sure whether this is the correct site but I also assume the question is not too different: Assume there are two curves: One is considered as a reference curve and the other is just an another or "measured" curve. I want to transform the measured curve in such a way that it fits the reference curve. I...
I would like to find the mean of all z-scores above a z-score cutoff. For example, what is the mean of all z scores above a z of 1.96 in a distribution N(0,1). (My calculus skills are modest.)
We have the following model that was proposed to me. It takes yes, no and maybe responses to try and predict attendance $y_{i}$. $$ \begin{align} y_i &\sim \mathsf{Bin}(n, p_i) \\ p_i &= \mathrm{logit}^{-1}\big(\beta_0 + \beta_1 I_{X=1} + \beta_2 I_{X\in (0,1)} x_i\big) \end{align} $$ dummy variables: $I_{X=1}$ that re...
I found a very basic but usefull chapter on GMM available here. Does anybody know the title and the author of the book containing this chapter?
I am trying to build ARIMA model, I have 144 terms in my standardized time series, which represent residuals form original time series. This residuals, on which I would like to build ARIMA model, are obtained when I subtracted linear trend and periodical component from original time series, so residuals are stochastic ...
Sampling from a maximal coupling of 2 univariate Gaussians will give you a bivariate distribution which is not bivariate Gaussian. A bivariate Gaussian can be parameterized with a correlation parameter $\rho$. I assume that the maximal coupling distribution will have a larger correlation than the bivariate Gaussian but...
I have a data set where one independent variable perfectly predicts the outcome. Specifically, age will perfectly predict if the user will buy the product. However, I also have a number of other variables such as income, marital status, and gender. When creating a model using a decision tree, it only uses the age vari...
Imagine a simple random walk where $x_n=\sum_{i=0}^ny_i$ and $y_i = \begin{cases} 1, & \text{with prob 1/2} \\ -1, & \text{with prob 1/2} \end{cases}$ Then say we want to find the probability that we reach a certain positive value before a negative one (i.e., the probability we reach 100 before reaching -50), given an...
While using QQ Plots, I always notice these 'groups' of points; many sets of points arranged in a straight line and sometimes in a curve as shown below: exponential: normal: The theoretical quantiles are from exactly the same distribution as the simulated random vectors. I used the following R code below for these pl...
I want to approximate a region of the sin function using a simple 1-3 layer neural network. However, I find that my model often converges on a state that has more local extremums than the data. Here is my most recent model architecture: layers: x, h1, y dimensions: 1, 128, 1 activations: tanh, tanh error functio...
I am developing a mean reversion pairs trading strategy using tick data for each asset. The tick data does not come in fixed intervals. For example it looks something like the below: The timestamp is the UNIX timestamp. To calculate the spread between my assets, I first check that the two timestamps match, and then s...
I have trained an image classifier (for my own face) via the transfer learning method, in two ways (in order to compare efficiencies later on): 1- I created a docker image, built on top of tensorflow's mobilenet network, and trained it with my own dataset. training was succesful and generated two files: /retrained_g...
I've been working on fitting a time series generated from an indicator in stock market, whose frequency is 1 minute and length is 1433. This series is stationary, proved by many stationarity tests. The graph of this series lies below. However, I faced great difficulty fitting this time series, though it passed neither...
I computed a word vector model on medical reports on a critical disease and run a logistic regression on a binary classifier. Text data is labeled with 1=successful and 0=non-successful for the true outcome of the treatment. I train with 90% of my data and test on 10%. The dataset contains about 30% successful and 70% ...
Does Oja's rule for normalized Hebbian learning always result in a unit eigenvector which corresponds to the largest eigenvalue? Or are there any specific conditions or assumptions under which this is true? Does Oja's rule require explicit normalization of the unit vector, and what would be the effect of doing so, if a...
Suppose I have a random variable $X$ with the following distribution: $$f(x|\theta)=\sum_{k=0}^{\infty}{p(k|\theta) \cdot \varphi_k(x)},$$ where $p(k|\theta)$ is some discrete probability distribution for random variable $K$ and $\{\varphi_k(x)\}$ ($k \in \mathbb{N}$) is a set of probability distributions for random va...
I have a binary treatment, and 6 continuous outcomes (at least, they can take from 21 to 49 distinct values), all measured at baseline and at 3 time points after the treatment. I was thinking about the following global tests on whether or not (given baseline values): 1) for each post-treatment time point, the treatmen...
I have more of a high-level question. I’m trying to design a neural network for flower detection. The images are 440x440x3 pixels (RGB) and are taken by drone so flowers are white dots (of radius up to 10 px). I have already annotated over 2000 images but I’m having trouble with the data representation for the output ...
I am trying to justify the following way of thinking about a classification problem, not necessarily in a strictly rigorous way. Assume that we have a large dataset, $S$, size of $N$ and we have $C$ classes. The dataset is balanced, nearly all classes have equal amount of samples. Further assume that we have disjoint c...
Why does the PACF of AR(p) model cut off past the order of the series? Why does the ACF tail off to zero? What is the intuitive reason behind this?
Is there a intuitive motivation for the Innovations Algorithm used in Time Series for forecasting and parameter estimations? I understand that one objective of the algorithm is to be able to write the linear predictors with uncorrelated terms (the innovations). But why would that be desirable, and how would that transl...
Problem Setup: Let's say a bag contains 100 balls, 60 of which are red and 40 are black. 100 Balls are drawn at random from the bag (with replacement) and before each draw, you have to guess whether the drawn ball will be red or black. Solution 1: You always guess that the drawn ball will be Red. This will result in a...
My problem is a parameters' estimation of highly contaminated normal distribution. Typical estimators of variance such as IQR or MAD are based on the assumption that there are not that much outliers. But what if we have a lot of outliers, probably, more than 50% of points, but all of them are quite distant from the cen...
If MSE is $$ \mathrm{MSE}(\hat Y) = \mathrm{Var}(\hat Y) + \mathrm{Bias}^2(\hat Y) $$ and the Bias-Variance decomposition is given by $$ \mathrm{Err}(\hat Y\,|\,X=x_0) = \mathrm{Var}(\hat Y) + \mathrm{Bias}^2(\hat Y) + \sigma^2 $$ so it looks like they're related, the second one being for a single event, while the ...
I have read a lot about Deep learning, and I'm little bit confused. Most of multilayer Machine Learning algorithms are considered as Deep Learning algorithm. I don't get it, does being a multilayer architecture is what characterizes a Deep learning algorithm or there's something else that I'm missing?
I have a set ${X}$ of $N$ Weibull-distributed variables that are differently parameterized. Let's denote as $S_i(t)$ the probability of survival for variable $i$ at time $t$. $F_i(t) = 1 - S_i(t)$ is the failure probability for variable $i$. I'd like to estimate the expected # of total failures at time $T$. Intuiti...
I was reading the Deep Learning book and came across the following para (page 109, second para): The training and test data are generated by a probability distribution over datasets called the data-generating process. We typically make a set of assumptions known collectively as the i.i.d. assumptions. These assumption...
I would like to calculate the probability of surviving three years after surgery. My dataset has four columns: date of surgery (surgery_date) date of death (death_date) years to death (survival) censored status (death) (1 = patient died, 2 = patient is alive) Data is structured as follows: # A tibble: 370 x 4 surg...
I am having a dataset under this form: It is to be known that this is an ordered structure of data. In other words, custommer 11676 bought item 3297 ,rated it then bought item 776 and rated it. Based on the user's historical records of bought items and ratings,we want to predict the rating of the next item. This is to...
I want to know the relationship between statistical model(regression model) over-fitting and number of parameters to be estimated. This could be a fundamental problem but I appreciate if someone can explain.
I was reading Hal Daume's ML notes and it decomposes a training example into its features and uses a mean and variance for each feature in an example. It asks , for a given class 'k' when can we assume all features have equal variance ? It seems that if the class 'k' is independent of those features, all of them sh...
I'm learning about RBM and I try to understand the notation used for it. We have the input vector $v=(v_i)$ and the output vector $h=(h_j)$, a weight matrix $W=(W_{ij})$ and finally two bias vectors - $a,b$. Normally for an ANN we would say that - $$h=\sigma(v^TW+a)$$ where $\sigma$ is the network's activation funct...
I have several points which appear duplicates in the feature matrix (same values for the features). These points may have different values of the target variable. What is the appropriate way to handle this case during train test split? Should I just ignore the problem and go on with random split or remove duplicated po...
I need to determine probability when user create first file during a day. I have time stamp in format HH:MM:SS. of creation first file during one year period. In order to determine distribution I created histogram in a way to create binds (10 minutes range) and count frequencies. Based on histogram this could be a gam...
The Facenet is a deep learning model for facial recognition. It is trained for extracting features, that is to represent the image by a fixed length vector called embedding. After training, for each given image, we take the output of the second last layer as its feature vector. Thereafter we can do verification (to tel...
Here is my data set. After applying clustering on two variables Annual income and Spending score, I tried visualizing it using clustplot. I haven't scaled any of these variables before applying kmeans. I'm unable to interpret the coordinates which look like some principle components. What exactly they refer to? why mi...
$X$ is distributed with $F$, i.i.d. and with densities. I am trying to discern an expected value for a certain order statistic $X_{k}$ under the condition that $X_{k}$ is closest to some value $\alpha$. To do so, I am trying to write the density of $X_k$ as the normal order statistic density $f_{(k)}(x)$ and a multipli...
What kind of constrains give rise to bimodal distributions in the Maximum Entropy formalism? Are there any known results in this topic?
Here is the question that I am trying to solve. Given: One in eight items in a production process was sampled. This resulted in 11,341 samples from the process These were tested for the presence of a biological pathogen After growing culture from these test about 817 had more than 2 colonies The mean number of colonie...
When we train neural networks, we vectorize all examples and after back propagation , subtract the sum of gradients for all examples per parameter. Would not it be accurate to update parameter for one example, then reuse the calculated parameter to generate updates for the next example. When we calculate all gradients ...
If $B$ is the lag operator or backshift operator used in time series, what's $(1-B)^d(a_0+...+a_{d}t^d)$? We can think of the polynomial as a trend in a time series process. More specifically, what's $Bt^d$? $t^d-1$ or $(t-1)^d$?
I have (for example) 2,000 observations from around 600 individuals measured at 5 time points. At each time point, the observation is associated with a value of 1 or 0. I'm trying to model the change in the probability of an observation being a 1 over time. The way I've tried to do this is to use a GLM with a binomia...
I am trying to run a backward selection in R and to build predictive model for car price (using this car dataset). I can't figure out how to deal with cat. vars fueltype- gas/diesel and fuelsystem- mpfi,2bbl,idi,etc. The thing is, only diesel cars use idi fuelsystem and viceversa. This results in getting NA in my model...
I'm trying to interpret the odds ratio for a coefficient (particularly for a slope that represents the change - in odds - of the outcome over time). If I convert an odds ratio to probability, for example, the odds ratio 1.26, using the formula: $$p\quad =\quad odds\_ ratio\quad /\quad (1\quad +\quad odds\_ ratio)$$ Th...
First I will describe my problem (1), then solutions I found (2), and then pose the question (3). 1) I am a student making a simple program for statistical analysis of data for a biological laboratory. The situation is as follows: They have a protein and measure some property three times (to eliminate measurement error...
Say, I have the following experiment: I have a large bucket of some material and I am trying to determine the melt temperature. So I take small samples and put them on a burner and note the temperature when they melt. For some reasons, the melt temperature will not be identical for each small sample but the results wil...
Memory Augmented Neural Networks have an external memory which helps to learn something with the low amount of data. It also can manipulate the memory in a dynamic manner. On another hand, siamese networks try to learn an encoding for each category and then use that encoding vector in classifying never seen examples. F...
When is $E[Y - g(X)]^2$ at it's minimum value over possible transforms $g$? I guess it's when $g(x) = E[Y|X]$. But i'm unable to prove it. Any ideas or hints how can i start the proof? (If i'm right about the answer)
I have a research question where I investigate the links between a continuous changing variable X (taken as a log of a variable) and mortality. This variable X is measured every three years and in my research question, I wanted to see if the increasing/decreasing nature of this variable (the fluctuations/changes) predi...
Is using a sigmoid at the end of a neural network with 1 label equivalent to using a softmax with 2 labels?
One of the factors for my regression analysis is customer's familiarity with the store which equals 1 if the customer visited the store more than $N$ times and 0 otherwise. Is there a right way to choose $N$? For some $N$ this factor is statistically significant and for some not.
Suppose $X_1,....,X_n$ are $iid$ random variables and for each of them $Variance(X_i)= \sigma^2$. $a_1...a_n$ are also real numbers and $\sum_{i=1}^n a_i = 1$ If $S = \sum_{i=1}^na_iX_i$, prove $var(S)$ is minimum if $a_i = 1/n, \ i=1,...,n$ So i did following: $Var(S) = \sum_{i=1}^na_i^2Var(X_i) + 2\sum_{i<j}a...
Does anyone know of any references that look at the relationship between the Laplace approximation and variational inference (with normal approximating distributions)? Namely I'm looking for something like conditions on the distribution being approximated for the two approximations to coincide. Edit: To give some clari...
I want to conduct a multiple regression analysis on Health Survey Data and have subsetted the one dependent and seven independent variables into a new dataframe. Whilst I now understand how to carry out the following, I am confused as to what order I should do them in, as I fear doing one before another may have implic...
I have a program for heat exchanger calculations which uses correlations that are complex and highly non-linear. I need to come up with an approximation of the function using regression. The function takes two inputs : inlet air temperature $T_{a,i}$ and valve control signal $u$. The output is $\Delta T_a$. I have plo...
Im running a multiple regression model and therefore need to create dummy variables for a categorical predictor variable. This variable is 'YSK87' and its values in the dataset correspond to the following: VALUE LABEL 1 = 1 Person 2 = 2 Persons 3 = 3 Persons 4 = 4 or more Persons Since alm...
I need to make a composite index from the sum of three power-law distributed variables, which vary on different scales and have different variances. For each variable there are many observations with very low scores and few observations with high scores. I need to normalize the variables to obtain a common scale, befor...
I have asked a related question in mathematics section, but I think here is a better place to ask. for both KNN algorithm (classification) and k-means algorithm (clustering), there is a need for a distance metric (like euclidean distance) to compute the distance between two instances. I know there is also other method...
I have been using scripts from package "Agricolae" but realised today that it compares only between the intercepts. I expect that since i am testing for the interaction term using ANCOVA, the post-hoc test should do that as well instead of being a more general comparison. Or am i wrong? Are there are scripts/methods t...
I am doing blind wine taste tests and I want quantitative measures of how good people are. The procedure is: Test subject becomes familiar with wines A and B. For n trials: Test runner randomly selects a wine. Test subject receives the randomly selected wine, blindly. Test subject tastes the wine. Test subject says...
I have two observations for each row of my dataset: My Dataset looks like this: Company1 | 2016 | x1 | y1 Company1 | 2017 | x2 | y2 Company2 | 2016 | x3 | y3 Company2 | 2017 | x4 | y4 ... I want to prove with a statistical test, that the $X$ values are significantly larger than the $Y$ values...
Suppose, I have a histogram (or a "discrete" frequency counter): X = {0.1: 3, 0.2: 5, 0.41: 1, 0.45: 5, 0.5: 3, 0.7: 9} What is the best possible way to convert it to a continuous function, so that, one can query the "frequency" for any number? I was reading on KDE but not able to get my head around it.
I am in the data preparation stages of conducting a multiple regression analysis of US health survey data. The first task I have decided to do is impute missing values from the dataset of 8 variables (1 dependent 7 independent). I have exactly 6000 entries for each variable in the dataset and am trying to impute for th...
We know that Beta distribution is conjugate prior for binomial likelihood. In a course, I am doing on coursera, instructor used beta distribution with alpha as k + 1 and beta as n-k+1 as likelihood instead of using binomial distribution, I am not able to understand the reason behind it. Also, when the shape of binomia...
I am currently engaged in research to find out whether there is a relationship between the number of photo count and the number of visitors coming for whale watching. The first dataset (photo count) is small (approximately 198), while other dataset (no of visitors) are in thousands. Both datasets collected per month b...