instruction
stringlengths
9
38.7k
I have a yes/no dependent variable; independent variables are also a combination of yes/no variables and one 3-level sexual identity variable. Also hoping to control for for 2 of the yes/no variables and one categorical variable. What analysis is appropriate? Should I be looking at binary?
my question is pretty basic, but I can't find many resources online about this. Say we have two losses for a model, for example a pix2pix GAN, which for those who are not familiar with it, for the generator, has 2 losses: $$ L_{gen} = L_{discriminator} + \lambda L_{rconstruction} $$ where $L_{discriminator}$ is for exa...
I have a nested dataset where information on individual workplace characteristics is available on the case level, and data on recorded sick leave on the group level. 7k individuals are nested within approx. 40 groups and, consequently, the sick leave data is the same for each case in a group. For example, 2.9 for group...
Say I knew the distribution of a continuous variable $X$. If somebody randomly picked out a single instance $x$ and asked me to bet on its value, I would go with the mode of the known distribution of $X$, which is the value that $x$ is most likely to take. Now consider a function $f(X)$. My immediate intuition would te...
When we use L1-regularization in neural networks, it is pretty intuitive how the regularization will influence the learned weights. Namely, weights will not become needlessly large and unimportant weights will go to 0, resulting in a sparser matrix. I wonder if there is a similar intuitive intuition for L2 regularizat...
How does a RandomForestClassifier in sklearn use sample weights? Are sample weights applied when Random Forest bootstraps? Are sample weights applied when model fitting i.e. when training the loss function or deciding splits and reduction in impurity? Are sample weights used in model evaluation metrics - precision, ...
I am a bit confused by the phenomenon of the curse of dimensionality. Most lecturers motivate this with the KNN classifier and I understand why higher dimensions should be avoided with this classifier but I don't get why higher dimensions are so bad in general. I understand that the more dimensions our data has the mor...
I'm currently trying to test whether trait is better at predicting overall/mean job performance than state anxiety and whether state anxiety is better at predicting daily job performance than trait anxiety. I collected data from an ESM diary study, where participants gave measures of their trait anxiety in a prescreen ...
I understand it's reasonable only to not reject the null hypothesis. But why can we accept the alternative hypothesis? What's the difference?
I have the following acceleration data taken from my phone when rowing The negative peak is the point at which the oars go in the water. I would like to be able to identify this peak in real time when rowing. Given the data is roughly periodic - with frequency between 0.1 and 1 times per second - and has a characteris...
17.7736 17.7736 17.7638 17.7638 17.754 17.754 17.7834 17.7834 17.7834 17.7834 17.7834 17.7834 17.7834 17.7834 17.8324 17.8324 17.8324 17.852 17.9304 17.9304 17.9304 18.1166 18.1166 18.1166 18.1166 18.1166 18.1166 18.1166 18.1362 18.146 18.146 18.1656 18.1754 18.1656 18.1656 18.1656 18.1656 18.1656 18.146 18.1362 18.136...
Lots of supervised learning theory is motivated using the IID assumption. Do most of these methods apply equally well if data is only exchangeable, and not IID? Can you provide an example where this is not the case, and explain why?
For a random variable $x$, how would I go about creating an unbiased estimator of the following quantity? $$R=2\left(\frac{E[x^2]}{E[x]^2}-1\right)^{-1}$$ For instance, when $x$ comes from from chi-squared distribution with 100 degrees of freedom, R=100 and sample estimate is an over-estimate. Any tips for practical bi...
I've got this table from the U.S. Census Bureau's American Community Survey. The moe column contains the 90% C.I. variable estimate moe 1 total 232176 4317 2 owner 92982 3261 3 renter 139194 4309 Owners make up an estimated 40% of the total (92982/232176 = 0.400). I'd like to calculate the 90% co...
I'm working on a meta-analysis on a subject with scant literature. I'm analyzing changes in thyroid hormones in spaceflight, looking to see if there is a significant difference between pre- and in-flight hormone levels. However, about half of my studies report measurements from a control group on Earth and from a group...
The Engle and Granger define two series as cointegrated, if they are integrated, but a linear combination of the two series exist, which is stationary. To estimate the cointegrating vector (i.e. the weights of the linear combination) they propose to estimate a regression with OLS and then test the residuals for station...
Is the probability theory used in frequentist and bayesian statistics the same? I know that the interpretation of the concept of probability is different under both approaches, but is it the case too with the mathematical formulation of probability theory (same set of axioms, etc)?
I have a dataset recording daily river flow from 1976 to 2017. I want to find out unusually high (potential flood) or low (potential drought) flow values from that datatset. What's the best way to identify such outliers? I define unusually high/low flow values as outliers as per the definition below: "An anomaly/outlie...
Here, I can calculate the AUC score of each class individually in a multiclass problem (not to be confused with multilabel.) import tensorflow as tf class MulticlassAUC(tf.keras.metrics.AUC): """AUC for a single class in a muliticlass problem. Parameters ---------- pos_label : int Label of the...
I posted on the site a few days ago about my research and got some good advice from several users who suggested that an MCA was the most appropriate way to analyze my data (thank you btw!). I have since then used SPSS to generate an MCA. The problem I now face is trying too sus out what is relevant/important from wha...
I have this linear mixed model with random intercept and slopes and the exercise ask to compute the Var(Yij|bi) and Var(Yij) at time point j=0, j=1 and j=2 (I'm not sure with the correct calculation of the second one). model7<-lme(Y ~ group*time, random= ~1+time| ID,data=datalong, method="REML",na.action=na.omit) Linea...
A definition that I am aware of is interpreted as follows. Given a fixed probability parameter $\theta$, if I construct $100$ confidence intervals $\{I_1, \cdots, I_{100}\}$, then it is expected that $95$ of confidence intervals contain $\theta$. However, I came across an alternative interpretation that confuses me: ...
I have been asked to compare my meta-analytic results obtained from the CMA software to the results from metafor. I find that the width of my confidence intervals are larger with metafor than with CMA, and I would like to better understand the driving cause of this. My code is as follows: mod.model <- rma.mv(yi = r_Z, ...
It seems like both the Weibull and the inverse or reversed Weibull model failure rates, waiting times and extreme phenomena. The inverse Weibull pdf is $$f_X(x; \alpha, \beta) = \beta \alpha^{-\beta}x^{-\beta - 1}\exp\left[- (\alpha x)^{-\beta} \right], \quad\quad x\geq 0, \alpha> 0, \beta >0$$ with $\alpha =\text{ sca...
I have a dataset of the percent of pavement area that is cracked and time as the explanatory variable for a city's streets. Engineering principles and logic tell us that as that as time progresses, the percent cracking keeps increasing. This is what my data looks like: As you can see, there's a huge variation in the c...
If we assume that: (1) $P(X_1, X_2|D)=P(X_1|D)P(X_2|D)$, i.e., $X_1$ and $X_2$ are conditional independence given $D$; (2) $P(X_1, X_2|\overline{D})=P(X_1|\overline{D})P(X_2|\overline{D})$, i.e., $X_1$ and $X_2$ are conditional independence given $\overline{D}$. (PS: we cannot derive (2) with the assumption of (1)) Can...
My research is people's bias toward CNN and Fox News, my professor assisted me with creating this in Rstudio but she failed to help me interpret them and I'm just lost on how I can explain it in my research. To be honest, I'm not sure what I'm even looking at, i need to include signs of your coefficients, the statist...
I have mental health score as my dependent variable, the relationship with people as one of my independent variables, which has 7 scores representing the mood from the most happy to the most bad. Another control variable represents the frequency of people working from home, which is labelled as 4 scores representing al...
Wikipedia gives one formulation for the k-means problem as: where we intend to find a set of clusters $S = \{S_1, \ldots, S_k\}$ to minimize this value. However, the equivalent formulation divides the sum of pairwise distances by the size of the cluster. Intuitively, why does the first formulation (using sum of dista...
I have 70 imputations of my original data set. I want to choose 50 of them which converged after less than 120 iterations on my CFA model: CFA.model <- ' B1 =~ ZB_TF + SR_TF + KO_TF + AU_TF + SF_TF B2 =~ ZB_ST + SR_ST + KO_ST + AU_ST + SF_ST + ZB_FW + SR_FW + KO_FW + AU_FW + SF_FW B3 =~ ZB_FWB + SR_FWB + KO_FWB + AU_FW...
I struggle to find a clean answer for this question: how to tune hyperparameters while the model does not produce similar results for different runs? Before starting the tuning, I play around with the parameters to have consistent outcomes. However, during the tuning process, the outputs of the model become inconsisten...
Two years ago I answered the question: What are the odds in Scrabble of not being able to make a legal move on opening? This question is asking for the value of the parameter in a Bernouilli distribution. A player is dealt a hand of letter tiles; then either they can form a word, with probability $1-p$, or they cannot ...
Is the confidence level of an interval only valid if the samples drawn are equal to the original sample size used when calculating the confidence level and interval? Why must it be equal? Why not less than or equal? Surely "less than or equal will have less variability and therefore likely to be within the interval?" A...
So I need to plot a Sensitivity-Specificity curve. Since ROCs represent TPR (sensitivity) against FPR (or 1 - Specificity), can I just plot TPR against 1 - FPR as in the code below to obtain a Sens-Spec curve? import matplotlib.pyplot as plt from sklearn.metrics import roc_curve ... fpr, tpr, _ = roc_curve(y_test, y_...
Since KL divergence can be decomposed as \begin{equation*} D_{\mathrm{KL}}(q \| p) = H(p \| q) - H(p), \end{equation*} I wonder if there exists a weighted version of KL divergence, i.e., \begin{equation*} D^{\gamma}_{\mathrm{KL}}(q \| p) = H(p \| q) - \gamma H(p), \end{equation*} BTW, the motivation of this weighted ve...
I have a question around interpretation of results of 1-sample t-test. I am using the test (with SciPy.stats.ttest_1samp function in Python) to check if the existing goal set for a productivity metric is correct. As I understand, for 1-sample t-test: a) H0: population mean equals the specified mean value (the metric go...
How do you interpret the value of x at the intersection ? what is the mathematical proof?
I would like to attempt a Monte Carlo procedure to filter composite anomalies at 90% confidence level from the rest of the composite anomalies. My data is a NetCDF of hourly surface temperature that I've aggregated to daily to get their composite daily anomalies. I'm doing the same methodology on different variables (h...
I have a list $L=\{x_1,x_2,\cdots,x_N \}$ of $N$ random integer numbers $x_i\in[a,b]$, $b\gt a$, $a,b\in\mathbb{N}$, $N\gg b$ and they follow a discrete uniform distribution. I need to scan the list from its beginning and "collect" each number from $a$ to $b$ and I am interested in how far in the list I had to go (reac...
I have read that highly autocorrelated data (such as stock markets) can be problematic when creating forecasting models essentially because we may infer that there is some signal or underlying model when in fact we are making sense of noise and the system is just highly autocorrelated. I am looking to model sunlight ir...
Let $y\in\mathbb{R}^n$, and let $f:\mathbb{R}^n\to\mathbb{R}^m$ be the transformation that outputs $m$ evenly-spaced order statistics (including the extremes) of $y$. What is the Jacobian of this transformation? My Attempt I tried coding this in Python and using automatic differentiation, but unfortunately doesn't se...
Part of the attraction of the Hayes PROCESS Macro in R is that it will generate the index of moderated mediation. It tells you if your indirect effect varies by the level of a moderator variable. I'm doing a moderated mediation analysis. BUT because I have a moderator variable with three categories, it actually generat...
Suppose that the observations $(y_t, x_t, k_t)_{t=1}^N$ satisfy the linear regression equation: \begin{equation} \begin{split} y_t = \begin{cases} x_t \beta + e_t & w.p. \; \theta \\ k_t \gamma + e_t & w.p. \; 1-\theta \end{cases} \end{split} \end{equation} with $\mathbb{E}(e_t|x_t, k_t)=0$ and other usual assumption...
I was wondering about the method of sample size calculation/power analysis in random forest and gradient boosting models. I already know the calculation of sample size using Gpower in regression model, but calculating sample size in the machine learning method is not familiar.
Suppose we have independent events $E_1,\dots,E_n$, and define $E = E_1 \land \cdots \land E_n$ to be the conjunction (logical-and) of these events. Let $p_i=\Pr[E_i]$, $p=\Pr[E]$. If we are given the probabilities $p_1,\dots,p_n$, it is easy to compute $p$ via the formula $p=p_1 \cdots p_n$. But what if we are workin...
I am training an LSTM to a univariate time series and I have some questions about how to evaluate the train vs validations loss charts and which number of epochs to use in the model. To give more context about my data. It is a monthly univariate time series and the LSTM wants to predict the next 12 data points. The dat...
Using MASS::glm.nb (R) I am having problems of convergence with certain dataset, and it seems theta goes very high, resulting in NaNs "In sqrt(1/i)" during the fit. I am trying to understand this and have run some tests to see if NB is a significant better fit than Poisson, and it isn't (p~0.3). My question: is it stil...
To explain the difference between Ridge and Lasso regression, following diagram is used as it is claimed that Ridge regression cannot shrink the regression coefficients to 0: But my question is, if my equation of cost function is like the one on in the following image, Ridge can also reduce the coefficient to 0: Plea...
I am working on doing some predictive analysis, and we are attempting to implement a schema that we have found in a white paper. I have been searching for a while, but have not been able to come up with a solution to this problem, and am hoping that some of the more experienced Data Scientist of Stack Exchange can poin...
I am looking for a beginner-friendly explanation of what Robbins' G-computation and G-estimation are for estimating causal effects. What problem(s) do they solve. Ideally I would like an example of where multivariable regression fails to estimate the desired effect, but G-methods succeed.
In Bishops book, "Statistical Pattern Recognition", there is one exercise, which states to derive the second order moment of the Gaussian Distribution: $E[x^2] = \int_{-\infty}^{\infty} N(x|\mu, \sigma^2 )x^2dx = \mu^2 + \sigma^2 $ As a hint, the book states to take the derivative of $\int_{-\infty}^{\infty} N(x|\mu, ...
Here are data about the ventilation response (VE) to exercise (i.e., increase in oxygen consumption or VO2). In normal condition, ventilation increases linearly until a threshold where hyperventilation starts around 50 to 70% of peak VO2. However, with cardiac disease (here coronary artery disease or CAD), hyperventila...
I am looking into using PSM to help determine the effects that an academic intervention has on student dropout rates, and I have a question about how to use it. Currently, I have information on whether a student was in the treatment, and some demographic information that I want to use as covariates. I do not yet have i...
How is the subdistribution survival function, associated with the subdistribution hazard function, interpreted? Is it just the probability of failing from the specific cause after the current time? I know it was developed to allow to estimate covariate effects on the incidence, but I'm not sure if that also means the s...
I got the following question: Suppose I have three variables, $x_1$, $x_2$ and $y$. We run univariate regression of $y$ on $x_1$ ($x_2$) with intercept and get the regression coefficients $\beta_1$ ($\beta_2$). We then run a multivariate regression of $y$ on $x_1$ and $x_2$ and get the regression coefficients $\gamma_1...
When working with the Metropolis-Hastings algorithm, we can work with an asymmetric proposal density $g(x^\prime | x)$ provided we know the distribution in order to calculate the ratio $\frac{g(x|x^\prime)}{g(x^\prime | x)}$. We can use also utilize a process that proposes updates according to an unknown distribution, ...
I have done a GC content (counting C and G in genomes) and GC variation within genomes, in a slide-window (1000 pb-base pairs). I have each genomic data separated in tsv files. When I work with pandas and merge all data by columns, I got a lot of lines with NAs because each species has a different genome size. Pandas w...
In Bishop's Pattern Recognition and Machine Learning book, page 30, section 1.2.6, it says that the MAP estimator for the curve fitting model derived in section 1.2.5 is a point estimator of the model parameters $\textbf{w}$: My question is: why are we calling MAP a point estimator? The posterior distribution can give...
UMP tests generally do not exist for two sided tests, ie $H_0: \theta = \theta_0$ vs $H_a: \theta \neq \theta_0$. However, if we observe $n$ iid observations of $X\sim Unif(0,\theta)$, we can construct a UMP test for the two sided hypothesis. The general strategy is to look at both sides of the inequality, ie $\theta <...
That's the question: Is data leakage from time series autocorrelation actual data leakage? To explain it with an example (I will separate the example in numbers to give more structure to the questions I have): If we have daily train data from 2012 until 2016, test data 2017, and we see that autocorrelation of features...
I think I'm misunderstanding something with training ML tree models. There's a bunch of evaluation metrics we can use. It seems like this metric however is only used after training, which does not seem intuitive for me. Perhaps we want to prioritise precision. Perhaps we want to prioritise recall, etc. Doesn't the ...
I have a question about linear error propagation. Let's say that I want to use an equation to calculate n, where n = (PV)/(RT) (eq.1) I only take one measurement of P, and one measurement of T, but I know their nominal uncertainties (e.g., .08% and 0.5) and will use those as the 'standard deviation' terms in standard l...
Given a confusion matrix of a binary classifier, what are the best measures of response bias towards one of the classes? One idea that comes to mind is Signal Detection Theory's criterion, but this measure assumes a Gaussian noise model. Is there a more straightforward, well-tested measure of response bias? For example...
Suppose there are two 2-d multivariate normal distributions , as in the image below: There is no correlation between the x and y components in the distributions, and the variance for each dimension is the same. Is it correct to say that the angle between the two distributions could be expressed as a wrapped normal di...
According to 4.5.13 $\hat{A}_{mh}=\left(\frac{1}{n}\sum_{i=1}^{n}z_{im}x_{i}^{\prime}\right)\left(\frac{1}{n}\sum_{i=1}^{n}x_{i}x_{i}^{\prime}\right)^{-1}\left(\frac{1}{n}\sum_{i=1}^{n}x_{i}z_{ih}^{\prime}\right)$ I have no idea how $x_i$ "disappears" and the above equation becomes $\hat{A}_{mh}=\frac{1}{n}\sum_{i=1}^{...
Recently I read Wald test for logistic regression this post, which states why do we use Wald test in logistic regression and no t-test instead. It says, that the main reason behind it, is that for example in OLS the variance of residuals is unknown, and it has to be estimated, so t-test has to be used. On the another h...
I have a question about interpreting a Bayesian ordered logistic model. The outcome variable is ordinal, on a scale 1 - 5, and there are two categorical predictor variables, religion (4 levels) and country (3 levels). I would prefer to use level mean coding (and not create dummies) for the categorical predictors for th...
I refer to this post I use the same library and also the same dataset library(tidyverse) library(lmer4) str(sleepstudy) 'data.frame': 180 obs. of 3 variables: $ Reaction: num 250 259 251 321 357 ... $ Days : num 0 1 2 3 4 5 6 7 8 9 ... $ Subject : Factor w/ 18 levels "308","309","310",..: 1 1 1 1 1 1 1 1 1 1...
I am completely new to meta analyses and I have to do one for a university project. I basically have beta coefficients from different papers performing covariate methods such as partial least squares, and want to pool the results together to assess the effect of different factors on each other. However, since only corr...
In healthcare, patient diagnosis is recorded with a code called an ICD code. There are around 43K distinct diagnosis codes. So, basically any population can have between 0 and 43K DISTINCT diagnosis. To keep things simple, assuming that: Every diagnosis is equally likely Each patient has just 1 diagnosis ... how do I...
I have a time series of a variable V1 with seasonality and a strong trend. The trend however seems to be closely related to (and caused by) the trend of another time varying variable (V2). As V2 grows i.e shows a positive trend, the trend on V1 declines (see chart). I want to use V2 as an exogenous variable in the tim...
I am performing a logistic regression where the original data has unbalanced classes, 5% 1s and 95% 0s. Using IPW (either by calculating the weights myself or by choosing class_weight='balanced' in sklearn's LogisticRegression), I get in-sample predictions that, on average, are below 40%. More details on the calculatio...
I am using Deep Recurrent Survival Machines (RDSM) model from auton-survival library for survival analysis with time-varying covariates. I am using a longitudinal survey dataset (Health and Retirement Study), where every respondent has variables from 13 waves at max. I first tried to understand how RDSM works (link to ...
Let's say I have data from several mice with id id. Each mouse wandered around two mazes (A and B) and I gave a score at the end of the run (score). dat <- data.frame(id=c(1, 1, 2, 2, 3, 3, 4, 4), maze=c("A", "B", "A", "B", "A", "B", "A", "B"), score=c(10, 21, 13, 9, 12, 16, 3, 18)) id maze sc...
Given a sample of $N$ points $\{\mathbf{x}_i\}$ from a bivariate Normal distribution (arbitrary mean and covariance matrix, though I'm mainly interested in the zero-mean case), how does one derive the distribution of the pairwise Euclidian distances between the points? That is, the distribution of {$|\mathbf{x}_i - \ma...
I'm separately analyzing 5 subsets of my data and running multiple linear regressions with the same outcome variable in each. (I am also running a single regression with all the subsets and using the subset variable as a predictor, but it is useful to run separate regressions for each subset because the results are qui...
Sorry it seems a pretty basic question, but I cannot find any clue in my probability theory and statistics textbooks. Let $$X\in D$$ be a categorical random variable of unknown distribution P on domain D, where D is an unknown limited domain. Let (S,C) be a sample of X, where S={x1,x2,...,xn} be unique values in the sa...
library(Matchit) library(cobalt) I am using the dataset lalonde in this example. head(lalonde) treat age educ race married nodegree re74 re75 re78 1 1 37 11 black 1 1 0 0 9930.0460 2 1 22 9 hispan 0 1 0 0 3595.8940 3 1 30 12 black 0 ...
I am working on a domain adaptation problem, where the default is a classification problem. I have worked exclusively with regression problems until now, so I am kind of thrown for a loop when it comes to understanding how ML algorithms handle the labels in classification problems. In regression, we use MSE loss with t...
I am working on propensity score matching using the Kernel Nadaraya–Watson kernel regression. But I am looking to understand the logic of estimation; First, we estimate the Kernel density of each unit (i) in the data using the formula $$ \hat Y_{0i} = \frac{\sum_{E_0} K\left(\left\| \tfrac{X_i-X_k}{h} \right\|\right) Y...
When implementing the adam optimizer algorithm each time step the betas must be updated. A static decay schedule can be used, although the paper recommend the following: beta1(t) = beta1^t beta2(t) = beta2^t I am not sure what t would represent. Is it a constant like 0.99?
I have a longitudinal dataset. I wish to do some exploratory data analysis on it. However, it has the problem of missing observations/non-response. Q: How does one do exploratory data analysis on this dataset so as not to bias the hypothesis generated? My intention is to do multiple imputation first and then conduct ex...
Can we represent a population by its mean? Is the answer simply "yes, unless there are outliers or the data is skewed"?
I'm trying to estimate the following state-space model: $$ y_{t} = \begin{bmatrix}1& 1 \end{bmatrix}\begin{bmatrix}\mu_{t}\\v_{t}\end{bmatrix} + \epsilon_{t},\quad \epsilon_{t}\sim N(0,\sigma_{\epsilon}) $$ $$ \begin{bmatrix}\mu_{t+1}\\ v_{t+1} \end{bmatrix} = \begin{bmatrix}1 & 0 \\ 0 & \rho \end{bmatrix} \begin{bmatr...
I have this algorithm which I encountered: (1) Generate $U_1$, $U_2$ independently from Uniform(0,1) (2) Set $Y_1 = -\log{U_1}, Y_2 = -\log{U_2}$. If $Y_2 > \frac{(1-Y_1)^2}{2}$, accept $(Y_1, Y_2)$. Else reject and return to step 1. (3) Generate $U_3$ from Uniform(0,1). If $U_3 < 0.5$, accept $X=Y_1$. Else, $X=-Y_1$ ...
I am working on a meta-analysis that has two moderator variables. Below is the code that I've figured out, but I'm not sure how to get the forest plot to show the overall model estimate. It's currently showing the effect sizes for each study, but is not taking into account the task or the display type to give me an ove...
I have to design a FCN which takes inputs with variable sizes (this is not a problem) but also the output has to vary. In particular, I have RxCx3 RGB input images and I want the output to be (R+C)x3. For instance, a 1024x2048x3 image should return an output of (1024+2048)x3=3072x3. The same has to be true with all the...
I have a distribution of values that I have simulated for a null hypothesis data generating process. I have a single real-world observation that is wayyyy outside the percentiles of this distribution. Can I give a p-value for this single observation not being generated by the same data generating process that gave me t...
I have not done a power analysis in a long time, but was asked to do so for a new study. The design is as follows: At enrollment, every patient has no diagnosis because conventional testing did not detect any disease The patients are then given a new test The results of the new test is given to the clinician, who then...
I'm trying to predict the scores of a soccer team in the next match using a VAR (Vector Autoregression Model). So my first attempt was to define the model as it follows: $$g_{1,t}=\alpha_{1}+\beta_{11}\cdot g_{1,t-1}+\beta_{12}\cdot g_{2,t-2}+u_{t}$$ $$g_{2,t}=\alpha_{1}+\beta_{21}\cdot g_{1,t-1}+\beta_{22}\cdot g_{2,t...
I'm working through the generalized additive models book by Simon Wood and I've had a discussion with a friend of mine over how P-Splines estimation would work for dependent data. For independent data we have the following, staying with the notation from the book, $y_i=f(x_i)+ \epsilon_i$ where $y_i$ is a response vari...
kI'm trying to build a decision tree model on a dataset that only has categorical values, an example fragment of the dataset is below. My training dataset consists of 40 observations Repository PrimaryLanguage BuildTools IntegrationRequired Active 1 repo-name-1 Java Maven yes ...
I am using dummy data to ask my question: I have a linear model y~x. library(tidyverse) library(ggpubr) theme_set(theme_pubr()) model <- lm(sales ~ youtube, data = marketing) Let's assume I am predicting into a new dataset: pred=predict(model,marketing[1:20,], interval="prediction") I want to calculate the sum of all...
I am using a Random Forest model for predicting a target variable wich is basincally 1 and 0 (I have created a dummie variable from a categorical variable). But after running the model I get a predicted variable wich is not only 1 and 0 (as expected) but some values in between (0.something). How can I restrict the pred...
I want to compare proportions or means in two groups in a clustered sample. Suppose the sampled clusters are schools or hospitals or Census areas, and we sample from each of these an equal number in each of the two comparison groups. In other words, it is not the case that entire clusters are in one comparison group or...
In my reading of maximum likelihood estimation, they go through samples with KNOWN distributions (e.g. binomial, poisson, etc.). I wonder how can I connect to my knowledge of machine learning. In machine learning, it's always the log likelihood to be maximized, usually in terms of P(data|theta). However, how we don't e...
Is it the same? If yes, which one is the more common/correct notation?
Studying for my finals in Deep learning. I'm trying to solve the following question: Calculate the Transposed Convolution of input $A$ with kernel $K$: $$ A=\begin{pmatrix}1 & 0 & 1\\ 0 & 1 & 0\\ 1 & 0 & 1 \end{pmatrix},\quad K=\begin{pmatrix}1 & 0\\ 1 & 1 \end{pmatrix} $$ I can't seem to find the formula which is us...
recently an interesting question came up and while I would have intuitively said it is not, other students have now made a compelling case (while not being sure themselves). For ridge (or l2 regularized) regression ( $RSS + \frac{\lambda}{2} ||w||^2 $) Is the function of the magnitude of the coefficients $||w||^2 $ a f...
I've read that time between calls (in a call center) can be modeled with exponential distribution. My question is this: the shape of the exponential distribution has a decreasing nature. Suppose that there are 6 calls at average in an hour. In this case, according to my intuition, the highest probability for the next c...