Displaying 6 results from an estimated 6 matches for "normx".
Did you mean:
norm
2018 Feb 27
2
scale.default gives an incorrect error message when is.numeric() fails on a sparse row matrix (dgeMatrix)
I am attempting to use the lars package with a sparse input feature matrix,
but the following fails:
library(Matrix)
library(lars)
data(diabetes)
attach(diabetes)
x = as(as.matrix(as.data.frame(x)), 'dgCMatrix')
lars(x, y, intercept = FALSE)
Error in scale.default(x, FALSE, normx) :
>
> length of 'scale' must equal the number of columns of 'x'
>
>
More specifically, scale.default fails:
normx = new(
"dgeMatrix",
x = c(1.00000000000004, 1, 1.00000000000009,
1.00000000000001, 1.00000000000001,
0.999999999999992, 1.0...
2018 Mar 01
0
scale.default gives an incorrect error message when is.numeric() fails on a dgeMatrix
...9;lars'
##UAagghh! not like this -- both attach() *and* as.data.frame() are horrific!
##UA attach(diabetes)
##UA x = as(as.matrix(as.data.frame(x)), 'dgCMatrix')
x <- as(unclass(diabetes$x), "dgCMatrix")
lars(x, y, intercept = FALSE)
## Error in scale.default(x, FALSE, normx) :
## length of 'scale' must equal the number of columns of 'x'
## More specifically, scale.default fails as called from lars():
normx <- new("dgeMatrix",
x = c(4, 0, 9, 1, 1, -1, 4, -2, 6, 6)*1e-14, Dim = c(1L, 10L),
Dimnames = list(NULL,
c(&qu...
2011 Mar 11
3
Large dataset operations
...he code I have come up with:
rows <- length(data$plateNo)
reps <- 3
norm <- list()
for (rep in 1:reps) {
x <- paste("rep_",rep,sep="")
normx <- paste("normalised_",rep,sep="")
for (row in 1:rows) {
plateMean <- mean(data[[x]][data$plateNo == data$plateNo[row]])
wellData <- data[[x]]...
2012 Feb 02
1
"shifted" bar chart / battleship curve
What I want to do is create a horizontal bar chart matrix for a set of data that have a common set of variables (e.g., % of As, % of Bs, etc.) listed on the Y-axis and groups (e.g., Classes) on the X-axis. The key here is that the bars for each individual class plot are "centered" rather than left or right-justified. In archaeology plots similar to this are called battleship curves or
2010 Dec 08
1
the output of function lars
...; "df" "lambda" "R2"
[6] "RSS" "Cp" "actions" "entry" "Gamrat"
[11] "arc.length" "Gram" "beta" "mu" "normx"
[16] "meanx"
I do not know what does RSS, arc.length, mu mean???
If mu means \hat{miu}, it does not seems to be right. I did not simulate my
data with mean.
besides I caculated R2 by myself but it cannot match the R2here
I think R2=1-sum((y-x%*%lobj$beta)^2)/var(y)*19 #I h...
2009 Jul 19
1
trouble using optim for maximalisation of 2-parameter function
...expomx
To optimize to two parameters you can't use "optimize", so I tried the
following to test my input:
>
llik.nor<-function(x,theta){mu<-theta[1];sig<-theta[2];-length(x)*log(sqrt(2*pi))-length(x)*log(sig)-(1/(2*sig**2))*sum((x-mu)**2)}
> x<-c(-1,4,6,4,2)
> normx<-optim(c(1,20),llik.nor)
the output should be close to
parameters: mu=3 and sigma=2.366
[This I calculated by hand to compare with the output]
but in stead of output I get an error:
Error in fn(par, ...) : argument "theta" is missing, with no default
I don't understand why this...