search for: f_j

Displaying 15 results from an estimated 15 matches for "f_j".

Did you mean: f_
2017 Nov 06
2
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
...combination of only X3B and X3C implies contrasts encoding, with respect to X3A.) Thanks in advance, Arie On Sat, Nov 4, 2017 at 5:33 PM, Tyler <tylermw at gmail.com> wrote: > Hi Arie, > > I understand what you're saying. The following excerpt out of the book shows > that F_j does not refer exclusively to categorical factors: "...the rule > does not do anything special for them, and it remains valid, in a trivial > sense, whenever any of the F_j is numeric rather than categorical." Since > F_j refers to both categorical and numeric variables, the beha...
2017 Nov 04
2
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hello Tyler, I rephrase my previous mail, as follows: In your example, T_i = X1:X2:X3. Let F_j = X3. (The numerical variables X1 and X2 are not encoded at all.) Then T_{i(j)} = X1:X2, which in the example is dropped from the model. Hence the X3 in T_i must be encoded by dummy variables, as indeed it is. Arie On Thu, Nov 2, 2017 at 4:11 PM, Tyler <tylermw at gmail.com> wrote: >...
2017 Nov 04
0
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hi Arie, I understand what you're saying. The following excerpt out of the book shows that F_j does not refer exclusively to categorical factors: "...the rule does not do anything special for them, and it remains valid, in a trivial sense, whenever any of the F_j is numeric rather than categorical." Since F_j refers to both categorical and numeric variables, the behavior of model.m...
2017 Nov 06
0
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
...oded with dummy variables. In reality, it is encoded by dummy variables only when the numeric:numeric interaction is missing, and by contrasts for the other two. The heuristic does not specify separate behavior for numeric vs categorical factors (When the author of Statistical Models in S refers to F_j as a "factor", it is a more general usage than the R type "factor" and includes numeric variables--the language used later on in the chapter on page 40 confirms this): when there is a missing marginal term in the formula, the higher-order interaction should be coded by dummy var...
2017 Nov 02
2
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hello Tyler, Thank you for searching for, and finding, the basic description of the behavior of R in this matter. I think your example is in agreement with the book. But let me first note the following. You write: "F_j refers to a factor (variable) in a model and not a categorical factor". However: "a factor is a vector object used to specify a discrete classification" (start of chapter 4 of "An Introduction to R".) You might also see the description of the R function factor(). You note...
2017 Nov 02
0
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hi Arie, The book out of which this behavior is based does not use factor (in this section) to refer to categorical factor. I will again point to this sentence, from page 40, in the same section and referring to the behavior under question, that shows F_j is not limited to categorical factors: "Numeric variables appear in the computations as themselves, uncoded. Therefore, the rule does not do anything special for them, and it remains valid, in a trivial sense, whenever any of the F_j is numeric rather than categorical." Note the ".....
2017 Oct 27
2
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
Hello Tyler, I want to bring to your attention the following document: "What happens if you omit the main effect in a regression model with an interaction?" (https://stats.idre.ucla.edu/stata/faq/what-happens-if-you-omit-the-main-effect-in-a-regression-model-with-an-interaction). This gives a useful review of the problem. Your example is Case 2: a continuous and a categorical regressor.
2018 Dec 06
2
New to LLVM. Need help generating assembly
...o increment the stack pointer by 'amount' (i.e. sp = sp + amount). During assembly generation, the string that gets emitted is "ADS $SP" rather than "ADS 10", for example, if I want to increment it by 10. Can somebody show me what I'm doing wrong? Thanks. def ADS: F_J<0b100001,(outs),(ins i32imm:$amount),"ADS $amount",[(set SP, (add SP, i32imm:$amount))] > { bits<10> amount; let Inst{9-0} = amount; let isReMaterializable = 1; let mayLoad = 0; let mayStore = 0; let Defs = [SP]; let Us...
2017 Oct 31
0
Bug in model.matrix.default for higher-order interaction encoding when specific model terms are missing
...hose pages could made unavailable by Amazon at any time, at the very least we have an problem with a lack of documentation. However, I still believe there is a bug when comparing R's implementation to the heuristic described in the book. From Statistical Models in S, page 38-39: "Suppose F_j is any factor included in term T_i. Let T_{i(j)} denote the margin of T_i for factor F_j--that is, the term obtained by dropping F_j from T_i. We say that T_{i(j)} has appeared in the formula if there is some term T_i' for i' < i such that T_i' contains all the factors appearing in T...
2018 Dec 06
3
New to LLVM. Need help generating assembly
...#39; (i.e. sp = sp + amount). During assembly generation, the string that gets emitted is "ADS $SP" rather than "ADS 10", for example, if I want to increment it by 10. >> >> Can somebody show me what I'm doing wrong? >> Thanks. >> >> def ADS: F_J<0b100001,(outs),(ins i32imm:$amount),"ADS $amount",[(set SP, (add SP, i32imm:$amount))] > { >> >> bits<10> amount; >> >> let Inst{9-0} = amount; >> let isReMaterializable = 1; >> let mayLoad = 0; >>...
2009 Aug 24
2
Formulas in gam function of mgcv package
Dear R-experts, I have a question on the formulas used in the gam function of the mgcv package. I am trying to understand the relationships between: y~s(x1)+s(x2)+s(x3)+s(x4) and y~s(x1,x2,x3,x4) Does the latter contain the former? what about the smoothers of all interaction terms? I have (tried to) read the manual pages of gam, formula.gam, smooth.terms, linear.functional.terms but
2009 Aug 24
2
Formulas in gam function of mgcv package
Dear R-experts, I have a question on the formulas used in the gam function of the mgcv package. I am trying to understand the relationships between: y~s(x1)+s(x2)+s(x3)+s(x4) and y~s(x1,x2,x3,x4) Does the latter contain the former? what about the smoothers of all interaction terms? I have (tried to) read the manual pages of gam, formula.gam, smooth.terms, linear.functional.terms but
2013 Nov 19
1
Generación de números aleatorios. Mixtura k-puntos
Saludo cordial para cada uno. Les pido ayuda para generar números aleatorios de una mixtura k-puntos. Sabemos que la función de distribución F es una mixtura k-puntos si es de la forma F(x) = p_1 F_1(x) + p_2 F_2(x) + … + p_k F_k(x), donde F_j es una función de distribución de probabilidad, p_j > 0 y suma(p_j) = 1, para j = 1, 2, …, k. En mi caso particular F es la suavización de la función de probabilidad discreta {p_j} mediante kernel gamma. En el siguiente código F es la función Keg: # Distribución empírica suavizada # Val...
2011 Jun 22
2
VGAM constraints-related puzzle
...fit simultaneously. Here \eta_j is the linear predictor, the logodds of outcome j vs the reference outcome. I cannot see how to fit exactly this. Instead I seem to be able to do the following: vgam(formula = y ~ s(x), family = multinomial) fits the model \eta_j = \beta_{ (j) 0 } + \beta_{ (j) x } f_j (x) i.e. a different function f_j (x) is fit for each outcome. vgam(formula = y ~ s(x), family = multinomial, constraints = list(`(Intercept)`= diag(1,3), 's(x)' = matrix(c(1,1,1),3,1)) ) fits the model \eta_j = \beta_{ (j) 0 } + f (x) i.e. a single function f (x) is fit, but scaled the s...
2011 Dec 10
2
efficiently finding the integrals of a sequence of functions
Hi folks, I am having a question about efficiently finding the integrals of a list of functions. To be specific, here is a simple example showing my question. Suppose we have a function f defined by f<-function(x,y,z) c(x,y^2,z^3) Thus, f is actually corresponding to three uni-dimensional functions f_1(x)=x, f_2(y)=y^2 and f_3(z)=z^3. What I am looking for are the integrals of these three