instruction
stringlengths
9
38.7k
For example, I have a set of numbers (say 0 to 10) that are presented to 100 subjects. Each subject is asked whether the number is a small or a large number. The results are that 100 people think zero is a small number, 70 people think one is a small number, etc. Now I use a certain distribution, say, exponential to ...
I was reading OkTrends and came across this: In fact, 32% of successful couples agreed on all of them—which is 3.7× the rate of simple coincidence. So, my question is: what is simple coincidence? How is it calculated? I can't find a Wikipedia article about simple coincidence, and nowhere can I find a numerical d...
I have data on the percent of organic matter in lake sediments from 0 cm (i.e., the sediment - water interface) down to 9 cm for approximately 25 lakes. In each lake 2 cores were taken from each location so I have 2 replicate measures of organic matter percentage at each sediment depth for each lake. I am interested i...
Principal component analysis can use matrix decomposition, but that is just a tool to get there. How would you find the principal components without the use of matrix algebra? What is the objective function (goal), and what are the constraints?
While im going through the derivation of E step in EM algorithm for pLSA, i came across the following derivation at this page. Could anyone explain me how the following step is derived. $\sum_z q(z) log \frac{P(X|z,\theta)P(z|\theta)}{q(z)} = \sum_z q(z) log \frac{P(z|X,\theta)P(X,\theta)}{q(z)} $
In the paper of Probabilistic Latent Semantic Analysis by Hofmann, the author fits the model for document $\times$ word matrix through EM Algorithm in section 3. I was able to follow the derivation and meaning of the model derived in it. However in the later section, the author mentioned about Tempered EM for improvin...
I am building a Box-Jenkins model in Excel using solver. The model is AR(2). The data that I have contains trend and seasonality both. I know how to remove seasonality using seasonal indexes and add it back to the forecast. But, how do I handle trend? If I remove trend from the data, how should I add it back to the f...
I've got a question concerning the estimation of a tobit model with the AER package in R. I observed t-distributed residuals, so that the assumption of normal distributed std errors is violated. Fortunately it's possible to choose "t" as the distribution when fitting with tobit(). It is tobit(<formula>, dist="t"). Afte...
I am working with a time series of anomaly scores (the background is anomaly detection in computer networks). Every minute, I get an anomaly score $x_t \in [0, 5]$ which tells me how "unexpected" or abnormal the current state of the network is. The higher the score, the more abnormal the current state. Scores close to ...
I have a response variable measured at three time points per individual (week 0, 18, and 36). I am interested in differences in the change of the response over the 36 weeks within some categorical variable X. I see two ways of modeling this. One way ANOVA with response = week_36_score - week_0_score (this seems like...
This is a rather general question (i.e. not necessarily specific to statistics), but I have noticed a trend in the machine learning and statistical literature where authors prefer to follow the following approach: Approach 1: Obtain a solution to a practical problem by formulating a cost function for which it is possi...
I am analyzing a large of dataset (n>100) of incident rates, with the aim of forming a normal distribution. Then I will know if a future incident rate (x%) is either close to a historical mean or not, and can score/rate it accordingly with an already created formula. The data is positively-skewed, as most data points ...
Context I ran an experiment with 3 x 2 design with three levels of within subjects factor (repeated measures) and two levels to the between subjects factors. I am interested in examining the changes from baseline and the interaction effect. Question How do I compute the required sample size for a 3 x 2 design in or...
At work we were discussing this as my boss has never heard of normalization. In Linear Algebra, Normalization seems to refer to the dividing of a vector by its length. And in statistics, Standardization seems to refer to the subtraction of a mean then dividing by its SD. But they seem interchangeable with other possibi...
I have some data that a downstream system needs an optimized function of boolean logic for. Essentially I have data similar to: User cat1 cat2 cat3 cat4 1 0 0 0 1 2 1 0 0 1 3 0 1 1 0 I must optimize cat4 as a function like this: (cat1 or cat2 or cat3). "Or" is the only ope...
I am trying to put together a data-mining package for StackExchange sites and in particular, I am stuck in trying to determine the "most interesting" questions. I would like to use the question score, but remove the bias due to the number of views, but I don't know how to approach this rigorously. In the ideal world, I...
I came across term perplexity which refers to the log-averaged inverse probability on unseen data. Wikipedia article on perplexity does not give an intuitive meaning for the same. This perplexity measure was used in pLSA paper. Can anyone explain the need and intuitive meaning of perplexity measure?
Using OLS, I've estimated the following equation: $y_i = \alpha_0 + \alpha_1 X_i + \epsilon_i$ I know that theoretically, the following should be true: $y_i = a + (1-e^{-\lambda 60}) X_i$ Is there any way, having an estimate of $\alpha_1$ I can translate it to an estimate of $\lambda$? As a follow up, if this is not ...
When does/can one use the likelihood ratio significance test instead of Fisher's exact test or its Pearson $\chi^2$ approximation for comparing two binomial datasets? Given two binomial datasets (distributions), I'm seeing the LR test being used to compare one distribution against the global (combined) distribution. Us...
I would like to explore the different ways one can detrend a time series without look ahead bias. I wanted to use the Hodrick Prescott filter, which seems like a quite good frequency filter, but it is based on an optimization method, and I understand that it may give strange and volatile results at the border. Wavelet ...
I am carrying out a statistical analysis for my research. I am using a Friedman's test with post hoc analysis. At present I am using the function friedman.test.with.post.hoc available for R software. This function reports "maxT" value instead of the chi-square value. Someone can explain me what is maxT and its relation...
I analyze a set of multivariate measurements. It is known that several pairs of independent variables show high linear correlation. The graph below shows a scatterplot of one such pair (X and Y, upper pane), as well the residuals as a function of Y (lower left pane) and the histogram of these residuals (lower right pan...
I'm working on a multiple logistic regression in R using glm. The predictor variables are continuous and categorical. An extract of the summary of the model shows the following: Coefficients: Estimate Std. Error z value Pr(>|z|) (Intercept) 2.451e+00 2.439e+00 1.005 0.3150 Age 5.747e-02 ...
Context I have a set of data that was collected from several inertial measurement units (orientation and acceleration data). I want to determine to what extent an inference method degrades when the data becomes noisy (or, should I say "noisier"). Questions How do I determine what type of noise to use? Is there a way in...
My girlfriend is an Actuarial Analyst at a large insurance company in the Netherlands and because we'll soon have our two year anniversary, I thought of gifts for her. On Proof: Math is beautiful I discovered these Distribution pluffies. So here's my question: What distribution is of the most relevance in the field of ...
In the book “Programming Collective Intelligence” Segaran explains the Fisher method for categorizing text as an alternative to Naive Bayes classifier. The Fisher method uses inverse-chi-square-distribution, which I do not really understand. I watched this video found on stats.stackexchange about chi-square-distributio...
I know that I, and others, sometimes get confused by the hypergeometric distribution (HD) as it pertains to overlapping lists. This is because the HD is usually described with the "balls in an urn" metaphor and not using "overlapping lists." What is the proper way to calculate the p-value, according to the hypergeometr...
What functionality should exist in a CAS that was specifically geared toward Statistics? Symbolic algebra systems like Mathematica and Maple are often used for calculus, logic, and physics problems but are rarely used for statistics. Why is this? What statistical constructs could be added to a symbolic algebra system t...
I'm working on some practice test problems, and one of them says to design a rejection sampling algorithm to produce draws from a unit exponential using draws from a Gamma(2,1). I don't understand how this is possible, because I am under the impression that the "envelope function" g(x) needs to be scalable in such a ...
What would be $\operatorname{Var}(X^2)$, if $\operatorname{Var}(X)=\sigma^2$?
I want to perform bootstrapping for calculation of efficiency score from data envelopment analysis (DEA) using R. Are there any examples of data and results for this type of analysis in R to enable me to check my results? Are there any online or other resources that might assist my task?
Given a panel of countries over time, a fixed effects estimator makes sense to control for country-specific effects. My intuition tells me that if the dependent variable is correlated with lags of the independent variables, then bias will be introduced into the estimator. However, I'm having difficulty rigorously under...
I am totally confused: On the one hand you can read all kinds of explanations why you have to divide by n-1 to get an unbiased estimator for the (unknown) population variance (degrees of freedom, not defined for sample size 1 etc.) - see e.g. here or here. On the other hand when it comes to variance estimation of a sup...
I am running a logistic regression with customer event data with multiple predictors. However, one variable is extremely important, alone predicting 60% of the customers for the event. When this main predictor is included in the model, other predictors add very little to prediction over and above this main predictor. ...
I have made a heatmap based upon a regular data matrix in R, the package I use is pheatmap. Regular clustering of my samples is performed by the distfun function within the package. Now I want to attach a precomputed distance matrix (generated by Unifrac) to my previously generated matrix/heatmap. Is this possible?
I am working on insurance data in which a customer has a field named customer_no_dependent (customer's number of dependent). Its coming out to be a significant variable( just that it has $p<0.0001$). This variable has almost 20% missing values. For imputation, I thought to determine proxy indicators for number of depe...
Context: My question concerns a typical design in my area – a researcher takes a group of subjects (say 10) and then applies three different conditions to them to measure the change in a response variable, e.g. vertical jump height performed after drinking a glucose drink, coloured plain water, and fruit juice (say). ...
I am building a propensity model using logistic regression for a utility client. My concern is that out of the total sample my 'bad' accounts are just 5%, and the rest are all good. I am predicting 'bad'. Will the result be biassed? What is optimal 'bad to good proportion' to build a good model?
How can I generate dependent time series from a given marginal distribution? I want to be able to adjust the level of dependence, to influence the predictability of the series, which will be given as input to a Monte Carlo simulation. The dependence parameter can be the correlation, the mutual information, or something...
My homework question: An inspector suspects that the food in the factory she is inspecting has been contaminated with a harmful chemical c. Such chemical contamination occurs in 5% of factories producing this food. The inspector has a test A for the chemical which registers positive with 100% certainty when the chemic...
I'm curious about repeatable procedures that can be used to discover the functional form of the function y = f(A, B, C) + error_term where my only input is a set of observations (y, A, B and C). Please note that the functional form of fis unknown. Consider the following dataset: AA BB CC DD EE FF == == == == ...
I am having difficulty to get $\bar u$ (to denote average of values $u_i$) as label for the x-axis in the output eps figure. Any help would be appreciated! Many thanks!
Suppose I have paired observations drawn i.i.d. as $X_i \sim \mathcal{N}\left(0,\sigma_x^2\right), Y_i \sim \mathcal{N}\left(0,\sigma_y^2\right),$ for $i=1,2,\ldots,n$. Let $Z_i = X_i + Y_i,$ and denote by $Z_{i_j}$ the $j$th largest observed value of $Z$. What is the (conditional) distribution of $X_{i_j}$? (or equiva...
I want to train a classifier, say SVM, or random forest, or any other classifier. One of the features in the dataset is a categorical variable with 1000 levels. What is the best way to reduce the number of levels in this variable. In R there is a function called combine.levels() in the Hmisc package, which combines inf...
I have two datasets from genome-wide association studies. The only information available is the odds ratio and the p-value for the first data set. For the second data set I have the Odds Ratio, p-value and allele frequencies (AFD= disease, AFC= controls) (e.g: 0.321). I'm trying to do a meta-analysis of these data bu...
I am currently working towards a Statistics BSc and am frequently having to organise my research. I am currently using a mixture of a mediawiki, and a bibliography browser plugin, to make an archive of my online data sources, and references to pdfs with useful information. but its becoming a bit of a mess. Is there any...
[I first posted this question to Stack Overflow here but didn't get any replies, so I thought I'd try over here. Apologies if reposting isn't allowed.] I've been trying to use this implementation of the Holt-Winters algorithm for time series forecasting in Python but have run into a roadblock... basically, for some ser...
I'm really confused. I never took statistics but am trying to read up as much as I can. I didn't think much about statistical analysis until after doing the experiment, unfortunately, but maybe someone can help me out. I have 4 birds. Each bird must fly in 7 different wind conditions. In each wind condition, I measure ...
I am going to make an environmental index to be used as an explanatory variable in a regression model. For making this index, I asked respondents a set of questions about their environmental attitudes. Each question has 5 response options from 1=“completely agree” to 5=“completely disagree”. I'm going to summarize eac...
I am trying to fit an ordinal regression model using the logit link function in R using ordinal package; the response variables have five levels. The number of explanatory variables is much larger than the number of samples ($p \gg n$) Could any one help me with the following problem: Start with a model that contains...
I would like to measure the amplitude of waves in a noisy time-series on-line. I have a time-series that models a noisy wave function, that undergoes shifts in amplitude. Say, for example, something like this: set.seed <- 1001 x <- abs(sin(seq(from = 0, t = 100, by = 0.1))) x <- x + (runif(1001, 0, 1) / 5) x <- x * c...
I'm using supervised classification algorithms from mlpy to classify things into two groups for a question-answering system. I don't really know how these algorithms work, but they seem to be doing vaguely what I want. I would like to get some measure of confidence out of the classifiers. I can get "real-valued predict...
I have a data set > head(data) id centre u time event x c1 c2 c3 c4 c5 c6 c7 c8 c9 c10 c11 c12 c13 c14 1 1 0.729891 0.3300478 1 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 2 1 0.729891 7.0100000 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 3 1 0.729891 7.0150000...
According to normal probability distribution theory which says that for $n$ independent, identically distributed, standard, normal, random variables $\xi_j$ the expected absolute maximum is $E(\max|\xi_j|)=\sqrt{2 \ln n}$ Regarding this, why do we need to multiple the above-mentioned estimate by $\sigma$ (Standard Devi...
In case of robust estimators, What does Gaussian efficiency means? For example $Q_{_n}$ has 82% Gaussian efficiency and 50% breakdown point. The reference is: Rousseeuw P.J., and Croux, C. (1993). “Alternatives to median absolute deviation.” J. American Statistical Assoc., 88, 1273-1283
I want to do a regression where my dependent variable has four categories (1,2,3,4) which represents the number of dependents. Can I do this with logistic regression? I read somewhere that link=glogit option is useful in this, can somebody please shed some light? I am new to this. Writing the syntax here would be very ...
Repeating an experiment with $n$ possible outcomes $t$ times independently, where all but one outcomes have probability $\frac{1}{n+1}$ and the other outcome has the double probability $\frac{2}{n+1}$, is there a good approximate formula for the probability that the outcome with the higher probability happens more ofte...
I have a few datasets of "interactions" between pairs of elements like so: element1 element2 1 element2 element3 1 element4 element5 1 ... element505535 element4 2 where the value in the 3rd column is the "strength" of interaction. Almost all of these strengths are "1." A strength of 1 means that this interaction was ...
Why the exchangeability of random variables is essential for the hierarchical Bayesian modeling?
I've got a question concerning a negative binomial regression: Suppose that you have the following commands: require(MASS) attach(cars) mod.NB<-glm.nb(dist~speed) summary(mod.NB) detach(cars) (Note that cars is a dataset which is available in R, and I don't really care if this model makes sense.) What I'd like to kn...
I have a large simulated loss data (from catastrophic models developed at my school) to calculate some extreme quantiles. Previously they used non-parametric methods to do this (find the point estimate for these extreme quantiles and CIs). I am using parametric models (extreme value theory, fat tail distributions, etc...
Recently I've been working EM algorithms for MAP estimation in a problem where the expectation is intractable, but the maximization is easy. Further, draws from the distribution in the E-step are easily available through MCMC, so I've been experimenting with stochastic versions of EM. Let $X$ be the observed data, $Z$ ...
Are there any papers/books/ideas about the relationship between the number of features and the number of observations one needs to have to train a "robust" classifier? For example, assume I have 1000 features and 10 observations from two classes as a training set, and 10 other observations as a testing set. I train som...
I'm a journalist turned developer who hobbies in APIs and analysis of web traffic. I've always enjoyed learning about stats but as I learned, I learned that I have misapplied some basic concepts in the past. I now know a bit better, and know to doublecheck my ideas with those are smarter than me -- I'm hoping to find a...
I use the auto.arima() function in the forecast package to fit ARMAX models with a variety of covariates. However, I often have a large number of variables to select from and usually end up with a final model that works with a subset of them. I don't like ad-hoc techniques for variable selection because I am human and...
I am using a fixed effect model for my panel data (9 years, 1000+ obs), since my Hausman test indicates a value $(Pr>\chi^2)<0.05$. When I add dummy variables for industries that my firms included, they always get omitted. I know there is a big difference when it comes to the DV (disclosure index) among the different i...
I'm wondering how to fit multivariate linear mixed model and finding multivariate BLUP in R. I'd appreciate if someone come up with example and R code. Edit I wonder how to fit multivariate linear mixed model with lme4. I fitted univariate linear mixed models with the following code: library(lme4) lmer.m1 <- lmer(Y1 ~ ...
First, let me say that I am a bit out of my depth here, so if this question needs to be re-phrased or closed as a duplicate, please let me know. It may simply be that I don't have the proper vocabulary to express my question. I am working on an image processing task in which I identify features in an image, and then cl...
I hope you can help me with a question regarding calculating mean age from grouped census data. If the age categories used were [0–4], [5–9], [10–14], and [15–19] years, how would you calculate the midpoints? I initially assumed the midpoints would be 2, 7, and so on. However, I read in a worked example that the mid...
I am not that familiar with statistics and was wondering about the best way to quantify the difference between a set of data and a function. My scenario is that I have a set with maximum heart rate data from around 60 people, with their age. I'm trying to see which of all "mathematical models" out there that describe t...
Suppose I have a quadratic regression model $$ Y = \beta_0 + \beta_1 X + \beta_2 X^2 + \epsilon $$ with the errors $\epsilon$ satisfying the usual assumptions (independent, normal, independent of the $X$ values). Let $b_0, b_1, b_2$ be the least squares estimates. I have two new $X$ values $x_1$ and $x_2$, and I'm int...
I'm running an experiment where I'm gathering (independent) samples in parallel, I compute the variance of each group of samples and now I want to combine then all to find the total variance of all the samples. I'm having a hard time finding a derivation for this as I'm not sure of terminology. I think of it as a part...
In general, I standardize my independent variables in regressions, in order to properly compare the coefficients (this way they have the same units: standard deviations). However, with panel/longitudinal data, I'm not sure how I should standardize my data, especially if I estimate a hierarchical model. To see why it ca...
Can anyone suggest a method for generating random correlation matrix with $90\%$ of the off-diagonal entries between $[-0.3, 0.3]$. The other $10\%$ should be larger than $0.3$ or smaller than $-0.3$.
I usually use the plot(lm()) or plot(glm()) (combined with par(mfrow=c(2,2)) to analyze residuals. Unfortunately this is not possible whenn estimating a tobit() (package AER) or zeroinfl() (package pscl) model. Furthermore any Cooks distance command does not work. It's either not possible to make the residual analysis ...
I've got a question concerning a negbin regression: suppose that you have the following commands require(MASS) attach(cars) mod.NB<-glm.nb(dist~speed) summary(mod.NB) detach(cars) (note that cars is a dataset which is available in R) and don't care if this model makes sense. What I'd like to know is, how can I interp...
Can you suggest some good movies which involve math, probabilities etc? One example is 21. I would also be interested in movies that involve algorithms (e.g. text decryption). In general "geeky" movies with famous scientific theories but no science fiction or documentaries. Thanks in advance!
Possible Duplicate First, I am not a statistician (though I'd like be one) but I am trying to understand how different tests can be utilized to examine samples. Let's say that I have five of Google AdWords ads and I'm trying to develop a test to show which has been more effective at getting users to click on that ad. ...
I've been taught that binning a continuous variable into categories is almost never a good idea, because you lose information in the process. But now I'm facing a situation where I have an age variable that is "mostly continuous", which is to say that about 90% of the values represent age in years, and the remaining 10...
Are there any analytical results or experimental papers regarding the optimal choice of the coefficient of the $\ell_1$ penalty term. By optimal, I mean a parameter that maximizes the probability of selecting the best model, or that minimizes the expected loss. I am asking because often it is impractical to choose the ...
This is a homework problem out of the book. It says If $U$ is a uniform random variable on [0,1], what is the distribution of the random variable $X = [nU]$, where [$t$] denotes the greatest integer less than or equal to $t$? There is a second part that says Do this for $n = 10$. True or false, and explain: “Random...
I was impressed by the Reputation histogram on the SE sites allowing one to zoom in to any time interval. How was it created?
I have some data in R, stored in a list. Think d <- c(1,2,3,4) although this is not my data. If I then enter the command plot(density(d, kernel="gaussian", width=1)) then I get the kernel probability density estimate, where the kernel is standard normal. If I replace 1 with other numbers, of course the picture chan...
Suppose I want to predict Amazon or Netflix demand, using demand data over the past year. For example, I might want to forecast the number of sales in the Electronics category on Amazon, or the number of times someone wants to rent Titanic on Netflix. My dataset consists of daily demand per item over the past couple of...
I became interested in doing this in C# for my own amusement after reading the following papers: http://www.cs.washington.edu/homes/brun/pubs/pubs/Kiddon11.pdf I also took a look at http://www.cs.rpi.edu/academics/courses/fall03/ai/misc/naive-example.pdf as a concrete example for my implementation. I have a working im...
It is easy to find a package calculating area under ROC, but is there a package that calculates the area under precision-recall curve?
I have a set of data (positive real numbers < 1) in five categories. My aim is to show that the data in the last category is bigger than the other categories for a range of examples (the data set), but the last category isn't necessarily more important than the others. I thought the best thing is to average each catego...
In the last few years I've read a number of papers arguing against the use of null hypothesis significance testing in science, but didn't think to keep a persistent list. A colleague recently asked me for such a list, so I thought I'd ask everyone here to help build it. To start things off, here's what I have so far: ...
Given a sample data set of floating point numbers, how do we determine its probability distribution and prove it? Also generate random numbers of the same distributions thereafter.
If I have many time series that I'd like to compare to see if there are relationships between the variables, (I have several dependent variables and many more independent variables) how might I go about doing this (I'm working in R, just fyi)? I haven't really found too many examples seeking to compare and explore the ...
I've been trying to replicate the results in this online calculator: http://www.raosoft.com/samplesize.html However, it seems that I am missing something. Exactly how do I solve the margin of error when all the other variables (sample size, confidence level, distribution and population*) are known? I've tried to use th...
Is there a way to utilize Canonical Correlation Analysis when your data are time series and repeated measures (i.e. your experimental units are not independent)? How might one approach the analysis of two sets of variables when the question is what relationships, if any, are there between one set of variables and the ...
I am reviewing a study in which standard deviations (SDs) of an X variable, calculated for each individual in the study (measures on each individual were replicated 4 times), are used as predictors of a Y variable. They do not observe a significant correlation between Y and the SDs of X and they conclude by saying that...
I'm wondering if this is possible to fit structural equation model for experimental design data. Problem Suppose a researcher observed four responses $Y_1$, $Y_2$, $Y_3$, and $Y_4$ along with three covariates $X_1$, $X_2$, and $X_3$ from an experiment involving ab treatment combinations from a fixed factor A with a lev...
Can someone tell a reference and/or book that explain how to use R for simulation of experimental design data?
I have key-value pairs of text. The values can be multiple words (n-grams). For example, A abcd A efgh B abcd C wxyz C mnop I want to calculate Pointwise Mutual Information for the pairs. Is there a function in R to do this? Otherwise, how can I go about it? Thanks
I am having some difficulty understanding Adaboost. How should the 1st threshold/classifier/weak learner be chosen? It seems that there are two conditions which must be satisfied Choose the classifier with the lowest error $e(t)<0.5$ otherwise stop; But if condition 1 is satisfied, doesn't it imply that condition 2 w...
I'm trying to fit some data using a hierarchical normal model $y_i \sim N(\theta_i,\sigma^2)$ $\theta_i \sim N(\mu, \sigma_\theta^2)$ $(\mu,\sigma^2,\sigma_\theta^2) \sim diffuse$ I fit this model and I'm getting posteriors for $\sigma_\theta^2$ and $\sigma^2$ that are nearly identical. Is this an identifiability issu...
migrated from math.stackexchange. I'm processing a long stream of integers and am considering tracking a few moments in order to be able to approximately compute various percentiles for the stream without storing much data. What's the simplest way to compute percentiles from a few moments. Is there a better approach th...
Im trying to use silhouette plot to determine the number of cluster in my dataset. Given the dataset Train , i used the following matlab code Train_data = full(Train); Result = []; for num_of_cluster = 1:20 centroid = kmeans(Train_data,num_of_cluster,'distance','sqeuclid'); s = silhouette(Train_data,ce...