Displaying 20 results from an estimated 6000 matches similar to: "MARS help?"
2004 Aug 10
1
Error message in function mars() in package mda
Hi,
I am using function mars() in package mda to find knots in a whole bunch
of predictor variables. I hope to be able to replicate all or some of
the basis functions that the MARS software from Salford Systems creates.
When I ran mars() on a small dataset, I was able to get the knots.
However, when I tried running mars() on a larger dataset (145 predictor
variables), for a different
2008 Jun 12
1
Problems with mars in R in the case of nonlinear functions
Hi,
I'm trying to use mars function in R to interpolate nonlinear
multivariate functions.
However, it seems that mars gives me a fit which uses only very few
basis function and
it underfits very badly.
For example, I have tried the following code to test mars:
require("mda")
f <- function(x,y) { x^2-y^2 };
#f <- function(x,y) { x+2*y };
# Grid
x <-
2024 Jul 16
2
Automatic Knot selection in Piecewise linear splines
>>>>> Anupam Tyagi
>>>>> on Tue, 9 Jul 2024 16:16:43 +0530 writes:
> How can I do automatic knot selection while fitting piecewise linear
> splines to two variables x and y? Which package to use to do it simply? I
> also want to visualize the splines (and the scatter plot) with a graph.
> Anupam
NB: linear splines, i.e. piecewise
2011 Mar 30
6
Quick recode of -999 to NA in R
Hi,
I am trying to write a loop to recode my data from -999 to NA in R. What's
the most efficient way to do this? Below is what I'm presently doing, which
is inefficient. Thanks,
Chris
dat0 <- read.table("time1.dat")
colnames(dat0) <- c("e1dq", "e1arcp", "e1dev", "s1prcp", "s1nrcp", "s1ints",
2024 Jul 26
1
Automatic Knot selection in Piecewise linear splines
dear all,
I apologize for my delay in replying you. Here my contribution, maybe
just for completeness:
Similar to "earth", "segmented" also fits piecewise linear relationships
with the number of breakpoints being selected by the AIC or BIC
(recommended).
#code (example and code from Martin Maechler previous email)
library(segmented)
o<-selgmented(y, ~x, Kmax=20,
2006 Apr 19
1
R-squared for MARS models
Hi,
is there an R function which can compute the R-squared
for a mars model fitted using the mda package?
many thanks in advance
best regards
Marco Girardello
2010 Dec 26
1
Question about mars() -function
Hi!
I have some questions about MARS model's coefficient of determination.
I use the MARS method in my master's thesis and I have noticed some
problems with
the MARS model's R^2.
You can see the following example that the MARS model's R^2 is too big
when i have used mars() -function for MARS model building, and when I
have made MARS-model using a linear regression, it
2006 Sep 22
2
Merge problem
Hello all,
I have read as many merge issues as I possibly could tonight and
although I presume this is a small error, I have not found the
solution to my problem.
I'm trying to merge two data sets: dat0 and TransTable. As you can
see below, dat0 has 8000 rows, whereas TransTable has 47296 rows. I
would expect when I merge the two data sets, with all.x=F, and
all.y=F, that the
2007 Aug 06
0
strange problem with mars() in package mda
Hello all,
So I'm doing some data analysis using MARS. I have a matrix of 65
independent variables, from which I'm trying to predict 71 dependent
variables.
I have 900+ data points (so a 900x136 matrix of data), which I randomly
split into training and validation sets, for ~450 data points in each set.
Occasionally, this works well, and I get decent predictions. However, quite
often
2009 Apr 15
2
AICs from lmer different with summary and anova
Dear R Helpers,
I have noticed that when I use lmer to analyse data, the summary function
gives different values for the AIC, BIC and log-likelihood compared with the
anova function.
Here is a sample program
#make some data
set.seed(1);
datx=data.frame(array(runif(720),c(240,3),dimnames=list(NULL,c('x1','x2','y'
))))
id=rep(1:120,2); datx=cbind(id,datx)
#give x1 a
2012 Feb 15
1
source code of MARS
Dear Sir/Madam,
I am a phd student and I am trying to implement a new approach for the knot
selection procedure in MARS algorithm. In order to apply and test the
efficiency of my method, is it possible to get the code (sourse) of "earth"
library?
Thank you for your interest and concern.
Best Wishes,
Elcin Kartal,
Research Assistant
Department of Statistics
Middle East Technical
2011 Jun 08
1
predict with model (rms package)
Dear R-help,
In the rms package, I have fitted an ols model with a variable
represented as a restricted cubic spline, with the knot locations
specified as a previously defined vector. When I save the model object
and open it in another workspace which does not contain the vector of
knot locations, I get an error message if I try to predict with that
model. This also happens if only one workspace
2013 Jan 28
2
Why are the number of coefficients varying? [mgcv][gam]
Dear List,
I'm using gam in a multiple imputation framework -- specifying the knot
locations, and saving the results of multiple models, each of which is
fit with slightly different data (because some of it is predicted when
missing). In MI, coefficients from multiple models are averaged, as are
variance-covariance matrices. VCV's get an additional correction to
account for how
2005 Feb 24
2
a question about function eval()
Hi,
I have a question about the usage of eval(). Wonder if any experienced user can help me out of it.
I use eval() in the following function:
semireg.pwl <- function(coef.s=rnorm(1),coef.a=rnorm(1),knots.pos=knots.x,knots.ini.val=knots.val){
knotn <- length(knots.pos)
def.par.env <- sys.frame(1)
print(def.par.env)
print(environment(coef.s))
tg <- eval( (parse(text=
2011 Oct 06
1
anova.rq {quantreg) - Why do different level of nesting changes the P values?!
Hello dear R help members.
I am trying to understand the anova.rq, and I am finding something which I
can not explain (is it a bug?!):
The example is for when we have 3 nested models. I run the anova once on
the two models, and again on the three models. I expect that the p.value
for the comparison of model 1 and model 2 would remain the same, whether or
not I add a third model to be compared
2024 Jul 09
1
Automatic Knot selection in Piecewise linear splines
How can I do automatic knot selection while fitting piecewise linear
splines to two variables x and y? Which package to use to do it simply? I
also want to visualize the splines (and the scatter plot) with a graph.
Anupam
[[alternative HTML version deleted]]
2019 Apr 24
1
Bug in "stats4" package - "confint" method
Dear R developers,
I noticed a bug in the stats4 package, specifically in the confint method applied to ?mle? objects.
In particular, when some ?fixed? parameters define the log likelihood, these parameters are stored within the mle object but they are not used by the ?confint" method, which retrieves their value from the global environment (whenever they still exist).
Sample code:
>
2010 Jun 11
1
Documentation of B-spline function
Goodmorning,
This is a documentation related question about the B-spline function in R.
In the help file it is stated that:
"df degrees of freedom; one can specify df rather than knots; bs() then chooses df-degree-1 knots at suitable quantiles of x (which will ignore missing values)."
So if one were to specify a spline with 6 degrees of freedom (and no intercept) then a basis
2018 Jan 17
1
Assessing calibration of Cox model with time-dependent coefficients
I am trying to find methods for testing and visualizing calibration to Cox
models with time-depended coefficients. I have read this nice article
<http://journals.sagepub.com/doi/10.1177/0962280213497434>. In this paper,
we can fit three models:
fit0 <- coxph(Surv(futime, status) ~ x1 + x2 + x3, data = data0) p <-
log(predict(fit0, newdata = data1, type = "expected")) lp
2009 Sep 30
1
rcs fits in design package
Hi all,
I have a vector of proportions (post_op_prw) such that
>summary(amb$post_op_prw)
Min. 1st Qu. Median Mean 3rd Qu. Max. NA's
0.0000 0.0000 0.0000 0.3985 0.9134 0.9962 1.0000
> summary(cut2(amb$post_op_prw,0.0001))
[0.0000,0.0001) [0.0001,0.9962] NA's
1904 1672 1