instruction
stringlengths
9
38.7k
I was reading the book foundations of machine learning by Mehryar Mohri, Afshin Rostamizadeh and Ameet Talwalkar, and I came up with this definition of generalization error: I dont understand what this means. I would like a more formal explanation of what they mean by the notation $$ \mathbb{P}_{x\sim \mathcal{D}} [h(...
This is not homework. This is simple self-learning from real data. I am fitting a logistic regression model as follows: $$\text{logit}(p_i) = \beta_0 + \beta_1 race_{i} + \beta_2 x_{2i} + \beta_3 x_{3i} + \beta_4 x_{4i}$$ where $p_i$ is represents the probability of the event in the i-th person. $race_i$ is a binary va...
I am having trouble specifying a model in lme4. Your help with be greatly appreciated!! And please let me know if I can improve how I ask this question. I am looking at the impact of light, temperature and fungicide on disease levels for a set of plants (plant=observational unit). I think the design is a split-block wi...
Consider a statistical test $\delta$, whose power function is $\pi(\theta|\delta)=\text{Pr}(H_0 \text{ is rejected}|\theta)$. The size of a statistical test $\delta$ is then given as $$\alpha(\delta)=\sup_{\theta\in\Theta_0}\pi(\theta|\delta)$$ I understand $\alpha(\delta)$ as a summarization statistic of $\pi(\theta|\...
I just realized I have not given this issue much thought. In a classification task, there is an argmax happening after the softmax to get the most likely class. So how does backpropagation go through that operation?
I am observing mutations in a population. In a population of 2000, I get a list of locations with the number of affected individuals in the disease and the control. I have done a boxplot of the diseased_individuals variable and matched_control_individuals variable and they are highly skewed. Which statistical test can ...
Consider a dataset which has ~ $20$ measurements $m_i$ each of which has an associated uncertainty $\epsilon_i$. There may be some outlier measurements which can have relatively low uncertainty. I want to summarise the data and obtain a combined uncertainty. Due to the outliers, a weighted mean/median where the weights...
So, I am learning a bit about Neural Networks. I have built a code in PyTorch for regression, and I have standardized both the features and the target variables following this answer. My question is that should I destandardize the loss value before plotting the elbow curve to observe the train and validation errors acr...
Suppose that we are given a sample of input-output pairs of a deterministic function. To make it concrete, I can generate input-output pairs of a function I myself created (for example $y = 240 + 20x - 12x^2)$. The function might be linear or non-linear. But there are no unknown noise or other contributing factors. Th...
I know that I can compute t-statistic as following. for one-sample T-Test: $$t = \frac{E(x) - \mu}{\sigma / \sqrt{(n)}}$$ for independent sample T-Test: $$t =\frac{E(x_1) - E(x_2)}{\sqrt{\sigma_1 / (n_1) + \sigma_2 / (n_2)}}$$ But I can't understand how we obtain denominators for both equations. The only source I found...
I have a joint distribution from which I want to simulate $f(x,y) = 2(1-x)(1-y)(1-xy)^{-3}, 0<x,y<1$. I have worked out that the marginal distributions are both $U(0,1)$, so I want to simulate by first simulating $Y \sim U(0,1)$, then use rejection sampling to simulate $X$ from $f_{X|Y}$. I have used calculus to work o...
I am looking for a way to force lavaan to use positive factor loadings in a latent construct. I am working on a sem defined as follows: ' FF =~ NA*ma09 + mp02 + mp03_r + mp19_r + mp18_r + ma02 + mp17_r + mp16_r + mp07 + ma03 + mp06 + mi02 + ma12_r + ma01 + mi04 + mp08_r + ma04 ...
I was wondering if anyone could help me. I am trying to analyse the effect of body dysmorphia scores (scored on a scale of 0-4) on ratings of agency (on a scale of -100 to 100) under differing contingencies (positive negative, zero). As I have collected data from the general population, the distribution of scores in my...
I'm doing an ANCOVA on a fictitious dataset of math test results (DV) by group (n1 = 50 online training; n2 = 50 no training) with previous math ability as a (covariate) to see if there is a difference between students who did an online training or not on their test performance. I already tested the following previous ...
Data: I have 1000 independent time series. Each of these 1000 contains two variables A & B. Goal: My goal is to find out whether there is a statistically significant correlation between A & B for ALL 1000 time series. Problem: I have performed cross-correlation for each of these 1000 time series separately and found ou...
I am trying to understand the differences in estimating diff-in-diff in different formulations. To exemplify, I'm using data from Abadie, et al., (2010), in which the authors estimate the effect of a tobacco control program implemented in California in 1989. Ps: I know in the paper they used the Synthetic Control Metho...
I am trying to understand how Latent Semantic Analysis works, reading demonstrations based on singular value decomposition. Let's denote $X$ a $N \times D$ document-term matrix. The $D$ rows of $X$ represent documents, and the $W$ columns represent words. Using SVD, we can write $X = U \Sigma V^T$. To me, this formulat...
In a logistic regression model, e.g., $$logit(\mu_i) = \beta_0 + \beta_1 X_{1i} + \beta_2X_{2i}$$ where $Y_i \sim Bernoulli(\mu_i)$, $expit(\beta_1)$ is the odds ratio. In a poisson regression model with an offset, e.g., \begin{align*} log(\mu_i) &= log(\lambda_i t_i)\\ &= log(\lambda_i) + log(t_i)\\ &= \beta_0 + \beta...
In my dataset, there are two distinct species, each with three unique treatments. My objective is to investigate whether there are any significant differences among the various species and treatments. However, my data does not meet the normal distribution assumption for a two-way ANOVA. Is it possible to conduct a non-...
Suppose I have the PDF $$ f_X(x) = \frac{12x^2}{7} $$ with $-1 \leq x \leq 1$. What would be the PDF of $Y = X^2$? Would it be $$ f_Y(y) = \frac{12x^{1/2}}{49},\quad 0 \leq y \leq 1 ? $$
Apologies if this is a very simple question but trying to work through a result in a paper made me realize I missed something a bit fundamental in my undergrad probability and analysis courses. Lets suppose we have $A\in \mathbb{R}^n$ which is a random variable with CDF $F_{A}(\cdot)$ and pdf $f_A(\cdot)$. For $h(\cdot...
I am confused about the presentation of using variogram in simple kriging in the book of Multivariate geostatistics by H. Wackernagel (1995). I understand the process of derivation of simple kriging equations which follows from determining the minimum of the variance of the estimation error. One challenge with the simp...
I have some variables in an OLS that are very skewed to the right, so it could make sense to the log transformation of it, however there are lots of 0s in the variable, so that would mean I have to remove those, thus resulting in a loss of observations. Can I argue that I didn't want to take the log for this reason? (T...
So I ran a regression with an outcome variable (CSI) and a categorical predictor variable (RT) than has two levels (A and B). I made A my baseline variable, and found that the difference between A and B was significant p = .001. CSI ~ RT Then I added in a continuous predictor variable (ACI), without an interaction. CSI...
I have a very simple question but I don't really have answer myself... I have a set of data like this : structure(list(PatientID = c("P1", "P1", "P1", "P2", "P3", "P3", "P4", "P5", "P5", "P6"), LesionResponse = structure(c(2L, 2L, 1L, 2L, 2L, 2L, 2L, 2L, 1L, 2L), .Label = c("0", "1"), class = "factor"), pyr...
The Viterbi algorithm is a dynamic programming algorithm for obtaining the maximum a posteriori probability estimate of the most likely sequence of hidden states—called the Viterbi path—that results in a sequence of observed events, especially in the context of Markov information sources and hidden Markov models (HMM)....
What is the distribution of $Y|aY+b$? I'm assuming that $a\neq 0$. A related question here discusses the distribution of $X|X$, which is degenerate. My guess is that the distribution of $Y|aY+b$ will also be degenerate but I'm not entirely sure how to work that out rigorously. My thought was to try working with the...
In this post, Frank Harrell advocates for Bayesian methods when random effects are used. Now, he is a known Bayesian, so this is not surprising, but his expansion in the comments suggests a stronger advocacy for Bayesian modeling here than his usual. Everything in the frequentist domain is approximate when you have ra...
I am attempting to predict the number of chicks that will hatch from a group of eggs stored in a box. My predictor variable is the count of the eggs based on their size, such as "THE NUMBER OF THE EGGS WHICH HAS SIZE OF 11mm", "THE NUMBER OF THE EGGS WHICH HAS SIZE OF 12mm", and so on ... I have data on the number of e...
I’m trying to fit an ECM-GARCH-DCC model for 2 time series, the whole 3 in the same time using log-likelihood estimation. It has 14 parameters to estimate: ECM has 2 gammas and 1 lambda per time series, this gives 4 gamma and 2 lambda for 2 TS. GARCH has 2 alpha, 2 betas, 2 omega for our 2 TS. DCC has only alpha and b...
I an assessing the agreement between two measurements methods on a binary presence/absence metric. Here is one example of a contingency table: > table 0 1 0 0.92221 0.04624 1 0.00916 0.02238 I am using epiR to compute Cohen's kappa coefficient, the prevalence index, the bias index and the PABAK co...
How can I derive the Autocorrelation function of AR(1)-GARCH(1,1) process which is the combination of AR(1) with GARCH(1,1) process?
I am trying to estimate a confidence interval for the population proportion level of a binary (yes / no) variable. The population comes in three segments - easy to sample (I have a sample); hard to sample (I have a sample but it was harder to get); impossible to sample (well, I haven't managed it). [EDIT ADDED:] My sam...
I recently estimated a regression model using statistical software, but I'm having trouble interpreting the output statistics like estimated coefficients and R-squared. Can you help me understand the process to interpret these results or recommend resources to better understand regression analysis? I'm not very familia...
Given the probability density function: $ \begin{equation} f_{X, Y}(x, y)=\begin{cases} \frac{xy}{3}, & \text{if } x=1,2,3 \text{ and } 0 < y < 1.\\\\ 0, & \text{otherwise}. \end{cases} \end{equation} $ What is the c.d.f. of $(X, Y)$? Ok, so cheking the marginals we see that X and Y are independent: $P(X=x)...
I have a data with 2 variables: diagnosis- yes/no Score- numeric variable from 0-10. I need to do ROC analysis for this data and to find the best cut off values. The problem is the data is too small so I can't split it to train and test data. I understand I need to do build a bootstraped data set, build the model and t...
I'm currently doing research on parent/child feeding and using 2 questionnaires to predict the score of the 3rd questionnaire. However, I have a lot of other predictor variables: gender age ethnicity education child's age child's gender score of questionnaire 1 subscale of questionnaire 2 subscale of questionnaire 2 ...
I have created logistic regression model with my X_variable being income and y variable being a binary variable of whether the business accepts card or cash (link to data at the end), I used sklearn python library to do so and these are the charts I got: However the issue is that while the chart on the right makes sen...
I possess a dataset containing 1,000 chickens. For each chicken, we have egg count data for various sizes (11 to 22mm) and the overall number of chicks that hatched from these eggs for each chiken. What is the appropriate statistical analysis to determine the probability of producing a chick for each egg size? Data of ...
How can I derive forecasting formula for the conditional variance $h_{t+k}$, $k\geq1$ for AR(p)-GARCH(1,1)?
I am trying to derive $\widehat{\beta}$ in summation form from the following: $$\text{argmin } \sum_{i=1}^{N}(y_i - X_i^{T}\beta)^2 + \lambda \sum_{k=1}^{K}{\beta}_k^2$$ I do not want to resort to matrix calculus, I want to use the fact that the sum of the derivative is the derivative of the sum in the finite case. So ...
I found a three-way interaction effect (each of the three factors has two levels) during a robust linear mixed model(RLMM). I'm wondering how to unpack this interaction. What I had done is: first separated it into two more RLMMs based on the two levels of factor 1. and then for further simple comparisons, I used paired...
How can we ensure that the chosen features can lead us to high accuracy if we made proper modifications in model architecture & hyper-parameters using the selected features, i.e. how can we make sure that the chosen set of features is really relevant to the problem and if we are not getting good accuracy then it's the ...
In a cross-sectional study based on geographical multilevel regression, the authors used both individual-level data AND features generated by aggregating the same individual data in the community and dichotomizing them based on being above or below the community median. I am not sure about the interpretation of the coe...
The goal of simulation is to produce a number of synthetic datasets, where the outcomes are a function of the known regression coefficients. I would like to know if my reasoning behind creating synthetic data is valid. The steps involved are: STEP 1: Based on the true (observed) data, fit GLM (e.g., gamma family). ST...
Let's say that we are trying to estimate the effect of a policy whose goal is to increase voter turnout in city-level elections (say, get out and vote campaigns ran by local government). Cities held elections in 2010 et 2020 but only some of them implemented the policy before the 2020 elections. Whether we can consider...
How to train a network with multiple inputs and multiple outputs I have a dataset of (400,256) 400 examples with 256 features. and each example has its corresponding output array (400,256) 400 examples with their 256 outputs. Once you have trained the network that takes an array of 256 inputs and predicts the correspon...
Problem, I have a process(water level in chamber), it perfectly fits with lognormal. But the chamber has a maximum water level, after which no effect of water must be there. I guess I can use the truncated lognormal distribution. I have the following questions regarding truncated lognormal distribution What are the PD...
I came across this property that I don't get and I couldn't find the proof anywhere: Suppose we have a density $K$ of the standard normal distribution and $K'$ its derivative. Suppose that the density $f$ is of class $C^4$ in $\Bbb{R}$ . Let $\hat{f'}_{h,n} = \cfrac{1}{nh^2}\sum_{j=1}^n K'(\cfrac{x-X_j}{h})$ be the est...
Suppose that $X_1,\dots,X_n$ are iid sample from $Bernoulli(p)$: $f(x|p)=p^x(1-p)^{1-x}$ for $x=0,1$, $p\in(0,1)$. The prior distribution of $p \sim Beta(\alpha_0, \beta_0)$ with known $\alpha_0$ and $\beta_0$. The Bayes estimator of $p$ is that $$ \hat{p}=\frac{\alpha_0+\beta_0}{\alpha_0+\beta_0+n}\frac{\alpha_0}{\alp...
I.e., if I flipped five non-absolute values, then averaged them, then got the absolute value as the result, and I did that infinite times, what would be the average value of the result? What mathematical method would I use to calculate this? I've only taken up to precalculus and I anticipate that calculating this would...
The unbaised variance of a population from a single sample ($n\ll N$), $s^2=\sum_i(x_i-\bar{x})/(n_x-1)$. ($n_x$ being the sample size.) However, the standard error of the mean: $SE=s/\sqrt{n_m}$, not $s/\sqrt{n_m-1}$. But the $n_m$ samples that go into the $SE$ are merely samples of the whole powerset population of al...
I have some data from the S&P500 of daily returns. I'm not sure if I can show my graph, as I will be using it in my undergraduate paper, but it looks essentially the same as the histogram here: Just like in the figure above, I am attempting to fit distributions to the histogram. I will be fitting a Gaussian distributi...
For the same set of data x1=1, y1=3 x1=2, y1=2 x1=3, y1=1 calculated by r2_score: from sklearn.metrics import r2_score r2_score([1,2,3], [3,2,1]) the result is -3. plot graph in Excel -- add a trendline -- right-click on your trendline -- Format Trendline -- (1) if select the checkbox next to "Set Intercept = 0.0"...
$$t = \frac{r}{\sqrt{\frac{1-r^2}{n-2}}} \sim t_{n - 2}$$ with $$r = \frac{S_{xy}}{\sqrt{SC_{xx} SC_{yy}}}$$ I've just found this equation with no direct data to of what can I get from it, I couldn't get what is it use for, but I know that is relate to Pearson. In the same diapositive, it says proof of hypothesis for $...
I came across the following statement in a textbook when discussing the classic best linear predictor problem in statistics. It says $E[XX']$ being positive definite is equivalent to it being invertible. I'm wondering why it is the case here because in general an invertible matrix is not necessarily positive definite. ...
Let $X_1,\dots, X_n$ be random sample from $Bernoulli(p)$. Compare the risks of the squared loss of two estimators of $p$: $$ \hat{p}_1=\bar{X}, \, \hat{p}_2=\frac{n\bar{X}+\alpha}{\alpha+\beta+n} $$ where $\bar{X}$ is the sample mean, and $\alpha, \beta$ are two positive constants. Which estimator is better? I comp...
I'm trying to wrap my head around the VECM model by doing some simple examples. In this exercise I'm taking the log prices of 2 assets, A and B. These prices are clearly not stationary, for example asset A: (For the rest of the explanation I'm using the statsmodels library, but my questions are about the fundamentals ...
I have a complex experimental design with two within-subject factors and one between-subject factor, where my outcome variable is measured on a binary response. Country (Between-subject, 2 levels: A and B) Experiment (Within-subject, 5 levels: 1,2,3,4) Trial (Within-subject, 3 levels: 1,2,3) DV/outcome measure is ...
I have an n-takes k-shots medical image segmentation problem. -Tasks: Different human organs ex: liver, spleen, kindness etc... -Shots: 10 CT scans NIFTI images, where all tasks(human organs) exist in all shots, but one of them is labelled to match the task. -Meta-teasing and meta-training have only one human organ seg...
Let me define random variables $A, B, C, D$ that are independent of each other. Additionally, PDFs of $A, B$ are the same, and PDFs of $C, D$ are the same too In such a case, is the following correct? $$W^1(P_{A,B} \parallel P_{C,D})=2W^1(P_A \parallel P_C)$$ where $W^1$ means Wasserstein-1 divergence and $P_{A,B}$ i...
Imagine a scientific organisation wants to communicate the likelihood of particular events occurring. For consistency, the organisation decides to always draw from the same set of words, which it interprets as belonging to an ordinal scale: Aways Usually Frequently Often Possibly Rarely I want to know to what extent ...
I have notice that most literature (especially recently) about posterior consistency as $n\rightarrow \infty$ only focuses on areas of high dimensionality i.e. on $p_n\rightarrow \infty$ as $n\rightarrow \infty$ or $p_n=o(n)$ such that $p$ increases with $n$. Why is this? Why not focuses on cases where $p$ remains fixe...
I have 2 sets of discrete data. My objective is to compare 2 different process which is manual strip and auto-layering machine. But my data are in percentage of scrap. Can I use F-test to analyse the data?
It is not clear to me what is the meaning of the Summary RMSE. I thought this would be average of the two out of sample periods but it is not.
I've just started using the survival and survminer packages in R and am trying to understand its output. In the code below I create a dataframe with the first 12 rows of my actual dataset, as representative of the issue/question. In this representative data: ID = unique identifier for each element time = survival time...
The following objective is taken from the paper 'Training language models to follow instructions with human feedback':which is used to fine-tune the pre-trained language model using Proximal Policy Optimization (PPO). In the original paper, the objective of PPO is as follows: comparing the two objectives we can see the...
Say a set of 5 participants completed two subtests (A and B). The scores on these subtests can be summed to get a total test score. Here is the dummy data: Participant Subtest A Subtest B Total test 1 5 9 14 2 7 0 7 3 5 6 11 4 3 3 6 5 5 2 7 Now, say we don't have access to this raw data. We only kno...
Why is the top result obtained using cosine similarity extremely close to 0 not the expected 1? That implies complete orthogonality. Data: 100k documents/rows with 2000 features(TF_IDF values of tokens, mostly zeroes/sparse) Used NearestNearest neighbors with cosine similarity from this thread: How to find nearest neig...
My question starts on previous answered questions: https://stackoverflow.com/questions/25735636/interpretation-of-ordered-and-non-ordered-factors-vs-numerical-predictors-in-m/25736023#25736023 Results of lm() function with a dependent ordered categorical variable? so we have a linear regression with an ordered factor s...
I came accross some articles stating that differencing a long memory time series leads to memory loss. I don't know much about long-memory time series, but I know how $ARMA$ and $ARIMA$ processes work. I suppose that "long-memory" means "slowly decaying autocovariances". I would like to have a simple and straightforwar...
I’ve been trying to get my head around the particularity of the Hilbert space that a positive-type (equiv. positive definite) kernel represents an inner product on, and was hoping for some help in validating the following logic. I use the support vector machine scenario to land the problem, but this stands in for any ...
I have a random variable $X$, and I need to give an example when $X$ and $X^2$ are independent. I can choose whatever distribution I please, I can say $X$ is a Bernoulli, uniform, or any other distribution. To prove this, I need to show that $P(X \cap X^2) = P(X)P(X^2)$, but I'm failing to do so. I tired keeping it sim...
I am regressing an outcome on two treatments using differences in differences. To deal with the pre-trend problem, I introduced some balancing method and run the regression separately on either treatment using the respective weights. I am trying to add both treatments together and see whether they are orthogonal to eac...
I've been trying to create a function for the Irwin Hall distribution that doesn't face the same issue as the unifed package implementation. Because the function suffers from numerical issues, I figured using Rmpfr to be able to specify precision would help. I was wrong. I also attempted to use as.brob() from the Brobd...
I'm performing a 3-step analysis in Latent Gold 5.1. In step 3 I estimate a model with an ordinal distant outcome. The documentation of Latent Gold gives advice for when to use ML (categorical dependent) or BCH (continuous and count dependent). But it does not explicitly state which method to use when modelling an ordi...
I know similar questions were asked before. However, none of the existing answers help me with my problem: I have a gls model with y=B0+B1X1+B2X2+B3X1X2+e. The VIF value for X1 and the interaction effect X1X2 are 413.67 and 414.08 respectively. The VIF value for X2 is only 1.044729. Furthermore, the resulting coefficie...
I'm not sure how to word the title best for this context. But I am creating a metric with data that is correlated. I have first, the number of a specific dish prepped for the day. Second, I have the time to sell that dish out. The underlying assumption here is that, of course, a dish that has a higher prepped quantity ...
In my data, I have about 10K predictive features (genes), and one target feature (age). I want to predict the ages according to the genes. The rows in the data are the patients. To do so I plan to use Regression Random Forest. I don't want to use this many predictive features, so I want to do some feature selection fir...
Motivated by an experimental investigation in pure mathematics, I am interested in the following type of reinforcement learning problems: The state is a collection of N integers, where there are no bounds on the values (or the bounds are very large); The possible actions are given by a collection of M integers, which ...
I am looking to simulate the results for MLB hitters in terms of their FanDuel and DraftKings fantasy scores. I'm wondering if this is doable given only the following information per player: Mean Median Standard Deviation For normally distributed outcomes, this would be fairly easy. The issue is that I know these valu...
I have DNA metabarcoding sequencing data in the following format: plot Time_point reads_species_A Reads_species_B reads_species_C 1 T1 0 245 65 2 T1 48 455 0 3 T1 15 5 10 1 T3 153 23 564 2 T3 448 468 48 3 T3 753 47 5 The read counts are DNA sequencing read counts and the dataset is rarefied to hav...
this is the data that i have and would like to determine if there was a significant difference between the groups as to average age at death I do not have the original raw data Class of occupation number average age at death Medical 244 67.31 Lawyer ...
I'm trying to fit an ECM model with variance following a GARCH-DCC model (GARCH with dynamic cross correlation). It has 16 parameters for 2 assets (ECM : 4 gammas, 2 lambda, GARCH: 2 alphas, 2 beta, 2 omega, DCC: alpha and beta). Since I'm pretty new in econometrics, I don't know really much what amount of time this sh...
Given $n+1$ variables $p_0, p_1, \ldots, p_n$ defined over $\mathbb{R}^{+}$ so that $\sum_{i=0}^np_i=1$, and given a real number $1<x<n$, I want to generate random solutions of the equation so that every solution is equiprobable (or close enough to be equiprobable) $$ 0p_0 + 1p_1+\ldots+np_n=x $$ Since all variables ar...
I am attempting to determine statistical significance of various customer programs for farmers use of sustainable products. Farm sales of sustainable products follows roughly an exponential curve, where many people purchase little but a few purchase a lot. The customer programs tend to target the larger purchasing cust...
I am researching if it makes sense to create personalized emails based on past purchase behavior, but I do not know how to design A/B tests. The starting data I have is a list of about 500,000 subscribed email addresses, about 1,700 of which have a common attribute: they've purchased a certain category of product. To d...
I am familiar with formulae for paired proportions Z test when the crosstabs table is available. However, if only the two proportions are available, I am having trouble to figure out what is the S.E. of the $P_1 - P_2$. If the following crosstab is available Success Failure Total Sucess a b a+b Failure c d c...
Suppose that we have observations in a 2-dimensional principal coordinate space. Let's denote one observation $\mathbf{y}=(y_1,y_2)$ in our PC space. Further, suppose that we have another observation $\mathbf{y}'=(y_1',y_2')$. Consider two scenarios: $y_1'=y_1$, $y_2' = y_2 + c,$ $y_1' = y_1 + c$, $y_2'=y_2,$ where $...
This is a situation that arises commonly in my area (medicine). Suppose there is an inherently continuous variable $y$ Suppose there is some normal range for this variable, say 80 - 120 Suppose there is a dichotomous categorization of $y$ as "within normal limits", and "outside normal limits" that are commonly used T...
Suppose $$\sqrt{n} (\hat{\beta} - \beta) \overset{d}{\rightarrow} N(0, \sigma^2)$$ Then I know that for some constant $\alpha$ that a linear combination of normal is normal: $$\sqrt{n} (\alpha\hat{\beta} - \alpha\beta) \overset{d}{\rightarrow} N(0, \sigma^2\alpha^2).$$ Now suppose that $\hat{\alpha} \rightarrow \alpha$...
I'm trying to understand this subject and I'm stuck in a question found in a book. I understand white noise characterization, but I'm having some problems with this... maybe it's too much theory? I kind of get lost when I try to prove that also the new variable $Y$ is MA, and don't get me started on solving for the p...
I want to generate $M$ random numbers following a poisson distribution with mean $k$, and then write down how many times the number 0 appears, how many times the number 1 appeared, and so on, until some number $n$, which is the higher number I'm interested in. Let's call $C(j)$ to the number of times the number $j$ wou...
I'm having trouble understanding how to specify a model for Bayesian inference. I have a set of measurements, each with known uncertainty, and I would like to infer the mean of the measurements with gaussian model. The mean is known to be within the interval [0,1], so I use an appropriate prior to enforce that. But I'm...
I used the following for cross-validation and expand grid function to train a caret rf model. control <- trainControl(method='repeatedcv', number=10, repeats=3) Is it possible to know what percentage of the training data is used in the cross-validation to generate rmse value f...
How can we calculate the expected R-squared for a linear regression model without intercept where the predictor variable x and the response variable y are both 100-dimensional standard normal vectors? I tried the following R code and got the output. It looks complicated to compute the expectation of $$1-R^2 = SS_{\math...
The continuous bag of words model has the following log probability for observing a sequence of words: $$\log P(\textbf{w})=\sum_{c=1}^{C}\log{P(w_c|w_{c-m},...w_{c-1}, w_{c+1},...,w_{c+m}})$$ I don't fully understand this. Probabilistically, shouln't it be define as: $$\log P(\textbf{w})=\sum_{c=1}^{C}\log{P(w_c|w_{c-...
I am trying to fit a multiple piecewise linear regression model, where I coerce the model to have the exact terms I want. For example, let's say I want to fit the exact model below, with predictors $x_1$, $x_2$, and $x_3$, to response $y$: $$y = b_0 + b_1 x_1 + b_2 x_2 + b_3\text{max}(0, x_3 - c_3)$$ I am solving for t...
I have recently started working on bed forecasting project. I don't have data and I am asked to figure out a way to forecast the bed occupancy. As per the discussion with my supervisor/boss, I have to use probability to find out how many beds the hospital needs to start. I would appreciate some opinions on how to get s...
Let$(X_1,...,X_{n})$ be a random sample from the Pareto distribution with pdf density $\theta a^{\theta} x^{-(\theta+1)}I_{(a,\infty)}(x),$ where $\theta>0$ and $a>0$ $\textbf{(i)}$ Show that when $\theta$ is known, $X_{(1)}$ is complete and sufficient for $a$. $\textbf{(ii)}$ Show that when both $a$ and $\theta$ are u...