Displaying 20 results from an estimated 2000 matches similar to: "matlab norm(h) command in R: sqrt(sum(h^2)) - use in an e xpression"
2005 Feb 15
1
matlab norm(h) command in R: sqrt(sum(h^2)) - use in an expression
Hi
in matlab I defined a function (double gamma, parameters at the end of
this mail) as
h(i)=((t/d1)^a1)*exp(-(t-d1)/b1)-c*((t/d2)^a2)*exp(-(t-d2)/b2);
h=h/norm(h);
I do know that norm() in matlab is equal to:
sqrt(sum(x^2))
in R
so in R I do it like:
#function (double gamama)
h <- expression((t/d1)^a1*exp(-(t-d1)/b1)-c*(t/d2)^a2*exp(-(t-d2)/b2))
# plot it
t <- seq(0, 20000,
2013 Mar 22
3
Distance calculation
Hi Elisa,
I hope this is what you wanted.
dat1<-read.csv("peaks.csv",sep=",")
#Subset
dat2<-dat1[1:5,]
res1<-do.call(cbind,lapply(seq_len(nrow(dat2)),function(i) do.call(rbind,lapply(split(rbind(dat2[i,],dat2[-i,]),1:nrow(rbind(dat2[i,],dat2[-i,]))), function(x) {x1<-rbind(dat2[i,],x);
2010 Aug 27
1
pairwise correlations for large dataset
Hello,
I need to calculate the correlation for all pairwise combinations in a very large matrix. I have 25,000 elements and need to calculate the pairwise correlation with a different set of 5,000 elements.
I have written code that works, but it is extremely slow. At the current rate, it will take a few weeks to finish running. I'm looking for suggestions on performing the calculations
2007 Oct 13
2
How to identify the two largest peaks in a trimodal distribution
Hello all
I'm trying to do a simulation that involves identifying the minimum
point between two peaks of a (usually) bimodal distribution. I can do
this easily if there are only two peaks:
CnBdens<-density(Ys/Xs) #probability density function for ratio of Ys
to Xs
for(p in 1:512) ifelse(CnBdens$y[p]>CnBdens$y[p-1],peak1<-p,break)
#identifies first peak in probability
2006 Mar 02
2
Graphics question
Hi
I am trying to plot two points (with confidence intervals) on a graph to
illustrate the value of a particular quantity after 1 and 2 iterations
respectively.
I'm doing this by
plot(cycle,alpha[2,],main="",ylim=c(-8,-3),cex=2,col="red",pch=19,ylab=e
xpression(alpha),xlab="cycle")
Etc..
Where
> cycle
[1] 1 2
> alpha
[,1] [,2]
[1,]
2009 Dec 24
3
Newbie: colSums() compared with Matlab's sum()
Hi all,
I'm trying to learn R after years of Matlab's experience. Here is an
issue I couldn't solve today.
Consider the following piece of code (written by memory):
for(i in 1:n){
submat <- data[1:i,]
C <- colSums(submat)
}
The problem is that at the first iteration, data[1:1,] reduces to a
vector and colSums returns an error. This sounds really strange to me
2009 Aug 13
1
R code to reproduce (while studying) Bates & Watts 1988
Hi R users,
I'm here trying to understand correlated residuals in nonlinear estimation.
I'm reading/studying the book Bates, D. M. and D. G. Watts, (1988),
/Nonlinear regression analysis and its applications/, Wiley, NY. pages
92-94, trying to reproduce the figures and to find out the code in R to
perform the necessary calculations.
I also consulted Pinheiro and Bates, but without
2006 Feb 01
3
norm package prelim.norm
Hey eveyone! I hope someone can help wiht this question. I have a matirux of all zeros and ones and I would like to indentify all unique patterns in the rows andthe number of times the pattern occurs. I changed all zeros to NA tried to use prelim.norm to identify all patterns of missing data in the rows. I got the message
Warning message:
NAs introduced by coercion
Any ideas of how
2005 Feb 24
1
problem (bug?) with prelim.norm (package norm)
dear list members,
there seems to be a problem with the prelim.norm function (package norm)
as number of items in the dataset increases.
the output of prelim.norm() is a list with different summary statistics,
one of them is the missingness indicator matrix "r". it lists all
patterns of missing data and a count of how often each pattern occured
in the dataset. as the number of items and
2003 Jun 01
6
compositional data: percent values sum up to 1
again, under another subject:
sorry, maybe an all too trivial question. But we have power data from J
frequency spectra and to have the same range for the data of all our
subjects, we just transformed them into % values, pseudo-code:
power[i,j]=power[i,j]/sum(power[i,1:J])
of course, now we have a perfect linear relationship in our x design-matrix,
since all power-values for each subject sum up
2005 Oct 24
0
In da.norm Error: NA/NaN/Inf in foreign function call (arg 2)
I am conducting a simulation study generating multivariate normal data,
deleting observations to create a
data set with missing values and then using multiple imputation via
da.norm in Schafer's norm package.
>From da.norm, I get the following error message: "Error: NA/NaN/Inf in
foreign function call (arg 2)"
The frequency of the error message seems to depend on the ratio of n
2011 Nov 24
2
da.norm function
Hello all
I'm running da.norm function in R for climate data
rngseed(1234567)
theta1=da.norm(mydata, thetahat, steps=1000,showits=T)
param1=getparam.norm(mydata,theta1)
As I understand the 1000 steps represent the markov chain values. Is there
a way to plot them? Something like plot(1:1000, param1$mu[]). I just can't
find a way to extract them out of my theta1.
Thank you, Andrey.
2004 Jun 14
1
Matrix_0.8-8 and norm() function
Hello and apologies if this is a stupid question (just rejoined the list):
Has anything changed with the norm() function with the latest update of
the Matrix library?
My old code seems not to be working properly even for very simple tests
of the norm function. I get too many
"No direct or inherited method for function "norm" for this call"
messages. I am using windows, R
2006 Oct 17
0
EM Algorithm help library norm
Hello, i need some help concerning the library norm. i habe to impute some
missing values using the em algorithm.
The help offered for the library doesn't really help me, maybe somebody
already worked on em algorithm or multiple imputation.
some fictive Data
x1 x2
50 60
24 .
26 20
87 .
21 .
Problem: Em Algorithm in R calculating the missings in x2.
Thanks in advance.
--
View this
2003 Jan 21
0
Summary: problems when compiling package 'norm'
Dear All,
Thanks a lot for this quick help. I've managed to solve the issue. The
problem was that I haven't installed the readline-devel and ncurse-devel
packages. It compiled nicely
Cheers,
Antonio
---
2003 Dec 18
2
: Lp norm estimation
Hi all
Just wondering whether one can undertake Lp norm estimation (a type of
regression analysis) in R?
i.e.
argmin S ( | y(i) - x(i)b | ^p )
where:
* S is the summation over observation i= 1,2,...,n
* y is a vector of n observations
* x is an n by p matrix of explanatory variables
* b is a p by 1 vector of beta coefficients and
* p is a constant to be estimated such that
2004 Mar 15
4
norm of complex number
Hi!
I want o calc the norm of a complex number ( |c| where c is complex). Does the function abs() this ?
Thanks,
--
Frank G. Zoellner
AG Angewandte Informatik
Technische Fakult"at
Universit"at Bielefeld
phone: +49(0)521-106-2951
fax: +49(0)521-106-2992
email: fzoellne at techfak.uni-bielefeld.de
2010 Jun 16
1
Too many columns with prelim.norm
Hi everyone,
I'm trying to use prelim.norm with a "big" matrix (36 columns by 10000 or so rows). I found that prelim.norm has a built-in limit of 30 columns, but I'd still really like to use it for my data. Does anyone know of a different way to do the same thing? Or, would it be easier to try to modify the source code? Thanks!
Josh
2012 Mar 30
0
Nonlinear regression / Curve fitting with L-infinity norm
Hello everyone,
I am looking into time series data compression at the moment.
The idea is to fit a curve on a time series of n points so that the maximum deviation on any of the points is not greater than a given
threshold. In other words, none of the values that the curve takes at the points where the time series is defined, should be "further away" than a certain threshold from the
2012 Sep 29
1
norm tables
Dear all,
Is anybody knows simple method for creation norm tables for
psychological tests for several groups distinguished by sex and age?
best regards,
Krzysztof