instruction
stringlengths
9
38.7k
I have a number of objective functions like: y1 = a11* x11 + a12*x11*x11+ a13*x12+....... y2 = a21* x21 + a22*x21*x21+ a23*x22+....... ::::: ::::: ::::: These are multiple objective functions. However, the constraints of the objective functions have dependency on each other. Something like, x11+ x21 + x22 < const1 x1...
I need to validate a model using `external model validation' and I have a question relating to deciding when a drop in $R^2$ when compared to $R_{prediction}^2$ is significant. DISCLOSURE: This is not a homework question. I am seeking clarification on something that is in the textbook that I am using for an applied re...
I am working to approximate, to extrapolate rather, values of a function from a few known values. Here is what I have: Less than 100 known I/O pairs. A monotonously positive correlation.en Something that is not exactly Gaussian, Poisson, or inverse binomial. Right now I can choose between a genetic algorithm and an a...
What is the difference between the intuition behind Gamma and Weibull distributions? Is there any relationship between the two densities?
I am a Phd Student in experimental psychology and I try hard to improve my skills and knowledge about how to analyze my data. Until my 5th year in Psychology, I thought that the regression-like models (e.g., ANOVA) assume the following things: normality of the data variance homogeneity for the data and so on My under...
For example, this mentioned here: link. I also saw this in my data. I wonder - does anyone know a good reference where this is explained and justified more rigorously with some math and for some more-or-less wide class of processes? Here are some plots: Series with positive autocorrelation before differencing Autocor...
I have an SPSS data set with 700+ respondents and 13 products that they could own. Each product has its own variable Product01 = 1 means they own product 1 Product02 = 0 means they dont own product 2 etc etc *Edit for clarity: For example, this would mean counting: How many respondents have product 1, 2, 3 and none of ...
I have some data that is highly skewed. I want to test whether the median of the data is different from 1, so I decided to use a Wilcoxon Signed Rank test. The description and implementation of this test in Stata and SAS is given here: http://www.ats.ucla.edu/stat/sas/whatstat/whatstat.htm#1sampm http://www.ats.ucla....
I have a questionnaire of 80 questions that I need to do dimension reduction on. About half the questions are ordinal (Likert-style questions), and the other half are qualitative/nominal. I've been given a suggestion to perform Multiple Correspondence Analysis on the dataset, but I was wondering, would it be methodolog...
I'm trying to model number of devices failed out of total produced using GAM. I want the value to be bound between zero and one. Couldn't find anything that can solve this problem. Any help will be greatly appreciated. (I have number of failures, total produced and the factors driving failure for each batch produced) I...
We have data with a binary outcome and some covariates. I used logistic regression to model the data. Just a simple analysis, nothing extraordinary. The final output is supposed to be a dose-response curve where we show how the probability changes for a specific covariate. Something like this: We received some critic...
I plotted a treatment effect on some performance measure over the course of an experiment. Stata has a nice feature called margins and marginsplot to do this. So what I do is run a linear regression, where the time trend is a third degree polynomial, like reg depvar control##c.time1##c.time1##c.time1 ..., vce(cluster c...
I'm looking for textbooks that discuss penalized regression in a methodical manner and present various model selection methods, such as AIC, BIC, Cp as special cases of penalized regression. The textbooks i am looking for don't have to be dedicated to penalized regression, rather this subject can be discussed in a chap...
I have done a cross-sectional regression of time-series average returns on estimated Betas (over the same time horizon) to determine average premiums. So far so good. But I was told that the standard t-statistics can be biased, due to the fact that betas are estimated. There is a solution by: Shanken (1992) - On the e...
I have measured the time taken to solve a problem by algorithm $X$ and by algorithm $Y$. It takes a quite long time, so I have only 10 data for each algorithm: $$ X : ( x_1, x_2, \dots , x_{10}) \\ Y : ( y_1, y_2, \dots , y_{10}) $$ EDIT: The problem they are solving is randomized. I generated 10 instances of the pro...
I am estimating some Confirmatory Factor Analysis (CFA) models using the Lavaan package and I hoping to extract the fitMeasures to export out of the model to a spreadsheet. This is easily done using the fitMeasures command, but it automatically defaults to exporting the "ML" fit measures, even if the model was run usin...
I'm looking for a closed form approximation of the variance of the minimum order statistic for normal random variates. Can anyone point me to a reference, or an approximation? I've seen the post about the approximate expected value of the min order statistic (Approximate order statistics for normal random variables), b...
If there is an outlier in a time series, how does its correlogram behave? Is it possible to find outliers using a correlogram? EDIT I have such a Time series: ts <- c(1,2,3,1,2,2,30,40,3,2,4,1,3,2,3,1,1,2) its correlogram looks like this: I have an outlier in my time series, Is it possible to detect these outlier fro...
The author of a famous online course takes a problem where 642 of 1000 polled men and 591 of 1000 polled women responded yes. The question is if men are more likely to agree or not, using 95% confidence interval. He starts by computing the difference of the means, $\bar p_1 - \bar p_2 = .642 -. 591 = 0.051$ and its sta...
My question is essentially simple: suppose we have a sequence of heads and tails with an apparent chance of getting heads $\hat{p} = 0.5$. h h t h t t t h t t h ... How do we tell if this sample was drawn from a binomial distribution with this $\hat{p}$ or if it comes from a combination of different distributions wh...
I am teaching a basic statistics course and today I will cover the chi-squared test of independence for two categories and the test for homogeneity. These two scenarios are conceptually different, but can use the same test statistic and distribution. In a test of homogeneity, marginal totals for one of the categories a...
I'm wondering how to calculate the C-Index for determining a 'good' number of groups in a cluster analysis in Stata? It's mentioned in this post (What is an acceptable value of the Calinski & Harabasz (CH) criterion?) for R, but it seems Stata does not provide a built-in solution. Thank you!
I am really new to Granger Causality and am just rabidly experimenting with this MATLAB function: granger_cause(x,y,alpha,max_lag) http://www.mathworks.com/matlabcentral/fileexchange/25467-granger-causality-test I have two series x and y which I need to check for causality. I need to check if y at a lag of 180 sampl...
I have been asked to develop control charts for my company - or some other means of quickly identifying when ticket sales are "out of control" and not just a random blip. The data we are looking at are seasonal with a positive trend (sales revenue). It has been suggested that I use an exponentially-weighted moving ave...
I have 100,000 students who have each answered some multiple choice questions. Given their performance I want to work out what the chances are of a particular student answering the next question correctly. not each student has answered every question the probability of getting a question correct by chance changes wit...
I have a response variable of percent cover of vegetation in a quadrat. I have tried to arcsine squareroot this data as recommended in the Crawley R book but I am not getting good fit. The data is zero-inflated with about half the data points being zero. Can someone point me in the right direction for how to approach...
When doing sequence analysis using a package such as TraMineR, one can calculate a clustering based on Optimal Matching (OM) distances, and then plot it as a tree. I use agnes to do it, roughly like this: sequences.sts <- seqdef(sequences.sts) ccost <- seqsubm(sequences.sts, method = "CONSTANT", cval = 2, with.missing=...
When does naive Bayes perform poorly? Can you think of any specific examples of problems in which it wouldn't work? We can ignore not having seen given data points before as that can be corrected by Laplace smoothing.
Let $p \in [0 , \frac{1}{2}] $ and $\eta_{i}$ be i.i.d random variables and $P(\eta_{i}=1)=p$ and $P(\eta_{i}=-1)=1-p$ and $\mathcal F_{n}=\sigma(\eta_{1},\cdots,\eta_{n})$ and $X_{n}=\sum_{i=1}^{n}\eta_{i}$ and $Y_{n}=X_{T(-7) \wedge n} $(means martingale/submartingale/supermartingale when stopped by a stopping ti...
I did a cubed root transformation of one of my predictors in multiple linear regression. How can I interpret this predictor now that it is transformed and my model is fit with it?
I have repeated measures over time from n subjects responding to a daily Likert scale question, so my data is ordinal and longitudinal over a few months. Not all subjects answer every daily survey of course. My goal would be to assess whether there is a statistical difference in survey responses between males and femal...
I'm writing my final thesis in Chinese Studies right now and planned on doing a qualitative test but as I have so much data I would like to analyse it quantitatively. I did so but am not sure about the test-methods - can you help me? Here is what I did: I'm analysing the design differences between a) English and Chines...
Suppose $X$ is a random variable, then is it true to say that $$ E \left[ g \left( X_i \right) \right] = E\left[ g \left( X_j \right) \right] $$ ? If so, why is that the case? Thanks a lot!
I have 11 scale parameters for each of 218 observations belonging to subjects, I did standardized PCA to reduce dimensionality of the data and found two meaningful components. Using Euclidean distances this was followed by cluster analysis of these two components (explaining about 75% of the variance) with bottom-up ap...
I know that Mincer-Zarnowitz type of regressions are typically applied in a time series setting to evaluate forecasts. My question is whether the same type of regressions can be used in a cross sectional setting? Say, my forecast of a variable for entity $i$ is $f_i$ and the realization of the variable is $a_i$. Does i...
I'm trying to understand how the parameters are estimated in ARIMA modeling/Box Jenkins (BJ). Unfortunately none of the books that I have encountered describes the estimation procedure such as Log-Likelihood estimation procedure in detail. Following is the Log-Likelihood for ARMA from any standard textbooks: $$ LL(\th...
Lets say I have the following JAGS model, what are the proper terms for the three parts and 1/tau? model{ #Term??? for(n in 1:Ndata){ y[n] ~ dnorm( mu[ subj[n] ], tau[ subj[n]] ) } #Term??? for(s in 1:Nsubj){ mu[s] ~ dnorm( muG, tauG) tau[s] ~ dgamma( 5, 5) } #Term??? muG ~ dnorm( 80, .01) ...
I'm going to analyse suicide rates for a time series, and I'd like to use robust tests, but I don't know which would be a good one. My purpose is to compare the variation of the suicide rates through the months and years and see if there are significant changes in respect to GDP. Then I also want to check differences a...
Suppose I have 50 scale parameters, these are all genes measured for one sample from a subject at the clinic, after data reduction by PCA, two meaningful components were extracted. This was followed by cluster analysis and turned out to be 4 meaningful clusters of subjects based on the two components of these 50 genes....
I have a certain family of models with latent random variables (not observed in the data), which I have a consistent estimator for. I now run EM on top of it, meaning, I get the consistent estimation, and initialize EM with it and run it for another few iterations. I know that EM has problem with local maxima, and also...
I am cross validating a classification tree and am able to plot the number of observations misclassed by different sizes of trees. My question is, what does it mean to return "the" number misclassed, for a given tree size, when there were k different runs of that sized tree (where each of the k runs has a presumably di...
I've seen this referred to in relation to model selection but haven't come across a definitive description of it. What the flat maximum effect?
I am working in a hobby project, and I'd like some help with the following problem: I'm pulling pricing information from an internet marketplace, so if I provide a keyword (say, iphone cases) I'm going to get the first 500 items that show up in that marketplace, along with their prices. My question is, how can I prop...
Is there a way to determine which features / variables of the dataset are the most important / dominant within a k-means cluster solution?
UPDATE Jan 25th 2014: the mistake is now corrected. Please ignore the calculated values of the Expected Value in the image uploaded - they are wrong- I don't delete the image because it has generated an answer to this question . UPDATE Jan 10th 2014: the mistake was found - a math typo in one of the sources used. Prepa...
We do a monthly fundraising letter at my nonprofit. I know how to set up tests in R to compare whether the proportion of response and amount received between two mailings is significantly different, but I would like to compare all twelve for the last year. I figure there is a test to do that, but I don't know what it w...
I have 3 observers, who each perform multiple observations in which they count a phenomenon. I'm trying to quantify both inter- and intra- observer error for this study. I'm new to this and am finding the analysis options quite confusing. Someone recommended using the ICC. I've mocked up some data below with "number of...
I am using ordinal regression (parallel) on a total dataset of 15706 points, for 10 categories, and testing whether additional predictors significantly improve the model fit. I started with 2 predictors, obtained a deviance of 16530 and plotted expected vs observed counts: Then I added a 3rd predictor (which I logica...
Let's say I have a sensor that measures pressure in a range from $10 - 60 \text{ mmHg}$. This sensor has an error of $\pm 0.8 \text{ mmHg}$. Is there a way to quantify how large this error is with respect to the range of values the sensor can sense? I want to figure out what the relative size of this error is.
I've got three groups A,B,C. Each has a different number of records and I have calculated the mean for each group. Now I want to know if these means are equal or not? What statistical test should I be doing? Group No.ofrec Mean A 100 10 B 200 5 C 300 20
How can I test whether there is a significant non-linear effect of a continuous predictor on a continuous DV? Here's my situation. I ran a simple linear regression and found a significant effect of a predictor (predictor2 below). However, when I plot my dv against that predictor, the trend does not look linear - in fa...
What is the distribution of the absolute value of the Skellam distribution?
I want to estimate the shape parameter of gamma distribution in Winbugs. I select gamma distribution as prior for shape parameter. Data set is generated using MATLAB as: gamrnd(5,1,[100 1]) a small part of data loaded to model is here: list(n=100,b=1) y[,1] 9.85509822926424 6.78794280129914 2.37341388433267 5.4466402...
I have a stratified random sample based on sampling frame formed from our CRM systems data. Now when I look responses in different strata they seem to differ. Some stratas have much higher response rate. My survey variables are mostly preference related, there are few single value answers and many multi value ans...
Paper1 (freely available) and Paper2 (Springer) talk about application of fuzzy cognitive map (FCM) for pattern classification. I am having a tough time to understand how the equation of FCM is constructed from a set of features. My application is in cognitive vision and I have features which are (hue values, SURF feat...
I have a question about solving simultaneity in this following case: Environmental taxes have direct and indirect effect on the change of waste pollution (ΔI). This effect (ΔI) has an indirect influence on environmental taxes in the next year, which may present the problem of simultaneity. However, the annual change of...
I have a data set with 8 different treatments and there is unequal number of observation within each group. I'd like to calculate regression coefficients for each group but I can not do it in other way than by subsetting data. I assume that I need some loop to run that but I have no idea how to do that. Can you help me...
I have some ratings averages values from 1 to 5(users were rating on 1,2,3,4,5 scale). I would like to split them into two classes: credible, not-credible. I know that respondents have a bias toward evaluating objects as credible to willingly. distribution: 1 1% 2 2% 3 5% 4 77% 5 14% I will then use this bi...
I am trying to calculate confidence intervals for transition probabilities between a set of discrete states over time (involving multiple time steps). Here is a toy example to get the transition probabilities: # create a toy dataset states<- c("A","B","C") t1 <- sample(states,30,c(2/3,1/6,1/6),replace=T) t2 <- sample(s...
I am trying to estimate the mean of the ratio of two empirical count distributions $f(x)$ and $b(x)$ defined on the limited range $[-1, 1]$ $$ \left<\frac{f(x)}{b(x)}\right> $$ $f(x)$ and $b(x)$ are measured in a counting experiment by filling unweighted histograms which then have Poisson uncertainties in each bin. To ...
I would like to investigate interactions between my explanatory variables prior to building a statistical model. Apparently it is possible to do it in R using a regression tree (library: tree). This method is based on binary recursive partitioning. The algorithm predicts a response variable by partitioning the data int...
I use simple regressions. My independent variable is a count data (# of a drug used per year), and it has too many zeroes. Depending upon a dependent variable, for some simple regressions, I have 13 observations, and there are only 3 non-zero values out of 13. For other simple regressions, I have 150 observations and o...
I am trying to optimize sklearn.linear_model.SGDRegressor, and I was wondering if people could point me in which direction I should try to optimize? Personal experience and literature are both welcome. I think it would be much better if there is kind of a ranking in which way to search; should I start with finding a g...
I am trying to understand zero-inflated negative binomial regression. My impression is that if a zero-inflated negative binomial model does not contain any logit part, the model is identical to the one can obtain with just ordinary negative binomial regression. Is this correct? PS: the logit part I was talking about - ...
If $X\sim\mathcal{LN}({\mu,\sigma^2})$, then $\mathrm{E}[X]=e^{\mu+\sigma^2/2}$. My question is: what right do we have to add a mean and variance together? If $X$ has physical dimensions, then the expression $\mu + \sigma^2/2$ is incoherent. So what gives?
I'd like to check in R if my data fits log-normal or Pareto distributions. How could I do that? Perhaps ks.test could help me do that, but how could I get the $\alpha$ and $k$ parameters for Pareto distribution for my data?
In a MCMC implementation of hierarchical models, with normal random effects and a Wishart prior for their covariance matrix, Gibbs sampling is typically used. However, if we change the distribution of the random effects (e.g., to Student's-t or another one), the conjugacy is lost. In this case, what would be a suitable...
I am attempting to create a model which looks at the effect that age, supplementary food use, and nest initiation date (converted to Julian days) is having on female reproductive success (success =1 and failure=0). Unfortunately I have a very small sample size of only 17 individuals. I believe that my data does include...
I wish to model the number of bugs caused by software development. This is intuitively sort of a Poisson process, however it is overdispersed. One thing we can do in this case is to use a negative binomial distribution (because negative binomial approaches Poisson as r gets larger, or because we might think the paramet...
I want to measure the correlations between ratings on different items of a scale. In my sample, there are multiple data points from the same subjects, for each subject to the same extent. I am able to trace the ratings back to the subject who made them. What is the appropriate correlation measure accounting for these d...
If machine is viewed as function approximation, what class of functions are modeled by a neural network?
Let $X$ and $Y$ be two i.i.d. chi-square distributed random variables with four degrees of freedom. How can we get the joint probability distribution function of the random variables $U=(X-Y)/(X+Y)$, $V=X+Y$?
I have data on about 20000 consumers who were exposed to some form of advertising. The data is in the following form. Cookie_Id Observation_Number Ad_Id Ad_Id_Lookup Placement_Id Placement_Category Placement_Cpi Cookie_Lookup 2 1 325 Standard 3722 News 20 0 3 1 325 Standard 3722 Ne...
I believe one major advantage of Bayesian inference is the intuitiveness of interpretation. This is my primary interest. However, it's not completely clear to me when it's OK to make such an interpretation. I make the potentially false assumption that fitting a probability model in the frequentist way is virtually the ...
I'm learning clustering analysis and one book I read says the clustering model should be applied to a disjoint data set to examine the consistency of the model. I think in clustering analysis we don't need to split the data into train and test sets like in supervised learning since without labels there is nothing to "...
Suppose I care about mispredicting one class much more than another. Is there a way I can communicate this information to the standard classification techniques? The only way I can think of is adjusting the threshold, but I wonder if there is a better way.
I have an idea about producing a genetic algorithm. But it involves using a relationship which believe could be defined as a horizontal Asymptote. I have found an image that depicts the type of relationship I will attempt to apply. However finding out what it is called and what the standard equation is that defines it ...
I am confused about the Vector Error Correction Model (VECM). Technical background: VECM offers a possibility to apply Vector Autoregressive Model (VAR) to integrated multivariate time series. In the textbooks they name some problems in applying a VAR to integrated time series, the most important of which is the so cal...
I am new to optimization in particular so I think what I am looking for is vocabulary to describe a particular area of problems. In many (all?) optimization algorithms you need to take the gradient of the objective function at various points in the algorithm. Many examples I find assume you already know the objective ...
I am performing ordinal regression, I have 5 response categories and several predictors both continuous and categorical. I would like to add a predictor which is categorical but ordered (1, 2, 3, 4). I don't think it would be appropriate to apply the usual dummy coding for unordered categorical predictors, but when I s...
I have some time course data which plotted looks like this: I have fitted a mixed model to my raw datapoints with R's lme4::lmer, as seen in this code. In essence I get the following output for my model: measurement~condition*time: Random effects: Groups Name Variance Std.Dev. ID (Intercept) 1118082 ...
Consider an ordered pair of random variables $(x_i,y_i)$, and the following relationship: $$\frac{\left(\sum_i^n x_i\right)^2}{\sum_i^n x_i y_i}\leq \sum_i^n\frac{x_i}{y_i}$$ Is there some useful way of restating the relationship in terms of statistical functions? Can the relationship between the two variables be summ...
Lately I have had some trouble interpreting the interaction term I use in a regression. I have two dummy variables and a continuous variable. For the explanation, BLACK takes the value 1 if the respondent is black and 0 otherwise. MAR takes the value 1 if married and 0 otherwise. I also include a continuous variable fo...
I have data for 352 response ratings that have been categorized as "Low," "Medium," and "High." I would like to compare the differences of five variables across the three categories to see which ones have significant differences. In the end I would like to be able to say something like, "variable 1 differed significant...
I am modeling a binary event of whether a sale will happen or not for an online retailer. I have millions of clicks to refer to. Needless to say the rate of sales happening is very very low (<1%). Now, to model this event, I am taking the product price to be one of the predictor variables that i am passing in the logis...
I have read up on Bayesian methods enough now to feel that I would rather use Bayesian analysis over Frequentist, the trouble now is finding the correct tools... I have data from an experiment with two groups of inbred fly lines and the measured variable is a continuous numeric value. Each group contains 40 genetic lin...
So I have these data points and I know the ground truth/labels of these points. I want to use Hierarchical clustering on the dataset given that all of the points that have the same labels are clustered together. I know this somewhat defeats the purpose of clustering where I use a clustering method on a dataset and comp...
I have time series data of credit card transaction volumes for different companies. For example: week1: \$5000 week2: \$6000 week3: \$6200 week4: \$7000 week5: \$9000 ... Is there a simple method in R to determine if the number series has a linear trend upwards, downwards or like a normal distribution (rising first th...
Every parametric test has the assumption that the sample means are following a normal distribution. This is the case if the sample itself is normal distributed or if approximately if the sample size is big enough. but why do they have that assumption? I thought the test statistic is used to make a decision and they hav...
I am trying to pick up and learn some statistics. I am not good at it, so please forgive me if I'm asking something naive. Suppose you have a set of data values, say 10k of them, and the format looks like: 1.256, 9.264, 4.483, 460.357.... How to identify the distribution of it? Thank you very much.
Let $\varepsilon$ be a Gaussian distributed random variable with mean $\mu_0$ and standard deviation $\sigma_0$. Is it possible to compute/approximate the expected value $$ \begin{eqnarray} & &\mathbb{E}\left[\Phi\left(\frac{\varepsilon-\mu_1}{\sigma_1}\right)\mid\varepsilon<c\right]=...\\ & &... =\int_{-\infty}^{c}d\v...
Assume that you need to build a linear model to make predictions for new observations, and that there is uncertainty about which subset of variables should be included in the model. You are only interested in making predictions, there is no theory available to guide variable selection, and you aren't interested in draw...
I am from an economics background and usually in the discipline the summary statistics of the variables are reported in a table. However, I wish to plot them. I could modify a box plot to allow it to display the mean, standard deviation, minimum and maximum but I don't wish to do so as box plots are traditionally used ...
I have two linear regressions. The linear coefficients of both of them are very close to $1$. The first plot seems reasonable linear regression, while the second one is tricky since if the bottom left part or the top right part of the data (they are quite random) are fitted, we can not get a close-to-1 coefficient. The...
In a survey done to find the characteristics consumers prefer while choosing a retail store. Respondents were given 9 options and to scale them from 1-10 one for the most preferred value. Now we have responses in which respondents have given same ratings to multiple characters. Example given: price 1 qua...
I am trying to figure out if this Markov chain is irreducible and if it is aperiodic and why or why not. For me it is not irreducible Markov chain because you cannot go from state 2, 5 or 6 to any of the states 1, 3, 4. I don't know if my argument is good.
For a CDF that is not strictly increasing, i.e. its inverse is not defined, define the quantile function $$F^{-1} (u) =\inf \{x: F(x) \geq u \},\quad 0<u<1. $$ Where U has a uniform $(0,1)$ distribution. Prove that the random variable $F^{-1} (u)$ has cdf $F(x)$. In case of a strictly increasing CDF the proof is quite...
I want to show that the variable $X$ is significant. In model 1, I use financial statements variables, other macroeconomic variables and $X$. Here, $X$ is siginificant at a 10% level and $R^2$ is 0.731. Since financial statements could have time lag, I have to check that effect so I made adjusted model 2. In here $X$ i...
I want to assign different weights to the variables in my cluster analysis, but my program (Stata) doesn't seem to have an option for this, so I need to do it manually. Imagine 4 variables A, B, C, D. The weights for those variables should be w(A)=50% w(B)=25% w(C)=10% w(D)=15% I am wondering whether one of the foll...
I am trying to get an optimal cut-off value dividing group with minimum sums of squares of residuals (=observed y - estimated y) the model is like below. In group 1 : model y= a1x + b1z + C1v ... In group 2 : model y= a2x + b1z + C1v ... I have the data of y, x, z, v... The problem is the group 1 and 2 are not divide...